There is no locking within a single drizzle_st structure, so for threaded applications you must either ensure isolation in the application or use multiple drizzle_st structures (for example, one for each thread).
enum drizzle_options_t |
Options for drizzle_st.
DRIZZLE_NONE | |
DRIZZLE_ALLOCATED | |
DRIZZLE_NON_BLOCKING | |
DRIZZLE_FREE_OBJECTS | |
DRIZZLE_ASSERT_DANGLING |
Definition at line 118 of file constants.h.
const char* drizzle_version | ( | void | ) |
Get library version string.
const char* drizzle_bugreport | ( | void | ) |
Get bug report URL.
const char* drizzle_verbose_name | ( | drizzle_verbose_t | verbose | ) |
Get string with the name of the given verbose level.
[in] | verbose | Verbose logging level. |
drizzle_st* drizzle_create | ( | drizzle_st * | drizzle | ) |
Initialize a drizzle structure. Always check the return value even if passing in a pre-allocated structure. Some other initialization may have failed.
[in] | drizzle | Caller allocated structure, or NULL to allocate one. |
drizzle_st* drizzle_clone | ( | drizzle_st * | drizzle, | |
const drizzle_st * | from | |||
) |
Clone a drizzle structure.
[in] | drizzle | Caller allocated structure, or NULL to allocate one. |
[in] | from | Drizzle structure to use as a source to clone from. |
void drizzle_free | ( | drizzle_st * | drizzle | ) |
Free a drizzle structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
const char* drizzle_error | ( | const drizzle_st * | drizzle | ) |
Return an error string for last error encountered.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
int drizzle_errno | ( | const drizzle_st * | drizzle | ) |
Value of errno in the case of a DRIZZLE_RETURN_ERRNO return value.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
uint16_t drizzle_error_code | ( | const drizzle_st * | drizzle | ) |
Get server defined error code for the last result read.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
const char* drizzle_sqlstate | ( | const drizzle_st * | drizzle | ) |
Get SQL state code for the last result read.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
drizzle_options_t drizzle_options | ( | const drizzle_st * | drizzle | ) |
Get options for a drizzle structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
void drizzle_set_options | ( | drizzle_st * | drizzle, | |
drizzle_options_t | options | |||
) |
Set options for a drizzle structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | options | Available options for drizzle structure to set. |
void drizzle_add_options | ( | drizzle_st * | drizzle, | |
drizzle_options_t | options | |||
) |
Add options for a drizzle structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | options | Available options for drizzle structure to add. |
void drizzle_remove_options | ( | drizzle_st * | drizzle, | |
drizzle_options_t | options | |||
) |
Remove options for a drizzle structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | options | Available options for drizzle structure to remove. |
void* drizzle_context | ( | const drizzle_st * | drizzle | ) |
Get application context pointer.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
void drizzle_set_context | ( | drizzle_st * | drizzle, | |
void * | context | |||
) |
Set application context pointer.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | context | Application context to set. |
void drizzle_set_context_free_fn | ( | drizzle_st * | drizzle, | |
drizzle_context_free_fn * | function | |||
) |
Set function to call when the drizzle structure is being cleaned up so the application can clean up the context pointer.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | function | Function to call to clean up drizzle context. |
int drizzle_timeout | ( | const drizzle_st * | drizzle | ) |
Get current socket I/O activity timeout value.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
void drizzle_set_timeout | ( | drizzle_st * | drizzle, | |
int | timeout | |||
) |
Set socket I/O activity timeout for connections in a Drizzle structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | timeout | Milliseconds to wait for I/O activity. A negative value means an infinite timeout. |
drizzle_verbose_t drizzle_verbose | ( | const drizzle_st * | drizzle | ) |
Get current verbosity threshold for logging messages.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
void drizzle_set_verbose | ( | drizzle_st * | drizzle, | |
drizzle_verbose_t | verbose | |||
) |
Set verbosity threshold for logging messages. If this is set above DRIZZLE_VERBOSE_NEVER and the drizzle_set_log_fn() callback is set to NULL, messages are printed to STDOUT.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | verbose | Verbosity threshold of what to log. |
void drizzle_set_log_fn | ( | drizzle_st * | drizzle, | |
drizzle_log_fn * | function, | |||
void * | context | |||
) |
Set logging function for a drizzle structure. This function is only called for log messages that are above the verbosity threshold set with drizzle_set_verbose().
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | function | Function to call when there is a logging message. |
[in] | context | Argument to pass into the callback function. |
void drizzle_set_event_watch_fn | ( | drizzle_st * | drizzle, | |
drizzle_event_watch_fn * | function, | |||
void * | context | |||
) |
Set a custom I/O event watcher function for a drizzle structure. Used to integrate libdrizzle with a custom event loop. The callback will be invoked to register or deregister interest in events for a connection. When the events are triggered, drizzle_con_set_revents() should be called to indicate which events are ready. The event loop should stop waiting for these events, as libdrizzle will call the callback again if it is still interested. To resume processing, the libdrizzle function that returned DRIZZLE_RETURN_IO_WAIT should be called again. See drizzle_event_watch_fn().
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | function | Function to call when there is an I/O event. |
[in] | context | Argument to pass into the callback function. |
drizzle_con_st* drizzle_con_create | ( | drizzle_st * | drizzle, | |
drizzle_con_st * | con | |||
) |
Initialize a connection structure. Always check the return value even if passing in a pre-allocated structure. Some other initialization may have failed.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | con | Caller allocated structure, or NULL to allocate one. |
drizzle_con_st* drizzle_con_clone | ( | drizzle_st * | drizzle, | |
drizzle_con_st * | con, | |||
const drizzle_con_st * | from | |||
) |
Clone a connection structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | con | Caller allocated structure, or NULL to allocate one. |
[in] | from | Connection structure to use as a source to clone from. |
void drizzle_con_free | ( | drizzle_con_st * | con | ) |
Free a connection structure.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
void drizzle_con_free_all | ( | drizzle_st * | drizzle | ) |
Free all connections in a drizzle structure.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
drizzle_return_t drizzle_con_wait | ( | drizzle_st * | drizzle | ) |
Wait for I/O on connections.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
drizzle_con_st* drizzle_con_ready | ( | drizzle_st * | drizzle | ) |
Get next connection that is ready for I/O.
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |