Database Independent Abstraction Layer for C: libdbi Programmer's Guide (OUTDATED SEE README!) | ||
---|---|---|
Prev | Chapter 3. libdbi API Reference | Next |
dbi_driver dbi_driver_list(dbi_driver Current) |
Enumerates all loaded drivers. If Current is NULL, the first available driver will be returned. If Current is a valid driver, the next available driver will be returned.
Current: The current driver in the list of drivers.
The next available driver, or NULL if there is an error or no more are available.
dbi_driver dbi_driver_open(const char *name) |
Locate the driver with the specified name.
name: The name of the driver to open.
The requested driver, or NULL if there is an error or it is not found.
int dbi_driver_is_reserved_word(dbi_driver Driver, const char *word) |
Looks for the specified word in the list of reserved words. The result of this function may vary between databases. Case does not matter.
Driver: The target driver.
word: The word to check against the reserved word list.
-1 if an error occurs, 0 if the word is not reserved, 1 otherwise.
void *dbi_driver_specific_function(dbi_driver Driver, const char *name) |
Returns a function pointer to the specifed custom function. This can be used to access database-specific functionality, but it will restrict your code to one particular database, lessening the benefits of using libdbi.
Driver: The target driver.
name: The name of the custom function.
If the custom function is found, a pointer to that function. If not, returns NULL.
int dbi_driver_quote_string(dbi_driver Driver, char **orig) |
Encloses the target string in the types of quotes that the database expects, and escapes any special characters. The original string will be freed and will point to a newly allocated one (which you still must free on your own).
Driver: The target driver.
orig: A pointer to the string to quote and escape.
The new string's length.
const char *dbi_driver_get_name(dbi_driver Driver) |
Requests the name of the specified driver. The calling program must not attempt to free the returned string.
Driver: The target driver.
A string containing the driver's name.
const char *dbi_driver_get_filename(dbi_driver Driver) |
Requests the filename of the specified driver. The calling program must not attempt to free the returned string.
Driver: The target driver.
A string containing the driver's full path and file name.
const char *dbi_driver_get_description(dbi_driver Driver) |
Requests a description of the specified driver. The calling program must not attempt to free the returned string.
Driver: The target driver.
A string containing the driver's description. It will be one or two short sentences with no newlines.
const char *dbi_driver_get_maintainer(dbi_driver Driver) |
Requests the maintainer of the specified driver. The calling program must not attempt to free the returned string.
Driver: The target driver.
A string containing the driver maintainer's full name and email address.
const char *dbi_driver_get_url(dbi_driver Driver) |
Requests the maintainer's URL for the specified driver. This is useful for drivers maintained by a third party. The calling program must not attempt to free the returned string.
Driver: The target driver.
const char *dbi_driver_get_version(dbi_driver Driver) |
Requests the version of the specified driver. The calling program must not attempt to free the returned string.
Driver: The target driver.
A string containing the driver's version.
const char *dbi_driver_get_date_compiled(dbi_driver Driver) |
Requests the compilation date of the specified driver. The calling program must not attempt to free the returned string.
Driver: The target driver.
A string containing the date the driver was compiled.