Functions to manage result structuresProvides some convenience macros and some memory management functions for result structures. More...
#include "db_res.h"#include "db_row.h"#include "../../dprint.h"#include "../../mem/mem.h"#include <string.h>
Go to the source code of this file.
Definition in file srdb1/db_res.c.
| int db_allocate_columns | ( | db1_res_t * | _r, | |
| const unsigned int | cols | |||
| ) | [inline] |
If no more memory is available for the allocation of the types then the already allocated memory for the names is freed.
| _r | filled result set | |
| cols | number of columns |
Definition at line 146 of file srdb1/db_res.c.
References RES_NAMES, and RES_TYPES.
Referenced by db_mysql_get_columns(), and db_postgres_get_columns().

| int db_allocate_rows | ( | db1_res_t * | _res | ) | [inline] |
| _res | result set |
Definition at line 176 of file srdb1/db_res.c.
References RES_ROW_N, and RES_ROWS.
Referenced by db_mysql_convert_rows(), and db_postgres_convert_rows().

| int db_free_columns | ( | db1_res_t * | _r | ) | [inline] |
This methods assumes that the string values holding the column names are in memory allocated from the database driver, and thus must be not freed here.
| _r | the result that should be released |
Definition at line 73 of file srdb1/db_res.c.
References RES_COL_N, RES_NAMES, and RES_TYPES.
Referenced by db_free_result(), db_mysql_convert_result(), db_mysql_get_columns(), db_postgres_convert_result(), and db_postgres_get_columns().

| int db_free_result | ( | db1_res_t * | _r | ) | [inline] |
Definition at line 126 of file srdb1/db_res.c.
References db_free_columns(), and db_free_rows().
Referenced by db_mysql_fetch_result(), db_mysql_free_result(), db_mysql_store_result(), db_postgres_delete(), db_postgres_fetch_result(), db_postgres_free_result(), db_postgres_insert(), db_postgres_store_result(), and db_postgres_update().


| int db_free_rows | ( | db1_res_t * | _r | ) | [inline] |
| _r | the result that should be released |
Definition at line 44 of file srdb1/db_res.c.
References db_free_row(), RES_ROW_N, and RES_ROWS.
Referenced by db_free_result(), db_mysql_convert_rows(), db_mysql_fetch_result(), db_postgres_convert_rows(), and db_postgres_fetch_result().


| db1_res_t* db_new_result | ( | void | ) | [inline] |
Definition at line 109 of file srdb1/db_res.c.
Referenced by db_mysql_fetch_result(), db_mysql_store_result(), db_postgres_fetch_result(), and db_postgres_store_result().

1.7.1