hamsterdb Embedded Database 1.1.15
Defines | Typedefs | Functions
hamsterdb Static Functions

Defines

#define HAM_DEBUG_LEVEL_DEBUG   0
#define HAM_DEBUG_LEVEL_NORMAL   1
#define HAM_DEBUG_LEVEL_FATAL   3

Typedefs

typedef void HAM_CALLCONV(* ham_errhandler_fun )(int level, const char *message)

Functions

HAM_EXPORT void HAM_CALLCONV ham_set_errhandler (ham_errhandler_fun f)
HAM_EXPORT const char *HAM_CALLCONV ham_strerror (ham_status_t status)
HAM_EXPORT void HAM_CALLCONV ham_get_version (ham_u32_t *major, ham_u32_t *minor, ham_u32_t *revision)
HAM_EXPORT void HAM_CALLCONV ham_get_license (const char **licensee, const char **product)

Define Documentation

#define HAM_DEBUG_LEVEL_DEBUG   0

A debug message

Definition at line 416 of file hamsterdb.h.

#define HAM_DEBUG_LEVEL_FATAL   3

A fatal error message

Definition at line 422 of file hamsterdb.h.

#define HAM_DEBUG_LEVEL_NORMAL   1

A normal error message

Definition at line 419 of file hamsterdb.h.


Typedef Documentation

typedef void HAM_CALLCONV(* ham_errhandler_fun)(int level, const char *message)

A typedef for a custom error handler function

This error handler can be used in combination with ham_set_errhandler().

Parameters:
messageThe error message
levelThe error level:
See also:
error_levels

Definition at line 413 of file hamsterdb.h.


Function Documentation

HAM_EXPORT void HAM_CALLCONV ham_get_license ( const char **  licensee,
const char **  product 
)

Returns the name of the licensee and the name of the licensed product

Parameters:
licenseeIf not NULL, will point to the licensee name, or to an empty string "" for non-commercial versions
productIf not NULL, will point to the product name

Referenced by ham::db::get_license().

HAM_EXPORT void HAM_CALLCONV ham_get_version ( ham_u32_t major,
ham_u32_t minor,
ham_u32_t revision 
)

Returns the version of the hamsterdb library

Parameters:
majorIf not NULL, will return the major version number
minorIf not NULL, will return the minor version number
revisionIf not NULL, will return the revision version number

Referenced by ham::db::get_version().

HAM_EXPORT void HAM_CALLCONV ham_set_errhandler ( ham_errhandler_fun  f)

Sets the global error handler

This handler will receive all debug messages that are emitted by hamsterdb. You can install the default handler by setting f to 0.

The default error handler prints all messages to stderr. To install a different logging facility, you can provide your own error handler.

Note that the callback function must have the same calling convention as the hamsterdb library.

Parameters:
fA pointer to the error handler function, or NULL to restore the default handler

Referenced by ham::db::set_errhandler().

HAM_EXPORT const char* HAM_CALLCONV ham_strerror ( ham_status_t  status)

Translates a hamsterdb status code to a descriptive error string

Parameters:
statusThe hamsterdb status code
Returns:
A pointer to a descriptive error string

Referenced by error(), and ham::error::get_string().