Functions

srdb1/db_res.c File Reference

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>
Include dependency graph for srdb1/db_res.c:

Go to the source code of this file.

Functions


Detailed Description

Definition in file srdb1/db_res.c.


Function Documentation

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.

Parameters:
_r filled result set
cols number of columns
Returns:
zero on success, negative on errors

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().

Here is the caller graph for this function:

int db_allocate_rows ( db1_res_t _res  )  [inline]
Parameters:
_res result set
Returns:
zero on success, negative on errors

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().

Here is the caller graph for this function:

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.

Parameters:
_r the result that should be released
Returns:
zero on success, negative on errors

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().

Here is the caller graph for this function:

int db_free_result ( db1_res_t _r  )  [inline]
Returns:
zero on success, negative on errors

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().

Here is the call graph for this function:

Here is the caller graph for this function:

int db_free_rows ( db1_res_t _r  )  [inline]
Parameters:
_r the result that should be released
Returns:
zero on success, negative on errors

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().

Here is the call graph for this function:

Here is the caller graph for this function:

db1_res_t* db_new_result ( void   )  [inline]
Returns:
a pointer to the new result on success, NULL on errors

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().

Here is the caller graph for this function: