Asterisk - The Open Source Telephony Project GIT-master-f36a736
|
Sorcery Data Access Layer API. More...
Go to the source code of this file.
Data Structures | |
struct | ast_sorcery_global_observer |
Interface for the global sorcery observer. More... | |
struct | ast_sorcery_instance_observer |
Interface for the sorcery instance observer. More... | |
struct | ast_sorcery_object_details |
Structure which contains details about a sorcery object. More... | |
struct | ast_sorcery_observer |
Interface for a sorcery object type observer. More... | |
struct | ast_sorcery_wizard |
Interface for a sorcery wizard. More... | |
struct | ast_sorcery_wizard_observer |
Interface for the sorcery wizard observer. More... | |
Macros | |
#define | ast_sorcery_apply_config(sorcery, name) __ast_sorcery_apply_config((sorcery), (name), AST_MODULE) |
#define | ast_sorcery_apply_default(sorcery, type, name, data) __ast_sorcery_apply_default((sorcery), (type), AST_MODULE, (name), (data)) |
#define | ast_sorcery_apply_wizard_mapping(sorcery, type, name, data, caching) __ast_sorcery_apply_wizard_mapping((sorcery), (type), AST_MODULE, (name), (data), (caching)); |
Apply additional object wizard mappings. More... | |
#define | ast_sorcery_insert_wizard_mapping(sorcery, type, name, data, caching, position) |
Insert an additional object wizard mapping at a specific position in the wizard list. More... | |
#define | ast_sorcery_internal_object_register(sorcery, type, alloc, transform, apply) __ast_sorcery_object_register((sorcery), (type), 1, 1, (alloc), (transform), (apply)) |
Register an internal, hidden object type. More... | |
#define | ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, flags, ...) __ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, NULL, NULL, NULL, flags, 0, 0, VA_NARGS(__VA_ARGS__), __VA_ARGS__) |
Register a field within an object. More... | |
#define | ast_sorcery_object_field_register_alias(sorcery, type, name, default_val, opt_type, flags, ...) __ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, NULL, NULL, NULL, flags, 1, 1, VA_NARGS(__VA_ARGS__), __VA_ARGS__) |
Register a field within an object as an alias. More... | |
#define | ast_sorcery_object_field_register_custom(sorcery, type, name, default_val, config_handler, sorcery_handler, multiple_handler, flags, ...) __ast_sorcery_object_field_register(sorcery, type, name, default_val, OPT_CUSTOM_T, config_handler, sorcery_handler, multiple_handler, flags, 0, 0, VA_NARGS(__VA_ARGS__), __VA_ARGS__); |
Register a field within an object with custom handlers. More... | |
#define | ast_sorcery_object_field_register_custom_alias(sorcery, type, name, default_val, config_handler, sorcery_handler, multiple_handler, flags, ...) __ast_sorcery_object_field_register(sorcery, type, name, default_val, OPT_CUSTOM_T, config_handler, sorcery_handler, multiple_handler, flags, 1, 1, VA_NARGS(__VA_ARGS__), __VA_ARGS__); |
Register a field within an object with custom handlers as an alias. More... | |
#define | ast_sorcery_object_field_register_custom_nodoc(sorcery, type, name, default_val, config_handler, sorcery_handler, multiple_handler, flags, ...) __ast_sorcery_object_field_register(sorcery, type, name, default_val, OPT_CUSTOM_T, config_handler, sorcery_handler, multiple_handler, flags, 1, 0, VA_NARGS(__VA_ARGS__), __VA_ARGS__); |
Register a field within an object with custom handlers without documentation. More... | |
#define | ast_sorcery_object_field_register_nodoc(sorcery, type, name, default_val, opt_type, flags, ...) __ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, NULL, NULL, NULL, flags, 1, 0, VA_NARGS(__VA_ARGS__), __VA_ARGS__) |
Register a field within an object without documentation. More... | |
#define | ast_sorcery_object_register(sorcery, type, alloc, transform, apply) __ast_sorcery_object_register((sorcery), (type), 0, 1, (alloc), (transform), (apply)) |
Register an object type. More... | |
#define | ast_sorcery_object_register_no_reload(sorcery, type, alloc, transform, apply) __ast_sorcery_object_register((sorcery), (type), 0, 0, (alloc), (transform), (apply)) |
Register an object type that is not reloadable. More... | |
#define | ast_sorcery_object_type_apply_wizard(sorcery, object_type_name, wizard_type_name, wizard_args, flags, wizard, wizard_data) |
Apply additional object wizard mappings returning wizard information. More... | |
#define | ast_sorcery_object_type_insert_wizard(sorcery, object_type_name, wizard_type_name, wizard_args, flags, position, wizard, wizard_data) |
Insert an additional object wizard mapping at a specific position in the wizard list returning wizard information. More... | |
#define | ast_sorcery_object_type_remove_wizard(sorcery, object_type_name, wizard_type_name, wizard_args) |
Remove an object wizard mapping. More... | |
#define | ast_sorcery_objectset_create(sorcery, object) ast_sorcery_objectset_create2(sorcery, object, AST_HANDLER_PREFER_LIST) |
Create an object set (KVP list) for an object. More... | |
#define | ast_sorcery_open() __ast_sorcery_open(AST_MODULE, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Open a new sorcery structure. More... | |
#define | ast_sorcery_remove_wizard_mapping(sorcery, type, name) __ast_sorcery_remove_wizard_mapping((sorcery), (type), AST_MODULE, (name)) |
Remove an object wizard mapping. More... | |
#define | ast_sorcery_unref(sorcery) ao2_cleanup(sorcery) |
Decrease the reference count of a sorcery structure. More... | |
#define | ast_sorcery_wizard_register(interface) __ast_sorcery_wizard_register(interface, AST_MODULE_SELF) |
See __ast_sorcery_wizard_register() More... | |
#define | MAX_OBJECT_FIELD 128 |
Maximum length of an object field name. More... | |
#define | MAX_OBJECT_TYPE 64 |
Maximum size of an object type. More... | |
#define | SORCERY_OBJECT(details) |
Macro which must be used at the beginning of each sorcery capable object. More... | |
Typedefs | |
typedef int(* | sorcery_apply_handler) (const struct ast_sorcery *sorcery, void *obj) |
A callback function for when an object set is successfully applied to an object. More... | |
typedef int(* | sorcery_copy_handler) (const void *src, void *dst) |
A callback function for copying the contents of one object to another. More... | |
typedef int(* | sorcery_diff_handler) (const void *original, const void *modified, struct ast_variable **changes) |
A callback function for generating a changeset between two objects. More... | |
typedef int(* | sorcery_field_handler) (const void *obj, const intptr_t *args, char **buf) |
A callback function for translating a value into a string. More... | |
typedef int(* | sorcery_fields_handler) (const void *obj, struct ast_variable **fields) |
A callback function for translating multiple values into an ast_variable list. More... | |
typedef struct ast_variable *(* | sorcery_transform_handler) (struct ast_variable *set) |
A callback function for performing a transformation on an object set. More... | |
Enumerations | |
enum | ast_sorcery_apply_result { AST_SORCERY_APPLY_FAIL = -1 , AST_SORCERY_APPLY_SUCCESS = 0 , AST_SORCERY_APPLY_DUPLICATE = 1 , AST_SORCERY_APPLY_DEFAULT_UNNECESSARY = 2 , AST_SORCERY_APPLY_NO_CONFIGURATION = 3 } |
enum | ast_sorcery_field_handler_flags { AST_HANDLER_PREFER_STRING , AST_HANDLER_PREFER_LIST , AST_HANDLER_ONLY_STRING , AST_HANDLER_ONLY_LIST } |
Field handler flags. More... | |
enum | ast_sorcery_retrieve_flags { AST_RETRIEVE_FLAG_DEFAULT = 0 , AST_RETRIEVE_FLAG_MULTIPLE = (1 << 0) , AST_RETRIEVE_FLAG_ALL = (1 << 1) } |
Retrieval flags. More... | |
enum | ast_sorcery_wizard_apply_flags { AST_SORCERY_WIZARD_APPLY_NONE = (0 << 0) , AST_SORCERY_WIZARD_APPLY_CACHING = (1 << 0) , AST_SORCERY_WIZARD_APPLY_READONLY = (1 << 1) , AST_SORCERY_WIZARD_APPLY_ALLOW_DUPLICATE = (1 << 2) } |
Wizard Apply Flags. More... | |
enum | ast_sorcery_wizard_position { AST_SORCERY_WIZARD_POSITION_LAST = -1 , AST_SORCERY_WIZARD_POSITION_FIRST = 0 } |
Pre-defined locations to insert at. More... | |
Functions | |
enum ast_sorcery_apply_result | __ast_sorcery_apply_config (struct ast_sorcery *sorcery, const char *name, const char *module) |
Apply configured wizard mappings. More... | |
enum ast_sorcery_apply_result | __ast_sorcery_apply_default (struct ast_sorcery *sorcery, const char *type, const char *module, const char *name, const char *data) |
Apply default object wizard mappings. More... | |
enum ast_sorcery_apply_result | __ast_sorcery_apply_wizard_mapping (struct ast_sorcery *sorcery, const char *type, const char *module, const char *name, const char *data, unsigned int caching) |
Apply additional object wizard mappings. More... | |
enum ast_sorcery_apply_result | __ast_sorcery_insert_wizard_mapping (struct ast_sorcery *sorcery, const char *type, const char *module, const char *name, const char *data, unsigned int caching, int position) |
Insert an additional object wizard mapping at a specific position in the wizard list. More... | |
int | __ast_sorcery_object_field_register (struct ast_sorcery *sorcery, const char *type, const char *name, const char *default_val, enum aco_option_type opt_type, aco_option_handler config_handler, sorcery_field_handler sorcery_handler, sorcery_fields_handler multiple_handler, unsigned int flags, unsigned int no_doc, unsigned int alias, size_t argc,...) |
Register a field within an object. More... | |
int | __ast_sorcery_object_register (struct ast_sorcery *sorcery, const char *type, unsigned int hidden, unsigned int reloadable, aco_type_item_alloc alloc, sorcery_transform_handler transform, sorcery_apply_handler apply) |
Register an object type. More... | |
enum ast_sorcery_apply_result | __ast_sorcery_object_type_insert_wizard (struct ast_sorcery *sorcery, const char *object_type_name, const char *module, const char *wizard_type_name, const char *wizard_args, enum ast_sorcery_wizard_apply_flags flags, int position, struct ast_sorcery_wizard **wizard, void **wizard_data) |
Insert an additional object wizard mapping at a specific position in the wizard list returning wizard information. More... | |
int | __ast_sorcery_object_type_remove_wizard (struct ast_sorcery *sorcery, const char *object_type_name, const char *module, const char *wizard_type_name, const char *wizard_args) |
Remove an object wizard mapping. More... | |
struct ast_sorcery * | __ast_sorcery_open (const char *module, const char *file, int line, const char *func) |
int | __ast_sorcery_remove_wizard_mapping (struct ast_sorcery *sorcery, const char *type, const char *module, const char *name) |
Remove an object wizard mapping. More... | |
int | __ast_sorcery_wizard_register (const struct ast_sorcery_wizard *interface, struct ast_module *module) |
Register a sorcery wizard. More... | |
void * | ast_sorcery_alloc (const struct ast_sorcery *sorcery, const char *type, const char *id) |
Allocate an object. More... | |
int | ast_sorcery_changeset_create (const struct ast_variable *original, const struct ast_variable *modified, struct ast_variable **changes) |
Create a changeset given two object sets. More... | |
void * | ast_sorcery_copy (const struct ast_sorcery *sorcery, const void *object) |
Create a copy of an object. More... | |
int | ast_sorcery_create (const struct ast_sorcery *sorcery, void *object) |
Create and potentially persist an object using an available wizard. More... | |
int | ast_sorcery_delete (const struct ast_sorcery *sorcery, void *object) |
Delete an object. More... | |
int | ast_sorcery_diff (const struct ast_sorcery *sorcery, const void *original, const void *modified, struct ast_variable **changes) |
Create a changeset of two objects. More... | |
void | ast_sorcery_force_reload (const struct ast_sorcery *sorcery) |
Inform any wizards to reload persistent objects, even if no changes determined. More... | |
void | ast_sorcery_force_reload_object (const struct ast_sorcery *sorcery, const char *type) |
Inform any wizards of a specific object type to reload persistent objects even if no changes determined. More... | |
void * | ast_sorcery_generic_alloc (size_t size, ao2_destructor_fn destructor) |
Allocate a generic sorcery capable object. More... | |
const char * | ast_sorcery_get_module (const struct ast_sorcery *sorcery) |
Get the module that has opened the provided sorcery instance. More... | |
struct ast_sorcery_object_type * | ast_sorcery_get_object_type (const struct ast_sorcery *sorcery, const char *type) |
Get the sorcery object type given a type name. More... | |
int | ast_sorcery_get_wizard_mapping (struct ast_sorcery *sorcery, const char *type, int index, struct ast_sorcery_wizard **wizard, void **data) |
By index, return a wizard mapped to an object type. More... | |
int | ast_sorcery_get_wizard_mapping_count (struct ast_sorcery *sorcery, const char *type) |
Return the number of wizards mapped to an object type. More... | |
int | ast_sorcery_global_observer_add (const struct ast_sorcery_global_observer *callbacks) |
Add a global observer to sorcery. More... | |
void | ast_sorcery_global_observer_remove (const struct ast_sorcery_global_observer *callbacks) |
Remove a global observer from sorcery. More... | |
int | ast_sorcery_init (void) |
Initialize the sorcery API. More... | |
int | ast_sorcery_instance_observer_add (struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks) |
Add an observer to a sorcery instance. More... | |
void | ast_sorcery_instance_observer_remove (struct ast_sorcery *sorcery, const struct ast_sorcery_instance_observer *callbacks) |
Remove an observer from a sorcery instance. More... | |
int | ast_sorcery_is_object_field_registered (const struct ast_sorcery_object_type *object_type, const char *field_name) |
Determine if a particular object field has been registered with sorcery. More... | |
int | ast_sorcery_is_stale (const struct ast_sorcery *sorcery, void *object) |
Determine if a sorcery object is stale with respect to its backing datastore. More... | |
void | ast_sorcery_load (const struct ast_sorcery *sorcery) |
Inform any wizards to load persistent objects. More... | |
void | ast_sorcery_load_object (const struct ast_sorcery *sorcery, const char *type) |
Inform any wizards of a specific object type to load persistent objects. More... | |
void * | ast_sorcery_lockable_alloc (size_t size, ao2_destructor_fn destructor, void *lockobj) |
Allocate a generic sorcery capable object with locking. More... | |
int | ast_sorcery_object_fields_register (struct ast_sorcery *sorcery, const char *type, const char *regex, aco_option_handler config_handler, sorcery_fields_handler sorcery_handler) |
Register a regex for multiple fields within an object. More... | |
const struct timeval | ast_sorcery_object_get_created (const void *object) |
Get when the sorcery object was created. More... | |
const char * | ast_sorcery_object_get_extended (const void *object, const char *name) |
Get an extended field value from a sorcery object. More... | |
const char * | ast_sorcery_object_get_id (const void *object) |
Get the unique identifier of a sorcery object. More... | |
const char * | ast_sorcery_object_get_type (const void *object) |
Get the type of a sorcery object. More... | |
unsigned int | ast_sorcery_object_has_dynamic_contents (const void *object) |
Get whether an object contains dynamic contents or not. More... | |
int | ast_sorcery_object_id_compare (void *obj, void *arg, int flags) |
ao2 object comparator based on sorcery id. More... | |
int | ast_sorcery_object_id_hash (const void *obj, int flags) |
ao2 object hasher based on sorcery id. More... | |
int | ast_sorcery_object_id_sort (const void *obj, const void *arg, int flags) |
ao2 object sorter based on sorcery id. More... | |
int | ast_sorcery_object_set_congestion_levels (struct ast_sorcery *sorcery, const char *type, long low_water, long high_water) |
Set the high and low alert water marks of the sorcery object type. More... | |
void | ast_sorcery_object_set_copy_handler (struct ast_sorcery *sorcery, const char *type, sorcery_copy_handler copy) |
Set the copy handler for an object type. More... | |
void | ast_sorcery_object_set_diff_handler (struct ast_sorcery *sorcery, const char *type, sorcery_diff_handler diff) |
Set the diff handler for an object type. More... | |
int | ast_sorcery_object_set_extended (const void *object, const char *name, const char *value) |
Set an extended field value on a sorcery object. More... | |
void | ast_sorcery_object_set_has_dynamic_contents (const void *object) |
Set the dynamic contents flag on a sorcery object. More... | |
int | ast_sorcery_object_unregister (struct ast_sorcery *sorcery, const char *type) |
Unregister an object type. More... | |
int | ast_sorcery_objectset_apply (const struct ast_sorcery *sorcery, void *object, struct ast_variable *objectset) |
Apply an object set (KVP list) to an object. More... | |
struct ast_variable * | ast_sorcery_objectset_create2 (const struct ast_sorcery *sorcery, const void *object, enum ast_sorcery_field_handler_flags flags) |
Create an object set (KVP list) for an object. More... | |
struct ast_json * | ast_sorcery_objectset_json_create (const struct ast_sorcery *sorcery, const void *object) |
Create an object set in JSON format for an object. More... | |
int | ast_sorcery_observer_add (const struct ast_sorcery *sorcery, const char *type, const struct ast_sorcery_observer *callbacks) |
Add an observer to a specific object type. More... | |
void | ast_sorcery_observer_remove (const struct ast_sorcery *sorcery, const char *type, const struct ast_sorcery_observer *callbacks) |
Remove an observer from a specific object type. More... | |
void | ast_sorcery_ref (struct ast_sorcery *sorcery) |
Increase the reference count of a sorcery structure. More... | |
void | ast_sorcery_reload (const struct ast_sorcery *sorcery) |
Inform any wizards to reload persistent objects. More... | |
void | ast_sorcery_reload_object (const struct ast_sorcery *sorcery, const char *type) |
Inform any wizards of a specific object type to reload persistent objects. More... | |
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. More... | |
void * | ast_sorcery_retrieve_by_id (const struct ast_sorcery *sorcery, const char *type, const char *id) |
Retrieve an object using its unique identifier. More... | |
struct ast_sorcery * | ast_sorcery_retrieve_by_module_name (const char *module_name) |
Retrieves an existing sorcery instance by module name. More... | |
struct ao2_container * | ast_sorcery_retrieve_by_prefix (const struct ast_sorcery *sorcery, const char *type, const char *prefix, const size_t prefix_len) |
Retrieve multiple objects whose id begins with the specified prefix. More... | |
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. More... | |
int | ast_sorcery_update (const struct ast_sorcery *sorcery, void *object) |
Update an object. More... | |
int | ast_sorcery_wizard_observer_add (struct ast_sorcery_wizard *wizard, const struct ast_sorcery_wizard_observer *callbacks) |
Add an observer to a sorcery wizard. More... | |
void | ast_sorcery_wizard_observer_remove (struct ast_sorcery_wizard *interface, const struct ast_sorcery_wizard_observer *callbacks) |
Remove an observer from a sorcery wizard. More... | |
int | ast_sorcery_wizard_unregister (const struct ast_sorcery_wizard *interface) |
Unregister a sorcery wizard. More... | |
Sorcery Data Access Layer API.
Definition in file sorcery.h.
#define ast_sorcery_apply_config | ( | sorcery, | |
name | |||
) | __ast_sorcery_apply_config((sorcery), (name), AST_MODULE) |
#define ast_sorcery_apply_default | ( | sorcery, | |
type, | |||
name, | |||
data | |||
) | __ast_sorcery_apply_default((sorcery), (type), AST_MODULE, (name), (data)) |
#define ast_sorcery_apply_wizard_mapping | ( | sorcery, | |
type, | |||
name, | |||
data, | |||
caching | |||
) | __ast_sorcery_apply_wizard_mapping((sorcery), (type), AST_MODULE, (name), (data), (caching)); |
Apply additional object wizard mappings.
sorcery | Pointer to a sorcery structure |
type | Type of object to apply to |
name | Name of the wizard to use |
data | Data to be passed to wizard |
caching | Wizard should cache |
Insert an additional object wizard mapping at a specific position in the wizard list.
sorcery | Pointer to a sorcery structure |
type | Type of object to apply to |
name | Name of the wizard to use |
data | Data to be passed to wizard |
caching | Wizard should cache |
position | One of ast_sorcery_wizard_position |
#define ast_sorcery_internal_object_register | ( | sorcery, | |
type, | |||
alloc, | |||
transform, | |||
apply | |||
) | __ast_sorcery_object_register((sorcery), (type), 1, 1, (alloc), (transform), (apply)) |
Register an internal, hidden object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
alloc | Required object allocation callback |
transform | Optional transformation callback |
apply | Optional object set apply callback |
0 | success |
-1 | failure |
#define ast_sorcery_object_field_register_alias | ( | sorcery, | |
type, | |||
name, | |||
default_val, | |||
opt_type, | |||
flags, | |||
... | |||
) | __ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, NULL, NULL, NULL, flags, 1, 1, VA_NARGS(__VA_ARGS__), __VA_ARGS__) |
Register a field within an object as an alias.
sorcery | Pointer to a sorcery structure |
type | Type of object |
name | Name of the field |
default_val | Default value of the field |
opt_type | Option type |
flags | Option type specific flags |
0 | success |
-1 | failure |
#define ast_sorcery_object_field_register_custom | ( | sorcery, | |
type, | |||
name, | |||
default_val, | |||
config_handler, | |||
sorcery_handler, | |||
multiple_handler, | |||
flags, | |||
... | |||
) | __ast_sorcery_object_field_register(sorcery, type, name, default_val, OPT_CUSTOM_T, config_handler, sorcery_handler, multiple_handler, flags, 0, 0, VA_NARGS(__VA_ARGS__), __VA_ARGS__); |
Register a field within an object with custom handlers.
sorcery | Pointer to a sorcery structure |
type | Type of object |
name | Name of the field |
default_val | Default value of the field |
config_handler | Custom configuration handler |
sorcery_handler | Custom sorcery handler |
multiple_handler | Custom multiple handler |
flags | Option type specific flags |
0 | success |
-1 | failure |
#define ast_sorcery_object_field_register_custom_alias | ( | sorcery, | |
type, | |||
name, | |||
default_val, | |||
config_handler, | |||
sorcery_handler, | |||
multiple_handler, | |||
flags, | |||
... | |||
) | __ast_sorcery_object_field_register(sorcery, type, name, default_val, OPT_CUSTOM_T, config_handler, sorcery_handler, multiple_handler, flags, 1, 1, VA_NARGS(__VA_ARGS__), __VA_ARGS__); |
Register a field within an object with custom handlers as an alias.
sorcery | Pointer to a sorcery structure |
type | Type of object |
name | Name of the field |
default_val | Default value of the field |
config_handler | Custom configuration handler |
sorcery_handler | Custom sorcery handler |
multiple_handler | Custom multiple handler |
flags | Option type specific flags |
0 | success |
-1 | failure |
#define ast_sorcery_object_field_register_custom_nodoc | ( | sorcery, | |
type, | |||
name, | |||
default_val, | |||
config_handler, | |||
sorcery_handler, | |||
multiple_handler, | |||
flags, | |||
... | |||
) | __ast_sorcery_object_field_register(sorcery, type, name, default_val, OPT_CUSTOM_T, config_handler, sorcery_handler, multiple_handler, flags, 1, 0, VA_NARGS(__VA_ARGS__), __VA_ARGS__); |
Register a field within an object with custom handlers without documentation.
sorcery | Pointer to a sorcery structure |
type | Type of object |
name | Name of the field |
default_val | Default value of the field |
config_handler | Custom configuration handler |
sorcery_handler | Custom sorcery handler |
multiple_handler | Custom multiple handler |
flags | Option type specific flags |
0 | success |
-1 | failure |
#define ast_sorcery_object_field_register_nodoc | ( | sorcery, | |
type, | |||
name, | |||
default_val, | |||
opt_type, | |||
flags, | |||
... | |||
) | __ast_sorcery_object_field_register(sorcery, type, name, default_val, opt_type, NULL, NULL, NULL, flags, 1, 0, VA_NARGS(__VA_ARGS__), __VA_ARGS__) |
Register a field within an object without documentation.
sorcery | Pointer to a sorcery structure |
type | Type of object |
name | Name of the field |
default_val | Default value of the field |
opt_type | Option type |
flags | Option type specific flags |
0 | success |
-1 | failure |
#define ast_sorcery_object_register | ( | sorcery, | |
type, | |||
alloc, | |||
transform, | |||
apply | |||
) | __ast_sorcery_object_register((sorcery), (type), 0, 1, (alloc), (transform), (apply)) |
#define ast_sorcery_object_register_no_reload | ( | sorcery, | |
type, | |||
alloc, | |||
transform, | |||
apply | |||
) | __ast_sorcery_object_register((sorcery), (type), 0, 0, (alloc), (transform), (apply)) |
Register an object type that is not reloadable.
sorcery | Pointer to a sorcery structure |
type | Type of object |
alloc | Required object allocation callback |
transform | Optional transformation callback |
apply | Optional object set apply callback |
0 | success |
-1 | failure |
#define ast_sorcery_object_type_apply_wizard | ( | sorcery, | |
object_type_name, | |||
wizard_type_name, | |||
wizard_args, | |||
flags, | |||
wizard, | |||
wizard_data | |||
) |
Apply additional object wizard mappings returning wizard information.
sorcery | Pointer to a sorcery structure | |
object_type_name | Name of the object type to apply to | |
wizard_type_name | Name of the wizard type to use | |
wizard_args | Opaque string to be passed to the wizard May be NULL but see note below | |
flags | One or more of enum ast_sorcery_wizard_apply_flags | |
[out] | wizard | A variable to receive a pointer to the ast_sorcery_wizard structure. May be NULL if not needed. |
[out] | wizard_data | A variable to receive a pointer to the wizard's internal data. May be NULL if not needed. |
wizard_args
is an optional parameter it is highly recommended to supply one. If you use the AST_SORCERY_WIZARD_APPLY_ALLOW_DUPLICATE flag, and you intend to ever remove a wizard mapping, you'll need wizard_args
to remove specific instances. #define ast_sorcery_object_type_insert_wizard | ( | sorcery, | |
object_type_name, | |||
wizard_type_name, | |||
wizard_args, | |||
flags, | |||
position, | |||
wizard, | |||
wizard_data | |||
) |
Insert an additional object wizard mapping at a specific position in the wizard list returning wizard information.
sorcery | Pointer to a sorcery structure | |
object_type_name | Name of the object type to apply to | |
wizard_type_name | Name of the wizard type to use | |
wizard_args | Opaque string to be passed to the wizard May be NULL but see note below | |
flags | One or more of enum ast_sorcery_wizard_apply_flags | |
position | An index to insert to or one of ast_sorcery_wizard_position | |
[out] | wizard | A variable to receive a pointer to the ast_sorcery_wizard structure. May be NULL if not needed. |
[out] | wizard_data | A variable to receive a pointer to the wizard's internal data. May be NULL if not needed. |
wizard_args
is an optional parameter it is highly recommended to supply one. If you use the AST_SORCERY_WIZARD_APPLY_ALLOW_DUPLICATE flag, and you intend to ever remove a wizard mapping, you'll need wizard_args
to remove specific instances. #define ast_sorcery_object_type_remove_wizard | ( | sorcery, | |
object_type_name, | |||
wizard_type_name, | |||
wizard_args | |||
) |
Remove an object wizard mapping.
sorcery | Pointer to a sorcery structure |
object_type_name | Name of the object type to remove from |
wizard_type_name | The name of the of the wizard type to remove |
wizard_args | Opaque string originally passed to the wizard |
0 | success |
-1 | failure |
wizard_args
, then only the first wizard matching wizard_type will be removed. #define ast_sorcery_objectset_create | ( | sorcery, | |
object | |||
) | ast_sorcery_objectset_create2(sorcery, object, AST_HANDLER_PREFER_LIST) |
Create an object set (KVP list) for an object.
sorcery | Pointer to a sorcery structure |
object | Pointer to a sorcery object |
non-NULL | success |
NULL | if error occurred |
#define ast_sorcery_open | ( | ) | __ast_sorcery_open(AST_MODULE, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Open a new sorcery structure.
module | The module name (AST_MODULE) |
When called, this will automatically also call __ast_sorcery_apply_config() with the module name as the configuration section.
non-NULL | success |
NULL | if allocation failed |
#define ast_sorcery_remove_wizard_mapping | ( | sorcery, | |
type, | |||
name | |||
) | __ast_sorcery_remove_wizard_mapping((sorcery), (type), AST_MODULE, (name)) |
#define ast_sorcery_unref | ( | sorcery | ) | ao2_cleanup(sorcery) |
#define ast_sorcery_wizard_register | ( | interface | ) | __ast_sorcery_wizard_register(interface, AST_MODULE_SELF) |
#define MAX_OBJECT_FIELD 128 |
#define MAX_OBJECT_TYPE 64 |
#define SORCERY_OBJECT | ( | details | ) |
Macro which must be used at the beginning of each sorcery capable object.
typedef int(* sorcery_apply_handler) (const struct ast_sorcery *sorcery, void *obj) |
A callback function for when an object set is successfully applied to an object.
sorcery | Sorcery structure in use |
obj | The object itself |
0 | Success |
non-zero | Failure |
typedef int(* sorcery_copy_handler) (const void *src, void *dst) |
typedef int(* sorcery_diff_handler) (const void *original, const void *modified, struct ast_variable **changes) |
typedef int(* sorcery_fields_handler) (const void *obj, struct ast_variable **fields) |
A callback function for translating multiple values into an ast_variable list.
obj | Object to get values from |
fields | Pointer to store the list of fields |
0 | success |
-1 | failure |
typedef struct ast_variable *(* sorcery_transform_handler) (struct ast_variable *set) |
A callback function for performing a transformation on an object set.
set | The existing object set |
non-NULL | new object set if changed |
NULL | if no changes present |
Definition at line 423 of file sorcery.h.
Field handler flags.
Definition at line 129 of file sorcery.h.
Retrieval flags.
Enumerator | |
---|---|
AST_RETRIEVE_FLAG_DEFAULT | Default retrieval flags. |
AST_RETRIEVE_FLAG_MULTIPLE | Return all matching objects. |
AST_RETRIEVE_FLAG_ALL | Perform no matching, return all objects. |
Definition at line 115 of file sorcery.h.
Wizard Apply Flags.
These flags apply only to a wizard/object-type combination. The same wizard may be applied to a different object-type with different flags and behavior. If ALLOW_DUPLICATE is set the wizard could even be applied to the same object-type with different flags.
Definition at line 575 of file sorcery.h.
Pre-defined locations to insert at.
Enumerator | |
---|---|
AST_SORCERY_WIZARD_POSITION_LAST | |
AST_SORCERY_WIZARD_POSITION_FIRST |
enum ast_sorcery_apply_result __ast_sorcery_apply_config | ( | struct ast_sorcery * | sorcery, |
const char * | name, | ||
const char * | module | ||
) |
Apply configured wizard mappings.
sorcery | Pointer to a sorcery structure |
name | Name of the category to use within the configuration file, normally the module name |
module | The module name (AST_MODULE) |
This function is called automatically by __ast_sorcery_open() using the module name as the configuration category. The only reason you should call this function is if your module wishes to apply configuration from additional sections of sorcery.conf.
If a configuration section attempts to apply the same sorcery wizard to an object type more than once, the wizard will only be applied one time.
Definition at line 985 of file sorcery.c.
References __ast_sorcery_apply_wizard_mapping(), ast_config_destroy(), ast_config_load2(), ast_free, AST_SORCERY_APPLY_FAIL, AST_SORCERY_APPLY_NO_CONFIGURATION, AST_SORCERY_APPLY_SUCCESS, ast_strdup, ast_strlen_zero(), ast_variable_browse(), config, CONFIG_STATUS_FILEINVALID, ast_flags::flags, name, ast_variable::name, ast_variable::next, options, RAII_VAR, sorcery, strsep(), type, and ast_variable::value.
Referenced by __ast_sorcery_open().
enum ast_sorcery_apply_result __ast_sorcery_apply_default | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | module, | ||
const char * | name, | ||
const char * | data | ||
) |
Apply default object wizard mappings.
sorcery | Pointer to a sorcery structure |
type | Type of object to apply to |
module | The name of the module, typically AST_MODULE |
name | Name of the wizard to use |
data | Data to be passed to wizard |
Definition at line 1031 of file sorcery.c.
References __ast_sorcery_apply_wizard_mapping(), ao2_cleanup, ao2_find, AST_SORCERY_APPLY_DEFAULT_UNNECESSARY, name, OBJ_KEY, RAII_VAR, sorcery, type, and ast_sorcery::types.
enum ast_sorcery_apply_result __ast_sorcery_apply_wizard_mapping | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | module, | ||
const char * | name, | ||
const char * | data, | ||
unsigned int | caching | ||
) |
Apply additional object wizard mappings.
sorcery | Pointer to a sorcery structure |
type | Type of object to apply to |
module | The name of the module, typically AST_MODULE |
name | Name of the wizard to use |
data | Data to be passed to wizard |
caching | Wizard should cache |
Apply additional object wizard mappings.
Definition at line 977 of file sorcery.c.
References __ast_sorcery_insert_wizard_mapping(), AST_SORCERY_WIZARD_POSITION_LAST, ast_sorcery_object_wizard::caching, ast_sorcery_object_wizard::data, name, sorcery, and type.
Referenced by __ast_sorcery_apply_config(), and __ast_sorcery_apply_default().
enum ast_sorcery_apply_result __ast_sorcery_insert_wizard_mapping | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | module, | ||
const char * | name, | ||
const char * | data, | ||
unsigned int | caching, | ||
int | position | ||
) |
Insert an additional object wizard mapping at a specific position in the wizard list.
sorcery | Pointer to a sorcery structure |
type | Type of object to apply to |
module | The name of the module, typically AST_MODULE |
name | Name of the wizard to use |
data | Data to be passed to wizard |
caching | Wizard should cache |
position | An index to insert to or one of ast_sorcery_wizard_position |
Insert an additional object wizard mapping at a specific position in the wizard list.
Definition at line 967 of file sorcery.c.
References __ast_sorcery_object_type_insert_wizard(), AST_SORCERY_WIZARD_APPLY_CACHING, AST_SORCERY_WIZARD_APPLY_NONE, ast_sorcery_object_wizard::caching, ast_sorcery_object_wizard::data, name, NULL, sorcery, and type.
Referenced by __ast_sorcery_apply_wizard_mapping().
int __ast_sorcery_object_field_register | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | name, | ||
const char * | default_val, | ||
enum aco_option_type | opt_type, | ||
aco_option_handler | config_handler, | ||
sorcery_field_handler | sorcery_handler, | ||
sorcery_fields_handler | multiple_handler, | ||
unsigned int | flags, | ||
unsigned int | no_doc, | ||
unsigned int | alias, | ||
size_t | argc, | ||
... | |||
) |
Register a field within an object.
sorcery | Pointer to a sorcery structure |
type | Type of object |
name | Name of the field |
default_val | Default value of the field |
config_handler | A custom handler for translating the string representation of the fields |
sorcery_handler | A custom handler for translating the native representation of the fields |
multiple_handler | A custom handler for translating the native representation of the fields |
opt_type | Option type |
flags | Option type specific flags |
no_doc | Field should not be documented |
alias | Interpret and apply field value only |
argc |
0 | success |
-1 | failure |
Definition at line 1192 of file sorcery.c.
References __aco_option_register(), ACO_EXACT, ao2_alloc, ao2_cleanup, ao2_find, ao2_link, args, ast_assert, ast_copy_string(), ast_sorcery_object_field::multiple_handler, name, NULL, OBJ_KEY, RAII_VAR, sorcery, sorcery_field_default_handler(), type, and ast_sorcery::types.
int __ast_sorcery_object_register | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
unsigned int | hidden, | ||
unsigned int | reloadable, | ||
aco_type_item_alloc | alloc, | ||
sorcery_transform_handler | transform, | ||
sorcery_apply_handler | apply | ||
) |
Register an object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
hidden | All objects of this type are internal and should not be manipulated by users |
reloadable | All objects of this type are reloadable |
alloc | Required object allocation callback |
transform | Optional transformation callback |
apply | Optional object set apply callback |
0 | success |
-1 | failure |
Definition at line 1080 of file sorcery.c.
References aco_info_init(), ACO_ITEM, ao2_cleanup, ao2_find, ast_sorcery_object_type::apply, ast_sorcery_object_fields_register(), ast_sorcery::module_name, NOTIFY_INSTANCE_OBSERVERS, NULL, OBJ_KEY, ast_sorcery::observers, RAII_VAR, ast_sorcery_object_type::reloadable, sorcery, sorcery_extended_config_handler(), sorcery_extended_fields_handler(), ast_sorcery_object_type::transform, type, and ast_sorcery::types.
enum ast_sorcery_apply_result __ast_sorcery_object_type_insert_wizard | ( | struct ast_sorcery * | sorcery, |
const char * | object_type_name, | ||
const char * | module, | ||
const char * | wizard_type_name, | ||
const char * | wizard_args, | ||
enum ast_sorcery_wizard_apply_flags | flags, | ||
int | position, | ||
struct ast_sorcery_wizard ** | wizard, | ||
void ** | wizard_data | ||
) |
Insert an additional object wizard mapping at a specific position in the wizard list returning wizard information.
sorcery | Pointer to a sorcery structure | |
object_type_name | Name of the object type to apply to | |
module | The name of the module, typically AST_MODULE | |
wizard_type_name | Name of the wizard type to use | |
wizard_args | Opaque string to be passed to the wizard May be NULL but see note below | |
flags | One or more of enum ast_sorcery_wizard_apply_flags | |
position | An index to insert to or one of ast_sorcery_wizard_position | |
[out] | wizard | A variable to receive a pointer to the ast_sorcery_wizard structure. May be NULL if not needed. |
[out] | wizard_data | A variable to receive a pointer to the wizard's internal data. May be NULL if not needed. |
wizard_args
is an optional parameter it is highly recommended to supply one. If you use the AST_SORCERY_WIZARD_APPLY_ALLOW_DUPLICATE flag, and you intend to ever remove a wizard mapping, you'll need wizard_args
to remove specific instances of a wizard type. Definition at line 869 of file sorcery.c.
References ast_sorcery_object_wizard::allow_duplicates, ao2_alloc, ao2_bump, ao2_cleanup, ao2_find, ao2_link, ast_debug, ast_log, ast_module_running_ref, ast_module_unref, AST_SORCERY_APPLY_DUPLICATE, AST_SORCERY_APPLY_FAIL, AST_SORCERY_APPLY_SUCCESS, AST_SORCERY_WIZARD_APPLY_ALLOW_DUPLICATE, AST_SORCERY_WIZARD_APPLY_CACHING, AST_SORCERY_WIZARD_APPLY_READONLY, AST_SORCERY_WIZARD_POSITION_LAST, ast_strlen_zero(), AST_VECTOR_GET_CMP, AST_VECTOR_INSERT_AT, AST_VECTOR_RW_UNLOCK, AST_VECTOR_RW_WRLOCK, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, LOG_ERROR, LOG_WARNING, ast_sorcery::module_name, NOTIFY_INSTANCE_OBSERVERS, NULL, OBJ_KEY, ast_sorcery::observers, RAII_VAR, S_OR, sorcery, sorcery_object_type_alloc(), sorcery_object_wizard_destructor(), ast_sorcery::types, ast_sorcery_object_wizard::wizard, ast_sorcery_object_wizard::wizard_args, WIZARD_COMPARE, and wizards.
Referenced by __ast_sorcery_insert_wizard_mapping().
int __ast_sorcery_object_type_remove_wizard | ( | struct ast_sorcery * | sorcery, |
const char * | object_type_name, | ||
const char * | module, | ||
const char * | wizard_type_name, | ||
const char * | wizard_args | ||
) |
Remove an object wizard mapping.
sorcery | Pointer to a sorcery structure |
object_type_name | Name of the object type to remove from |
module | The name of the module, typically AST_MODULE |
wizard_type_name | The name of the of the wizard type to remove |
wizard_args | Opaque string originally passed to the wizard |
0 | success |
-1 | failure |
wizard_args
, then only the first wizard matching wizard_type will be removed. Definition at line 820 of file sorcery.c.
References ao2_cleanup, ao2_find, AST_VECTOR_GET, AST_VECTOR_REMOVE_ORDERED, AST_VECTOR_RW_UNLOCK, AST_VECTOR_RW_WRLOCK, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, ast_sorcery_wizard::name, OBJ_SEARCH_KEY, RAII_VAR, S_OR, sorcery, ast_sorcery::types, ast_sorcery_object_wizard::wizard, and ast_sorcery_object_wizard::wizard_args.
struct ast_sorcery * __ast_sorcery_open | ( | const char * | module, |
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
Definition at line 601 of file sorcery.c.
References __ao2_alloc(), __ao2_weakproxy_find(), __ast_sorcery_apply_config(), AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_cleanup, ao2_container_alloc_hash, ao2_container_alloc_list, ao2_link_flags, ao2_ref, ao2_t_weakproxy_alloc, ao2_t_weakproxy_set_object, ao2_unlock, ao2_weakproxy_subscribe(), ao2_wrlock, ast_assert, ast_log, AST_SORCERY_APPLY_FAIL, make_ari_stubs::file, instances, LOG_ERROR, sorcery_proxy::module_name, ast_sorcery::module_name, NOTIFY_GLOBAL_OBSERVERS, NULL, OBJ_NOLOCK, OBJ_SEARCH_KEY, ast_sorcery::observers, observers, sorcery, sorcery_destructor(), sorcery_proxy_cb(), TYPE_BUCKETS, and ast_sorcery::types.
int __ast_sorcery_remove_wizard_mapping | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | module, | ||
const char * | name | ||
) |
Remove an object wizard mapping.
sorcery | Pointer to a sorcery structure |
type | Type of object to remove from |
module | The name of the module, typically AST_MODULE |
name | The name of the wizard to remove |
0 | success |
-1 | failure |
Remove an object wizard mapping.
Definition at line 850 of file sorcery.c.
References ao2_cleanup, ao2_find, AST_VECTOR_REMOVE_CMP_ORDERED, AST_VECTOR_RW_UNLOCK, AST_VECTOR_RW_WRLOCK, name, OBJ_KEY, RAII_VAR, sorcery, type, ast_sorcery::types, and WIZARD_NAME_COMPARE.
int __ast_sorcery_wizard_register | ( | const struct ast_sorcery_wizard * | interface, |
struct ast_module * | module | ||
) |
Register a sorcery wizard.
interface | Pointer to a wizard interface |
module | Pointer to the module implementing the interface |
0 | success |
-1 | failure |
Definition at line 432 of file sorcery.c.
References ao2_alloc, AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_cleanup, ao2_container_alloc_list, ao2_find, ao2_link_flags, ao2_lock, ao2_unlock, ast_assert, ast_log, ast_strlen_zero(), ast_verb, ast_sorcery_internal_wizard::callbacks, done, LOG_WARNING, ast_sorcery_wizard::module, ast_sorcery_wizard::name, NOTIFY_GLOBAL_OBSERVERS, NULL, OBJ_KEY, OBJ_NOLOCK, ast_sorcery_internal_wizard::observers, observers, sorcery_internal_wizard_destructor(), and wizards.
Referenced by ast_bucket_init().
void * ast_sorcery_alloc | ( | const struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | id | ||
) |
Allocate an object.
sorcery | Pointer to a sorcery structure |
type | Type of object to allocate |
id | Optional unique identifier, if none is provided one will be generated |
non-NULL | success |
NULL | failure |
Definition at line 1744 of file sorcery.c.
References aco_set_defaults(), ao2_cleanup, ao2_find, ao2_ref, ast_copy_string(), ast_strdup, ast_strlen_zero(), ast_tvnow(), ast_uuid_generate_str(), AST_UUID_STR_LEN, ast_sorcery_object::created, ast_sorcery_object::id, NULL, OBJ_KEY, ast_sorcery_object_details::object, RAII_VAR, sorcery, type, ast_sorcery_object::type, ast_sorcery::types, and uuid().
Referenced by alloc_artificial_auth(), ast_ari_asterisk_update_object(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_mwi_mailbox_alloc(), ast_sip_initialize_system(), ast_sip_location_create_contact(), ast_sorcery_copy(), AST_TEST_DEFINE(), create_artificial_endpoint(), create_effective_profile(), create_object(), default_profile_create(), global_loaded_observer(), load_module(), mock_retrieve_id(), permanent_uri_handler(), sip_cli_print_global(), sip_cli_print_system(), sorcery_astdb_retrieve_fields_common(), sorcery_astdb_retrieve_id(), sorcery_astdb_retrieve_prefix(), sorcery_astdb_retrieve_regex(), sorcery_config_internal_load(), sorcery_memory_cache_thrash_update(), sorcery_realtime_retrieve_fields(), sorcery_realtime_retrieve_multiple(), sorcery_test_retrieve_id(), and subscription_persistence_create().
int ast_sorcery_changeset_create | ( | const struct ast_variable * | original, |
const struct ast_variable * | modified, | ||
struct ast_variable ** | changes | ||
) |
Create a changeset given two object sets.
original | Original object set |
modified | Modified object set |
changes | Pointer to hold any changes between the object sets |
0 | success |
-1 | failure |
Definition at line 1663 of file sorcery.c.
References ast_variable_find_in_list(), ast_variable_new, ast_variables_destroy(), ast_variable::name, ast_variable::next, NULL, tmp(), and ast_variable::value.
Referenced by ast_sorcery_diff(), AST_TEST_DEFINE(), can_reuse_registration(), and sorcery_is_criteria_met().
void * ast_sorcery_copy | ( | const struct ast_sorcery * | sorcery, |
const void * | object | ||
) |
Create a copy of an object.
sorcery | Pointer to a sorcery structure |
object | Existing object |
non-NULL | success |
NULL | failure |
Definition at line 1778 of file sorcery.c.
References ao2_cleanup, ao2_find, ast_sorcery_alloc(), ast_sorcery_objectset_apply(), ast_sorcery_objectset_create, ast_variables_destroy(), copy(), ast_sorcery_object::id, NULL, OBJ_KEY, ast_sorcery_object_details::object, RAII_VAR, sorcery, ast_sorcery_object::type, and ast_sorcery::types.
Referenced by ast_ari_asterisk_update_object(), ast_bucket_clone(), ast_bucket_file_clone(), ast_mwi_mailbox_copy(), and AST_TEST_DEFINE().
int ast_sorcery_create | ( | const struct ast_sorcery * | sorcery, |
void * | object | ||
) |
Create and potentially persist an object using an available wizard.
sorcery | Pointer to a sorcery structure |
object | Pointer to a sorcery object |
0 | success |
-1 | failure |
Definition at line 2062 of file sorcery.c.
References ao2_cleanup, ao2_container_count(), ao2_find, ast_taskprocessor_push(), AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_object_wizard::caching, CMP_MATCH, NULL, OBJ_KEY, ast_sorcery_object_details::object, sorcery_observer_invocation::object_type, RAII_VAR, ast_sorcery_object_type::serializer, sorcery_details::sorcery, sorcery, sorcery_observer_invocation_alloc(), sorcery_observers_notify_create(), sorcery_wizard_create(), ast_sorcery_object::type, ast_sorcery::types, and ast_sorcery_object_type::wizards.
Referenced by ast_ari_asterisk_update_object(), ast_bucket_create(), ast_bucket_file_create(), ast_mwi_mailbox_update(), ast_sip_location_create_contact(), AST_TEST_DEFINE(), create_effective_profile(), default_profile_create(), load_module(), and subscription_persistence_create().
int ast_sorcery_delete | ( | const struct ast_sorcery * | sorcery, |
void * | object | ||
) |
Delete an object.
sorcery | Pointer to a sorcery structure |
object | Pointer to a sorcery object |
0 | success |
-1 | failure |
Definition at line 2238 of file sorcery.c.
References ao2_cleanup, ao2_container_count(), ao2_find, ast_taskprocessor_push(), AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_object_wizard::caching, CMP_MATCH, NULL, OBJ_KEY, ast_sorcery_object_details::object, sorcery_observer_invocation::object_type, RAII_VAR, ast_sorcery_object_type::serializer, sorcery_details::sorcery, sorcery, sorcery_observer_invocation_alloc(), sorcery_observers_notify_delete(), sorcery_wizard_delete(), ast_sorcery_object::type, ast_sorcery::types, and ast_sorcery_object_type::wizards.
Referenced by ast_ari_asterisk_delete_object(), ast_bucket_delete(), ast_bucket_file_delete(), ast_sip_location_delete_contact(), AST_TEST_DEFINE(), bucket_http_wizard_retrieve_id(), mwi_mailbox_delete(), sub_persistence_recreate(), subscription_persistence_recreate(), subscription_persistence_remove(), and unload_module().
int ast_sorcery_diff | ( | const struct ast_sorcery * | sorcery, |
const void * | original, | ||
const void * | modified, | ||
struct ast_variable ** | changes | ||
) |
Create a changeset of two objects.
sorcery | Pointer to a sorcery structure |
original | Original object |
modified | Modified object |
changes | Pointer which will be populated with changes if any exist |
0 | success |
-1 | failure |
Definition at line 1805 of file sorcery.c.
References ao2_cleanup, ao2_find, ast_sorcery_changeset_create(), ast_sorcery_object_get_type(), ast_sorcery_objectset_create, ast_variables_destroy(), NULL, OBJ_KEY, RAII_VAR, sorcery, and ast_sorcery::types.
Referenced by AST_TEST_DEFINE(), and transport_apply().
void ast_sorcery_force_reload | ( | const struct ast_sorcery * | sorcery | ) |
Inform any wizards to reload persistent objects, even if no changes determined.
sorcery | Pointer to a sorcery structure |
Definition at line 1425 of file sorcery.c.
References ao2_callback, ast_sorcery::module_name, NOTIFY_INSTANCE_OBSERVERS, OBJ_NODATA, ast_sorcery::observers, sorcery_load_details::sorcery, sorcery, sorcery_object_load(), and ast_sorcery::types.
void ast_sorcery_force_reload_object | ( | const struct ast_sorcery * | sorcery, |
const char * | type | ||
) |
Inform any wizards of a specific object type to reload persistent objects even if no changes determined.
sorcery | Pointer to a sorcery structure |
type | Name of the object type to reload |
Definition at line 1457 of file sorcery.c.
References ao2_cleanup, ao2_find, OBJ_KEY, RAII_VAR, sorcery_load_details::sorcery, sorcery, sorcery_object_load(), type, and ast_sorcery::types.
Referenced by acl_change_stasis_cb(), as_config_reload(), profile_reload(), tn_config_reload(), and vs_config_reload().
void * ast_sorcery_generic_alloc | ( | size_t | size, |
ao2_destructor_fn | destructor | ||
) |
Allocate a generic sorcery capable object.
size | Size of the object |
destructor | Optional destructor function |
non-NULL | success |
NULL | failure |
Definition at line 1728 of file sorcery.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ast_sorcery_object::destructor, NULL, ast_sorcery_object_details::object, and sorcery_object_destructor().
Referenced by acl_alloc(), ast_sip_endpoint_alloc(), asterisk_publication_config_alloc(), attestation_alloc(), auth_alloc(), bucket_alloc(), bucket_file_alloc(), client_config_alloc(), contact_alloc(), domain_alias_alloc(), geoloc_location_alloc(), geoloc_profile_alloc(), global_alloc(), ip_identify_alloc(), mapping_alloc(), mwi_sorcery_object_alloc(), phoneprov_alloc(), profile_alloc(), publication_resource_alloc(), resource_list_alloc(), sip_nat_hook_alloc(), sip_outbound_publish_alloc(), sip_outbound_registration_alloc(), sip_transport_alloc(), subscription_persistence_alloc(), system_alloc(), test_data_alloc(), test_sorcery_object_alloc(), tn_alloc(), and verification_alloc().
const char * ast_sorcery_get_module | ( | const struct ast_sorcery * | sorcery | ) |
Get the module that has opened the provided sorcery instance.
sorcery | The sorcery instance |
Definition at line 2536 of file sorcery.c.
References ast_sorcery::module_name, and sorcery.
Referenced by sorcery_memory_cache_load().
struct ast_sorcery_object_type * ast_sorcery_get_object_type | ( | const struct ast_sorcery * | sorcery, |
const char * | type | ||
) |
Get the sorcery object type given a type name.
sorcery | The sorcery from which to retrieve the object type |
type | The type name |
Definition at line 2494 of file sorcery.c.
References ao2_find, OBJ_SEARCH_KEY, sorcery, type, and ast_sorcery::types.
Referenced by ast_ari_asterisk_delete_object(), ast_ari_asterisk_get_object(), ast_ari_asterisk_update_object(), AST_TEST_DEFINE(), load_module(), sorcery_astdb_filter_objectset(), sorcery_is_explicit_name_met(), and sorcery_realtime_filter_objectset().
int ast_sorcery_get_wizard_mapping | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
int | index, | ||
struct ast_sorcery_wizard ** | wizard, | ||
void ** | data | ||
) |
By index, return a wizard mapped to an object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
index | Index of the wizard |
wizard | A pointer to receive the wizard pointer |
data | A pointer to receive the data pointer |
0 | success |
-1 | failure |
Definition at line 790 of file sorcery.c.
References ao2_bump, ao2_cleanup, ao2_find, AST_VECTOR_GET, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, ast_sorcery_object_wizard::data, NULL, OBJ_KEY, RAII_VAR, sorcery, type, ast_sorcery::types, and ast_sorcery_object_wizard::wizard.
Referenced by AST_TEST_DEFINE().
int ast_sorcery_get_wizard_mapping_count | ( | struct ast_sorcery * | sorcery, |
const char * | type | ||
) |
Return the number of wizards mapped to an object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
Definition at line 778 of file sorcery.c.
References ao2_cleanup, ao2_find, AST_VECTOR_SIZE, OBJ_KEY, RAII_VAR, sorcery, type, and ast_sorcery::types.
Referenced by AST_TEST_DEFINE().
int ast_sorcery_global_observer_add | ( | const struct ast_sorcery_global_observer * | callbacks | ) |
Add a global observer to sorcery.
callbacks | Implementation of the global observer interface |
0 | success |
-1 | failure |
Definition at line 498 of file sorcery.c.
References ao2_alloc, ao2_link, ao2_ref, sorcery_global_observer::callbacks, callbacks, NULL, and observers.
Referenced by AST_TEST_DEFINE(), and load_module().
void ast_sorcery_global_observer_remove | ( | const struct ast_sorcery_global_observer * | callbacks | ) |
Remove a global observer from sorcery.
A global observer is notified... After a new wizard is registered. After a new sorcery instance is opened. Before an instance is destroyed. Before a wizard is unregistered.
callbacks | Implementation of the global observer interface |
Definition at line 514 of file sorcery.c.
References ao2_callback, callbacks, OBJ_NODATA, OBJ_UNLINK, observers, and sorcery_generic_observer_remove().
Referenced by AST_TEST_DEFINE(), and unload_module().
int ast_sorcery_init | ( | void | ) |
Initialize the sorcery API.
0 | success |
-1 | failure |
Initialize the sorcery API.
Hashing function for sorcery instances
Definition at line 387 of file sorcery.c.
References AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_RWLOCK, ao2_container_alloc_hash, ao2_container_alloc_list, ast_assert, ast_register_cleanup(), ast_threadpool_create(), AST_THREADPOOL_OPTIONS_VERSION, INSTANCE_BUCKETS, instances, NULL, observers, options, sorcery_cleanup(), threadpool, WIZARD_BUCKETS, and wizards.
Referenced by asterisk_daemon().
int ast_sorcery_instance_observer_add | ( | struct ast_sorcery * | sorcery, |
const struct ast_sorcery_instance_observer * | callbacks | ||
) |
Add an observer to a sorcery instance.
sorcery | Pointer to a sorcery structure |
callbacks | Implementation of the instance observer interface |
An instance observer is notified... Before an instance is loaded or reloaded. After an instance is loaded or reloaded. After a wizard is mapped to an object type. After an object type is registered. Before an object type is loaded or reloaded. After an object type is loaded or reloaded.
0 | success |
-1 | failure |
Definition at line 520 of file sorcery.c.
References ao2_alloc, ao2_link, ao2_ref, sorcery_instance_observer::callbacks, callbacks, NULL, ast_sorcery::observers, and sorcery.
Referenced by ast_sip_initialize_sorcery_global(), AST_TEST_DEFINE(), instance_created_observer(), load_module(), and pjsip_outbound_registration_metrics_init().
void ast_sorcery_instance_observer_remove | ( | struct ast_sorcery * | sorcery, |
const struct ast_sorcery_instance_observer * | callbacks | ||
) |
Remove an observer from a sorcery instance.
sorcery | Pointer to a sorcery structure |
callbacks | Implementation of the instance observer interface |
Definition at line 537 of file sorcery.c.
References ao2_callback, callbacks, OBJ_NODATA, OBJ_UNLINK, ast_sorcery::observers, sorcery, and sorcery_generic_observer_remove().
Referenced by ast_sip_destroy_sorcery_global(), AST_TEST_DEFINE(), instance_destroying_observer(), pjsip_outbound_registration_metrics_init(), pjsip_outbound_registration_metrics_unload_cb(), and unload_module().
int ast_sorcery_is_object_field_registered | ( | const struct ast_sorcery_object_type * | object_type, |
const char * | field_name | ||
) |
Determine if a particular object field has been registered with sorcery.
object_type | The object type to check against |
field_name | The name of the field to check |
0 | The field is not registered for this sorcery type |
1 | The field is registered for this sorcery type |
Definition at line 2514 of file sorcery.c.
References ao2_callback, ao2_cleanup, ao2_find, ast_assert, ast_sorcery_object_type::fields, is_registered_cb(), NULL, and OBJ_SEARCH_KEY.
Referenced by AST_TEST_DEFINE(), sorcery_astdb_filter_objectset(), sorcery_is_explicit_name_met(), and sorcery_realtime_filter_objectset().
int ast_sorcery_is_stale | ( | const struct ast_sorcery * | sorcery, |
void * | object | ||
) |
Determine if a sorcery object is stale with respect to its backing datastore.
This function will query the wizard(s) backing the particular sorcery object to determine if the in-memory object is now stale. No action is taken to update the object. Callers of this function may use one of the ast_sorcery_retrieve functions to obtain a new instance of the object if desired.
0 | the object is not stale |
1 | the object is stale |
Definition at line 2288 of file sorcery.c.
References ao2_cleanup, ao2_find, ast_debug, ast_sorcery_object_get_id(), AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, ast_sorcery_object_wizard::data, ast_sorcery_wizard::is_stale, ast_sorcery_wizard::name, OBJ_KEY, ast_sorcery_object_details::object, RAII_VAR, sorcery, ast_sorcery_object::type, ast_sorcery::types, and ast_sorcery_object_wizard::wizard.
Referenced by ast_bucket_file_is_stale(), ast_bucket_is_stale(), and AST_TEST_DEFINE().
void ast_sorcery_load | ( | const struct ast_sorcery * | sorcery | ) |
Inform any wizards to load persistent objects.
sorcery | Pointer to a sorcery structure |
Definition at line 1377 of file sorcery.c.
References ao2_callback, ast_sorcery::module_name, NOTIFY_INSTANCE_OBSERVERS, OBJ_NODATA, ast_sorcery::observers, sorcery_load_details::sorcery, sorcery, sorcery_object_load(), and ast_sorcery::types.
Referenced by ast_res_pjsip_initialize_configuration(), ast_sip_initialize_system(), AST_TEST_DEFINE(), geoloc_config_load(), and load_module().
void ast_sorcery_load_object | ( | const struct ast_sorcery * | sorcery, |
const char * | type | ||
) |
Inform any wizards of a specific object type to load persistent objects.
sorcery | Pointer to a sorcery structure |
type | Name of the object type to load |
Definition at line 1393 of file sorcery.c.
References ao2_cleanup, ao2_find, OBJ_KEY, RAII_VAR, sorcery_load_details::sorcery, sorcery, sorcery_object_load(), type, and ast_sorcery::types.
Referenced by as_config_load(), AST_TEST_DEFINE(), load_module(), profile_load(), reregister_all(), tn_config_load(), and vs_config_load().
void * ast_sorcery_lockable_alloc | ( | size_t | size, |
ao2_destructor_fn | destructor, | ||
void * | lockobj | ||
) |
Allocate a generic sorcery capable object with locking.
Sorcery objects may be replaced with new allocations during reloads. If locking is required on sorcery objects it must be shared between the old object and the new one. lockobj can be any AO2 object with locking enabled, but in most cases named locks should be used to provide stable locking.
size | Size of the object |
destructor | Optional destructor function |
lockobj | An AO2 object that will provide locking. |
non-NULL | success |
NULL | failure |
Definition at line 1712 of file sorcery.c.
References ao2_alloc_with_lockobj, ast_sorcery_object::destructor, NULL, ast_sorcery_object_details::object, and sorcery_object_destructor().
Referenced by aor_alloc().
int ast_sorcery_object_fields_register | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | regex, | ||
aco_option_handler | config_handler, | ||
sorcery_fields_handler | sorcery_handler | ||
) |
Register a regex for multiple fields within an object.
sorcery | Pointer to a sorcery structure |
type | Type of object |
regex | A regular expression pattern for the fields |
config_handler | A custom handler for translating the string representation of the fields |
sorcery_handler | A custom handler for translating the native representation of the fields |
0 | success |
-1 | failure |
Definition at line 1160 of file sorcery.c.
References __aco_option_register(), ACO_REGEX, ao2_alloc, ao2_cleanup, ao2_find, ao2_link, ast_alloca, ast_calloc, ast_copy_string(), ast_log, LOG_ERROR, MAX_REGEX_ERROR_LEN, NULL, OBJ_KEY, OPT_CUSTOM_T, RAII_VAR, regex(), sorcery, sorcery_object_field_destructor(), type, and ast_sorcery::types.
Referenced by __ast_sorcery_object_register(), AST_TEST_DEFINE(), and load_module().
const struct timeval ast_sorcery_object_get_created | ( | const void * | object | ) |
Get when the sorcery object was created.
object | Pointer to a sorcery object |
Definition at line 2323 of file sorcery.c.
References ast_sorcery_object::created, and ast_sorcery_object_details::object.
const char * ast_sorcery_object_get_extended | ( | const void * | object, |
const char * | name | ||
) |
Get an extended field value from a sorcery object.
object | Pointer to a sorcery object |
name | Name of the extended field value |
non-NULL | if found |
NULL | if not found |
Definition at line 2335 of file sorcery.c.
References ast_sorcery_object::extended, name, ast_variable::name, ast_variable::next, NULL, ast_sorcery_object_details::object, and ast_variable::value.
Referenced by AST_TEST_DEFINE(), asterisk_start_devicestate_publishing(), asterisk_start_mwi_publishing(), delete_existing_cb(), and publisher_start().
const char * ast_sorcery_object_get_id | ( | const void * | object | ) |
Get the unique identifier of a sorcery object.
object | Pointer to a sorcery object |
Definition at line 2317 of file sorcery.c.
References ast_sorcery_object::id, and ast_sorcery_object_details::object.
Referenced by __print_debug_details(), aeap_cli_show(), aeap_tab_complete_name(), allocate_subscription_tree(), allow_and_or_replace_unsolicited(), ami_outbound_registration_task(), ami_show_registration_contact_statuses(), anonymous_identify(), aor_deleted_observer(), apply_acls(), ast_bucket_file_json(), ast_bucket_json(), ast_geoloc_eprofile_create_from_profile(), ast_mwi_mailbox_get_id(), ast_mwi_mailbox_update(), ast_res_pjsip_find_or_create_contact_status(), ast_res_pjsip_initialize_configuration(), ast_sip_create_dialog_uac(), ast_sip_create_subscription(), ast_sip_for_each_contact(), ast_sip_format_contact_ami(), ast_sip_get_contact_status(), ast_sip_get_device_state(), ast_sip_initialize_sorcery_auth(), ast_sip_initialize_sorcery_transport(), ast_sip_location_create_contact(), ast_sip_location_retrieve_aor_contacts_nolock_filtered(), ast_sip_session_alloc(), ast_sip_session_create_outgoing(), ast_sip_session_get_name(), ast_sip_set_tpselector_from_transport(), ast_sip_subscription_destroy(), ast_sorcery_is_stale(), ast_sorcery_object_id_hash(), ast_sorcery_object_id_sort(), AST_TEST_DEFINE(), asterisk_publication_devicestate(), asterisk_publication_devicestate_refresh(), asterisk_publication_devicestate_state_change(), asterisk_publication_mailboxstate(), asterisk_publication_mwi_refresh(), asterisk_publication_mwi_state_change(), attestation_apply(), auth_apply(), auth_observer(), bucket_file_run_curl(), bucket_http_test_wizard_create(), bucket_http_test_wizard_delete(), bucket_http_test_wizard_update(), build_resource_tree(), can_reuse_registration(), cancel_and_unpublish(), chan_pjsip_indicate(), chan_pjsip_new(), change_outgoing_sdp_stream_media_address(), check_state(), cli_aor_get_id(), cli_aor_print_body(), cli_complete_endpoint(), cli_complete_registration(), cli_complete_uri(), cli_contact_print_body(), cli_endpoint_print_body(), cli_iterator(), cli_list_subscriptions_detail(), cli_print_body(), cli_show_subscriptions_detail(), client_config_apply(), codec_prefs_handler(), common_identify(), config_object_cli_show(), config_object_tab_complete_name(), connected_line_method_handler(), contact_apply_handler(), contact_function_get_permanent(), create_dialog_uas(), create_effective_profile(), create_out_of_dialog_request(), create_outgoing_sdp_stream(), create_rtp(), create_unsolicited_mwi_subscriptions(), current_state_reusable(), destroy_subscription(), digest_check_auth(), digest_create_request_with_auth(), direct_media_glare_mitigation_handler(), direct_media_method_handler(), domain_alias_apply(), endpt_send_request(), eprofile_apply(), expire_objects_from_cache(), file_extension_from_url_path(), find_internal_state_by_transport(), find_or_create_temporary_state(), find_registrar_aor(), format_ami_aor_handler(), format_ami_auth_handler(), format_ami_endpoint_identify(), format_ami_endpoint_transport(), from_user_handler(), geoloc_config_list_locations(), geoloc_config_list_profiles(), geoloc_location_apply_handler(), geoloc_profile_apply_handler(), get_account_id(), get_curl_instance(), get_resource_display_name(), handle_export_primitives(), handle_incoming_request(), handle_outgoing_request(), handle_slash(), has_mwi_subscription(), header_identify_match_check(), ident_handler(), internal_state_alloc(), ip_identify_apply(), ip_identify_match_check(), ip_identify_match_handler(), line_identify(), load_engine(), load_module(), log_caps(), mark_object_as_stale_in_cache(), matches_engine(), media_cache_handle_show_item(), media_cache_item_del_from_astdb(), media_cache_item_sync_to_astdb(), media_cache_prnt_summary(), memory_cache_stale_update_object(), msg_send(), mwi_contact_changed(), mwi_observe_delete(), mwi_post_event(), mwi_subscription_alloc(), mwi_validate_for_aor(), new_subscribe(), permanent_uri_handler(), permanent_uri_sort_fn(), persistent_endpoint_find_or_create(), pjsip_aor_function_read(), profile_apply(), publish_request_initial(), publisher_start(), publisher_stop(), pubsub_on_rx_mwi_notify_request(), pubsub_on_rx_publish_request(), pubsub_on_rx_refresh(), pubsub_on_rx_subscribe_request(), qualify_contact_cb(), read_pjsip(), redirect_handler(), refer_client_on_evsub_state(), refer_incoming_attended_request(), refer_incoming_blind_request(), refer_incoming_invite_request(), refer_incoming_refer_request(), refer_progress_alloc(), refer_send(), registrar_contact_delete(), registrar_on_rx_request(), registration_deleted_observer(), registration_state_cmp(), registration_state_hash(), remove_from_cache(), remove_subscription(), request_identify_match_check(), resource_list_apply_handler(), rfc3326_add_reason_header(), rx_data_to_ast_msg(), session_destructor(), session_inv_on_redirected(), session_inv_on_tsx_state_changed(), session_outgoing_nat_hook(), set_outbound_authentication_credentials(), sip_aor_to_ami(), sip_endpoint_apply_handler(), sip_options_aor_alloc(), sip_options_aor_observer_deleted_task(), sip_options_aor_observer_modified_task(), sip_options_apply_aor_configuration(), sip_options_contact_status_notify_task(), sip_options_endpoint_observer_deleted_task(), sip_options_endpoint_observer_modified_task(), sip_options_endpoint_state_compositor_find_or_alloc(), sip_options_endpoint_unlink_aor_feeders(), sip_options_qualify_contact(), sip_options_remove_contact_status(), sip_options_synchronize_aor(), sip_options_synchronize_endpoint(), sip_outbound_publish_apply(), sip_outbound_publish_callback(), sip_outbound_publish_state_alloc(), sip_outbound_publish_synchronize(), sip_outbound_publisher_alloc(), sip_outbound_publisher_init(), sip_outbound_publisher_set_uris(), sip_outbound_registration_apply(), sip_outbound_registration_regc_alloc(), sip_outbound_registration_state_alloc(), sip_sorcery_object_ami_set_type_name(), sip_subscription_send_request(), sip_subscription_to_ami(), sorcery_astdb_create(), sorcery_astdb_delete(), sorcery_astdb_update(), sorcery_config_fields_cmp(), sorcery_memory_cache_complete_object_name(), sorcery_memory_cache_create(), sorcery_memory_cache_delete(), sorcery_memory_cache_fields_cmp(), sorcery_memory_cache_print_object(), sorcery_memory_cache_retrieve_id(), sorcery_memory_cached_object_cmp(), sorcery_memory_cached_object_hash(), sorcery_memory_cmp(), sorcery_memory_create(), sorcery_memory_delete(), sorcery_memory_fields_cmp(), sorcery_memory_hash(), sorcery_memory_update(), sorcery_realtime_create(), sorcery_realtime_delete(), sorcery_realtime_update(), stale_item_update(), stir_shaken_handler(), subscription_established(), subscription_persistence_create(), subscription_persistence_remove(), subscription_tree_destructor(), t38_initialize_session(), tn_apply(), tn_get_etn(), tos_handler(), transport_apply(), transport_tls_file_handler(), transport_tos_handler(), unload_engine(), update_devstate(), users_apply_handler(), validate_publish_config(), and verification_apply().
const char * ast_sorcery_object_get_type | ( | const void * | object | ) |
Get the type of a sorcery object.
object | Pointer to a sorcery object |
Definition at line 2329 of file sorcery.c.
References ast_sorcery_object_details::object, and ast_sorcery_object::type.
Referenced by aeap_cli_show(), ast_sorcery_diff(), AST_TEST_DEFINE(), config_object_cli_show(), memory_cache_stale_check_object(), memory_cache_stale_update_object(), sip_aor_to_ami(), sip_sorcery_object_ami_set_type_name(), sorcery_astdb_create(), sorcery_astdb_delete(), sorcery_astdb_update(), and stale_item_update().
unsigned int ast_sorcery_object_has_dynamic_contents | ( | const void * | object | ) |
Get whether an object contains dynamic contents or not.
object | Pointer to a sorcery object |
Definition at line 2377 of file sorcery.c.
References ast_sorcery_object::has_dynamic_contents, and ast_sorcery_object_details::object.
Referenced by sorcery_config_internal_load().
int ast_sorcery_object_id_compare | ( | void * | obj, |
void * | arg, | ||
int | flags | ||
) |
ao2 object comparator based on sorcery id.
Definition at line 2464 of file sorcery.c.
References ast_sorcery_object_id_sort(), and CMP_MATCH.
Referenced by ast_media_cache_init(), cli_aor_get_container(), cli_endpoint_get_container(), cli_get_container(), handle_registrations(), sip_options_aor_alloc(), and sorcery_config_internal_load().
int ast_sorcery_object_id_hash | ( | const void * | obj, |
int | flags | ||
) |
ao2 object hasher based on sorcery id.
Definition at line 2475 of file sorcery.c.
References ast_assert, ast_sorcery_object_get_id(), ast_str_hash(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, and OBJ_SEARCH_OBJECT.
Referenced by ast_media_cache_init(), sip_options_aor_alloc(), and sorcery_config_internal_load().
int ast_sorcery_object_id_sort | ( | const void * | obj, |
const void * | arg, | ||
int | flags | ||
) |
ao2 object sorter based on sorcery id.
Definition at line 2440 of file sorcery.c.
References ast_sorcery_object_get_id(), OBJ_SEARCH_KEY, OBJ_SEARCH_MASK, OBJ_SEARCH_OBJECT, and OBJ_SEARCH_PARTIAL_KEY.
Referenced by ast_sorcery_object_id_compare(), cli_aor_get_container(), cli_endpoint_get_container(), cli_get_container(), geoloc_config_list_locations(), geoloc_config_list_profiles(), geoloc_config_show_profiles(), and sip_options_aor_alloc().
int ast_sorcery_object_set_congestion_levels | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
long | low_water, | ||
long | high_water | ||
) |
Set the high and low alert water marks of the sorcery object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
low_water | New queue low water mark. (-1 to set as 90% of high_water) |
high_water | New queue high water mark. |
0 | on success. |
-1 | on error (water marks not changed). |
Definition at line 1114 of file sorcery.c.
References ao2_find, ao2_ref, ast_taskprocessor_alert_set_levels(), OBJ_SEARCH_KEY, ast_sorcery_object_type::serializer, sorcery, type, and ast_sorcery::types.
Referenced by ast_sip_initialize_sorcery_location().
void ast_sorcery_object_set_copy_handler | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
sorcery_copy_handler | copy | ||
) |
Set the copy handler for an object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
copy | Copy handler |
Definition at line 1128 of file sorcery.c.
References ao2_cleanup, ao2_find, copy(), OBJ_KEY, RAII_VAR, sorcery, type, and ast_sorcery::types.
Referenced by ast_bucket_init(), and AST_TEST_DEFINE().
void ast_sorcery_object_set_diff_handler | ( | struct ast_sorcery * | sorcery, |
const char * | type, | ||
sorcery_diff_handler | diff | ||
) |
Set the diff handler for an object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
diff | Diff handler |
Definition at line 1139 of file sorcery.c.
References ao2_cleanup, ao2_find, ast_sorcery_object_type::diff, OBJ_KEY, RAII_VAR, sorcery, type, and ast_sorcery::types.
Referenced by AST_TEST_DEFINE().
int ast_sorcery_object_set_extended | ( | const void * | object, |
const char * | name, | ||
const char * | value | ||
) |
Set an extended field value on a sorcery object.
object | Pointer to a sorcery object |
name | Name of the extended field |
value | Value of the extended field |
0 | success |
-1 | failure |
Definition at line 2349 of file sorcery.c.
References ast_variable_new, ast_variables_destroy(), ast_sorcery_object::extended, name, ast_variable::next, NULL, ast_sorcery_object_details::object, RAII_VAR, and value.
Referenced by AST_TEST_DEFINE(), and sorcery_extended_config_handler().
void ast_sorcery_object_set_has_dynamic_contents | ( | const void * | object | ) |
Set the dynamic contents flag on a sorcery object.
object | Pointer to a sorcery object |
Definition at line 2384 of file sorcery.c.
References ast_sorcery_object::has_dynamic_contents, and ast_sorcery_object_details::object.
Referenced by ip_identify_apply(), and transport_tls_file_handler().
int ast_sorcery_object_unregister | ( | struct ast_sorcery * | sorcery, |
const char * | type | ||
) |
Unregister an object type.
sorcery | Pointer to a sorcery structure |
type | Type of object |
0 | success |
-1 | failure |
Definition at line 1061 of file sorcery.c.
References ACO_ITEM, ao2_cleanup, ao2_find, ao2_unlink_flags, ao2_unlock, ao2_wrlock, OBJ_NOLOCK, OBJ_SEARCH_KEY, sorcery, type, aco_type::type, ast_sorcery_object_type::type, and ast_sorcery::types.
Referenced by geoloc_config_unload(), and unload_module().
int ast_sorcery_objectset_apply | ( | const struct ast_sorcery * | sorcery, |
void * | object, | ||
struct ast_variable * | objectset | ||
) |
Apply an object set (KVP list) to an object.
sorcery | Pointer to a sorcery structure |
object | Pointer to a sorcery object |
objectset | Object set itself |
0 | success |
-1 | failure |
Definition at line 1632 of file sorcery.c.
References aco_process_var(), ao2_cleanup, ao2_find, ast_variables_destroy(), ast_sorcery_object::id, ast_variable::next, NULL, OBJ_KEY, ast_sorcery_object_details::object, RAII_VAR, sorcery, ast_sorcery_object::type, and ast_sorcery::types.
Referenced by ast_ari_asterisk_update_object(), ast_sorcery_copy(), AST_TEST_DEFINE(), create_effective_profile(), create_object(), sorcery_astdb_retrieve_fields_common(), sorcery_astdb_retrieve_id(), sorcery_astdb_retrieve_prefix(), sorcery_astdb_retrieve_regex(), sorcery_config_internal_load(), sorcery_realtime_retrieve_fields(), and sorcery_realtime_retrieve_multiple().
struct ast_variable * ast_sorcery_objectset_create2 | ( | const struct ast_sorcery * | sorcery, |
const void * | object, | ||
enum ast_sorcery_field_handler_flags | flags | ||
) |
Create an object set (KVP list) for an object.
sorcery | Pointer to a sorcery structure |
object | Pointer to a sorcery object |
flags | Flags indicating which handler to use and in what order. |
non-NULL | success |
NULL | if error occurred |
Definition at line 1511 of file sorcery.c.
References ao2_cleanup, ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, AST_HANDLER_ONLY_LIST, AST_HANDLER_ONLY_STRING, AST_HANDLER_PREFER_LIST, AST_HANDLER_PREFER_STRING, ast_variable_list_append_hint(), get_multiple_fields_as_var_list(), get_single_field_as_var_list(), NULL, OBJ_KEY, ast_sorcery_object_details::object, RAII_VAR, sorcery, tmp(), ast_sorcery_object::type, and ast_sorcery::types.
Referenced by ast_sip_sorcery_object_to_ami(), config_object_cli_show(), and sip_aor_to_ami().
struct ast_json * ast_sorcery_objectset_json_create | ( | const struct ast_sorcery * | sorcery, |
const void * | object | ||
) |
Create an object set in JSON format for an object.
sorcery | Pointer to a sorcery structure |
object | Pointer to a sorcery object |
non-NULL | success |
NULL | if error occurred |
Definition at line 1565 of file sorcery.c.
References ao2_cleanup, ao2_find, ao2_iterator_destroy(), ao2_iterator_init(), ao2_iterator_next, ao2_ref, ast_sorcery_object_field::args, ast_debug, ast_free, ast_json_object_create(), ast_json_object_set(), ast_json_string_create(), ast_json_unref(), ast_variables_destroy(), buf, ast_sorcery_object_field::handler, ast_sorcery_object_field::multiple_handler, ast_variable::name, ast_sorcery_object_field::name, ast_variable::next, NULL, OBJ_KEY, ast_sorcery_object_details::object, RAII_VAR, sorcery, tmp(), ast_sorcery_object::type, ast_sorcery::types, ast_variable::value, and value.
Referenced by ast_bucket_file_json(), ast_bucket_json(), AST_TEST_DEFINE(), and sorcery_astdb_create().
int ast_sorcery_observer_add | ( | const struct ast_sorcery * | sorcery, |
const char * | type, | ||
const struct ast_sorcery_observer * | callbacks | ||
) |
Add an observer to a specific object type.
sorcery | Pointer to a sorcery structure |
type | Type of object that should be observed |
callbacks | Implementation of the observer interface |
0 | success |
-1 | failure |
Definition at line 2391 of file sorcery.c.
References ao2_alloc, ao2_cleanup, ao2_find, ao2_link, ao2_ref, callbacks, NULL, OBJ_KEY, observer, RAII_VAR, sorcery, type, and ast_sorcery::types.
Referenced by ast_bucket_file_observer_add(), ast_bucket_observer_add(), ast_res_pjsip_initialize_configuration(), ast_sip_initialize_distributor(), ast_sip_initialize_sorcery_location(), ast_sip_initialize_transport_management(), AST_TEST_DEFINE(), load_module(), pjsip_outbound_registration_metrics_init(), and sip_options_init_task().
void ast_sorcery_observer_remove | ( | const struct ast_sorcery * | sorcery, |
const char * | type, | ||
const struct ast_sorcery_observer * | callbacks | ||
) |
Remove an observer from a specific object type.
sorcery | Pointer to a sorcery structure |
type | Type of object that should no longer be observed |
callbacks | Implementation of the observer interface |
Definition at line 2423 of file sorcery.c.
References ao2_callback, ao2_cleanup, ao2_find, callbacks, NULL, OBJ_KEY, OBJ_NODATA, OBJ_UNLINK, RAII_VAR, sorcery, sorcery_observer_remove(), type, and ast_sorcery::types.
Referenced by ast_bucket_file_observer_remove(), ast_bucket_observer_remove(), ast_res_pjsip_cleanup_options_handling(), ast_sip_destroy_distributor(), ast_sip_destroy_sorcery_location(), ast_sip_destroy_transport_management(), load_module(), pjsip_outbound_registration_metrics_init(), pjsip_outbound_registration_metrics_unload_cb(), and unload_module().
void ast_sorcery_ref | ( | struct ast_sorcery * | sorcery | ) |
void ast_sorcery_reload | ( | const struct ast_sorcery * | sorcery | ) |
Inform any wizards to reload persistent objects.
sorcery | Pointer to a sorcery structure |
Definition at line 1408 of file sorcery.c.
References ao2_callback, ast_sorcery::module_name, NOTIFY_INSTANCE_OBSERVERS, OBJ_NODATA, ast_sorcery::observers, sorcery_load_details::sorcery, sorcery, sorcery_object_load(), and ast_sorcery::types.
Referenced by ast_res_pjsip_reload_configuration(), AST_TEST_DEFINE(), geoloc_config_reload(), load_module(), and reload_module().
void ast_sorcery_reload_object | ( | const struct ast_sorcery * | sorcery, |
const char * | type | ||
) |
Inform any wizards of a specific object type to reload persistent objects.
sorcery | Pointer to a sorcery structure |
type | Name of the object type to reload |
Definition at line 1442 of file sorcery.c.
References ao2_cleanup, ao2_find, OBJ_KEY, RAII_VAR, sorcery_load_details::sorcery, sorcery, sorcery_object_load(), type, and ast_sorcery::types.
Referenced by apply_list_configuration(), ast_sip_initialize_distributor(), ast_sip_initialize_transport_management(), AST_TEST_DEFINE(), load_module(), load_users(), and reload_module().
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.
sorcery | Pointer to a sorcery structure |
type | Type of object to retrieve |
flags | Flags to control behavior |
fields | Optional object fields and values to match against |
non-NULL | if found |
NULL | if not found |
Example:
The following code can be significantly faster when a realtime backend is in use because the expression "qualify_frequency > 0" is passed to the database to limit the number of rows returned.
struct ast_variable *var = ast_variable_new("qualify_frequency >", "0", ""); struct ao2_container *aors;
if (!var) { return; }
aors = ast_sorcery_retrieve_by_fields(ast_sip_get_sorcery(), "aor", AST_RETRIEVE_FLAG_MULTIPLE, var);
Definition at line 1897 of file sorcery.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, ao2_container_alloc_list, ao2_container_count(), ao2_find, AST_RETRIEVE_FLAG_MULTIPLE, AST_VECTOR_CALLBACK, AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, NULL, OBJ_KEY, RAII_VAR, ast_sorcery_wizard::retrieve_fields, ast_sorcery_wizard::retrieve_multiple, sorcery_details::sorcery, sorcery, sorcery_cache_create(), type, ast_sorcery::types, and ast_sorcery_object_wizard::wizard.
Referenced by acl_on_rx_msg(), ami_show_registration_contact_statuses(), ami_show_resource_lists(), ast_aeap_client_configs_get(), ast_mwi_mailbox_get_all(), ast_sip_get_endpoints(), ast_sip_initialize_sorcery_transport(), ast_sip_initialize_system(), ast_sip_location_prune_boot_contacts(), AST_TEST_DEFINE(), asterisk_publication_send_refresh(), auth_observer(), check_expiration_thread(), cli_complete_registration(), cli_contact_get_container(), cli_get_aors(), cli_get_auths(), cli_iterator(), common_identify(), create_mwi_subscriptions(), eprofile_get_all(), format_ami_endpoint_identify(), geoloc_config_list_locations(), geoloc_config_list_profiles(), geoloc_config_show_profiles(), get_all_contacts(), get_publishes_and_update_state(), get_registrations(), get_system_cfg(), get_tn_all(), global_loaded_observer(), handle_export_primitives(), load_all_endpoints(), load_users(), memory_cache_populate(), process_nat(), profile_get_all(), sip_options_aor_observer_modified_task(), sip_options_synchronize_task(), stale_cache_update(), and subscription_persistence_load().
void * ast_sorcery_retrieve_by_id | ( | const struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | id | ||
) |
Retrieve an object using its unique identifier.
sorcery | Pointer to a sorcery structure |
type | Type of object to retrieve |
id | Unique object identifier |
non-NULL | if found |
NULL | if not found |
Definition at line 1853 of file sorcery.c.
References ao2_find, ao2_ref, ast_strlen_zero(), AST_VECTOR_CALLBACK, AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, ast_sorcery_object_type::name, NULL, OBJ_SEARCH_KEY, ast_sorcery_wizard::retrieve_id, sorcery_details::sorcery, sorcery, sorcery_cache_create(), type, ast_sorcery::types, ast_sorcery_object_wizard::wizard, and ast_sorcery_object_type::wizards.
Referenced by add_security_headers(), ami_show_endpoint(), ami_sip_qualify(), anonymous_identify(), as_get_cfg(), as_is_config_loaded(), ast_ari_asterisk_delete_object(), ast_ari_asterisk_get_object(), ast_ari_asterisk_update_object(), ast_bucket_file_retrieve(), ast_bucket_retrieve(), ast_geoloc_datastore_create_from_profile_name(), ast_geoloc_eprofile_refresh_location(), ast_geoloc_get_location(), ast_geoloc_get_profile(), ast_mwi_mailbox_get(), ast_mwi_mailbox_update(), ast_sip_default_outbound_endpoint(), ast_sip_for_each_auth(), ast_sip_location_retrieve_aor(), ast_sip_location_retrieve_contact(), ast_sip_retrieve_auths(), ast_sip_retrieve_auths_vector(), ast_sip_rewrite_uri_to_local(), ast_sip_set_tpselector_from_transport_name(), AST_TEST_DEFINE(), asterisk_publication_devicestate_state_change(), asterisk_publication_mwi_state_change(), asterisk_publication_new(), chan_pjsip_devicestate(), check_state(), cli_aor_retrieve_by_id(), cli_endpoint_retrieve_by_id(), cli_iterate(), cli_qualify(), cli_reload_qualify_aor(), cli_reload_qualify_endpoint(), cli_retrieve_by_id(), cli_show_qualify_endpoint(), client_config_get(), common_identify(), contact_observer_updated(), create_effective_profile(), create_rtp(), eprofile_get_cfg(), find_aor2(), find_aor_name(), find_endpoint(), format_ami_endpoint_transport(), geoloc_profile_apply_handler(), get_log_mappings(), get_write_timeout(), handle_atsign(), handle_registration_response(), handle_single_token(), handle_slash(), line_identify(), load_endpoint(), mwi_contact_changed(), mwi_contact_deleted(), mwi_subscription_shutdown(), on_rx_process_symmetric_transport(), pjsip_acf_dial_contacts_read(), pjsip_aor_function_read(), pjsip_contact_function_read(), pjsip_endpoint_function_read(), process_nat(), profile_get_cfg(), publish_request_initial(), push_notify(), request(), retrieve_resource_list(), send_unsolicited_mwi_notify(), sip_options_contact_add_management_task(), sip_options_qualify_contact(), sorcery_function_read(), sorcery_memory_cache_thrash_retrieve(), stale_item_update(), sub_persistence_recreate(), t38_initialize_session(), tn_get_cfg(), tn_get_etn(), transfer(), vs_get_cfg(), and vs_is_config_loaded().
struct ast_sorcery * ast_sorcery_retrieve_by_module_name | ( | const char * | module_name | ) |
Retrieves an existing sorcery instance by module name.
module_name | The module name |
non-NULL | success |
NULL | if no instance was found |
Retrieves an existing sorcery instance by module name.
Definition at line 672 of file sorcery.c.
References ao2_weakproxy_find, instances, ast_sorcery::module_name, and OBJ_SEARCH_KEY.
Referenced by ast_ari_asterisk_delete_object(), ast_ari_asterisk_get_object(), ast_ari_asterisk_update_object(), AST_TEST_DEFINE(), and sorcery_function_read().
struct ao2_container * ast_sorcery_retrieve_by_prefix | ( | const struct ast_sorcery * | sorcery, |
const char * | type, | ||
const char * | prefix, | ||
const size_t | prefix_len | ||
) |
Retrieve multiple objects whose id begins with the specified prefix.
sorcery | Pointer to a sorcery structure |
type | Type of object to retrieve |
prefix | Object id prefix |
prefix_len | The length of prefix in bytes |
non-NULL | if error occurs |
NULL | success |
Definition at line 1989 of file sorcery.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, ao2_container_alloc_list, ao2_container_count(), ao2_find, AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, NULL, OBJ_KEY, prefix, RAII_VAR, ast_sorcery_wizard::retrieve_prefix, sorcery, type, ast_sorcery::types, and ast_sorcery_object_wizard::wizard.
Referenced by aor_deleted_observer(), ast_sip_location_retrieve_aor_contacts_nolock_filtered(), cli_complete_endpoint(), and sip_options_apply_aor_configuration().
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.
sorcery | Pointer to a sorcery structure |
type | Type of object to retrieve |
regex | Regular expression |
non-NULL | if error occurs |
NULL | success |
Definition at line 1954 of file sorcery.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_cleanup, ao2_container_alloc_list, ao2_container_count(), ao2_find, AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_internal_wizard::callbacks, NULL, OBJ_KEY, RAII_VAR, regex(), ast_sorcery_wizard::retrieve_regex, sorcery, type, ast_sorcery::types, and ast_sorcery_object_wizard::wizard.
Referenced by ast_mwi_mailbox_get_by_regex(), AST_TEST_DEFINE(), cli_aor_get_container(), cli_contact_get_container(), cli_endpoint_get_container(), cli_get_container(), geoloc_config_list_locations(), geoloc_config_list_profiles(), and geoloc_config_show_profiles().
int ast_sorcery_update | ( | const struct ast_sorcery * | sorcery, |
void * | object | ||
) |
Update an object.
sorcery | Pointer to a sorcery structure |
object | Pointer to a sorcery object |
0 | success |
-1 | failure |
Definition at line 2150 of file sorcery.c.
References ao2_cleanup, ao2_container_count(), ao2_find, ast_taskprocessor_push(), AST_VECTOR_GET, AST_VECTOR_RW_RDLOCK, AST_VECTOR_RW_UNLOCK, AST_VECTOR_SIZE, ast_sorcery_object_wizard::caching, CMP_MATCH, NULL, OBJ_KEY, ast_sorcery_object_details::object, sorcery_observer_invocation::object_type, RAII_VAR, ast_sorcery_object_type::serializer, sorcery_details::sorcery, sorcery, sorcery_observer_invocation_alloc(), sorcery_observers_notify_update(), sorcery_wizard_update(), ast_sorcery_object::type, ast_sorcery::types, and ast_sorcery_object_type::wizards.
Referenced by ast_ari_asterisk_update_object(), ast_bucket_file_update(), ast_mwi_mailbox_update(), ast_sip_location_update_contact(), AST_TEST_DEFINE(), create_effective_profile(), sorcery_memory_cache_thrash_update(), and subscription_persistence_update().
int ast_sorcery_wizard_observer_add | ( | struct ast_sorcery_wizard * | wizard, |
const struct ast_sorcery_wizard_observer * | callbacks | ||
) |
Add an observer to a sorcery wizard.
wizard | Pointer to a previously registered wizard structure |
callbacks | Implementation of the wizard observer interface |
A wizard observer is notified... Before a wizard is loaded or reloaded. After a wizard is loaded or reloaded.
0 | success |
-1 | failure |
Definition at line 543 of file sorcery.c.
References ao2_alloc, ao2_cleanup, ao2_find, ao2_link, ao2_ref, sorcery_wizard_observer::callbacks, callbacks, ast_sorcery_wizard::name, NULL, OBJ_SEARCH_KEY, RAII_VAR, and wizards.
Referenced by AST_TEST_DEFINE().
void ast_sorcery_wizard_observer_remove | ( | struct ast_sorcery_wizard * | interface, |
const struct ast_sorcery_wizard_observer * | callbacks | ||
) |
Remove an observer from a sorcery wizard.
interface | Pointer to a sorcery structure |
callbacks | Implementation of the wizard observer interface |
Definition at line 568 of file sorcery.c.
References ao2_callback, ao2_cleanup, ao2_find, callbacks, ast_sorcery_wizard::name, NULL, OBJ_NODATA, OBJ_SEARCH_KEY, OBJ_UNLINK, RAII_VAR, sorcery_generic_observer_remove(), and wizards.
Referenced by AST_TEST_DEFINE().
int ast_sorcery_wizard_unregister | ( | const struct ast_sorcery_wizard * | interface | ) |
Unregister a sorcery wizard.
interface | Pointer to the wizard interface |
0 | success |
-1 | failure |
Definition at line 474 of file sorcery.c.
References ao2_find, ao2_ref, ao2_unlink, ast_verb, ast_sorcery_internal_wizard::callbacks, if(), name, ast_sorcery_wizard::name, NOTIFY_GLOBAL_OBSERVERS, NULL, OBJ_SEARCH_KEY, observers, and wizards.
Referenced by AST_TEST_DEFINE(), bucket_cleanup(), sorcery_memory_cache_thrash_destroy(), and unload_module().