45    char *object_id = 
NULL;
 
 
   61    char *object_id = 
NULL;
 
 
  134    .
name = 
"sorcery_realtime_test",
 
 
  190        info->name = 
"object_create";
 
  191        info->category = 
"/res/sorcery_realtime/";
 
  192        info->summary = 
"sorcery realtime object creation unit test";
 
  194            "Test object creation in sorcery using realtime wizard";
 
 
  225        info->name = 
"object_retrieve_id";
 
  226        info->category = 
"/res/sorcery_realtime/";
 
  227        info->summary = 
"sorcery object retrieval using id unit test";
 
  229            "Test object retrieval using id in sorcery with realtime wizard";
 
 
  283        info->name = 
"object_retrieve_field";
 
  284        info->category = 
"/res/sorcery_realtime/";
 
  285        info->summary = 
"sorcery object retrieval using a specific field unit test";
 
  287            "Test object retrieval using a specific field in sorcery with realtime wizard";
 
 
  346        info->name = 
"object_retrieve_multiple_all";
 
  347        info->category = 
"/res/sorcery_realtime/";
 
  348        info->summary = 
"sorcery multiple object retrieval unit test";
 
  350            "Test multiple object retrieval in sorcery using realtime wizard";
 
 
  402        info->name = 
"object_retrieve_multiple_all_nofetch";
 
  403        info->category = 
"/res/sorcery_realtime/";
 
  404        info->summary = 
"sorcery multiple object retrieval unit test";
 
  406            "Test multiple object retrieval in sorcery using realtime wizard";
 
 
  460        info->name = 
"object_retrieve_multiple_field";
 
  461        info->category = 
"/res/sorcery_realtime/";
 
  462        info->summary = 
"sorcery multiple object retrieval unit test";
 
  464            "Test multiple object retrieval in sorcery using fields using realtime wizard";
 
 
  525        info->name = 
"object_retrieve_regex";
 
  526        info->category = 
"/res/sorcery_realtime/";
 
  527        info->summary = 
"sorcery multiple object retrieval using regex unit test";
 
  529            "Test multiple object retrieval in sorcery using regular expression for matching using realtime wizard";
 
 
  593        info->name = 
"object_retrieve_regex_nofetch";
 
  594        info->category = 
"/res/sorcery_realtime/";
 
  595        info->summary = 
"sorcery multiple object retrieval using regex unit test";
 
  597            "Test multiple object retrieval in sorcery using regular expression for matching using realtime wizard";
 
 
  661        info->name = 
"object_update";
 
  662        info->category = 
"/res/sorcery_realtime/";
 
  663        info->summary = 
"sorcery object update unit test";
 
  665            "Test object updating in sorcery using realtime wizard";
 
  704    } 
