Enumerations |
enum | drizzle_options_t {
DRIZZLE_NONE = 0,
DRIZZLE_ALLOCATED = (1 << 0),
DRIZZLE_NON_BLOCKING = (1 << 1),
DRIZZLE_FREE_OBJECTS = (1 << 2),
DRIZZLE_ASSERT_DANGLING = (1 << 3)
} |
Functions |
const char * | drizzle_version (void) |
const char * | drizzle_bugreport (void) |
const char * | drizzle_verbose_name (drizzle_verbose_t verbose) |
drizzle_st * | drizzle_create (drizzle_st *drizzle) |
drizzle_st * | drizzle_clone (drizzle_st *drizzle, const drizzle_st *from) |
void | drizzle_free (drizzle_st *drizzle) |
const char * | drizzle_error (const drizzle_st *drizzle) |
int | drizzle_errno (const drizzle_st *drizzle) |
uint16_t | drizzle_error_code (const drizzle_st *drizzle) |
const char * | drizzle_sqlstate (const drizzle_st *drizzle) |
drizzle_options_t | drizzle_options (const drizzle_st *drizzle) |
void | drizzle_set_options (drizzle_st *drizzle, drizzle_options_t options) |
void | drizzle_add_options (drizzle_st *drizzle, drizzle_options_t options) |
void | drizzle_remove_options (drizzle_st *drizzle, drizzle_options_t options) |
void * | drizzle_context (const drizzle_st *drizzle) |
void | drizzle_set_context (drizzle_st *drizzle, void *context) |
void | drizzle_set_context_free_fn (drizzle_st *drizzle, drizzle_context_free_fn *function) |
int | drizzle_timeout (const drizzle_st *drizzle) |
void | drizzle_set_timeout (drizzle_st *drizzle, int timeout) |
drizzle_verbose_t | drizzle_verbose (const drizzle_st *drizzle) |
void | drizzle_set_verbose (drizzle_st *drizzle, drizzle_verbose_t verbose) |
void | drizzle_set_log_fn (drizzle_st *drizzle, drizzle_log_fn *function, void *context) |
void | drizzle_set_event_watch_fn (drizzle_st *drizzle, drizzle_event_watch_fn *function, void *context) |
drizzle_con_st * | drizzle_con_create (drizzle_st *drizzle, drizzle_con_st *con) |
drizzle_con_st * | drizzle_con_clone (drizzle_st *drizzle, drizzle_con_st *con, const drizzle_con_st *from) |
void | drizzle_con_free (drizzle_con_st *con) |
void | drizzle_con_free_all (drizzle_st *drizzle) |
drizzle_return_t | drizzle_con_wait (drizzle_st *drizzle) |
drizzle_con_st * | drizzle_con_ready (drizzle_st *drizzle) |
Detailed Description
This is the core library structure that other structures (such as connections) are created from.
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).
Enumeration Type Documentation
Options for drizzle_st.
- Enumerator:
DRIZZLE_NONE |
|
DRIZZLE_ALLOCATED |
|
DRIZZLE_NON_BLOCKING |
|
DRIZZLE_FREE_OBJECTS |
|
DRIZZLE_ASSERT_DANGLING |
|
Definition at line 118 of file constants.h.
Function Documentation
Get library version string.
- Returns:
- Pointer to static buffer in library that holds the version string.
Get bug report URL.
- Returns:
- Bug report URL string.
Get string with the name of the given verbose level.
- Parameters:
-
[in] | verbose | Verbose logging level. |
- Returns:
- String form of verbose level.
Initialize a drizzle structure. Always check the return value even if passing in a pre-allocated structure. Some other initialization may have failed.
- Parameters:
-
[in] | drizzle | Caller allocated structure, or NULL to allocate one. |
- Returns:
- On success, a pointer to the (possibly allocated) structure. On failure this will be NULL.
Clone a drizzle structure.
- Parameters:
-
[in] | drizzle | Caller allocated structure, or NULL to allocate one. |
[in] | from | Drizzle structure to use as a source to clone from. |
- Returns:
- Same return as drizzle_create().
Free a drizzle structure.
- Parameters:
-
Return an error string for last error encountered.
- Parameters:
-
- Returns:
- Pointer to static buffer in library that holds an error string.
Value of errno in the case of a DRIZZLE_RETURN_ERRNO return value.
- Parameters:
-
- Returns:
- An errno value as defined in your system errno.h file.
Get server defined error code for the last result read.
- Parameters:
-
- Returns:
- An error code given back in the server response.
Get SQL state code for the last result read.
- Parameters:
-
- Returns:
- A SQLSTATE code given back in the server response.
Get options for a drizzle structure.
- Parameters:
-
- Returns:
- Options set for the drizzle structure.
Set options for a drizzle structure.
- Parameters:
-
Add options for a drizzle structure.
- Parameters:
-
Remove options for a drizzle structure.
- Parameters:
-
[in] | drizzle | Drizzle structure previously initialized with drizzle_create() or drizzle_clone(). |
[in] | options | Available options for drizzle structure to remove. |
Get application context pointer.
- Parameters:
-
- Returns:
- Application context that was previously set, or NULL.
Set application context pointer.
- Parameters:
-
Set function to call when the drizzle structure is being cleaned up so the application can clean up the context pointer.
- Parameters:
-
Get current socket I/O activity timeout value.
- Parameters:
-
- Returns:
- Timeout in milliseconds to wait for I/O activity. A negative value means an infinite timeout.
Set socket I/O activity timeout for connections in a Drizzle structure.
- Parameters:
-
[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. |
Get current verbosity threshold for logging messages.
- Parameters:
-
- Returns:
- Current verbosity threshold.
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.
- Parameters:
-
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().
- Parameters:
-
[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. |
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().
- Parameters:
-
[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. |
Initialize a connection structure. Always check the return value even if passing in a pre-allocated structure. Some other initialization may have failed.
- Parameters:
-
- Returns:
- On success, a pointer to the (possibly allocated) structure. On failure this will be NULL.
Clone a connection structure.
- Parameters:
-
[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. |
- Returns:
- Same return as drizzle_con_create().
Free a connection structure.
- Parameters:
-
Free all connections in a drizzle structure.
- Parameters:
-
Wait for I/O on connections.
- Parameters:
-
- Returns:
- Standard drizzle return value.
Get next connection that is ready for I/O.
- Parameters:
-
- Returns:
- Connection that is ready for I/O, or NULL if there are none.