Database Independent Abstraction Layer for C: libdbi Plugin Author's Guide | ||
---|---|---|
Prev | Chapter 2. Plugin Functions | Next |
dbi_result_t *_dbd_result_create(dbi_driver_t *driver, void *handle, unsigned int numrows_matched, unsigned int numrows_affected) |
Allocates a new dbi_result_t, filling the number of rows matched and affected, storing the database-specific result handle, and allocating room for rows to be stored.
driver: The target driver.
handle: The database-specific result handle used internally by the plugin.
numrows_matched: The number of rows matched by the query.
numrows_affected: The number of rows affected by the query.
A new DBI result object.
void _dbd_result_set_numfields(dbi_result_t *result, unsigned int numfields) |
Sets a result's number of fields and allocates room for field information to be stored.
result: The target result.
numfields: The number of fields in the result set.
void _dbd_result_add_field(dbi_result_t *result, unsigned int idx, char *name, unsigned short type, unsigned int attribs) |
Stores information about the target field into the result set.
result: The target result.
idx: The numeric field index.
name: The name of the field.
type: The datatype of the field.
attribs: The attributes of the field.
dbi_row_t *_dbd_row_allocate(unsigned int numfields) |
Allocates a new row, ready to be filled with data.
numfields: The number of fields in the result set.
A new DBI row, or NULL on error.
void _dbd_row_finalize(dbi_result_t *result, dbi_row_t *row, unsigned int idx) |
Associates and stores the row with the result set, once the row's data has been filled.
result: The target result set.
row: The target row object.
idx: The index of the row.