dbt_lib.h File Reference

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

Include dependency graph for dbt_lib.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _dbt_cache
struct  _dbt_column
struct  _dbt_row
struct  _dbt_table
struct  _dbt_tbl_cachel

Defines

#define DBT_DELIM   ':'
#define DBT_DELIM_C   ' '
#define DBT_DELIM_R   '\n'
#define DBT_FL_IGN   -1
#define DBT_FL_SET   0
#define DBT_FL_UNSET   1
#define DBT_FLAG_AUTO   2
#define DBT_FLAG_NULL   1
#define DBT_FLAG_UNSET   0
#define DBT_TBFL_MODI   1
#define DBT_TBFL_ZERO   0

Typedefs

typedef struct _dbt_cachedbt_cache_p
typedef struct _dbt_cache dbt_cache_t
typedef struct _dbt_columndbt_column_p
typedef struct _dbt_column dbt_column_t
typedef struct _dbt_rowdbt_row_p
typedef struct _dbt_row dbt_row_t
typedef struct _dbt_tabledbt_table_p
typedef struct _dbt_table dbt_table_t
typedef struct _dbt_tbl_cacheldbt_tbl_cachel_p
typedef struct _dbt_tbl_cachel dbt_tbl_cachel_t
typedef db_val_tdbt_val_p
typedef db_val_t dbt_val_t

Functions

int dbt_cache_check_db (str *)
int dbt_cache_del_db (str *)
int dbt_cache_destroy (void)
int dbt_cache_free (dbt_cache_p)
dbt_cache_p dbt_cache_get_db (str *)
int dbt_cache_print (int)
int dbt_check_mtime (const str *, const str *, time_t *)
int dbt_column_free (dbt_column_p)
dbt_column_p dbt_column_new (char *, int)
dbt_table_p dbt_db_get_table (dbt_cache_p, const str *)
int dbt_init_cache (void)
int dbt_is_neq_type (db_type_t _t0, db_type_t _t1)
dbt_table_p dbt_load_file (const str *, const str *)
int dbt_print_table (dbt_table_p, str *)
int dbt_release_table (dbt_cache_p, const str *)
int dbt_row_free (dbt_table_p, dbt_row_p)
dbt_row_p dbt_row_new (int)
int dbt_row_set_val (dbt_row_p, dbt_val_p, int, int)
int dbt_row_update_val (dbt_row_p, dbt_val_p, int, int)
int dbt_table_add_row (dbt_table_p, dbt_row_p)
int dbt_table_check_row (dbt_table_p, dbt_row_p)
int dbt_table_free (dbt_table_p)
int dbt_table_free_rows (dbt_table_p)
dbt_table_p dbt_table_new (const str *, const str *, const char *)
int dbt_table_update_flags (dbt_table_p, int, int, int)

Variables

int db_mode


Define Documentation

#define DBT_DELIM   ':'

Definition at line 49 of file dbt_lib.h.

Referenced by dbt_load_file(), and dbt_print_table().

#define DBT_DELIM_C   ' '

Definition at line 50 of file dbt_lib.h.

Referenced by dbt_load_file(), and dbt_print_table().

#define DBT_DELIM_R   '\n'

Definition at line 51 of file dbt_lib.h.

Referenced by dbt_load_file(), and dbt_print_table().

#define DBT_FL_IGN   -1

Definition at line 45 of file dbt_lib.h.

Referenced by dbt_query().

#define DBT_FL_SET   0

#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

Definition at line 38 of file dbt_lib.h.

Referenced by dbt_column_new().

#define DBT_TBFL_MODI   1

#define DBT_TBFL_ZERO   0

Definition at line 42 of file dbt_lib.h.

Referenced by dbt_query(), and dbt_table_new().


Typedef Documentation

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_row * dbt_row_p

typedef struct _dbt_row dbt_row_t

typedef struct _dbt_table * dbt_table_p

typedef struct _dbt_table dbt_table_t

typedef db_val_t * dbt_val_p

Definition at line 58 of file dbt_lib.h.

Definition at line 58 of file dbt_lib.h.


Function Documentation

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   ) 

int dbt_cache_free ( dbt_cache_p   ) 

dbt_cache_p dbt_cache_get_db ( str  ) 

int dbt_cache_print ( int   ) 

int dbt_check_mtime ( const str tbn,
const str dbn,
time_t *  mt 
)

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

dbt_table_p dbt_db_get_table ( dbt_cache_p  ,
const str  
)

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

int dbt_is_neq_type ( db_type_t  _t0,
db_type_t  _t1 
)

dbt_table_p dbt_load_file ( const str ,
const str  
)

int dbt_print_table ( dbt_table_p  ,
str  
)

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   
)

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

int dbt_row_set_val ( dbt_row_p  ,
dbt_val_p  ,
int  ,
int   
)

int dbt_row_update_val ( dbt_row_p  ,
dbt_val_p  ,
int  ,
int   
)

int dbt_table_add_row ( dbt_table_p  ,
dbt_row_p   
)

int dbt_table_check_row ( dbt_table_p  ,
dbt_row_p   
)

int dbt_table_free ( dbt_table_p   ) 

int dbt_table_free_rows ( dbt_table_p   ) 

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   
)


Variable Documentation

int db_mode


Generated on Tue May 22 14:00:35 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6