40 #define OBJECT_BUCKETS 53 100 const char *
id = arg;
136 }
else if (params->
prefix) {
141 }
else if (params->
fields &&
187 .container = objects,
198 .container = objects,
199 .regex = &expression,
206 if (regcomp(&expression, regex, REG_EXTENDED | REG_NOSUB)) {
211 regfree(&expression);
218 .container = objects,
248 return existing ? 0 : -1;
Asterisk main include file. File version handling, generic pbx functions.
static void * sorcery_memory_retrieve_id(const struct ast_sorcery *sorcery, void *data, const char *type, const char *id)
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
#define ao2_callback(c, flags, cb_fn, arg)
Structure for variables, used for configurations and for channel variables.
Assume that the ao2_container is already locked.
Full structure for sorcery.
static int sorcery_memory_update(const struct ast_sorcery *sorcery, void *data, void *object)
#define ao2_link_flags(container, obj, flags)
const char * name
Name of the wizard.
static void sorcery_memory_retrieve_prefix(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *prefix, const size_t prefix_len)
static int sorcery_memory_delete(const struct ast_sorcery *sorcery, void *data, void *object)
static void * sorcery_memory_retrieve_fields(const struct ast_sorcery *sorcery, void *data, const char *type, const struct ast_variable *fields)
#define ast_strlen_zero(foo)
struct ao2_container * container
Optional container to put object into.
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.
static int sorcery_memory_create(const struct ast_sorcery *sorcery, void *data, void *object)
#define ao2_ref(o, delta)
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
struct ao2_global_obj objects
Objects retrieved from the configuration file.
regex_t * regex
Regular expression for checking object id.
static void sorcery_memory_retrieve_multiple(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const struct ast_variable *fields)
#define ast_sorcery_wizard_register(interface)
See __ast_sorcery_wizard_register()
#define ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn)
const size_t prefix_len
Prefix length in bytes for matching object id.
#define OBJECT_BUCKETS
Number of buckets for sorcery objects.
int ast_sorcery_wizard_unregister(const struct ast_sorcery_wizard *interface)
Unregister a sorcery wizard.
#define ast_sorcery_objectset_create(sorcery, object)
Create an object set (KVP list) for an object.
static int regex(struct ast_channel *chan, const char *cmd, char *parse, char *buf, size_t len)
Module has failed to load, may be in an inconsistent state.
#define ao2_find(container, arg, flags)
static void sorcery_memory_retrieve_regex(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *regex)
static int sorcery_memory_fields_cmp(void *obj, void *arg, int flags)
static int unload_module(void)
AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS|AST_MODFLAG_LOAD_ORDER, "HTTP Phone Provisioning",.support_level=AST_MODULE_SUPPORT_EXTENDED,.load=load_module,.unload=unload_module,.reload=reload,.load_pri=AST_MODPRI_CHANNEL_DEPEND,.requires="http",)
const char * prefix
Prefix for matching object id.
Interface for a sorcery wizard.
static int load_module(void)
static struct ast_sorcery * sorcery
int ast_variable_lists_match(const struct ast_variable *left, const struct ast_variable *right, int exact_match)
Tests 2 variable lists to see if they match.
static void sorcery_memory_close(void *data)
static int sorcery_memory_hash(const void *obj, const int flags)
Hashing function for sorcery objects.
const struct ast_variable * fields
Pointer to the fields to check.
static struct ast_sorcery_wizard memory_object_wizard
#define ASTERISK_GPL_KEY
The text the key() function should return.
Asterisk module definitions.
static int sorcery_memory_cmp(void *obj, void *arg, int flags)
Comparator function for sorcery objects.
const struct ast_sorcery * sorcery
Pointer to the sorcery structure.
Structure used for fields comparison.
static void * sorcery_memory_open(const char *data)
Sorcery Data Access Layer API.
static char prefix[MAX_PREFIX]
static force_inline int attribute_pure ast_str_hash(const char *str)
Compute a hash value on a string.
#define ao2_link(container, obj)