else if ((obj->bob != obj2->bob) || (obj->joe != obj2->joe)) {
 
 
  719        info->name = 
"object_delete";
 
  720        info->category = 
"/res/sorcery_realtime/";
 
  721        info->summary = 
"sorcery object deletion unit test";
 
  723            "Test object deletion in sorcery using realtime wizard";
 
 
  766        info->name = 
"object_delete_uncreated";
 
  767        info->category = 
"/res/sorcery_realtime/";
 
  768        info->summary = 
"sorcery object deletion unit test";
 
  770            "Test object deletion of an uncreated object in sorcery using realtime wizard";
 
 
  802        info->name = 
"object_allocate_on_retrieval";
 
  803        info->category = 
"/res/sorcery_realtime/";
 
  804        info->summary = 
"sorcery object allocation upon retrieval unit test";
 
  806            "This test creates data in a realtime backend, not through sorcery. Sorcery is then\n" 
  807            "instructed to retrieve an object with the id of the object that was created in the\n" 
  808            "realtime backend. Sorcery should be able to allocate the object appropriately";
 
  830    if (obj->bob != 42) {
 
  834    } 
else if (obj->joe != 93) {
 
 
  852        info->name = 
"object_filter";
 
  853        info->category = 
"/res/sorcery_realtime/";
 
  854        info->summary = 
"sorcery object field filter unit test";
 
  856            "This test creates data in a realtime backend, not through sorcery. In addition to\n" 
  857            "the object fields that have been registered with sorcery, there is data in the\n" 
  858            "realtime backend that is unknown to sorcery. When sorcery attempts to retrieve\n" 
  859            "the object from the realtime backend, the data unknown to sorcery should be\n" 
  860            "filtered out of the returned objectset, and the object should be successfully\n" 
  861            "allocated by sorcery";
 
  884    if (obj->bob != 42) {
 
  888    } 
else if (obj->joe != 93) {
 
 
Persistent data storage (akin to *doze registry)
Asterisk main include file. File version handling, generic pbx functions.
int ao2_container_count(struct ao2_container *c)
Returns the number of elements in a container.
#define FLDSET(type,...)
Convert a struct and list of fields to an argument list of field offsets.
@ OPT_UINT_T
Type for default option handler for unsigned integers.
char * ast_category_browse(struct ast_config *config, const char *prev_name)
Browse categories.
struct ast_category * ast_category_delete(struct ast_config *cfg, struct ast_category *cat)
Delete a category.
struct ast_config * ast_config_new(void)
Create a new base configuration structure.
void ast_category_append(struct ast_config *config, struct ast_category *category)
Appends a category to a config.
void ast_variable_append(struct ast_category *category, struct ast_variable *variable)
struct ast_category * ast_category_new(const char *name, const char *in_file, int lineno)
Create a category.
#define ast_variable_new(name, value, filename)
int ast_config_engine_deregister(struct ast_config_engine *del)
Deregister config engine.
struct ast_variable * ast_variables_dup(struct ast_variable *var)
Duplicate variable list.
struct ast_variable * ast_category_root(struct ast_config *config, char *cat)
returns the root ast_variable of a config
void ast_config_destroy(struct ast_config *cfg)
Destroys a config.
int ast_category_exist(const struct ast_config *config, const char *category_name, const char *filter)
Check for category duplicates.
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.
void ast_variables_destroy(struct ast_variable *var)
Free variable list.
const struct ast_variable * ast_variable_find_variable_in_list(const struct ast_variable *list, const char *variable_name)
Gets a variable from a variable list by name.
int ast_config_engine_register(struct ast_config_engine *newconfig)
Register config engine.
struct ast_category * ast_category_get(const struct ast_config *config, const char *category_name, const char *filter)
Retrieve a category if it exists.
Support for logging to various files, console and syslog Configuration in file logger....
static int ast_realtime_append_mapping(const char *name, const char *driver, const char *database, const char *table, int priority)
Asterisk module definitions.
#define AST_MODULE_INFO_STANDARD(keystr, desc)
#define ASTERISK_GPL_KEY
The text the key() function should return.
@ AST_MODULE_LOAD_SUCCESS
static struct ast_sorcery * sorcery
Sorcery Data Access Layer API.
#define ast_sorcery_unref(sorcery)
Decrease the reference count of a sorcery structure.
const char * ast_sorcery_object_get_id(const void *object)
Get the unique identifier of a sorcery object.
#define ast_sorcery_object_field_register_nodoc(sorcery, type, name, default_val, opt_type, flags,...)
Register a field within an object without documentation.
@ AST_RETRIEVE_FLAG_MULTIPLE
Return all matching objects.
@ AST_RETRIEVE_FLAG_DEFAULT
Default retrieval flags.
@ AST_RETRIEVE_FLAG_ALL
Perform no matching, return all objects.
int ast_sorcery_create(const struct ast_sorcery *sorcery, void *object)
Create and potentially persist an object using an available wizard.
void * ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *type, const char *id)
Retrieve an object using its unique identifier.
struct ao2_container * ast_sorcery_retrieve_by_regex(const struct ast_sorcery *sorcery, const char *type, const char *regex)
Retrieve multiple objects using a regular expression on their id.
#define ast_sorcery_internal_object_register(sorcery, type, alloc, transform, apply)
Register an internal, hidden object type.
void * ast_sorcery_generic_alloc(size_t size, ao2_destructor_fn destructor)
Allocate a generic sorcery capable object.
void * ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, const char *id)
Allocate an object.
int ast_sorcery_update(const struct ast_sorcery *sorcery, void *object)
Update an object.
#define ast_sorcery_apply_default(sorcery, type, name, data)
#define ast_sorcery_open()
Open a new sorcery structure.
void * ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const char *type, unsigned int flags, struct ast_variable *fields)
Retrieve an object or multiple objects using specific fields.
int ast_sorcery_delete(const struct ast_sorcery *sorcery, void *object)
Delete an object.
void * ast_sorcery_copy(const struct ast_sorcery *sorcery, const void *object)
Create a copy of an object.
@ AST_SORCERY_APPLY_SUCCESS
Configuration engine structure, used to define realtime drivers.
Full structure for sorcery.
Structure for variables, used for configurations and for channel variables.
#define AST_TEST_REGISTER(cb)
#define ast_test_status_update(a, b, c...)
#define AST_TEST_UNREGISTER(cb)
#define AST_TEST_DEFINE(hdr)
static struct ast_sorcery * alloc_and_initialize_sorcery(void)
static void * test_sorcery_object_alloc(const char *id)
Internal function to allocate a test object.
static struct ast_config * realtime_objects
Configuration structure which contains all stored objects.
static int realtime_sorcery_destroy(const char *database, const char *table, const char *keyfield, const char *entity, const struct ast_variable *fields)
static void deinitialize_sorcery(struct ast_sorcery *sorcery)
static int realtime_sorcery_store(const char *database, const char *table, const struct ast_variable *fields)
struct ast_config_engine sorcery_config_engine
static struct ast_variable * realtime_sorcery(const char *database, const char *table, const struct ast_variable *fields)
static struct ast_config * realtime_sorcery_multi(const char *database, const char *table, const struct ast_variable *fields)
static int load_module(void)
static int unload_module(void)
static int realtime_sorcery_update(const char *database, const char *table, const char *keyfield, const char *entity, const struct ast_variable *fields)
#define RAII_VAR(vartype, varname, initval, dtor)
Declare a variable that will call a destructor function when it goes out of scope.