Provides 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.
Functions | |
| int | db_allocate_columns (db_res_t *_r, const unsigned int cols) |
| int | db_allocate_rows (db_res_t *_res) |
| int | db_free_columns (db_res_t *_r) |
| int | db_free_result (db_res_t *_r) |
| int | db_free_rows (db_res_t *_r) |
| db_res_t * | db_new_result (void) |
Provides some convenience macros and some memory management functions for result structures.
Definition in file db_res.c.
| int db_allocate_columns | ( | db_res_t * | _r, | |
| const unsigned int | cols | |||
| ) | [inline] |
Allocate storage for column names and type in existing result structure. 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 144 of file db_res.c.
References LM_DBG, LM_ERR, pkg_free, pkg_malloc, RES_NAMES, and RES_TYPES.
Referenced by bdb_get_columns(), db_mysql_get_columns(), db_postgres_get_columns(), db_unixodbc_get_columns(), dbt_get_columns(), and get_columns().
| int db_allocate_rows | ( | db_res_t * | _res | ) | [inline] |
Allocate memory for rows.
| _res | result set |
Definition at line 174 of file db_res.c.
References len, LM_DBG, LM_ERR, pkg_malloc, RES_ROW_N, and RES_ROWS.
Referenced by db_mysql_convert_rows(), db_postgres_convert_rows(), db_unixodbc_convert_rows(), and dbt_convert_rows().
| int db_free_columns | ( | db_res_t * | _r | ) | [inline] |
Release memory used by columns. 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 71 of file db_res.c.
References LM_DBG, LM_ERR, NULL, pkg_free, RES_COL_N, RES_NAMES, and RES_TYPES.
Referenced by bdb_get_columns(), db_free_result(), db_mysql_convert_result(), db_mysql_get_columns(), db_oracle_store_result(), db_postgres_convert_result(), db_postgres_get_columns(), db_unixodbc_convert_result(), db_unixodbc_fetch_result(), db_unixodbc_get_columns(), dbt_convert_result(), dbt_get_columns(), and get_columns().
| int db_free_result | ( | db_res_t * | _r | ) | [inline] |
Release memory used by a result structure.
Definition at line 124 of file db_res.c.
References db_free_columns(), db_free_rows(), LM_DBG, LM_ERR, NULL, and pkg_free.
Referenced by _bdb_delete_cursor(), bdb_close(), bdb_free_query(), bdb_query(), db_mysql_fetch_result(), db_mysql_free_result(), db_mysql_store_result(), db_oracle_free_result(), db_postgres_delete(), db_postgres_fetch_result(), db_postgres_free_result(), db_postgres_insert(), db_postgres_store_result(), db_postgres_update(), db_unixodbc_fetch_result(), db_unixodbc_free_result(), and dbt_free_result().
| int db_free_rows | ( | db_res_t * | _r | ) | [inline] |
Release memory used by rows in a result structure.
| _r | the result that should be released |
Definition at line 44 of file db_res.c.
References db_free_row(), LM_DBG, LM_ERR, NULL, pkg_free, RES_ROW_N, and RES_ROWS.
Referenced by _bdb_delete_cursor(), db_free_result(), db_mysql_convert_rows(), db_mysql_fetch_result(), db_postgres_convert_rows(), db_postgres_fetch_result(), db_unixodbc_convert_rows(), db_unixodbc_fetch_result(), dbt_convert_rows(), and get_rows().
| db_res_t* db_new_result | ( | void | ) | [inline] |
Create a new result structure and initialize it.
Definition at line 107 of file db_res.c.
References LM_DBG, LM_ERR, NULL, and pkg_malloc.
Referenced by _bdb_delete_cursor(), bdb_query(), db_mysql_fetch_result(), db_mysql_store_result(), db_oracle_store_result(), db_postgres_fetch_result(), db_postgres_store_result(), db_unixodbc_fetch_result(), db_unixodbc_store_result(), and dbt_get_result().
1.5.6