#include "../../str.h"#include "../../db/db_val.h"#include "../../locking.h"


Go to the source code of this file.
| #define DBT_DELIM ':' |
| #define DBT_DELIM_C ' ' |
| #define DBT_DELIM_R '\n' |
| #define DBT_FL_IGN -1 |
| #define DBT_FL_SET 0 |
Definition at line 46 of file dbt_lib.h.
Referenced by dbt_delete(), dbt_table_add_row(), dbt_table_free_rows(), dbt_table_update_flags(), and dbt_update().
| #define DBT_FL_UNSET 1 |
Definition at line 47 of file dbt_lib.h.
Referenced by dbt_cache_print(), and dbt_table_update_flags().
| #define DBT_FLAG_AUTO 2 |
Definition at line 40 of file dbt_lib.h.
Referenced by dbt_load_file(), dbt_print_table(), and dbt_table_check_row().
| #define DBT_FLAG_NULL 1 |
Definition at line 39 of file dbt_lib.h.
Referenced by dbt_load_file(), dbt_print_table(), dbt_result_print(), and dbt_table_check_row().
| #define DBT_FLAG_UNSET 0 |
| #define DBT_TBFL_MODI 1 |
Definition at line 43 of file dbt_lib.h.
Referenced by dbt_cache_print(), dbt_delete(), dbt_table_add_row(), dbt_table_free_rows(), and dbt_update().
| #define DBT_TBFL_ZERO 0 |
| typedef struct _dbt_cache * dbt_cache_p |
| typedef struct _dbt_cache dbt_cache_t |
| typedef struct _dbt_column * dbt_column_p |
| typedef struct _dbt_column dbt_column_t |
| typedef struct _dbt_table * dbt_table_p |
| typedef struct _dbt_table dbt_table_t |
| typedef struct _dbt_tbl_cachel * dbt_tbl_cachel_p |
| typedef struct _dbt_tbl_cachel dbt_tbl_cachel_t |
| int dbt_cache_check_db | ( | str * | ) |
Definition at line 185 of file dbt_lib.c.
References _dbt_cachesem, _str::len, _dbt_cache::name, _dbt_cache::next, NULL, and _str::s.
| int dbt_cache_del_db | ( | str * | ) |
| int dbt_cache_destroy | ( | void | ) |
Definition at line 341 of file dbt_lib.c.
References _dbt_cachesem, DBT_CACHETBL_SIZE, dbt_table_free(), _dbt_tbl_cachel::dtp, _dbt_table::next, _dbt_cache::next, NULL, and shm_free.
Referenced by destroy().
| int dbt_cache_free | ( | dbt_cache_p | ) |
| dbt_cache_p dbt_cache_get_db | ( | str * | ) |
Definition at line 116 of file dbt_lib.c.
References _dbt_cachesem, dbt_is_database(), _str::len, LM_DBG, LM_ERR, _dbt_cache::name, _dbt_cache::next, NULL, _str::s, shm_free, and shm_malloc().
Referenced by dbt_init().
| int dbt_cache_print | ( | int | ) |
Definition at line 388 of file dbt_lib.c.
References _dbt_table::auto_col, _dbt_table::auto_val, _dbt_table::dbname, DBT_CACHETBL_SIZE, DBT_FL_UNSET, dbt_print_table(), dbt_table_update_flags(), DBT_TBFL_MODI, _dbt_tbl_cachel::dtp, _dbt_table::flag, _str::len, _dbt_table::mark, _dbt_table::name, _dbt_table::next, NULL, and _str::s.
Referenced by destroy().
-1 - error 0 - no change 1 - changed
Definition at line 50 of file dbt_file.c.
References _str::len, LM_DBG, and _str::s.
Referenced by dbt_db_get_table().
| int dbt_column_free | ( | dbt_column_p | ) |
Definition at line 76 of file dbt_tb.c.
References _dbt_column::name, _str::s, and shm_free.
Referenced by dbt_table_free().
| dbt_column_p dbt_column_new | ( | char * | , | |
| int | ||||
| ) |
Definition at line 49 of file dbt_tb.c.
References DBT_FLAG_UNSET, _dbt_column::flag, _str::len, _dbt_column::name, _dbt_column::next, NULL, _dbt_column::prev, _str::s, shm_free, shm_malloc(), and _dbt_column::type.
Referenced by dbt_load_file().
| dbt_table_p dbt_db_get_table | ( | dbt_cache_p | , | |
| const str * | ||||
| ) |
Definition at line 259 of file dbt_lib.c.
References core_hash(), db_mode, _dbt_table::dbname, DBT_CACHETBL_SIZE, dbt_check_mtime(), dbt_db_del_table(), dbt_load_file(), _dbt_tbl_cachel::dtp, _dbt_table::hash, hash, _str::len, LM_DBG, LM_ERR, _dbt_table::mt, _dbt_table::name, _dbt_cache::name, _dbt_table::next, NULL, _dbt_table::prev, and _str::s.
Referenced by dbt_delete(), dbt_insert(), dbt_query(), and dbt_update().
| int dbt_init_cache | ( | void | ) |
Definition at line 53 of file dbt_lib.c.
References _dbt_cachesem, DBT_CACHETBL_SIZE, LM_CRIT, NULL, shm_free, and shm_malloc().
Referenced by mod_init().
Definition at line 428 of file dbt_lib.c.
References DB_BIGINT, DB_BITMAP, DB_BLOB, DB_DATETIME, DB_DOUBLE, DB_INT, DB_STR, DB_STRING, and LM_ERR.
Referenced by dbt_insert(), dbt_result_extract_fields(), dbt_table_check_row(), and dbt_update().
| dbt_table_p dbt_load_file | ( | const str * | , | |
| const str * | ||||
| ) |
crow, ccol, bp, buf);
Definition at line 90 of file dbt_file.c.
References _dbt_table::auto_col, buf, _dbt_table::cols, _dbt_table::colv, DB_BLOB, DB_DATETIME, DB_DOUBLE, DB_INT, DB_STR, DB_STRING, dbt_column_new(), DBT_DELIM, DBT_DELIM_C, DBT_DELIM_R, DBT_FLAG_AUTO, DBT_FLAG_NULL, dbt_row_new(), dbt_row_set_val(), dbt_table_check_row(), dbt_table_new(), db_val_t::double_val, _dbt_column::flag, db_val_t::int_val, _str::len, LM_DBG, _dbt_row::next, _dbt_column::next, _dbt_table::nrcols, _dbt_table::nrrows, db_val_t::nul, NULL, _dbt_row::prev, _dbt_column::prev, _dbt_table::rows, _str::s, shm_malloc(), db_val_t::str_val, db_val_t::type, _dbt_column::type, and db_val_t::val.
Referenced by dbt_db_get_table().
| int dbt_print_table | ( | dbt_table_p | , | |
| str * | ||||
| ) |
Definition at line 490 of file dbt_file.c.
References _dbt_table::cols, _dbt_table::colv, DB_BLOB, DB_DATETIME, DB_DOUBLE, DB_INT, DB_STR, DB_STRING, _dbt_table::dbname, DBT_DELIM, DBT_DELIM_C, DBT_DELIM_R, DBT_FLAG_AUTO, DBT_FLAG_NULL, db_val_t::double_val, _dbt_row::fields, _dbt_column::flag, db_val_t::int_val, _str::len, _dbt_column::name, _dbt_table::name, _dbt_row::next, _dbt_column::next, _dbt_table::nrcols, db_val_t::nul, NULL, _dbt_table::rows, _str::s, db_val_t::str_val, _dbt_column::type, and db_val_t::val.
Referenced by dbt_cache_print().
| int dbt_release_table | ( | dbt_cache_p | , | |
| const str * | ||||
| ) |
Definition at line 322 of file dbt_lib.c.
References core_hash(), DBT_CACHETBL_SIZE, hash, _str::len, _dbt_cache::name, and _str::s.
Referenced by dbt_delete(), dbt_insert(), dbt_query(), and dbt_update().
| int dbt_row_free | ( | dbt_table_p | , | |
| dbt_row_p | ||||
| ) |
Definition at line 118 of file dbt_tb.c.
References _dbt_table::colv, DB_BLOB, DB_STR, DB_STRING, _dbt_row::fields, _dbt_table::nrcols, _str::s, shm_free, db_val_t::str_val, _dbt_column::type, and db_val_t::val.
Referenced by dbt_delete(), dbt_insert(), and dbt_table_free_rows().
| dbt_row_p dbt_row_new | ( | int | ) |
Definition at line 91 of file dbt_tb.c.
References _dbt_row::fields, _dbt_row::next, db_val_t::nul, NULL, _dbt_row::prev, shm_free, and shm_malloc().
Referenced by dbt_insert(), and dbt_load_file().
Definition at line 276 of file dbt_tb.c.
References db_val_t::bitmap_val, DB_BITMAP, DB_BLOB, DB_DATETIME, DB_DOUBLE, DB_INT, DB_STR, DB_STRING, db_val_t::double_val, _dbt_row::fields, db_val_t::int_val, _str::len, db_val_t::nul, _str::s, shm_malloc(), db_val_t::str_val, db_val_t::string_val, db_val_t::time_val, db_val_t::type, and db_val_t::val.
Referenced by dbt_insert(), and dbt_load_file().
Definition at line 353 of file dbt_tb.c.
References db_val_t::bitmap_val, DB_BITMAP, DB_BLOB, DB_DATETIME, DB_DOUBLE, DB_INT, DB_STR, DB_STRING, db_val_t::double_val, _dbt_row::fields, db_val_t::int_val, _str::len, LM_ERR, db_val_t::nul, _str::s, shm_free, shm_malloc(), db_val_t::str_val, db_val_t::string_val, db_val_t::time_val, db_val_t::type, and db_val_t::val.
Referenced by dbt_update().
| int dbt_table_add_row | ( | dbt_table_p | , | |
| dbt_row_p | ||||
| ) |
Definition at line 221 of file dbt_tb.c.
References DBT_FL_SET, dbt_table_check_row(), dbt_table_update_flags(), DBT_TBFL_MODI, _dbt_row::next, _dbt_table::nrrows, and _dbt_table::rows.
Referenced by dbt_insert().
| int dbt_table_check_row | ( | dbt_table_p | , | |
| dbt_row_p | ||||
| ) |
Definition at line 443 of file dbt_tb.c.
References _dbt_table::auto_col, _dbt_table::auto_val, _dbt_table::colv, DB_INT, DBT_FLAG_AUTO, DBT_FLAG_NULL, dbt_is_neq_type(), _dbt_row::fields, _dbt_column::flag, db_val_t::int_val, LM_DBG, _dbt_table::nrcols, db_val_t::nul, db_val_t::type, _dbt_column::type, and db_val_t::val.
Referenced by dbt_load_file(), and dbt_table_add_row().
| int dbt_table_free | ( | dbt_table_p | ) |
Definition at line 243 of file dbt_tb.c.
References _dbt_table::cols, _dbt_table::colv, _dbt_table::dbname, dbt_column_free(), dbt_table_free_rows(), _dbt_table::name, _dbt_column::next, _dbt_table::nrrows, NULL, _dbt_table::rows, _str::s, and shm_free.
Referenced by dbt_cache_destroy(), and dbt_db_del_table().
| int dbt_table_free_rows | ( | dbt_table_p | ) |
Definition at line 196 of file dbt_tb.c.
References _dbt_table::colv, DBT_FL_SET, dbt_row_free(), dbt_table_update_flags(), DBT_TBFL_MODI, _dbt_row::next, _dbt_table::nrrows, NULL, and _dbt_table::rows.
Referenced by dbt_delete(), and dbt_table_free().
| dbt_table_p dbt_table_new | ( | const str * | , | |
| const str * | , | |||
| const char * | ||||
| ) |
Definition at line 142 of file dbt_tb.c.
References DBT_TBFL_ZERO, _str::len, LM_DBG, NULL, _str::s, shm_free, and shm_malloc().
Referenced by dbt_load_file().
| int dbt_table_update_flags | ( | dbt_table_p | , | |
| int | , | |||
| int | , | |||
| int | ||||
| ) |
Definition at line 483 of file dbt_tb.c.
References DBT_FL_SET, DBT_FL_UNSET, _dbt_table::flag, _dbt_table::mark, and NULL.
Referenced by dbt_cache_print(), dbt_delete(), dbt_query(), dbt_table_add_row(), dbt_table_free_rows(), and dbt_update().
| int db_mode |
Database sync scheme: 0-no db, 1-write through, 2-write back, 3-only db
Definition at line 49 of file dbtext.c.
Referenced by allow_trusted(), bind_usrloc(), child_init(), dbt_db_get_table(), delete_ucontact(), delete_urecord(), free_urecord(), get_all_ucontacts(), get_urecord(), init_child_trusted(), init_trusted(), insert_ucontact(), insert_urecord(), is_domain_local(), lock_udomain(), lock_ulslot(), mi_child_init(), mi_domain_dump(), mi_domain_reload(), mod_init(), register_udomain(), release_urecord(), st_delete_ucontact(), st_update_ucontact(), synchronize_all_udomains(), timer_urecord(), unlock_udomain(), unlock_ulslot(), and update_ucontact().
1.5.6