Persistant data storage (akin to *doze registry) More...
Go to the source code of this file.
Data Structures | |
struct | ast_db_entry |
Functions | |
int | ast_db_del (const char *family, const char *key) |
Delete entry in astdb. More... | |
int | ast_db_deltree (const char *family, const char *keytree) |
Delete one or more entries in astdb If both parameters are NULL, the entire database will be purged. If only keytree is NULL, all entries within the family will be purged. It is an error for keytree to have a value when family is NULL. More... | |
void | ast_db_freetree (struct ast_db_entry *entry) |
Free structure created by ast_db_gettree() More... | |
int | ast_db_get (const char *family, const char *key, char *out, int outlen) |
Get key value specified by family/key. More... | |
int | ast_db_get_allocated (const char *family, const char *key, char **out) |
Get key value specified by family/key as a heap allocated string. More... | |
struct ast_db_entry * | ast_db_gettree (const char *family, const char *keytree) |
Get a list of values within the astdb tree If family is specified, only those keys will be returned. If keytree is specified, subkeys are expected to exist (separated from the key with a slash). If subkeys do not exist and keytree is specified, the tree will consist of either a single entry or NULL will be returned. More... | |
int | ast_db_put (const char *family, const char *key, const char *value) |
Store value addressed by family/key. More... | |
Persistant data storage (akin to *doze registry)
Definition in file astdb.h.
int ast_db_del | ( | const char * | family, |
const char * | key | ||
) |
Delete entry in astdb.
Definition at line 365 of file db.c.
References ast_debug, ast_mutex_lock, ast_mutex_unlock, db_sync(), dbinit(), dblock, and MAX_DB_FIELD.
Referenced by __expire_registry(), ast_privacy_set(), auth_exec(), cache_lookup_internal(), del_exec(), destroy_all_channels(), destroy_association(), dialgroup_refreshdb(), dump_queue_members(), function_db_delete(), handle_cli_database_del(), handle_dbdel(), handle_pri_service_generic(), manager_dbdel(), mkintf(), pri_dchannel(), process_clearcache(), reload_queue_members(), and update_registry().
int ast_db_deltree | ( | const char * | family, |
const char * | keytree | ||
) |
Delete one or more entries in astdb If both parameters are NULL, the entire database will be purged. If only keytree is NULL, all entries within the family will be purged. It is an error for keytree to have a value when family is NULL.
-1 | An error occurred |
>= | 0 Number of records deleted |
Definition at line 241 of file db.c.
References db_deltree_cb(), MAX_DB_FIELD, prefix, and process_db_keys().
Referenced by ast_privacy_reset(), deltree_exec(), dundi_flush(), handle_cli_database_deltree(), handle_dbdeltree(), iax_provision_reload(), and manager_dbdeltree().
void ast_db_freetree | ( | struct ast_db_entry * | entry | ) |
Free structure created by ast_db_gettree()
Definition at line 656 of file db.c.
References ast_free, last, and ast_db_entry::next.
Referenced by handle_cli_devstate_list(), load_module(), process_clearcache(), and reload_queue_members().
int ast_db_get | ( | const char * | family, |
const char * | key, | ||
char * | out, | ||
int | outlen | ||
) |
Get key value specified by family/key.
Definition at line 348 of file db.c.
References ast_assert, and db_get_common().
Referenced by ast_privacy_check(), auth_exec(), blacklist_read(), cache_lookup_internal(), check_access(), create_addr(), custom_devstate_callback(), database_increment(), destroy_all_channels(), function_db_delete(), function_db_exists(), function_db_read(), handle_cli_database_get(), handle_dbget(), iax_provision_version(), load_password(), manager_dbget(), mkintf(), populate_addr(), and reg_source_db().
int ast_db_get_allocated | ( | const char * | family, |
const char * | key, | ||
char ** | out | ||
) |
Get key value specified by family/key as a heap allocated string.
Given a family and key, sets out to a pointer to a heap allocated string. In the event of an error, out will be set to NULL. The string must be freed by calling ast_free().
-1 | An error occurred |
0 | Success |
Definition at line 358 of file db.c.
References db_get_common().
Referenced by reload_queue_members().
struct ast_db_entry* ast_db_gettree | ( | const char * | family, |
const char * | keytree | ||
) |
Get a list of values within the astdb tree If family is specified, only those keys will be returned. If keytree is specified, subkeys are expected to exist (separated from the key with a slash). If subkeys do not exist and keytree is specified, the tree will consist of either a single entry or NULL will be returned.
Resulting tree should be freed by passing the return value to ast_db_freetree() when usage is concluded.
Definition at line 631 of file db.c.
References ast_log(), ast_strlen_zero(), db_gettree_cb(), LOG_WARNING, MAX_DB_FIELD, prefix, and process_db_keys().
Referenced by handle_cli_devstate_list(), load_module(), process_clearcache(), and reload_queue_members().
int ast_db_put | ( | const char * | family, |
const char * | key, | ||
const char * | value | ||
) |
Store value addressed by family/key.
Definition at line 260 of file db.c.
References ast_log(), ast_mutex_lock, ast_mutex_unlock, db_sync(), dbinit(), dblock, LOG_WARNING, and MAX_DB_FIELD.
Referenced by __analog_ss_thread(), ast_privacy_set(), cache_save(), cache_save_hint(), database_increment(), devstate_write(), dialgroup_refreshdb(), dump_queue_members(), function_db_write(), handle_cli_database_put(), handle_cli_devstate_change(), handle_command_response(), handle_dbput(), handle_pri_service_generic(), iax_provision_build(), manager_dbput(), mgcp_ss(), parse_register_contact(), pri_dchannel(), save_secret(), and update_registry().