Asterisk - The Open Source Telephony Project
21.4.1
|
Asterisk datastore objects. More...
#include "asterisk/linkedlists.h"
Go to the source code of this file.
Data Structures | |
struct | ast_datastore |
Structure for a data store object. More... | |
struct | ast_datastore_info |
Structure for a data store type. More... | |
Macros | |
#define | ast_datastore_alloc(info, uid) __ast_datastore_alloc(info, uid, AST_MODULE_SELF, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Functions | |
struct ast_datastore * | __ast_datastore_alloc (const struct ast_datastore_info *info, const char *uid, struct ast_module *mod, const char *file, int line, const char *function) |
Create a data store object. More... | |
int | ast_datastore_free (struct ast_datastore *datastore) |
Free a data store object. More... | |
int | ast_datastores_add (struct ao2_container *datastores, struct ast_datastore *datastore) |
Add a data store to a container. More... | |
struct ao2_container * | ast_datastores_alloc (void) |
Allocate a specialized data stores container. More... | |
struct ast_datastore * | ast_datastores_alloc_datastore (const struct ast_datastore_info *info, const char *uid) |
Allocate a datastore for use with the datastores container. More... | |
struct ast_datastore * | ast_datastores_find (struct ao2_container *datastores, const char *name) |
Find a data store in a container. More... | |
void | ast_datastores_remove (struct ao2_container *datastores, const char *name) |
Remove a data store from a container. More... | |
Asterisk datastore objects.
Definition in file datastore.h.
struct ast_datastore* __ast_datastore_alloc | ( | const struct ast_datastore_info * | info, |
const char * | uid, | ||
struct ast_module * | mod, | ||
const char * | file, | ||
int | line, | ||
const char * | function | ||
) |
Create a data store object.
[in] | info | information describing the data store object |
[in] | uid | unique identifer |
[in] | mod | The module to hold until this datastore is freed. |
file,line,function |
Definition at line 39 of file datastore.c.
References ast_module_ref, ast_strdup, ast_datastore::info, ast_datastore::mod, and ast_datastore::uid.
int ast_datastore_free | ( | struct ast_datastore * | datastore | ) |
Free a data store object.
[in] | datastore | datastore to free |
Definition at line 68 of file datastore.c.
References ast_module_unref, ast_datastore::data, ast_datastore_info::destroy, ast_datastore::info, ast_datastore::mod, and ast_datastore::uid.
Referenced by ast_bridge_discard_after_goto(), ast_bridge_setup_after_goto(), ast_cel_fabricate_channel_from_event(), ast_channel_destructor(), ast_channel_unsuppress(), ast_do_pickup(), ast_dummy_channel_destructor(), ast_iax2_new(), ast_jb_create_framehook(), ast_setup_cc_recall_datastore(), audiohook_volume_get(), authenticate_reply(), bridge_timeout(), fixup_callback(), lua_get_state(), raise_exception(), save_dialstring(), and setup_async_playback_datastore().
int ast_datastores_add | ( | struct ao2_container * | datastores, |
struct ast_datastore * | datastore | ||
) |
Add a data store to a container.
[in] | datastores | container to store datastore in |
[in] | datastore | datastore to add |
0 | success |
-1 | failure |
Definition at line 105 of file datastore.c.
References ao2_link, ast_datastore::info, and ast_datastore::uid.
struct ao2_container* ast_datastores_alloc | ( | void | ) |
Allocate a specialized data stores container.
Definition at line 99 of file datastore.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, ao2_container_alloc_hash, and DATASTORE_BUCKETS.
struct ast_datastore* ast_datastores_alloc_datastore | ( | const struct ast_datastore_info * | info, |
const char * | uid | ||
) |
Allocate a datastore for use with the datastores container.
[in] | info | information about the datastore |
[in] | uid | unique identifier for the datastore |
non-NULL | success |
NULL | failure |
Definition at line 142 of file datastore.c.
References ao2_ref, ast_strdup, ast_uuid_generate_str(), ast_datastore::info, and ast_datastore::uid.
struct ast_datastore* ast_datastores_find | ( | struct ao2_container * | datastores, |
const char * | name | ||
) |
Find a data store in a container.
[in] | datastores | container to find datastore in |
[in] | name | name of the data store to find |
non-NULL | success |
NULL | failure |
Definition at line 123 of file datastore.c.
References OBJ_SEARCH_KEY.
void ast_datastores_remove | ( | struct ao2_container * | datastores, |
const char * | name | ||
) |
Remove a data store from a container.
[in] | datastores | container to remove datastore from |
[in] | name | name of the data store to remove |
Definition at line 118 of file datastore.c.
References OBJ_NODATA, OBJ_SEARCH_KEY, and OBJ_UNLINK.