37 #define DATASTORE_BUCKETS 53 41 const char *
file,
int line,
const char *
function)
50 datastore =
__ast_calloc(1,
sizeof(*datastore), file, line,
function);
107 if (!
ao2_link(datastores, datastore)) {
142 const char *uid_ptr =
uid;
160 if (!datastore->
uid) {
void * __ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func) attribute_malloc
Asterisk main include file. File version handling, generic pbx functions.
int ast_datastores_add(struct ao2_container *datastores, struct ast_datastore *datastore)
Add a data store to a container.
int ast_datastore_free(struct ast_datastore *datastore)
Free a data store object.
The arg parameter is a search key, but is not an object.
struct ast_datastore * ast_datastores_find(struct ao2_container *datastores, const char *name)
Find a data store in a container.
Universally unique identifier support.
Structure for a data store type.
#define ast_strdup(str)
A wrapper for strdup()
Structure for a data store object.
#define ast_module_unref(mod)
Release a reference to the module.
#define ast_strlen_zero(foo)
AO2_STRING_FIELD_HASH_FN(ast_datastore, uid)
Asterisk datastore objects.
#define ao2_ref(o, delta)
const struct ast_datastore_info * info
void(* destroy)(void *data)
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
#define ao2_alloc(data_size, destructor_fn)
#define DATASTORE_BUCKETS
Number of buckets for datastore container.
char * ast_uuid_generate_str(char *buf, size_t size)
Generate a UUID string.
Prototypes for public functions only of internal interest,.
#define ao2_find(container, arg, flags)
static void datastore_destroy(void *obj)
AO2_STRING_FIELD_CMP_FN(ast_datastore, uid)
struct ao2_container * ast_datastores_alloc(void)
Allocate a specialized data stores container.
void ast_datastores_remove(struct ao2_container *datastores, const char *name)
Remove a data store from a container.
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.
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.
Asterisk module definitions.
#define ast_module_ref(mod)
Hold a reference to the module.
#define ao2_link(container, obj)