#include "db_val.h"
#include "db_res.h"


Go to the source code of this file.
Data Structures | |
| struct | db_row |
Defines | |
| #define | ROW_N(rw) ((rw)->n) |
| #define | ROW_VALUES(rw) ((rw)->values) |
Typedefs | |
| typedef struct db_row | db_row_t |
Functions | |
| int | db_allocate_row (const db_res_t *_res, db_row_t *_row) |
| int | db_free_row (db_row_t *_r) |
This file holds a type that represents a row in a database, some convenience macros and a function for memory managements.
Definition in file db_row.h.
| #define ROW_N | ( | rw | ) | ((rw)->n) |
Return the number of colums
Definition at line 55 of file db_row.h.
Referenced by bdb_append_row(), bdb_convert_row(), check_rule(), convert_row(), db_allocate_row(), db_free_row(), db_postgres_convert_row(), match_res(), reload_address_table(), reload_domain_table(), and reload_trusted_table().
| #define ROW_VALUES | ( | rw | ) | ((rw)->values) |
Return the columns in the row
Definition at line 53 of file db_row.h.
Referenced by add_from_db(), add_resource_instance(), add_waiting_watchers(), bdb_append_row(), bdb_convert_row(), bdb_row_match(), check_rule(), constr_multipart_body(), convert_row(), db_allocate_row(), db_free_row(), db_load_urecord(), db_mysql_convert_row(), db_postgres_convert_row(), db_restore(), db_table_version(), db_unixodbc_convert_row(), dbt_convert_row(), dp_load_db(), ds_load_db(), find_accounts(), find_sip_user(), find_users(), get_all_db_ucontacts(), get_database_info(), get_db_subs_auth(), get_ha1(), get_p_notify_body(), get_resource_list(), get_rules_doc(), get_sphere(), get_subs_db(), get_wi_subs_db(), load_dialog_info_from_db(), load_user_carrier(), match_res(), msg_presentity_clean(), preload_udomain(), pres_htable_restore(), query_xcap_update(), reload_address_table(), reload_domain_table(), reload_gws_and_lcrs(), reload_trusted_table(), restore_db_subs(), rls_restore_db_subs(), timer_send_notify(), update_presentity(), update_watchers_status(), and xj_worker_process().
Allocate memory for row value.
| _res | result set | |
| _row | filled row |
Definition at line 111 of file db_row.c.
References len, LM_DBG, LM_ERR, pkg_malloc, RES_COL_N, ROW_N, and ROW_VALUES.
Referenced by bdb_append_row(), bdb_convert_row(), db_mysql_convert_row(), db_postgres_convert_row(), db_unixodbc_convert_row(), and dbt_convert_row().
| int db_free_row | ( | db_row_t * | _r | ) | [inline] |
Release memory used by a row. This method only frees values that are inside the row if the free flag of the specific value is set. Otherwise this storage must be released when the database specific result free function is called. Only string based values are freed if wanted, null values are skipped.
| _r | row that should be released |
Definition at line 42 of file db_row.c.
References DB_BLOB, DB_STR, DB_STRING, len, LM_DBG, LM_ERR, NULL, pkg_free, ROW_N, ROW_VALUES, s, VAL_BLOB, VAL_FREE, VAL_NULL, VAL_STR, VAL_STRING, and VAL_TYPE.
Referenced by bdb_append_row(), bdb_convert_row(), db_free_rows(), db_mysql_convert_row(), db_postgres_convert_row(), and db_unixodbc_convert_row().
1.5.6