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