2.3. DBD Helper Functions

2.3.1. _dbd_result_create

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.

Arguments

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.

Returns

A new DBI result object.

2.3.2. _dbd_result_set_numfields

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.

Arguments

result: The target result.

numfields: The number of fields in the result set.

2.3.3. _dbd_result_add_field

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.

Arguments

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.

2.3.4. _dbd_row_allocate

dbi_row_t *_dbd_row_allocate(unsigned int numfields)

Allocates a new row, ready to be filled with data.

Arguments

numfields: The number of fields in the result set.

Returns

A new DBI row, or NULL on error.

2.3.5. _dbd_row_finalize

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.

Arguments

result: The target result set.

row: The target row object.

idx: The index of the row.