Asterisk - The Open Source Telephony Project
21.4.1
|
#include "asterisk/compat.h"
#include "asterisk/lock.h"
#include "asterisk/linkedlists.h"
#include "asterisk/inline_api.h"
Go to the source code of this file.
Data Structures | |
struct | ao2_global_obj |
struct | ao2_iterator |
When we need to walk through a container, we use an ao2_iterator to keep track of the current position. More... | |
struct | ao2_weakproxy |
This struct should be opaque, but it's size is needed. More... | |
Macros | |
#define | ao2_alloc_with_lockobj(data_size, destructor_fn, lockobj, tag) __ao2_alloc_with_lockobj((data_size), (destructor_fn), (lockobj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize an object with separate locking. More... | |
#define | ao2_callback_data(container, flags, cb_fn, arg, data) __ao2_callback_data((container), (flags), (cb_fn), (arg), (data), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_cleanup(obj) __ao2_cleanup_debug((obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | AO2_FIELD_CMP_FN(stype, fn_suffix, field, key_cmp, partial_key_cmp, transform, argconst) |
#define | AO2_FIELD_HASH_FN(stype, field, hash_fn) |
Creates a hash function for a structure field. More... | |
#define | AO2_FIELD_TRANSFORM_CMP_FN(cmp) ((cmp) ? 0 : CMP_MATCH) |
#define | AO2_FIELD_TRANSFORM_SORT_FN(cmp) (cmp) |
#define | ao2_find(container, arg, flags) __ao2_find((container), (arg), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_global_obj_ref(holder) __ao2_global_obj_ref(&holder, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Get a reference to the object stored in the global holder. More... | |
#define | ao2_global_obj_release(holder) __ao2_global_obj_replace_unref(&holder, NULL, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Release the ao2 object held in the global holder. More... | |
#define | ao2_global_obj_replace(holder, obj) __ao2_global_obj_replace(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Replace an ao2 object in the global holder. More... | |
#define | ao2_global_obj_replace_unref(holder, obj) __ao2_global_obj_replace_unref(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Replace an ao2 object in the global holder, throwing away any old object. More... | |
#define | AO2_GLOBAL_OBJ_STATIC(name) |
Define a global object holder to be used to hold an ao2 object, statically initialized. More... | |
#define | ao2_iterator_next(iter) __ao2_iterator_next((iter), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_lock(a) __ao2_lock(a, AO2_LOCK_REQ_MUTEX, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
#define | ao2_rdlock(a) __ao2_lock(a, AO2_LOCK_REQ_RDLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
#define | AO2_STRING_FIELD_CASE_CMP_FN(stype, field) AO2_FIELD_CMP_FN(stype, _cmp_fn, field, strcasecmp, strncasecmp, AO2_FIELD_TRANSFORM_CMP_FN,) |
#define | AO2_STRING_FIELD_CASE_HASH_FN(stype, field) AO2_FIELD_HASH_FN(stype, field, ast_str_case_hash) |
#define | AO2_STRING_FIELD_CASE_SORT_FN(stype, field) AO2_FIELD_CMP_FN(stype, _sort_fn, field, strcasecmp, strncasecmp, AO2_FIELD_TRANSFORM_SORT_FN, const) |
#define | AO2_STRING_FIELD_CMP_FN(stype, field) AO2_FIELD_CMP_FN(stype, _cmp_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_CMP_FN,) |
Creates a compare function for a structure string field. More... | |
#define | AO2_STRING_FIELD_HASH_FN(stype, field) AO2_FIELD_HASH_FN(stype, field, ast_str_hash) |
Creates a hash function for a structure string field. More... | |
#define | AO2_STRING_FIELD_SORT_FN(stype, field) AO2_FIELD_CMP_FN(stype, _sort_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_SORT_FN, const) |
Creates a sort function for a structure string field. More... | |
#define | ao2_t_callback_data(container, flags, cb_fn, arg, data, tag) __ao2_callback_data((container), (flags), (cb_fn), (arg), (data), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
ao2_callback_data() is a generic function that applies cb_fn() to all objects in a container. It is functionally identical to ao2_callback() except that instead of taking an ao2_callback_fn *, it takes an ao2_callback_data_fn *, and allows the caller to pass in arbitrary data. More... | |
#define | ao2_t_cleanup(obj, tag) __ao2_cleanup_debug((obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_t_find(container, arg, flags, tag) __ao2_find((container), (arg), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_t_global_obj_ref(holder, tag) __ao2_global_obj_ref(&holder, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
#define | ao2_t_global_obj_release(holder, tag) __ao2_global_obj_replace_unref(&holder, NULL, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
#define | ao2_t_global_obj_replace(holder, obj, tag) __ao2_global_obj_replace(&holder, (obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
#define | ao2_t_global_obj_replace_unref(holder, obj, tag) __ao2_global_obj_replace_unref(&holder, (obj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
#define | ao2_t_iterator_next(iter, tag) __ao2_iterator_next((iter), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_trylock(a) __ao2_trylock(a, AO2_LOCK_REQ_MUTEX, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
#define | ao2_tryrdlock(a) __ao2_trylock(a, AO2_LOCK_REQ_RDLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
#define | ao2_trywrlock(a) __ao2_trylock(a, AO2_LOCK_REQ_WRLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
#define | ao2_unlock(a) __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
#define | ao2_weakproxy_find(c, arg, flags, tag) __ao2_weakproxy_find(c, arg, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Perform an ao2_find on a container with ao2_weakproxy objects, returning the real object. More... | |
#define | ao2_wrlock(a) __ao2_lock(a, AO2_LOCK_REQ_WRLOCK, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a) |
#define | OBJ_KEY OBJ_SEARCH_KEY |
#define | OBJ_PARTIAL_KEY OBJ_SEARCH_PARTIAL_KEY |
#define | OBJ_POINTER OBJ_SEARCH_OBJECT |
Typedefs | |
typedef int( | ao2_callback_data_fn) (void *obj, void *arg, void *data, int flags) |
Type of a generic callback function. More... | |
typedef int( | ao2_callback_fn) (void *obj, void *arg, int flags) |
Type of a generic callback function. More... | |
typedef void(* | ao2_destructor_fn) (void *vdoomed) |
Typedef for an object destructor. More... | |
typedef int( | ao2_hash_fn) (const void *obj, int flags) |
typedef int( | ao2_sort_fn) (const void *obj_left, const void *obj_right, int flags) |
Type of generic container sort function. More... | |
Functions | |
void * | __ao2_alloc_with_lockobj (size_t data_size, ao2_destructor_fn destructor_fn, void *lockobj, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
void * | __ao2_callback_data (struct ao2_container *c, enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data, const char *tag, const char *file, int line, const char *func) |
void | __ao2_cleanup (void *obj) |
void | __ao2_cleanup_debug (void *obj, const char *tag, const char *file, int line, const char *function) |
void * | __ao2_find (struct ao2_container *c, const void *arg, enum search_flags flags, const char *tag, const char *file, int line, const char *func) |
void * | __ao2_global_obj_ref (struct ao2_global_obj *holder, const char *tag, const char *file, int line, const char *func, const char *name) attribute_warn_unused_result |
void * | __ao2_global_obj_replace (struct ao2_global_obj *holder, void *obj, const char *tag, const char *file, int line, const char *func, const char *name) attribute_warn_unused_result |
int | __ao2_global_obj_replace_unref (struct ao2_global_obj *holder, void *obj, const char *tag, const char *file, int line, const char *func, const char *name) |
void * | __ao2_iterator_next (struct ao2_iterator *iter, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
int | __ao2_lock (void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var) |
Lock an object. More... | |
int | __ao2_trylock (void *a, enum ao2_lock_req lock_how, const char *file, const char *func, int line, const char *var) |
Try locking– (don't block if fail) More... | |
int | __ao2_unlock (void *a, const char *file, const char *func, int line, const char *var) |
Unlock an object. More... | |
void * | __ao2_weakproxy_find (struct ao2_container *c, const void *arg, enum search_flags flags, const char *tag, const char *file, int line, const char *func) |
void | ao2_iterator_cleanup (struct ao2_iterator *iter) |
int | ao2_iterator_count (struct ao2_iterator *iter) |
Get a count of the iterated container objects. More... | |
void | ao2_iterator_destroy (struct ao2_iterator *iter) |
Destroy a container iterator. More... | |
struct ao2_iterator | ao2_iterator_init (struct ao2_container *c, int flags) attribute_warn_unused_result |
Create an iterator for a container. More... | |
void | ao2_iterator_restart (struct ao2_iterator *iter) |
Restart an iteration. More... | |
int | ao2_match_by_addr (void *obj, void *arg, int flags) |
A common ao2_callback is one that matches by address. More... | |
void * | ao2_object_get_lockaddr (void *obj) |
Return the mutex lock address of an object. More... | |
int | ao2_ref_and_lock (void *obj) |
Increment reference count on an object and lock it. More... | |
int | ao2_unlock_and_unref (void *obj) |
Unlock an object and decrement its reference count. More... | |
#define | ao2_t_alloc_options(data_size, destructor_fn, options, debug_msg) __ao2_alloc((data_size), (destructor_fn), (options), (debug_msg), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize an object. More... | |
#define | ao2_alloc_options(data_size, destructor_fn, options) __ao2_alloc((data_size), (destructor_fn), (options), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_t_alloc(data_size, destructor_fn, debug_msg) __ao2_alloc((data_size), (destructor_fn), AO2_ALLOC_OPT_LOCK_MUTEX, (debug_msg), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_alloc(data_size, destructor_fn) __ao2_alloc((data_size), (destructor_fn), AO2_ALLOC_OPT_LOCK_MUTEX, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
void * | __ao2_alloc (size_t data_size, ao2_destructor_fn destructor_fn, unsigned int options, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
#define | ao2_ref(o, delta) __ao2_ref((o), (delta), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Reference/unreference an object and return the old refcount. More... | |
#define | ao2_t_ref(o, delta, tag) __ao2_ref((o), (delta), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_bump(obj) ao2_t_bump((obj), NULL) |
Bump refcount on an AO2 object by one, returning the object. More... | |
#define | ao2_t_bump(obj, tag) |
#define | ao2_replace(dst, src) ao2_t_replace((dst), (src), NULL) |
Replace one object reference with another cleaning up the original. More... | |
#define | ao2_t_replace(dst, src, tag) |
unsigned int | ao2_options_get (void *obj) |
Retrieve the ao2 options used to create the object. More... | |
int | __ao2_ref (void *o, int delta, const char *tag, const char *file, int line, const char *func) |
#define | AO2_WEAKPROXY() struct ao2_weakproxy __weakproxy##__LINE__ |
Macro which must be used at the beginning of weakproxy capable objects. More... | |
#define | ao2_weakproxy_alloc(data_size, destructor_fn) __ao2_weakproxy_alloc(data_size, destructor_fn, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate an ao2_weakproxy object. More... | |
#define | ao2_t_weakproxy_alloc(data_size, destructor_fn, tag) __ao2_weakproxy_alloc(data_size, destructor_fn, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_weakproxy_set_object(weakproxy, obj, flags) __ao2_weakproxy_set_object(weakproxy, obj, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Associate weakproxy with obj. More... | |
#define | ao2_t_weakproxy_set_object(weakproxy, obj, flags, tag) __ao2_weakproxy_set_object(weakproxy, obj, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_weakproxy_ref_object(weakproxy, delta, flags) ao2_t_weakproxy_ref_object(weakproxy, delta, flags, NULL) |
Run ao2_t_ref on the object associated with weakproxy. More... | |
#define | ao2_t_weakproxy_ref_object(weakproxy, delta, flags, tag) |
#define | ao2_weakproxy_get_object(weakproxy, flags) __ao2_weakproxy_get_object(weakproxy, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Get the object associated with weakproxy. More... | |
#define | ao2_t_weakproxy_get_object(weakproxy, flags, tag) __ao2_weakproxy_get_object(weakproxy, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_get_weakproxy(obj) __ao2_get_weakproxy(obj, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Get the weakproxy attached to obj. More... | |
#define | ao2_t_get_weakproxy(obj, tag) __ao2_get_weakproxy(obj, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
typedef void(* | ao2_weakproxy_notification_cb) (void *weakproxy, void *data) |
void * | __ao2_weakproxy_alloc (size_t data_size, ao2_destructor_fn destructor_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
int | __ao2_weakproxy_set_object (void *weakproxy, void *obj, int flags, const char *tag, const char *file, int line, const char *func) |
int | __ao2_weakproxy_ref_object (void *weakproxy, int delta, int flags, const char *tag, const char *file, int line, const char *func) |
void * | __ao2_weakproxy_get_object (void *weakproxy, int flags, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
int | ao2_weakproxy_subscribe (void *weakproxy, ao2_weakproxy_notification_cb cb, void *data, int flags) |
Request notification when weakproxy points to NULL. More... | |
int | ao2_weakproxy_unsubscribe (void *weakproxy, ao2_weakproxy_notification_cb cb, void *data, int flags) |
Remove notification of real object destruction. More... | |
void * | __ao2_get_weakproxy (void *obj, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
Object Containers | |
#define | ao2_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn) __ao2_container_alloc_hash((ao2_options), (container_options), (n_buckets), (hash_fn), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize a hash container with the desired number of buckets. More... | |
#define | ao2_t_container_alloc_hash(ao2_options, container_options, n_buckets, hash_fn, sort_fn, cmp_fn, tag) __ao2_container_alloc_hash((ao2_options), (container_options), (n_buckets), (hash_fn), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn) __ao2_container_alloc_list((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize a list container. More... | |
#define | ao2_t_container_alloc_list(ao2_options, container_options, sort_fn, cmp_fn, tag) __ao2_container_alloc_list((ao2_options), (container_options), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_container_alloc_rbtree(ao2_options, container_options, sort_fn, cmp_fn) __ao2_container_alloc_rbtree((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize a red-black tree container. More... | |
#define | ao2_t_container_alloc_rbtree(ao2_options, container_options, sort_fn, cmp_fn, tag) __ao2_container_alloc_rbtree((ao2_options), (container_options), (sort_fn), (cmp_fn), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_container_clone(orig, flags) __ao2_container_clone(orig, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Create a clone/copy of the given container. More... | |
#define | ao2_t_container_clone(orig, flags, tag) __ao2_container_clone(orig, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
typedef void( | ao2_prnt_fn) (void *where, const char *fmt,...) |
Print output. More... | |
typedef void( | ao2_prnt_obj_fn) (void *v_obj, void *where, ao2_prnt_fn *prnt) |
Print object key. More... | |
struct ao2_container * | __ao2_container_alloc_hash (unsigned int ao2_options, unsigned int container_options, unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
struct ao2_container * | __ao2_container_alloc_list (unsigned int ao2_options, unsigned int container_options, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
struct ao2_container * | __ao2_container_alloc_rbtree (unsigned int ao2_options, unsigned int container_options, ao2_sort_fn *sort_fn, ao2_callback_fn *cmp_fn, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
int | ao2_container_count (struct ao2_container *c) |
Returns the number of elements in a container. More... | |
int | ao2_container_dup (struct ao2_container *dest, struct ao2_container *src, enum search_flags flags) |
Copy all object references in the src container into the dest container. More... | |
int | ao2_container_dup_weakproxy_objs (struct ao2_container *dest, struct ao2_container *src, enum search_flags flags) |
Copy object references associated with src container weakproxies into the dest container. More... | |
struct ao2_container * | __ao2_container_clone (struct ao2_container *orig, enum search_flags flags, const char *tag, const char *file, int line, const char *func) attribute_warn_unused_result |
void | ao2_container_dump (struct ao2_container *self, enum search_flags flags, const char *name, void *where, ao2_prnt_fn *prnt, ao2_prnt_obj_fn *prnt_obj) |
Display contents of the specified container. More... | |
void | ao2_container_stats (struct ao2_container *self, enum search_flags flags, const char *name, void *where, ao2_prnt_fn *prnt) |
Display statistics of the specified container. More... | |
int | ao2_container_check (struct ao2_container *self, enum search_flags flags) |
Perform an integrity check on the specified container. More... | |
int | ao2_container_register (const char *name, struct ao2_container *self, ao2_prnt_obj_fn *prnt_obj) |
Register a container for CLI stats and integrity check. More... | |
void | ao2_container_unregister (const char *name) |
Unregister a container for CLI stats and integrity check. More... | |
Object Management | |
Here we have functions to manage objects. We can use the functions below on any kind of object defined by the user. | |
#define | ao2_link(container, obj) __ao2_link((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Add an object to a container. More... | |
#define | ao2_t_link(container, obj, tag) __ao2_link((container), (obj), 0, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_link_flags(container, obj, flags) __ao2_link((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Add an object to a container. More... | |
#define | ao2_t_link_flags(container, obj, flags, tag) __ao2_link((container), (obj), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_unlink(container, obj) __ao2_unlink((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Remove an object from a container. More... | |
#define | ao2_t_unlink(container, obj, tag) __ao2_unlink((container), (obj), 0, (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define | ao2_unlink_flags(container, obj, flags) __ao2_unlink((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Remove an object from a container. More... | |
#define | ao2_t_unlink_flags(container, obj, flags, tag) __ao2_unlink((container), (obj), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
int | __ao2_link (struct ao2_container *c, void *obj_new, int flags, const char *tag, const char *file, int line, const char *func) |
void * | __ao2_unlink (struct ao2_container *c, void *obj, int flags, const char *tag, const char *file, int line, const char *func) |
#define | ao2_callback(c, flags, cb_fn, arg) __ao2_callback((c), (flags), (cb_fn), (arg), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below. More... | |
#define | ao2_t_callback(c, flags, cb_fn, arg, tag) __ao2_callback((c), (flags), (cb_fn), (arg), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
void * | __ao2_callback (struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg, const char *tag, const char *file, int line, const char *func) |
Object Model implementing objects and containers.
Definition in file astobj2.h.
#define ao2_alloc_with_lockobj | ( | data_size, | |
destructor_fn, | |||
lockobj, | |||
tag | |||
) | __ao2_alloc_with_lockobj((data_size), (destructor_fn), (lockobj), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize an object with separate locking.
data_size | The sizeof() of the user-defined structure. |
destructor_fn | The destructor function (can be NULL) |
lockobj | A separate ao2 object that will provide locking. |
tag | An ao2 object debug tracing message. |
Definition at line 431 of file astobj2.h.
Referenced by ast_sorcery_lockable_alloc().
#define ao2_bump | ( | obj | ) | ao2_t_bump((obj), NULL) |
Bump refcount on an AO2 object by one, returning the object.
NULL
safe, for even more convenience.obj | AO2 object to bump the refcount on. |
Definition at line 480 of file astobj2.h.
Referenced by __ast_frisolate(), __ast_sorcery_object_type_insert_wizard(), app_create(), app_send(), ast_aeap_send_msg_tsx(), ast_ari_bridges_set_video_source(), ast_ari_channels_create(), ast_bridge_blob_create_from_snapshots(), ast_bridge_channel_get_chan(), ast_bridge_get_snapshot(), ast_bridge_get_snapshot_by_uniqueid(), ast_bridges(), ast_cdr_get_config(), ast_cdr_message_router(), ast_cel_set_config(), ast_channel_blob_create(), ast_channel_cache_by_name(), ast_channel_snapshot_create(), ast_channel_start_silence_generator(), ast_channel_yank(), ast_dns_query_set_resolve_async(), ast_dns_resolve_recurring(), ast_dns_resolver_set_data(), ast_format_attribute_set(), ast_format_create_named(), ast_format_get_codec(), ast_format_joint(), ast_format_parse_sdp_fmtp(), ast_local_lock_all(), ast_openvstream(), ast_rtp_bundle(), ast_rtp_codecs_get_payload(), ast_rtp_codecs_get_payload_format(), ast_rtp_codecs_get_preferred_format(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_new(), ast_sip_dialog_get_endpoint(), ast_sip_get_distributor_serializer(), ast_sip_schedule_task(), ast_sip_transport_monitor_register_replace_key(), ast_slinfactory_init(), ast_slinfactory_init_with_format(), ast_sorcery_get_wizard_mapping(), ast_speech_new(), ast_stream_set_formats(), ast_unreal_indicate(), attended_transfer_bridge(), begin_dial_prerun(), chan_pjsip_answer(), chan_pjsip_indicate(), channel_do_masquerade(), command_prestart_get_container(), conf_set_menu_to_user(), control_create(), control_set_app(), dial_transfer(), dns_query_alloc(), dns_query_recurring_resolution_callback(), dns_system_resolver_resolve(), filter_history(), generic_fax_exec(), get_dial_bridge(), make_silence(), newpvt(), pjsip_acf_channel_read(), prometheus_general_config_get(), ring_entry(), set_read_to_slin(), softmix_bridge_stream_topology_changed(), speech_background(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_exec(), stasis_cache_get_by_eid(), stasis_forward_all(), stasis_message_router_publish_sync(), stasis_state_subscriber_data(), stasis_unsubscribe(), and wrap_hook().
#define ao2_callback | ( | c, | |
flags, | |||
cb_fn, | |||
arg | |||
) | __ao2_callback((c), (flags), (cb_fn), (arg), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.
c | A pointer to the container to operate on. |
flags | A set of flags specifying the operation to perform, partially used by the container code, but also passed to the callback.
|
cb_fn | A function pointer, that will be called on all objects, to see if they match. This function returns CMP_MATCH if the object is matches the criteria; CMP_STOP if the traversal should immediately stop, or both (via bitwise ORing), if you find a match and want to end the traversal, and 0 if the object is not a match, but the traversal should continue. This is the function that is applied to each object traversed. Its arguments are: (void *obj, void *arg, int flags), where: obj is an object arg is the same as arg passed into ao2_callback flags is the same as flags passed into ao2_callback (flags are also used by ao2_callback). |
arg | passed to the callback. |
NULL | on failure or no matching object found. |
If the function returns any objects, their refcount is incremented, and the caller is in charge of decrementing them once done.
Typically, ao2_callback() is used for two purposes:
This function searches through a container and performs operations on objects according on flags passed. XXX describe better The comparison is done calling the compare function set implicitly. The arg pointer can be a pointer to an object or to a key, we can say this looking at flags value. If arg points to an object we will search for the object pointed by this value, otherwise we search for a key value. If the key is not unique we only find the first matching value.
The use of flags argument is the follow:
OBJ_UNLINK unlinks the object found OBJ_NODATA on match, do not return an object Callbacks use OBJ_NODATA as a default functions such as find() do OBJ_MULTIPLE return multiple matches Default is no. OBJ_SEARCH_OBJECT the pointer is to an object OBJ_SEARCH_KEY the pointer is to a search key OBJ_SEARCH_PARTIAL_KEY the pointer is to a partial search key
Definition at line 1693 of file astobj2.h.
Referenced by admin_exec(), ao2_container_dup(), ao2_container_dup_weakproxy_objs(), ast_ari_applications_list(), ast_ari_websocket_events_event_websocket_dtor(), ast_bridge_features_merge(), ast_bucket_file_metadata_callback(), ast_calendar_clear_events(), ast_calendar_merge_events(), ast_calendar_unregister(), ast_cdr_setvar(), ast_channel_dialed_causes_channels(), ast_channel_dialed_causes_clear(), ast_codec_get_by_id(), ast_extension_state_del(), ast_media_get_media(), ast_media_get_variants(), ast_merge_contexts_and_delete(), ast_multi_channel_blob_get_channels(), ast_namedgroups_intersect(), ast_odbc_get_max_connections(), ast_sip_transport_monitor_unregister_all(), ast_softhangup_all(), ast_sorcery_force_reload(), ast_sorcery_global_observer_remove(), ast_sorcery_instance_observer_remove(), ast_sorcery_is_object_field_registered(), ast_sorcery_load(), ast_sorcery_observer_remove(), ast_sorcery_reload(), ast_sorcery_wizard_observer_remove(), ast_unregister_indication_country(), channel_admin_exec(), cleanup(), context_table_create_autohints(), create_sound_blob(), handle_cli_sounds_show(), load_config(), load_indications(), load_module(), object_type_loaded_observer(), one_protocol(), parking_lot_inspect_parked_user(), parking_lot_retrieve_parked_user(), parse_config(), process_config(), reload_queues(), reload_single_queue(), set_config(), sorcery_observers_notify_create(), sorcery_observers_notify_delete(), sorcery_observers_notify_loaded(), sorcery_observers_notify_update(), stasis_app_get_all(), stasis_app_to_cli(), stasis_cache_dump_all(), stasis_cache_dump_by_eid(), unload_module(), xmpp_client_service_discovery_result_hook(), xmpp_init_event_distribution(), xmpp_pak_presence(), and xmpp_roster_hook().
#define ao2_container_alloc_hash | ( | ao2_options, | |
container_options, | |||
n_buckets, | |||
hash_fn, | |||
sort_fn, | |||
cmp_fn | |||
) | __ao2_container_alloc_hash((ao2_options), (container_options), (n_buckets), (hash_fn), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize a hash container with the desired number of buckets.
We allocate space for a struct astobj_container, struct container and the buckets[] array.
ao2_options | Container ao2 object options (See enum ao2_alloc_opts) |
container_options | Container behaviour options (See enum ao2_container_opts) |
n_buckets | Number of buckets for hash |
hash_fn | Pointer to a function computing a hash value. (NULL if everyting goes in first bucket.) |
sort_fn | Pointer to a sort function. (NULL to not sort the buckets.) |
cmp_fn | Pointer to a compare function used by ao2_find. (NULL to match everything) |
Definition at line 1303 of file astobj2.h.
Referenced by aco_option_container_alloc(), ast_aeap_create(), ast_ari_websocket_events_event_websocket_init(), ast_bridge_peers_nolock(), ast_bucket_init(), ast_calendar_event_container_alloc(), ast_channels_init(), ast_codec_init(), ast_config_hook_register(), ast_config_text_file_save2(), ast_datastores_alloc(), ast_endpoint_init(), ast_format_cache_init(), ast_format_init(), ast_get_namedgroups(), ast_media_cache_init(), ast_media_index_create(), ast_multi_channel_blob_create(), ast_multi_channel_blob_get_channels(), ast_named_locks_init(), ast_pbx_init(), ast_sip_initialize_scheduler(), ast_sorcery_init(), ast_stasis_channels_init(), ast_str_container_alloc_options(), ast_tps_init(), ast_xmldoc_build_documentation(), ast_xmpp_client_config_alloc(), bucket_file_alloc(), build_calendar(), init_queue(), jingle_config_alloc(), jingle_endpoint_state_create(), load_module(), named_acl_config_alloc(), parking_config_alloc(), realtime_sqlite3_require(), sig_pri_load(), skel_config_alloc(), sorcery_object_type_alloc(), stasis_cache_create_full(), stasis_init(), stasis_state_manager_create(), stasis_topic_pool_create(), test_performance(), xml_translate(), xmpp_client_alloc(), and xmpp_client_create_buddy().
#define ao2_container_alloc_list | ( | ao2_options, | |
container_options, | |||
sort_fn, | |||
cmp_fn | |||
) | __ao2_container_alloc_list((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize a list container.
ao2_options | Container ao2 object options (See enum ao2_alloc_opts) |
container_options | Container behaviour options (See enum ao2_container_opts) |
sort_fn | Pointer to a sort function. (NULL if list not sorted.) |
cmp_fn | Pointer to a compare function used by ao2_find. (NULL to match everything) |
Definition at line 1327 of file astobj2.h.
Referenced by __ast_sorcery_wizard_register(), ast_add_hint(), ast_bridge_features_init(), ast_local_init(), ast_msg_alloc(), ast_pbx_init(), ast_pickup_find_by_group(), ast_refer_alloc(), ast_rtp_ice_add_cand(), ast_rtp_ice_add_remote_candidate(), ast_sorcery_init(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), build_conf(), build_mansession(), command_prestart_queue_command(), control_create(), init_queue(), load_module(), load_modules(), object_type_loaded_observer(), sorcery_object_type_alloc(), stasis_cache_dump_all(), stasis_cache_dump_by_eid(), stasis_cache_get_all(), test_performance(), and xmpp_config_alloc().
#define ao2_container_alloc_rbtree | ( | ao2_options, | |
container_options, | |||
sort_fn, | |||
cmp_fn | |||
) | __ao2_container_alloc_rbtree((ao2_options), (container_options), (sort_fn), (cmp_fn), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize a red-black tree container.
ao2_options | Container ao2 object options (See enum ao2_alloc_opts) |
container_options | Container behaviour options (See enum ao2_container_opts) |
sort_fn | Pointer to a sort function. |
cmp_fn | Pointer to a compare function used by ao2_find. (NULL to match everything) |
Definition at line 1349 of file astobj2.h.
Referenced by __queues_show(), app_create(), ast_bridging_init(), bucket_alloc(), conf_alloc(), handle_cli_sounds_show(), and test_performance().
#define ao2_container_clone | ( | orig, | |
flags | |||
) | __ao2_container_clone(orig, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Create a clone/copy of the given container.
orig | Container to copy all object references from. |
flags | OBJ_NOLOCK if a lock is already held on the container. |
NULL | on error. |
Definition at line 1419 of file astobj2.h.
Referenced by ast_bucket_file_copy().
#define AO2_FIELD_HASH_FN | ( | stype, | |
field, | |||
hash_fn | |||
) |
Creates a hash function for a structure field.
stype | The structure type |
field | The string field in the structure to hash |
hash_fn | Function which hashes the field |
AO2_FIELD_HASH_FN(mystruct, myfield, ast_str_hash) will produce a function named mystruct_hash_fn which hashes mystruct->myfield with ast_str_hash.
#define ao2_get_weakproxy | ( | obj | ) | __ao2_get_weakproxy(obj, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
#define ao2_global_obj_ref | ( | holder | ) | __ao2_global_obj_ref(&holder, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Get a reference to the object stored in the global holder.
holder | Global ao2 object holder. |
NULL | if no object available. |
Definition at line 918 of file astobj2.h.
Referenced by __ast_manager_event_multichan(), __ast_vm_greeter_register(), __ast_vm_register(), ast_ari_config_get(), ast_cdr_engine_term(), ast_cdr_get_config(), ast_cdr_set_config(), ast_cel_backend_register(), ast_cel_backend_unregister(), ast_cel_check_enabled(), ast_cel_fabricate_channel_from_event(), ast_cel_get_config(), ast_cel_set_config(), ast_named_acl_find(), ast_parking_blind_transfer_park(), ast_parking_is_exten_park(), ast_parking_park_bridge_channel(), ast_parking_park_call(), ast_parking_provider_registered(), ast_parking_register_bridge_features(), ast_parking_unregister_bridge_features(), ast_sip_transport_monitor_register_replace_key(), ast_sip_transport_monitor_unregister_all(), ast_sip_transport_monitor_unregister_key(), ast_smdi_interface_find(), ast_vm_greeter_is_registered(), ast_vm_greeter_unregister(), ast_vm_is_registered(), ast_vm_unregister(), ast_xmpp_client_find(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), build_mansession(), cdr_toggle_runtime_options(), conf_find_bridge_profile(), conf_find_user_profile(), conf_set_menu_to_user(), find_session(), find_session_by_nonce(), function_amiclient(), handle_channel_snapshot_update_message(), handle_kickmanconn(), handle_show_named_acl_cmd(), handle_showmanconn(), hep_queue_cb(), hepv3_config_post_apply(), hepv3_get_uuid_type(), hepv3_is_loaded(), hepv3_send_packet(), jingle_endpoint_state_find_or_create(), jingle_request(), parking_dynamic_lots_enabled(), prometheus_config_post_apply(), prometheus_general_config_get(), prometheus_general_config_set(), purge_sessions(), skel_find_or_create_state(), stasis_init(), stasis_message_type_declined(), transport_state_callback(), xmpp_action_hook(), xmpp_cli_create_collection(), xmpp_cli_create_leafnode(), xmpp_cli_delete_pubsub_node(), xmpp_cli_list_pubsub_nodes(), xmpp_cli_purge_pubsub_nodes(), xmpp_client_find_or_create(), xmpp_client_reconnect(), xmpp_client_send_message(), xmpp_client_set_presence(), xmpp_client_thread(), xmpp_component_register_get_hook(), xmpp_component_service_discovery_get_hook(), xmpp_component_service_discovery_items_hook(), xmpp_connect_hook(), xmpp_init_event_distribution(), xmpp_join_exec(), xmpp_leave_exec(), xmpp_log_hook(), xmpp_pubsub_build_publish_skeleton(), xmpp_pubsub_iq_create(), xmpp_pubsub_publish_device_state(), xmpp_pubsub_subscribe(), xmpp_roster_hook(), and xmpp_sendgroup_exec().
#define ao2_global_obj_release | ( | holder | ) | __ao2_global_obj_replace_unref(&holder, NULL, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Release the ao2 object held in the global holder.
holder | Global ao2 object holder. |
Definition at line 859 of file astobj2.h.
Referenced by ast_ari_config_destroy(), ast_parking_unregister_bridge_features(), ast_vm_greeter_unregister(), ast_vm_unregister(), bridge_agent_hold_dissolving(), conf_destroy_config(), load_module(), sorcery_config_destructor(), stasis_cleanup(), and unload_module().
#define ao2_global_obj_replace | ( | holder, | |
obj | |||
) | __ao2_global_obj_replace(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Replace an ao2 object in the global holder.
holder | Global ao2 object holder. |
obj | Object to put into the holder. Can be NULL. |
NULL | if no object available. |
#define ao2_global_obj_replace_unref | ( | holder, | |
obj | |||
) | __ao2_global_obj_replace_unref(&holder, (obj), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__, #holder) |
Replace an ao2 object in the global holder, throwing away any old object.
holder | Global ao2 object holder. |
obj | Object to put into the holder. Can be NULL. |
0 | The global object was previously empty |
1 | The global object was not previously empty |
Definition at line 901 of file astobj2.h.
Referenced by __ast_vm_greeter_register(), __ast_vm_register(), ast_parking_register_bridge_features(), hepv3_config_post_apply(), and stasis_init().
#define AO2_GLOBAL_OBJ_STATIC | ( | name | ) |
Define a global object holder to be used to hold an ao2 object, statically initialized.
name | This will be the name of the object holder. |
This macro creates a global object holder that can be used to hold an ao2 object accessible using the API. The structure is allocated and initialized to be empty.
Example usage:
This defines global_cfg, intended to hold an ao2 object accessible using an API.
#define ao2_link | ( | container, | |
obj | |||
) | __ao2_link((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Add an object to a container.
container | The container to operate on. |
obj | The object to be added. |
0 | on errors. |
1 | on success. |
This function inserts an object in a container according its key.
Definition at line 1532 of file astobj2.h.
Referenced by __ast_sorcery_object_field_register(), __ast_sorcery_object_type_insert_wizard(), add_column_name(), alloc_variant(), ast_add_hint(), ast_aeap_user_data_register(), ast_bridge_dtmf_hook(), ast_bridge_peers_nolock(), ast_bucket_file_metadata_set(), ast_cel_backend_register(), ast_change_hint(), ast_change_name(), ast_channel_dialed_causes_add(), ast_config_hook_register(), ast_datastores_add(), ast_get_namedgroups(), ast_merge_contexts_and_delete(), ast_multi_channel_blob_add_channel(), ast_multi_channel_blob_get_channels(), ast_register_indication_country(), ast_rtp_ice_add_cand(), ast_rtp_ice_add_remote_candidate(), ast_sip_schedule_task(), ast_sorcery_global_observer_add(), ast_sorcery_instance_observer_add(), ast_sorcery_object_fields_register(), ast_sorcery_observer_add(), ast_sorcery_wizard_observer_add(), ast_str_container_add(), ast_xmldoc_build_documentation(), bridge_register(), build_calendar(), build_mansession(), build_profile(), build_route(), chan_pjsip_add_hold(), channel_do_masquerade(), command_prestart_queue_command(), context_table_create_autohints(), event_session_alloc(), fax_session_new(), find_channel_by_group(), handle_channel_snapshot_update_message(), jingle_action_session_initiate(), jingle_request(), join_conference_bridge(), load_config(), local_request_with_stream_topology(), merge_container_cb(), parking_lot_build_or_update(), parse_config(), realtime_peer(), realtime_user(), reload_single_member(), set_config(), sorcery_astdb_retrieve_fields_common(), stasis_app_bridge_playback_channel_add(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_exec(), test_performance(), transport_state_callback(), xml_translate(), and xmpp_client_create_buddy().
#define ao2_link_flags | ( | container, | |
obj, | |||
flags | |||
) | __ao2_link((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Add an object to a container.
container | The container to operate on. |
obj | The object to be added. |
flags | search_flags to control linking the object. (OBJ_NOLOCK) |
0 | on errors. |
1 | on success. |
This function inserts an object in a container according its key.
Definition at line 1554 of file astobj2.h.
Referenced by __ast_bucket_scheme_register(), __ast_channel_alloc_ap(), __ast_format_interface_register(), __ast_sorcery_wizard_register(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), ast_channel_publish_snapshot(), ast_format_cache_set(), ast_media_cache_create_or_update(), ast_media_cache_retrieve(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), create_dsn(), dup_weakproxy_cb(), publish_cluster_discovery_to_stasis(), stasis_topic_pool_get_topic(), and xmpp_pak_presence().
#define ao2_ref | ( | o, | |
delta | |||
) | __ao2_ref((o), (delta), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Reference/unreference an object and return the old refcount.
o | A pointer to the object |
delta | Value to add to the reference counter. |
Increase/decrease the reference counter according the value of delta.
If the refcount goes to zero, the object is destroyed.
Definition at line 459 of file astobj2.h.
Referenced by __aco_option_register(), __ao2_cleanup(), __ast_channel_alloc_ap(), __ast_format_interface_register(), __ast_read(), __find_callno(), __queues_show(), __rtp_recvfrom(), __rtp_sendto(), acf_faxopt_read(), acf_faxopt_write(), aco_option_register_deprecated(), aco_process_var(), aco_set_defaults(), action_coreshowchannelmap(), action_coreshowchannels(), add_column_name(), add_format_information_cb(), add_hintdevice(), add_ice_to_stream(), add_to_dial_bridge(), add_to_queue(), admin_exec(), agent_request_exec(), alias_show(), alloc_variant(), ao2_iterator_restart(), ao2_ref_and_lock(), app_create(), app_subscribe_bridge(), app_subscribe_channel(), app_subscribe_endpoint(), app_to_json(), ast_add_hint(), ast_aeap_create(), ast_aeap_create_and_connect(), ast_aeap_custom_fields_get(), ast_aeap_message_create1(), ast_aeap_message_create2(), ast_aeap_message_create_error(), ast_aeap_message_create_request(), ast_aeap_message_deserialize(), ast_aeap_send_msg(), ast_aeap_send_msg_tsx(), ast_aeap_user_data_object_by_id(), ast_aeap_user_data_register(), ast_ari_add_handler(), ast_ari_applications_filter(), ast_ari_asterisk_update_object(), ast_ari_bridges_clear_video_source(), ast_ari_bridges_list(), ast_ari_bridges_set_video_source(), ast_ari_channels_create(), ast_ari_channels_get(), ast_ari_channels_list(), ast_ari_config_validate_user(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_endpoints_refer_to_endpoint(), ast_ari_endpoints_send_message_to_endpoint(), ast_ari_websocket_events_event_websocket_established(), ast_ari_websocket_session_create(), ast_bridge_blob_create(), ast_bridge_blob_create_from_snapshots(), ast_bridge_channel_feature_digit(), ast_bridge_channel_kick(), ast_bridge_channel_lock_bridge(), ast_bridge_channel_merge_inhibit(), ast_bridge_channel_write_unhold(), ast_bridge_depart(), ast_bridge_destroy(), ast_bridge_dtmf_hook(), ast_bridge_features_cleanup(), ast_bridge_get_snapshot_by_uniqueid(), ast_bridge_interval_hook(), ast_bridge_join(), ast_bridge_notify_masquerade(), ast_bridge_publish_attended_transfer(), ast_bridge_publish_enter(), ast_bridge_publish_leave(), ast_bridge_publish_merge(), ast_bridge_publish_state(), ast_bridge_snapshot_create(), ast_bridge_transfer_acquire_bridge(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_bucket_file_copy(), ast_bucket_file_json(), ast_bucket_json(), ast_calendar_unref_event(), ast_cdr_fork(), ast_cel_backend_register(), ast_cel_backend_unregister(), ast_cel_general_config_alloc(), ast_cel_get_config(), ast_cel_set_config(), ast_change_hint(), ast_channel_bridge_peer(), ast_channel_dialed_causes_add(), ast_channel_get_bridge(), ast_channel_get_bridge_channel(), ast_channel_get_vars(), ast_channel_publish_blob(), ast_channel_publish_cached_blob(), ast_channel_publish_final_snapshot(), ast_channel_publish_snapshot(), ast_channel_snapshot_create(), ast_channel_suppress(), ast_closestream(), ast_codec_samples_count(), ast_complete_channels(), ast_config_hook_register(), ast_config_text_file_save2(), ast_datastores_alloc_datastore(), ast_dns_query_set_add(), ast_dns_query_set_create(), ast_dns_query_set_resolve_async(), ast_dns_resolve(), ast_dns_resolve_async(), ast_dns_resolve_recurring(), ast_dns_resolve_recurring_cancel(), ast_endpoint_blob_create(), ast_endpoint_blob_publish(), ast_endpoint_latest_snapshot(), ast_endpoint_shutdown(), ast_extension_state_del(), ast_extension_state_extended(), ast_format_attribute_get(), ast_format_attribute_set(), ast_format_cache_get_by_codec(), ast_format_cap_append_by_type(), ast_format_cap_get_best_by_type(), ast_format_cap_get_compatible(), ast_format_cap_get_format(), ast_format_cap_remove_by_type(), ast_format_clone(), ast_format_create_named(), ast_format_generate_sdp_fmtp(), ast_format_parse_sdp_fmtp(), ast_get_namedgroups(), ast_hangup(), ast_iax2_new(), ast_local_get_peer(), ast_local_setup_bridge(), ast_local_setup_masquerade(), ast_local_unlock_all(), ast_manager_event_blob_create(), ast_media_cache_create_or_update(), ast_media_cache_delete(), ast_media_cache_exists(), ast_media_cache_retrieve(), ast_media_cache_retrieve_metadata(), ast_media_get_media(), ast_media_get_variants(), ast_media_index_create(), ast_merge_contexts_and_delete(), ast_msg_alloc(), ast_msg_destroy(), ast_msg_get_var(), ast_msg_queue(), ast_msg_ref(), ast_msg_send(), ast_multi_channel_blob_add_channel(), ast_multi_channel_blob_create(), ast_multi_channel_blob_get_channel(), ast_multi_channel_blob_get_channels(), ast_multi_object_blob_create(), ast_multi_object_blob_single_channel_publish(), ast_mwi_blob_create(), ast_mwi_mailbox_delete_all(), ast_mwi_mailbox_delete_by_regex(), ast_mwi_publish(), ast_mwi_publish_by_mailbox(), ast_odbc_get_max_connections(), ast_odbc_release_obj(), ast_openstream_full(), ast_openvstream(), ast_parked_call_payload_create(), ast_pickup_find_by_group(), ast_print_namedgroups(), ast_query_set_resolve(), ast_refer_alloc(), ast_refer_destroy(), ast_refer_get_var(), ast_refer_get_var_and_unlink(), ast_refer_ref(), ast_refer_send(), ast_remove_hint(), ast_rtcp_write(), ast_rtp_bundle(), ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_codecs_payloads_unset(), ast_rtp_destroy(), ast_rtp_engine_unload_format(), ast_rtp_ice_add_cand(), ast_rtp_ice_add_remote_candidate(), ast_rtp_ice_get_local_candidates(), ast_rtp_ice_start(), ast_rtp_ice_stop(), ast_rtp_ice_turn_request(), ast_rtp_instance_make_compatible(), ast_rtp_instance_new(), ast_rtp_lookup_mime_multiple2(), ast_rtp_prop_set(), ast_rtp_publish_rtcp_message(), ast_rtp_stop(), ast_sip_dialog_get_endpoint(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sip_sched_is_task_running_by_name(), ast_sip_sched_task_cancel_by_name(), ast_sip_sched_task_get_next_run_by_name(), ast_sip_sched_task_get_times_by_name2(), ast_sip_schedule_task(), ast_sip_transport_monitor_register_replace_key(), ast_sip_transport_monitor_unregister_all(), ast_sip_transport_monitor_unregister_key(), ast_smdi_interface_find(), ast_sorcery_alloc(), ast_sorcery_global_observer_add(), ast_sorcery_instance_observer_add(), ast_sorcery_object_set_congestion_levels(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_sorcery_observer_add(), ast_sorcery_ref(), ast_sorcery_retrieve_by_id(), ast_sorcery_wizard_observer_add(), ast_sorcery_wizard_unregister(), ast_sounds_get_index_for_file(), ast_speech_destroy(), ast_speech_new(), ast_str_container_add(), ast_stream_create_resolved(), ast_stream_topology_alloc(), ast_stream_topology_create_from_format_cap(), ast_system_publish_registry(), ast_taskprocessor_get(), ast_taskprocessor_listener_get_tps(), ast_taskprocessor_unreference(), ast_tcptls_client_start_timeout(), ast_tone_zone_ref(), ast_tone_zone_sound_ref(), ast_tone_zone_sound_unref(), ast_tone_zone_unref(), ast_tps_init(), ast_translate_available_formats(), ast_translator_best_choice(), ast_unreal_alloc_stream_topology(), ast_unreal_answer(), ast_unreal_channel_push_to_bridge(), ast_unreal_digit_begin(), ast_unreal_digit_end(), ast_unreal_hangup(), ast_unreal_indicate(), ast_unreal_new_channels(), ast_unreal_sendhtml(), ast_unreal_sendtext(), ast_unreal_setoption(), ast_unreal_write_stream(), ast_xmpp_client_config_alloc(), ast_xmpp_client_find(), ast_xmpp_client_unref(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), attended_transfer_bridge(), attended_transfer_properties_alloc(), audiosocket_request(), bridge_agent_hold_push(), bridge_app_subscribed(), bridge_app_subscribed_involved(), bridge_base_init(), bridge_basic_change_personality(), bridge_channel_ind_thread(), bridge_merge_message_create(), bridge_show_specific_print_channel(), bucket_alloc(), bucket_file_alloc(), build_conf(), build_mansession(), chan_pjsip_answer(), chan_pjsip_call(), chan_pjsip_devicestate(), chan_pjsip_get_rtp_peer(), chan_pjsip_get_vrtp_peer(), chan_pjsip_indicate(), chan_pjsip_new(), chan_pjsip_read_stream(), chan_pjsip_sendtext_data(), chan_pjsip_set_rtp_peer(), chan_rtp_get_rtp_peer(), channel_admin_exec(), channel_do_masquerade(), channel_state_invalid(), clear_history_entry_cb(), cli_alias_passthrough(), cli_complete_show(), cli_fax_show_session(), cli_fax_show_sessions(), compatible_formats_exist(), complete_core_show_hint(), conf_alloc(), conf_announce_channel_push(), conf_bridge_profile_copy(), conf_bridge_profile_destroy(), conf_find_bridge_profile(), conf_find_user_profile(), conf_free(), conf_send_event_to_participants(), console_new(), context_table_create_autohints(), control_create(), control_dispatch_all(), control_flush_queue(), coreshowchannelmap_add_connected_channels(), create_dsn(), create_object(), create_outgoing_sdp_stream(), create_rtp(), destroy_gateway(), destroy_queue(), destroy_session(), destroy_v21_sessions(), device_state_cb(), dial_exec_full(), dns_query_alloc(), dns_query_recurring_resolution_callback(), dns_query_recurring_scheduled_callback(), dns_query_set_callback(), dns_query_set_destroy(), dns_system_resolver_process_query(), dns_system_resolver_resolve(), dump_queue_members(), dup_weakproxy_cb(), fax_detect_attach(), fax_detect_framehook(), fax_detect_framehook_destroy(), fax_detect_new(), fax_gateway_attach(), fax_gateway_detect_t38(), fax_gateway_detect_v21(), fax_gateway_framehook(), fax_gateway_framehook_destroy(), fax_gateway_new(), fax_gateway_request_t38(), fax_gateway_start(), fax_session_new(), fax_session_reserve(), fax_session_tab_complete(), feature_attended_transfer(), find_bridge(), find_channel_control(), find_control(), find_details(), find_hint_by_cb_id(), find_or_create_details(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), find_user(), format_cap_destroy(), forwards_create_bridge(), forwards_create_channel(), forwards_create_endpoint(), free_members(), function_amiclient(), generic_fax_exec(), get_dsn(), get_languages(), get_member_penalty(), get_member_status(), grab_transfer(), handle_bridge_pairings(), handle_cli_sound_show(), handle_cli_sounds_show(), handle_kickmanconn(), handle_show_hint(), handle_show_hints(), handle_show_named_acl_cmd(), handle_showmanconn(), handle_tcptls_connection(), handle_voicemail_show_aliases(), hangupcause_read(), hepv3_config_post_apply(), hepv3_create_capture_info(), hepv3_data_alloc(), hepv3_send_packet(), history_on_rx_msg(), history_on_tx_msg(), hold(), http_server_discard(), http_server_get(), iax2_codec_pref_string(), iax2_format_compatibility_cap2bitfield(), internal_stasis_subscribe(), jingle_action_hook(), jingle_action_session_initiate(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_add_payloads_to_description(), jingle_alloc(), jingle_config_alloc(), jingle_endpoint_alloc(), jingle_endpoint_destructor(), jingle_endpoint_state_create(), jingle_endpoint_state_destructor(), jingle_endpoint_state_find_or_create(), jingle_get_rtp_peer(), jingle_hangup(), jingle_interpret_content(), jingle_new(), jingle_read(), jingle_request(), join_conference_bridge(), leave_conference(), load_config(), load_module(), load_users(), local_call(), local_devicestate(), local_hangup(), local_request_with_stream_topology(), locals_show(), manager_add_filter(), manager_queues_status(), manager_queues_summary(), matrix_rebuild(), message_sink_cb(), messaging_app_subscribe_endpoint(), messaging_app_unsubscribe_endpoint(), messaging_cleanup(), messaging_init(), module_config_alloc(), module_config_destructor(), module_config_dtor(), moh_channel_thread(), multicast_rtp_request(), named_acl_config_alloc(), newpvt(), num_available_members(), orig_app(), orig_exten(), parking_config_alloc(), parking_lot_build_or_update(), parking_lot_get_bridge(), parking_lot_get_space(), parking_lot_retrieve_parked_user(), parking_set_duration(), parse_config(), pjsip_acf_channel_read(), pjsip_acf_dial_contacts_read(), pjsip_channel_cli_register(), pjsip_history_entry_alloc(), play_sound(), prepare_bridge_moh_channel(), print_queue(), process_description_file(), publish_cluster_discovery_to_stasis(), publish_cluster_discovery_to_stasis_full(), publish_hint_change(), publish_hint_remove(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), qupd_exec(), realtime_sqlite3_require(), recording_alloc(), release_obj_or_dsn(), reload_single_member(), reload_single_queue(), remb_enable_collection(), remote_send_hold_refresh(), remove_bridge_playback(), remove_from_playbacks(), remove_from_queue(), ringing(), rna(), rqm_exec(), rt_handle_member_record(), rtp_add_candidates_to_ice(), rtp_raw_write(), session_details_new(), session_do(), set_interval_hook(), sig_pri_call(), sig_pri_cc_monitor_destructor(), sig_pri_unload(), skel_config_alloc(), skel_find_or_create_state(), skel_level_alloc(), sla_calc_station_delays(), sla_choose_idle_trunk(), sla_choose_ringing_trunk(), sla_find_trunk_ref_byname(), sla_queue_event_conf(), sorcery_is_explicit_name_met(), sorcery_object_type_alloc(), sorcery_observer_invocation_alloc(), spandsp_fax_gw_gen_alloc(), stasis_app_bridge_moh_channel(), stasis_app_bridge_moh_stop(), stasis_app_bridge_playback_channel_find(), stasis_app_bridge_playback_channel_remove(), stasis_app_channel_unreal_set_internal(), stasis_app_control_play_uri(), stasis_app_control_record(), stasis_app_control_snoop(), stasis_app_event_allowed(), stasis_app_exec(), stasis_app_get_debug_by_name(), stasis_app_mailboxes_to_json(), stasis_app_recording_options_create(), stasis_app_send(), stasis_app_send_command_async(), stasis_app_subscribe_channel(), stasis_app_to_cli(), stasis_app_unregister(), stasis_app_user_event(), stasis_caching_topic_create(), stasis_caching_unsubscribe(), stasis_caching_unsubscribe_and_join(), stasis_cp_all_create(), stasis_cp_single_create(), stasis_cp_sink_create(), stasis_forward_all(), stasis_init(), stasis_message_create_full(), stasis_message_sink_create(), stasis_message_type_declined(), stasis_state_add_publisher(), stasis_state_add_subscriber(), stasis_state_manager_create(), stasis_state_publish_by_id(), stasis_state_remove_publish_by_id(), stasis_state_subscribe_pool(), stasis_state_topic(), stasis_state_unsubscribe(), stasis_state_unsubscribe_and_join(), stasis_topic_create_with_detail(), stasis_topic_pool_create(), stasis_topic_pool_topic_exists(), stasis_unsubscribe_and_join(), t38_automatic_reject_timer_cb(), t38_change_state(), t38_create_media_state(), t38_framehook(), t38_initialize_session(), t38_parameters_task_data_alloc(), test_core_format_parse_sdp_fmtp(), test_iterator_next(), test_performance(), test_ref(), test_unref(), transport_state_callback(), unhold(), unicast_rtp_request(), unistim_new(), unload_module(), unref_instance_cond(), unref_mansession(), update_connected_line_information(), update_file_format_info(), update_queue(), user_alloc(), websocket_client_parse_uri(), xfer_client_on_evsub_state(), xml_translate(), xmpp_buddy_destructor(), xmpp_client_alloc(), xmpp_client_create_buddy(), xmpp_client_find_or_create(), xmpp_client_service_discovery_result_hook(), xmpp_component_register_get_hook(), xmpp_config_alloc(), xmpp_pak_presence(), xmpp_pak_s10n(), xmpp_pubsub_create_affiliations(), and xmpp_roster_hook().
#define ao2_replace | ( | dst, | |
src | |||
) | ao2_t_replace((dst), (src), NULL) |
Replace one object reference with another cleaning up the original.
dst | Pointer to the object that will be cleaned up. |
src | Pointer to the object replacing it. |
Definition at line 501 of file astobj2.h.
Referenced by app_set_replace_channel_snapshot(), app_update(), ast_cdr_set_config(), ast_channel_make_compatible_helper(), ast_dns_resolve_recurring_cancel(), ast_rtp_codecs_payloads_copy(), ast_rtp_codecs_payloads_unset(), ast_rtp_codecs_payloads_xover(), ast_rtp_codecs_set_preferred_format(), ast_rtp_write(), ast_slinfactory_feed(), ast_translator_best_choice(), ast_writestream(), bridge_p2p_rtp_write(), dns_query_recurring_resolution_callback(), fax_detect_framehook(), fax_gateway_framehook(), format_cache_shutdown(), prometheus_general_config_set(), stasis_state_publish(), and stasis_state_publish_by_id().
#define AO2_STRING_FIELD_CMP_FN | ( | stype, | |
field | |||
) | AO2_FIELD_CMP_FN(stype, _cmp_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_CMP_FN,) |
Creates a compare function for a structure string field.
stype | The structure type |
field | The string field in the structure to compare |
AO2_STRING_FIELD_CMP_FN(mystruct, myfield) will produce a function named mystruct_cmp_fn which compares mystruct->myfield.
AO2_STRING_FIELD_CASE_CMP_FN(mystruct, myfield) would do the same except it performs case insensitive comparisons.
#define AO2_STRING_FIELD_HASH_FN | ( | stype, | |
field | |||
) | AO2_FIELD_HASH_FN(stype, field, ast_str_hash) |
Creates a hash function for a structure string field.
stype | The structure type |
field | The string field in the structure to hash |
AO2_STRING_FIELD_HASH_FN(mystruct, myfield) will produce a function named mystruct_hash_fn which hashes mystruct->myfield.
AO2_STRING_FIELD_HASH_FN(mystruct, myfield) would do the same except it uses the hash function which ignores case.
#define AO2_STRING_FIELD_SORT_FN | ( | stype, | |
field | |||
) | AO2_FIELD_CMP_FN(stype, _sort_fn, field, strcmp, strncmp, AO2_FIELD_TRANSFORM_SORT_FN, const) |
Creates a sort function for a structure string field.
stype | The structure type |
field | The string field in the structure to compare |
AO2_STRING_FIELD_SORT_FN(mystruct, myfield) will produce a function named mystruct_sort_fn which compares mystruct->myfield.
AO2_STRING_FIELD_CASE_SORT_FN(mystruct, myfield) would do the same except it performs case insensitive comparisons.
#define ao2_t_alloc_options | ( | data_size, | |
destructor_fn, | |||
options, | |||
debug_msg | |||
) | __ao2_alloc((data_size), (destructor_fn), (options), (debug_msg), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate and initialize an object.
data_size | The sizeof() of the user-defined structure. |
destructor_fn | The destructor function (can be NULL) |
options | The ao2 object options (See enum ao2_alloc_opts) |
debug_msg | An ao2 object debug tracing message. |
Allocates a struct astobj2 with sufficient space for the user-defined structure.
Definition at line 402 of file astobj2.h.
Referenced by ao2_container_register(), ast_format_create_named(), stasis_message_create_full(), and stasis_message_type_create().
#define ao2_t_callback_data | ( | container, | |
flags, | |||
cb_fn, | |||
arg, | |||
data, | |||
tag | |||
) | __ao2_callback_data((container), (flags), (cb_fn), (arg), (data), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
ao2_callback_data() is a generic function that applies cb_fn() to all objects in a container. It is functionally identical to ao2_callback() except that instead of taking an ao2_callback_fn *, it takes an ao2_callback_data_fn *, and allows the caller to pass in arbitrary data.
This call would be used instead of ao2_callback() when the caller needs to pass OBJ_SEARCH_OBJECT, OBJ_SEARCH_KEY, or OBJ_SEARCH_PARTIAL_KEY as part of the flags argument (which in turn requires passing in a known pointer type for 'arg') and also needs access to other non-global data to complete it's comparison or task.
See the documentation for ao2_callback() for argument descriptions.
#define ao2_t_find | ( | container, | |
arg, | |||
flags, | |||
tag | |||
) | __ao2_find((container), (arg), (flags), (tag), __FILE__, __LINE__, __PRETTY_FUNCTION__) |
ao2_find() is a short hand for ao2_callback(c, flags, c->cmp_fn, arg) XXX possibly change order of arguments ?
Definition at line 1734 of file astobj2.h.
Referenced by ao2_container_unregister(), find_load_queue_rt_friendly(), find_queue_by_name_rt(), queue_function_queuegetchannel(), queue_function_queuewaitingcount(), reload_queue_members(), reload_single_queue(), and remove_from_queue().
#define ao2_t_weakproxy_ref_object | ( | weakproxy, | |
delta, | |||
flags, | |||
tag | |||
) |
#define ao2_unlink | ( | container, | |
obj | |||
) | __ao2_unlink((container), (obj), 0, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Remove an object from a container.
container | The container to operate on. |
obj | The object to unlink. |
NULL | always |
Definition at line 1578 of file astobj2.h.
Referenced by ast_ari_websocket_events_event_websocket_established(), ast_bridge_channel_feature_digit(), ast_bridge_channel_kick(), ast_change_name(), ast_channel_release(), ast_channel_unlink(), ast_endpoint_shutdown(), ast_hangup(), ast_pickup_find_by_group(), ast_sip_sched_task_cancel(), ast_sip_schedule_task(), ast_sorcery_wizard_unregister(), build_calendar(), build_user(), channel_do_masquerade(), conf_ended(), control_unlink(), destroy_gateway(), destroy_v21_sessions(), event_session_cleanup(), fax_session_new(), generic_fax_exec(), handle_channel_snapshot_update_message(), http_server_discard(), jingle_hangup(), join_conference_bridge(), local_hangup(), messaging_app_unsubscribe_endpoint(), moh_channel_thread(), parking_lot_remove_if_unused(), parking_lot_retrieve_parked_user(), reload_single_member(), remove_bridge_playback(), sig_pri_cc_monitor_destructor(), sorcery_proxy_cb(), stasis_app_bridge_destroy(), stasis_app_bridge_playback_channel_remove(), and unpark_parked_user().
#define ao2_unlink_flags | ( | container, | |
obj, | |||
flags | |||
) | __ao2_unlink((container), (obj), (flags), NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Remove an object from a container.
container | The container to operate on. |
obj | The object to unlink. |
flags | search_flags to control unlinking the object. (OBJ_NOLOCK) |
NULL | always |
Definition at line 1600 of file astobj2.h.
Referenced by ast_format_cache_set(), ast_media_cache_create_or_update(), ast_media_cache_retrieve(), ast_sip_dialog_set_endpoint(), ast_sip_dialog_set_serializer(), ast_sorcery_object_unregister(), ast_taskprocessor_unreference(), remove_from_playbacks(), and xmpp_pak_presence().
#define AO2_WEAKPROXY | ( | ) | struct ao2_weakproxy __weakproxy##__LINE__ |
#define ao2_weakproxy_alloc | ( | data_size, | |
destructor_fn | |||
) | __ao2_weakproxy_alloc(data_size, destructor_fn, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Allocate an ao2_weakproxy object.
data_size | The sizeof() of the user-defined structure. |
destructor_fn | The destructor function (can be NULL) |
#define ao2_weakproxy_find | ( | c, | |
arg, | |||
flags, | |||
tag | |||
) | __ao2_weakproxy_find(c, arg, flags, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Perform an ao2_find on a container with ao2_weakproxy objects, returning the real object.
Definition at line 1748 of file astobj2.h.
Referenced by ast_sorcery_retrieve_by_module_name(), stasis_state_remove_publish_by_id(), and stasis_topic_get().
#define ao2_weakproxy_get_object | ( | weakproxy, | |
flags | |||
) | __ao2_weakproxy_get_object(weakproxy, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Get the object associated with weakproxy.
weakproxy | The weakproxy to read from. |
flags | OBJ_NOLOCK to avoid locking weakproxy. |
NULL | Either no object was set or the previously set object has been freed. |
Definition at line 621 of file astobj2.h.
Referenced by dup_weakproxy_cb().
#define ao2_weakproxy_ref_object | ( | weakproxy, | |
delta, | |||
flags | |||
) | ao2_t_weakproxy_ref_object(weakproxy, delta, flags, NULL) |
Run ao2_t_ref on the object associated with weakproxy.
weakproxy | The weakproxy to read from. |
delta | Value to add to the reference counter. |
flags | OBJ_NOLOCK to avoid locking weakproxy. |
-2 | weakproxy is not a valid ao2_weakproxy. |
-1 | weakproxy has no associated object. |
#define ao2_weakproxy_set_object | ( | weakproxy, | |
obj, | |||
flags | |||
) | __ao2_weakproxy_set_object(weakproxy, obj, flags, NULL, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Associate weakproxy with obj.
weakproxy | An object created by ao2_weakproxy_alloc. |
obj | An ao2 object not created by ao2_weakproxy_alloc. |
flags | OBJ_NOLOCK to avoid locking weakproxy. |
0 | Success |
-1 | Failure |
#define OBJ_KEY OBJ_SEARCH_KEY |
Deprecated name
Definition at line 1151 of file astobj2.h.
Referenced by __ast_bucket_scheme_register(), __ast_sorcery_apply_default(), __ast_sorcery_object_field_register(), __ast_sorcery_object_register(), __ast_sorcery_object_type_insert_wizard(), __ast_sorcery_remove_wizard_mapping(), __ast_sorcery_wizard_register(), agent_login_exec(), agent_request_exec(), alloc_variant(), ast_bucket_alloc(), ast_bucket_file_alloc(), ast_bucket_file_metadata_get(), ast_bucket_file_metadata_set(), ast_bucket_file_metadata_unset(), ast_channel_dialed_causes_add(), ast_channel_dialed_causes_find(), ast_channel_get_by_name_prefix(), ast_channel_iterator_by_name_new(), ast_endpoint_find_by_id(), ast_media_get_variants(), ast_sorcery_alloc(), ast_sorcery_copy(), ast_sorcery_create(), ast_sorcery_delete(), ast_sorcery_diff(), ast_sorcery_force_reload_object(), ast_sorcery_get_wizard_mapping(), ast_sorcery_get_wizard_mapping_count(), ast_sorcery_is_stale(), ast_sorcery_load_object(), ast_sorcery_object_fields_register(), ast_sorcery_object_set_copy_handler(), ast_sorcery_object_set_diff_handler(), ast_sorcery_objectset_apply(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_sorcery_observer_add(), ast_sorcery_observer_remove(), ast_sorcery_reload_object(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), ast_sorcery_update(), ast_taskprocessor_create_with_listener(), ast_taskprocessor_get(), authenticate_request(), bridge_cmp_cb(), bucket_file_wizard_retrieve(), bucket_rbtree_str_sort_cmp(), bucket_wizard_retrieve(), build_peer(), build_user(), conf_find_bridge(), conf_find_bridge_profile(), conf_find_user_profile(), conf_set_menu_to_user(), conference_bridge_cmp_cb(), conference_bridge_hash_cb(), find_member_by_queuename_and_interface(), find_peer(), http_server_get_by_addr(), iax2_destroy_helper(), jingle_action_hook(), jingle_endpoint_cmp(), jingle_endpoint_find(), jingle_endpoint_hash(), jingle_request(), jingle_session_cmp(), jingle_session_hash(), join_conference_bridge(), menu_cmp_cb(), named_item_find(), peer_cmp_cb(), peer_hash_cb(), protocol_cmp_fn(), protocol_hash_fn(), skel_find_or_create_state(), skel_level_find(), sorcery_memory_cmp(), sorcery_memory_hash(), sorcery_reloadable(), stasis_app_control_record(), stasis_app_playback_find_by_id(), stasis_app_recording_find_by_name(), tps_cmp_cb(), tps_hash_cb(), user_cmp_cb(), user_hash_cb(), xmpp_buddy_cmp(), xmpp_buddy_hash(), xmpp_client_service_discovery_result_hook(), xmpp_component_register_get_hook(), xmpp_config_cmp(), xmpp_config_find(), xmpp_pak_message(), xmpp_pak_presence(), xmpp_pak_s10n(), xmpp_resource_hash(), and xmpp_roster_hook().
#define OBJ_PARTIAL_KEY OBJ_SEARCH_PARTIAL_KEY |
Deprecated name
Definition at line 1152 of file astobj2.h.
Referenced by bridge_cmp_cb(), bucket_rbtree_str_sort_cmp(), conference_bridge_cmp_cb(), conference_bridge_hash_cb(), menu_cmp_cb(), and user_cmp_cb().
#define OBJ_POINTER OBJ_SEARCH_OBJECT |
Deprecated name
Definition at line 1150 of file astobj2.h.
Referenced by __find_callno(), ast_config_hook_unregister(), ast_get_indication_zone(), ast_get_namedgroups(), ast_rtp_ice_add_cand(), ast_unregister_indication_country(), bridge_cmp_cb(), bucket_rbtree_str_sort_cmp(), cli_alias_passthrough(), cli_fax_show_session(), conference_bridge_cmp_cb(), conference_bridge_hash_cb(), find_load_queue_rt_friendly(), find_queue_by_name_rt(), menu_cmp_cb(), named_acl_find(), queue_function_queuegetchannel(), queue_function_queuewaitingcount(), realtime_sqlite3_require(), reload_queue_members(), reload_single_member(), reload_single_queue(), remove_from_playbacks(), remove_from_queue(), update_queue(), and user_cmp_cb().
typedef int( ao2_callback_data_fn) (void *obj, void *arg, void *data, int flags) |
Type of a generic callback function.
obj | pointer to the (user-defined part) of an object. |
arg | callback argument from ao2_callback() |
data | arbitrary data from ao2_callback() |
flags | flags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'arg', is an object. OBJ_SEARCH_KEY - if set, 'arg', is a search key item that is not an object. OBJ_SEARCH_PARTIAL_KEY - if set, 'arg', is a partial search key item that is not an object. |
The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.
typedef int( ao2_callback_fn) (void *obj, void *arg, int flags) |
Type of a generic callback function.
obj | pointer to the (user-defined part) of an object. |
arg | callback argument from ao2_callback() |
flags | flags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'arg', is an object. OBJ_SEARCH_KEY - if set, 'arg', is a search key item that is not an object. OBJ_SEARCH_PARTIAL_KEY - if set, 'arg', is a partial search key item that is not an object. |
The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.
typedef void(* ao2_destructor_fn) (void *vdoomed) |
typedef int( ao2_hash_fn) (const void *obj, int flags) |
Type of a generic function to generate a hash value from an object.
obj | pointer to the (user-defined part) of an object. |
flags | flags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'obj', is an object. OBJ_SEARCH_KEY - if set, 'obj', is a search key item that is not an object. |
typedef void( ao2_prnt_fn) (void *where, const char *fmt,...) |
typedef void( ao2_prnt_obj_fn) (void *v_obj, void *where, ao2_prnt_fn *prnt) |
typedef int( ao2_sort_fn) (const void *obj_left, const void *obj_right, int flags) |
Type of generic container sort function.
obj_left | pointer to the (user-defined part) of an object. |
obj_right | pointer to the (user-defined part) of an object. |
flags | flags from ao2_callback() OBJ_SEARCH_OBJECT - if set, 'obj_right', is an object. OBJ_SEARCH_KEY - if set, 'obj_right', is a search key item that is not an object. OBJ_SEARCH_PARTIAL_KEY - if set, 'obj_right', is a partial search key item that is not an object. |
negtaive | if obj_left < obj_right |
0 | if obj_left == obj_right |
positive | if obj_left > obj_right |
enum _cb_results |
A callback function will return a combination of CMP_MATCH and CMP_STOP. The latter will terminate the search in a container.
Enumerator | |
---|---|
CMP_MATCH |
the object matches the request |
CMP_STOP |
stop the search now |
Definition at line 1026 of file astobj2.h.
enum ao2_alloc_opts |
Options available when allocating an ao2 object.
Definition at line 361 of file astobj2.h.
enum ao2_container_opts |
Options available when allocating an ao2 container object.
Definition at line 1161 of file astobj2.h.
enum ao2_iterator_flags |
Flags that can be passed to ao2_iterator_init() to modify the behavior of the iterator.
Enumerator | |
---|---|
AO2_ITERATOR_DONTLOCK |
Assume that the ao2_container is already locked.
|
AO2_ITERATOR_MALLOCD |
Indicates that the iterator was dynamically allocated by astobj2 API and should be freed by ao2_iterator_destroy(). |
AO2_ITERATOR_UNLINK |
Indicates that before the iterator returns an object from the container being iterated, the object should be unlinked from the container. |
AO2_ITERATOR_DESCENDING |
Iterate in descending order (Last to first container object) (Otherwise ascending order)
|
enum ao2_lock_req |
Which lock to request.
Enumerator | |
---|---|
AO2_LOCK_REQ_MUTEX |
Request the mutex lock be acquired. |
AO2_LOCK_REQ_RDLOCK |
Request the read lock be acquired. |
AO2_LOCK_REQ_WRLOCK |
Request the write lock be acquired. |
enum search_flags |
Flags passed to ao2_callback_fn(), ao2_hash_fn(), and ao2_sort_fn() to modify behaviour.
Enumerator | |
---|---|
OBJ_UNLINK |
Unlink the object for which the callback function returned CMP_MATCH. |
OBJ_NODATA |
On match, don't return the object hence do not increase its refcount. |
OBJ_MULTIPLE |
Don't stop at the first match in ao2_callback() unless the result of the callback function has the CMP_STOP bit set. |
OBJ_NOLOCK |
Assume that the ao2_container is already locked.
|
OBJ_SEARCH_MASK |
Search option field mask.
|
OBJ_SEARCH_NONE |
The arg parameter has no meaning to the astobj2 code. |
OBJ_SEARCH_OBJECT |
The arg parameter is an object of the same type. The arg parameter is an object of the same type as the one being searched for, so use the object's ao2_hash_fn and/or ao2_sort_fn functions for optimized searching.
|
OBJ_SEARCH_KEY |
The arg parameter is a search key, but is not an object. This can be used when you want to be able to pass custom data to the container's stored ao2_hash_fn, ao2_sort_fn, and ao2_find ao2_callback_fn functions that is not a full object, but perhaps just a string.
|
OBJ_SEARCH_PARTIAL_KEY |
The arg parameter is a partial search key similar to OBJ_SEARCH_KEY. The partial key can be used by the ao2_sort_fn to guide the search to find a contiguous subset of a sorted container. For example, a sorted container holds: "A", "B", "Bert", "Beth", "Earnie". Doing a partial key search with "B" will find the sorted subset of all held objects starting with "B".
|
OBJ_ORDER_MASK |
Traverse order option field mask. |
OBJ_ORDER_ASCENDING |
Traverse in ascending order (First to last container object) |
OBJ_ORDER_DESCENDING |
Traverse in descending order (Last to first container object) |
OBJ_ORDER_PRE |
Traverse in pre-order (Node then children, for tree container)
|
OBJ_ORDER_POST |
Traverse in post-order (Children then node, for tree container)
|
Definition at line 1034 of file astobj2.h.
void __ao2_cleanup | ( | void * | obj | ) |
gcc attribute(cleanup()) functions
Definition at line 677 of file astobj2.c.
References ao2_ref.
Referenced by agent_request_exec(), ast_ari_bridges_set_video_source(), bridge_agent_hold_push(), dial_bridge_after_cb(), and parking_set_duration().
void* __ao2_find | ( | struct ao2_container * | c, |
const void * | arg, | ||
enum search_flags | flags, | ||
const char * | tag, | ||
const char * | file, | ||
int | line, | ||
const char * | func | ||
) |
the find function just invokes the default callback with some reasonable flags.
Definition at line 427 of file astobj2_container.c.
References ao2_container::cmp_fn.
int __ao2_lock | ( | void * | a, |
enum ao2_lock_req | lock_how, | ||
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | var | ||
) |
Lock an object.
a | A pointer to the object we want to lock. |
lock_how,file,func,line,var |
Definition at line 222 of file astobj2.c.
References __INTERNAL_OBJ_CHECK, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_atomic_fetchadd_int(), __priv_data::lockused, ao2_rwlock_priv::num_lockers, and __priv_data::options.
int __ao2_trylock | ( | void * | a, |
enum ao2_lock_req | lock_how, | ||
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | var | ||
) |
Try locking– (don't block if fail)
a | A pointer to the object we want to lock. |
lock_how,file,func,line,var |
Definition at line 342 of file astobj2.c.
References __INTERNAL_OBJ_CHECK, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, AO2_LOCK_REQ_WRLOCK, ast_atomic_fetchadd_int(), __priv_data::lockused, ao2_rwlock_priv::num_lockers, and __priv_data::options.
int __ao2_unlock | ( | void * | a, |
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | var | ||
) |
Unlock an object.
a | A pointer to the object we want unlock. |
file,func,line,var |
Definition at line 288 of file astobj2.c.
References __INTERNAL_OBJ_CHECK, AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_ALLOC_OPT_LOCK_RWLOCK, ast_atomic_fetchadd_int(), ao2_rwlock_priv::num_lockers, and __priv_data::options.
int ao2_container_check | ( | struct ao2_container * | self, |
enum search_flags | flags | ||
) |
Perform an integrity check on the specified container.
self | Container to check integrity. |
flags | OBJ_NOLOCK if a lock is already held on the container. |
0 | on success. |
-1 | on error. |
Definition at line 856 of file astobj2_container.c.
int ao2_container_count | ( | struct ao2_container * | c | ) |
Returns the number of elements in a container.
return the number of elements in the container
Definition at line 34 of file astobj2_container.c.
References ast_atomic_fetchadd_int(), and ao2_container::elements.
Referenced by ao2_iterator_count(), app_is_finished(), ast_active_channels(), ast_ari_applications_list(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_endpoint_snapshot_create(), ast_get_namedgroups(), ast_merge_contexts_and_delete(), ast_namedgroups_intersect(), ast_rtp_ice_add_remote_candidate(), ast_rtp_ice_start(), ast_sorcery_create(), ast_sorcery_delete(), ast_sorcery_retrieve_by_fields(), ast_sorcery_retrieve_by_prefix(), ast_sorcery_retrieve_by_regex(), ast_sorcery_update(), ast_tone_zone_count(), calc_metric(), cli_fax_show_sessions(), control_command_count(), control_wait(), create_sound_blob(), handle_cli_sound_show(), handle_show_hint(), handle_show_hints(), locals_show(), object_type_loaded_observer(), one_protocol(), parking_lot_remove_if_unused(), pjsip_acf_dial_contacts_read(), print_queue(), process_config(), queue_exec(), queue_function_mem_read(), stasis_app_set_global_debug(), stasis_app_to_cli(), test_cel_peer_strings_match(), and unload_module().
void ao2_container_dump | ( | struct ao2_container * | self, |
enum search_flags | flags, | ||
const char * | name, | ||
void * | where, | ||
ao2_prnt_fn * | prnt, | ||
ao2_prnt_obj_fn * | prnt_obj | ||
) |
Display contents of the specified container.
self | Container to dump. |
flags | OBJ_NOLOCK if a lock is already held on the container. |
name | Container name. (NULL if anonymous) |
where | User data needed by prnt to determine where to put output. |
prnt | Print output callback function to use. |
prnt_obj | Callback function to print the given object's key. (NULL if not available) |
Definition at line 792 of file astobj2_container.c.
Referenced by test_traversal_sorted().
int ao2_container_dup | ( | struct ao2_container * | dest, |
struct ao2_container * | src, | ||
enum search_flags | flags | ||
) |
Copy all object references in the src container into the dest container.
dest | Container to copy src object references into. |
src | Container to copy all object references from. |
flags | OBJ_NOLOCK if a lock is already held on both containers. Otherwise, the src container is locked first. |
0 | on success. |
-1 | on error. |
Definition at line 673 of file astobj2_container.c.
References ao2_callback, and OBJ_MULTIPLE.
Referenced by __queues_show(), and handle_cli_sounds_show().
int ao2_container_dup_weakproxy_objs | ( | struct ao2_container * | dest, |
struct ao2_container * | src, | ||
enum search_flags | flags | ||
) |
Copy object references associated with src container weakproxies into the dest container.
dest | Container to copy src strong object references into. |
src | Container to copy all weak object references from. |
flags | OBJ_NOLOCK if a lock is already held on both containers. Otherwise, the src container is locked first. |
src
with no associated object is ignored.0 | on success. |
-1 | on error. |
Definition at line 726 of file astobj2_container.c.
References ao2_callback, dup_weakproxy_cb(), and OBJ_MULTIPLE.
int ao2_container_register | ( | const char * | name, |
struct ao2_container * | self, | ||
ao2_prnt_obj_fn * | prnt_obj | ||
) |
Register a container for CLI stats and integrity check.
name | Name to register the container under. |
self | Container to register. |
prnt_obj | Callback function to print the given object's key. (NULL if not available) |
0 | on success. |
-1 | on error. |
Definition at line 958 of file astobj2_container.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, and ao2_t_alloc_options.
Referenced by ast_bridging_init(), ast_channels_init(), ast_pbx_init(), load_module(), stasis_caching_topic_create(), stasis_state_manager_create(), and stasis_topic_pool_create().
void ao2_container_stats | ( | struct ao2_container * | self, |
enum search_flags | flags, | ||
const char * | name, | ||
void * | where, | ||
ao2_prnt_fn * | prnt | ||
) |
Display statistics of the specified container.
self | Container to display statistics. |
flags | OBJ_NOLOCK if a lock is already held on the container. |
name | Container name. (NULL if anonymous) |
where | User data needed by prnt to determine where to put output. |
prnt | Print output callback function to use. |
Definition at line 819 of file astobj2_container.c.
Referenced by test_traversal_sorted().
void ao2_container_unregister | ( | const char * | name | ) |
Unregister a container for CLI stats and integrity check.
name | Name the container is registered under. |
Definition at line 985 of file astobj2_container.c.
References ao2_t_find, and OBJ_SEARCH_KEY.
Referenced by load_module().
int ao2_iterator_count | ( | struct ao2_iterator * | iter | ) |
Get a count of the iterated container objects.
iter | the iterator to query |
Definition at line 630 of file astobj2_container.c.
References ao2_container_count(), and ao2_iterator::c.
void ao2_iterator_destroy | ( | struct ao2_iterator * | iter | ) |
Destroy a container iterator.
iter | the iterator to destroy |
This function will release the container reference held by the iterator and any other resources it may be holding.
Definition at line 534 of file astobj2_container.c.
References AO2_ITERATOR_MALLOCD, ao2_iterator_restart(), ao2_iterator::c, and ao2_iterator::flags.
Referenced by __queues_show(), aco_set_defaults(), action_coreshowchannelmap(), action_coreshowchannels(), add_ice_to_stream(), alias_show(), app_to_json(), ast_add_hint(), ast_ari_bridges_list(), ast_ari_channels_list(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_recordings_list_stored(), ast_bridge_channel_kick(), ast_bucket_file_json(), ast_bucket_json(), ast_cdr_setvar(), ast_channel_iterator_destroy(), ast_complete_channels(), ast_endpoint_snapshot_create(), ast_format_cache_get_by_codec(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_destroy(), ast_multi_channel_blob_get_channels(), ast_pickup_find_by_group(), ast_print_namedgroups(), ast_refer_var_iterator_destroy(), ast_rtp_ice_start(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), authenticate_reply(), bridge_app_subscribed_involved(), clear_stats(), cli_complete_show(), cli_fax_show_sessions(), complete_core_show_hint(), complete_mohclass_realtime(), complete_queue(), control_dispatch_all(), control_flush_queue(), control_prestart_dispatch_all(), coreshowchannelmap_add_connected_channels(), device_state_cb(), dump_queue_members(), event_session_shutdown(), fax_session_tab_complete(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), free_members(), get_member_status(), handle_bridge_pairings(), handle_cli_sound_show(), handle_kickmanconn(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_named_acl_cmd(), handle_showmanconn(), handle_voicemail_show_aliases(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_request(), load_users(), local_devicestate(), locals_show(), manager_iax2_show_peer_list(), manager_queues_status(), manager_queues_summary(), num_available_members(), parking_lot_get_space(), pjsip_acf_dial_contacts_read(), print_queue(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), qupd_exec(), reload_single_queue(), rt_handle_member_record(), rtp_add_candidates_to_ice(), set_config(), sla_calc_station_delays(), sla_queue_event_conf(), stasis_app_mailboxes_to_json(), stasis_app_to_cli(), update_queue(), and xmpp_pubsub_create_affiliations().
struct ao2_iterator ao2_iterator_init | ( | struct ao2_container * | c, |
int | flags | ||
) |
Create an iterator for a container.
c | the container |
flags | one or more flags from ao2_iterator_flags. |
This function will take a reference on the container being iterated.
initialize an iterator so we start from the first object
Definition at line 485 of file astobj2_container.c.
References ao2_iterator::c.
Referenced by __queues_show(), aco_set_defaults(), action_coreshowchannelmap(), action_coreshowchannels(), add_ice_to_stream(), alias_show(), app_to_json(), ast_add_hint(), ast_ari_bridges_list(), ast_ari_channels_list(), ast_ari_endpoints_list(), ast_ari_endpoints_list_by_tech(), ast_ari_recordings_list_stored(), ast_bridge_channel_kick(), ast_bucket_file_json(), ast_bucket_json(), ast_channel_iterator_all_new(), ast_complete_channels(), ast_endpoint_snapshot_create(), ast_format_cache_get_by_codec(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_init(), ast_pickup_find_by_group(), ast_print_namedgroups(), ast_refer_var_iterator_init(), ast_rtp_ice_start(), ast_sorcery_objectset_create2(), ast_sorcery_objectset_json_create(), ast_tone_zone_iterator_init(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), authenticate_reply(), bridge_app_subscribed_involved(), clear_stats(), cli_complete_show(), cli_fax_show_sessions(), complete_core_show_hint(), complete_mohclass_realtime(), complete_queue(), control_dispatch_all(), control_flush_queue(), control_prestart_dispatch_all(), coreshowchannelmap_add_connected_channels(), device_state_cb(), dump_queue_members(), event_session_shutdown(), fax_session_tab_complete(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), free_members(), get_member_status(), handle_bridge_pairings(), handle_cli_sound_show(), handle_kickmanconn(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_named_acl_cmd(), handle_showmanconn(), handle_voicemail_show_aliases(), jingle_add_google_candidates_to_transport(), jingle_add_ice_udp_candidates_to_transport(), jingle_request(), load_users(), local_devicestate(), locals_show(), manager_iax2_show_peer_list(), manager_queues_status(), manager_queues_summary(), num_available_members(), parking_lot_get_space(), pjsip_acf_dial_contacts_read(), print_queue(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), qupd_exec(), reload_single_queue(), rt_handle_member_record(), rtp_add_candidates_to_ice(), set_config(), sla_calc_station_delays(), sla_queue_event_conf(), stasis_app_mailboxes_to_json(), stasis_app_set_global_debug(), update_queue(), and xmpp_pubsub_create_affiliations().
void ao2_iterator_restart | ( | struct ao2_iterator * | iter | ) |
Restart an iteration.
iter | the iterator to restart |
Definition at line 497 of file astobj2_container.c.
References AO2_ITERATOR_DONTLOCK, AO2_LOCK_REQ_MUTEX, AO2_LOCK_REQ_RDLOCK, ao2_ref, ao2_iterator::c, ao2_iterator::complete, ao2_iterator::flags, and ao2_iterator::last_node.
Referenced by ao2_iterator_destroy().
int ao2_match_by_addr | ( | void * | user_data, |
void * | arg, | ||
int | flags | ||
) |
A common ao2_callback is one that matches by address.
A common ao2_callback is one that matches by address.
Definition at line 166 of file astobj2_container.c.
References CMP_MATCH, and CMP_STOP.
void* ao2_object_get_lockaddr | ( | void * | obj | ) |
Return the mutex lock address of an object.
[in] | obj | A pointer to the object we want. |
This function comes in handy mainly for debugging locking situations, where the locking trace code reports the lock address, this allows you to correlate against object address, to match objects to reported locks.
Definition at line 476 of file astobj2.c.
References AO2_ALLOC_OPT_LOCK_MASK, AO2_ALLOC_OPT_LOCK_MUTEX, and __priv_data::options.
Referenced by ast_rtp_ice_turn_request(), control_wait(), db_sync_thread(), ice_reset_session(), and stasis_subscription_join().
unsigned int ao2_options_get | ( | void * | obj | ) |
Retrieve the ao2 options used to create the object.
obj | pointer to the (user-defined part) of an object. |
Definition at line 781 of file astobj2.c.
References __priv_data::options.
|
inline |
Increment reference count on an object and lock it.
[in] | obj | A pointer to the ao2 object |
0 | The object is not an ao2 object or wasn't locked successfully |
1 | The object's reference count was incremented and was locked |
Definition at line 780 of file astobj2.h.
References ao2_ref.
|
inline |
Unlock an object and decrement its reference count.
[in] | obj | A pointer to the ao2 object |
0 | The object is not an ao2 object or wasn't unlocked successfully |
1 | The object was unlocked and it's reference count was decremented |
int ao2_weakproxy_subscribe | ( | void * | weakproxy, |
ao2_weakproxy_notification_cb | cb, | ||
void * | data, | ||
int | flags | ||
) |
Request notification when weakproxy points to NULL.
weakproxy | The weak object |
cb | Procedure to call when no real object is associated |
data | Passed to cb |
flags | OBJ_NOLOCK to avoid locking weakproxy. |
0 | Success |
-1 | Failure |
Definition at line 934 of file astobj2.c.
References ast_calloc, AST_LIST_INSERT_HEAD, and __priv_data::weakptr.
int ao2_weakproxy_unsubscribe | ( | void * | weakproxy, |
ao2_weakproxy_notification_cb | cb, | ||
void * | data, | ||
int | flags | ||
) |
Remove notification of real object destruction.
weakproxy | The weak object |
cb | Callback to remove from destroy notification list |
data | Data pointer to match |
flags | OBJ_NOLOCK to avoid locking weakproxy. OBJ_MULTIPLE to remove all copies of the same cb / data pair. |
0 | cb / data pair not found, nothing removed. |
-1 | Failure due to invalid parameters. |
Definition at line 973 of file astobj2.c.
References AST_LIST_REMOVE_CURRENT, AST_LIST_TRAVERSE_SAFE_BEGIN, AST_LIST_TRAVERSE_SAFE_END, and OBJ_MULTIPLE.