#include <stdio.h>#include <string.h>#include <time.h>#include <sys/types.h>#include <dirent.h>#include "../../mem/shm_mem.h"#include "../../mem/mem.h"#include "../../dprint.h"#include "dbt_util.h"#include "dbt_lib.h"

Go to the source code of this file.
Defines | |
| #define | DBT_CACHETBL_SIZE 16 |
Functions | |
| int | dbt_cache_check_db (str *_s) |
| int | dbt_cache_destroy (void) |
| dbt_cache_p | dbt_cache_get_db (str *_s) |
| int | dbt_cache_print (int _f) |
| int | dbt_db_del_table (dbt_cache_p _dc, const str *_s, int sync) |
| dbt_table_p | dbt_db_get_table (dbt_cache_p _dc, const str *_s) |
| int | dbt_init_cache (void) |
| int | dbt_is_neq_type (db_type_t _t0, db_type_t _t1) |
| int | dbt_release_table (dbt_cache_p _dc, const str *_s) |
Variables | |
| static dbt_cache_p * | _dbt_cachedb = NULL |
| static gen_lock_t * | _dbt_cachesem = NULL |
| static dbt_tbl_cachel_p | _dbt_cachetbl = NULL |
| #define DBT_CACHETBL_SIZE 16 |
Definition at line 48 of file dbt_lib.c.
Referenced by dbt_cache_destroy(), dbt_cache_print(), dbt_db_del_table(), dbt_db_get_table(), dbt_init_cache(), and dbt_release_table().
| int dbt_cache_check_db | ( | str * | _s | ) |
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_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().
| dbt_cache_p dbt_cache_get_db | ( | str * | _s | ) |
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 | _f | ) |
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().
| int dbt_db_del_table | ( | dbt_cache_p | _dc, | |
| const str * | _s, | |||
| int | sync | |||
| ) |
Definition at line 213 of file dbt_lib.c.
References core_hash(), _dbt_table::dbname, DBT_CACHETBL_SIZE, dbt_table_free(), _dbt_tbl_cachel::dtp, _dbt_table::hash, hash, _str::len, _dbt_table::name, _dbt_cache::name, _dbt_table::next, NULL, _dbt_table::prev, and _str::s.
Referenced by dbt_db_get_table().
| dbt_table_p dbt_db_get_table | ( | dbt_cache_p | _dc, | |
| const str * | _s | |||
| ) |
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().
| int dbt_release_table | ( | dbt_cache_p | _dc, | |
| const str * | _s | |||
| ) |
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().
dbt_cache_p* _dbt_cachedb = NULL [static] |
gen_lock_t* _dbt_cachesem = NULL [static] |
Definition at line 44 of file dbt_lib.c.
Referenced by dbt_cache_check_db(), dbt_cache_destroy(), dbt_cache_get_db(), and dbt_init_cache().
dbt_tbl_cachel_p _dbt_cachetbl = NULL [static] |
1.5.6