Fri Feb 10 06:34:57 2012

Asterisk developer's documentation


astobj2.h File Reference

#include "asterisk/compat.h"
#include "asterisk/linkedlists.h"

Include dependency graph for astobj2.h:

Go to the source code of this file.

Data Structures

struct  ao2_iterator
 When we need to walk through a container, we use an ao2_iterator to keep track of the current position. More...
#define ao2_alloc(data_size, destructor_fn)   __ao2_alloc((data_size), (destructor_fn))
#define ao2_t_alloc(data_size, destructor_fn, debug_msg)   __ao2_alloc((data_size), (destructor_fn))
 Allocate and initialize an object.
void * __ao2_alloc (const size_t data_size, ao2_destructor_fn destructor_fn)
void * __ao2_alloc_debug (const size_t data_size, ao2_destructor_fn destructor_fn, const char *tag, const char *file, int line, const char *funcname, int ref_debug)
#define ao2_callback(c, flags, cb_fn, arg)   __ao2_callback((c), (flags), (cb_fn), (arg))
#define ao2_t_callback(c, flags, cb_fn, arg, tag)   __ao2_callback((c), (flags), (cb_fn), (arg))
 ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.
void * __ao2_callback (struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg)
void * __ao2_callback_debug (struct ao2_container *c, enum search_flags flags, ao2_callback_fn *cb_fn, void *arg, const char *tag, char *file, int line, const char *funcname)

Object Containers

Here start declarations of containers.

#define ao2_container_alloc(arg1, arg2, arg3)   __ao2_container_alloc((arg1), (arg2), (arg3))
#define ao2_t_container_alloc(arg1, arg2, arg3, arg4)   __ao2_container_alloc((arg1), (arg2), (arg3))
 Allocate and initialize a container with the desired number of buckets.
struct ao2_container__ao2_container_alloc (const unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn)
struct ao2_container__ao2_container_alloc_debug (const unsigned int n_buckets, ao2_hash_fn *hash_fn, ao2_callback_fn *cmp_fn, const char *tag, char *file, int line, const char *funcname, int ref_debug)
int ao2_container_count (struct ao2_container *c)
 Returns the number of elements in a container.

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(arg1, arg2)   __ao2_link((arg1), (arg2), 0)
#define ao2_link_nolock(arg1, arg2)   __ao2_link((arg1), (arg2), OBJ_NOLOCK)
#define ao2_t_link(arg1, arg2, arg3)   __ao2_link((arg1), (arg2), 0)
 Add an object to a container.
#define ao2_t_link_nolock(arg1, arg2, arg3)   __ao2_link((arg1), (arg2), OBJ_NOLOCK)
#define ao2_t_unlink(arg1, arg2, arg3)   __ao2_unlink((arg1), (arg2), 0)
 Remove an object from a container.
#define ao2_t_unlink_nolock(arg1, arg2, arg3)   __ao2_unlink((arg1), (arg2), OBJ_NOLOCK)
#define ao2_unlink(arg1, arg2)   __ao2_unlink((arg1), (arg2), 0)
#define ao2_unlink_nolock(arg1, arg2)   __ao2_unlink((arg1), (arg2), OBJ_NOLOCK)
void * __ao2_link (struct ao2_container *c, void *newobj, int flags)
void * __ao2_link_debug (struct ao2_container *c, void *new_obj, int flags, const char *tag, char *file, int line, const char *funcname)
void * __ao2_unlink (struct ao2_container *c, void *obj, int flags)
void * __ao2_unlink_debug (struct ao2_container *c, void *obj, int flags, const char *tag, char *file, int line, const char *funcname)
#define ao2_ref(o, delta)   __ao2_ref((o), (delta))
#define ao2_t_ref(o, delta, tag)   __ao2_ref((o), (delta))
 Reference/unreference an object and return the old refcount.
int __ao2_ref (void *o, int delta)
int __ao2_ref_debug (void *o, int delta, const char *tag, char *file, int line, const char *funcname)

Defines

#define ao2_callback_data(arg1, arg2, arg3, arg4, arg5)   __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5))
#define ao2_find(arg1, arg2, arg3)   __ao2_find((arg1), (arg2), (arg3))
#define ao2_iterator_next(arg1)   __ao2_iterator_next((arg1))
#define ao2_lock(a)   __ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
#define ao2_t_callback_data(arg1, arg2, arg3, arg4, arg5, arg6)   __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5))
 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.
#define ao2_t_find(arg1, arg2, arg3, arg4)   __ao2_find((arg1), (arg2), (arg3))
#define ao2_t_iterator_next(arg1, arg2)   __ao2_iterator_next((arg1))
#define ao2_trylock(a)   __ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)
#define ao2_unlock(a)   __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

Typedefs

typedef int( ao2_callback_data_fn )(void *obj, void *arg, void *data, int flags)
 Type of a generic callback function.
typedef int( ao2_callback_fn )(void *obj, void *arg, int flags)
 Type of a generic callback function.
typedef void(* ao2_destructor_fn )(void *)
 Typedef for an object destructor. This is called just before freeing the memory for the object. It is passed a pointer to the user-defined data of the object.
typedef int( ao2_hash_fn )(const void *obj, const int flags)

Enumerations

enum  _cb_results { CMP_MATCH = 0x1, CMP_STOP = 0x2 }
 A callback function will return a combination of CMP_MATCH and CMP_STOP. The latter will terminate the search in a container. More...
enum  ao2_iterator_flags { AO2_ITERATOR_DONTLOCK = (1 << 0), AO2_ITERATOR_MALLOCD = (1 << 1), AO2_ITERATOR_UNLINK = (1 << 2) }
enum  search_flags {
  OBJ_UNLINK = (1 << 0), OBJ_NODATA = (1 << 1), OBJ_MULTIPLE = (1 << 2), OBJ_POINTER = (1 << 3),
  OBJ_CONTINUE = (1 << 4), OBJ_NOLOCK = (1 << 5), OBJ_KEY = (1 << 6)
}
 Flags passed to ao2_callback() and ao2_hash_fn() to modify its behaviour. More...

Functions

void * __ao2_callback_data (struct ao2_container *c, enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data)
void * __ao2_callback_data_debug (struct ao2_container *c, enum search_flags flags, ao2_callback_data_fn *cb_fn, void *arg, void *data, const char *tag, char *file, int line, const char *funcname)
void * __ao2_find (struct ao2_container *c, const void *arg, enum search_flags flags)
void * __ao2_find_debug (struct ao2_container *c, const void *arg, enum search_flags flags, const char *tag, char *file, int line, const char *funcname)
void * __ao2_iterator_next (struct ao2_iterator *a)
void * __ao2_iterator_next_debug (struct ao2_iterator *a, const char *tag, char *file, int line, const char *funcname)
int __ao2_lock (void *a, const char *file, const char *func, int line, const char *var)
 Lock an object.
int __ao2_trylock (void *a, const char *file, const char *func, int line, const char *var)
 Try locking-- (don't block if fail).
int __ao2_unlock (void *a, const char *file, const char *func, int line, const char *var)
 Unlock an object.
void ao2_bt (void)
void ao2_iterator_destroy (struct ao2_iterator *i)
 Destroy a container iterator.
struct ao2_iterator ao2_iterator_init (struct ao2_container *c, int flags)
 Create an iterator for a container.
void * ao2_object_get_lockaddr (void *obj)
 Return the lock address of an object.

Variables

ao2_callback_fn ao2_match_by_addr
 a very common callback is one that matches by address.


Detailed Description

Object Model implementing objects and containers.

Definition in file astobj2.h.


Define Documentation

#define ao2_alloc ( data_size,
destructor_fn   )     __ao2_alloc((data_size), (destructor_fn))

Definition at line 419 of file astobj2.h.

Referenced by __ast_channel_alloc_ap(), _ast_odbc_request_obj2(), _moh_class_malloc(), add_calltoken_ignore(), add_column_name(), alloc_event_ref(), ast_add_hint(), ast_bridge_new(), ast_calendar_event_alloc(), ast_dummy_channel_alloc(), ast_extension_state_add_destroy(), ast_format_attr_reg_interface(), ast_format_cap_add(), ast_manager_register2(), ast_msg_alloc(), ast_msg_tech_register(), ast_register_indication(), ast_rtp_instance_new(), ast_taskprocessor_get(), ast_tcptls_client_create(), ast_tcptls_server_root(), ast_tone_zone_alloc(), bridge_channel_alloc(), bridge_request(), build_calendar(), build_callno_limits(), build_device(), build_format_list_array(), build_mansession(), build_peer(), build_profile(), build_route(), build_user(), caldav_load_calendar(), calendar_query_exec(), chan_list_init(), conf_run(), create_callno_pools(), create_esc_entry(), create_parkinglot(), create_queue_member(), data_filter_alloc(), data_provider_new(), data_result_create(), data_search_alloc(), dialgroup_write(), ewscal_load_calendar(), exchangecal_load_calendar(), fax_detect_new(), fax_gateway_new(), fax_session_new(), fax_session_reserve(), format_list_add_custom(), format_list_add_static(), get_filestream(), ical_load_calendar(), inprocess_count(), join_conference_bridge(), kqueue_timer_open(), load_config(), load_odbc_config(), local_alloc(), msg_data_alloc(), multiplexed_bridge_create(), new_iax(), new_realtime_sqlite3_db(), parse_apps(), peercnt_add(), pthread_timer_open(), realtime_common(), session_details_new(), set_fn(), sip_monitor_instance_init(), sip_prepare_socket(), sip_tcptls_write(), sip_threadinfo_create(), softmix_bridge_create(), timerfd_timer_open(), try_calling(), and xml_translate().

#define ao2_callback ( c,
flags,
cb_fn,
arg   )     __ao2_callback((c), (flags), (cb_fn), (arg))

#define ao2_callback_data ( arg1,
arg2,
arg3,
arg4,
arg5   )     __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5))

Definition at line 955 of file astobj2.h.

Referenced by ast_channel_callback().

#define ao2_container_alloc ( arg1,
arg2,
arg3   )     __ao2_container_alloc((arg1), (arg2), (arg3))

#define ao2_find ( arg1,
arg2,
arg3   )     __ao2_find((arg1), (arg2), (arg3))

Definition at line 976 of file astobj2.h.

Referenced by __find_callno(), _lookup_timer(), action_confbridgekick(), action_confbridgelist(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), add_calltoken_ignore(), admin_exec(), ast_add_hint(), ast_cel_report_event(), ast_change_hint(), ast_event_get_cached(), ast_extension_state_add_destroy(), ast_extension_state_del(), ast_format_attr_reg_interface(), ast_format_attr_unreg_interface(), ast_format_cap_get_compatible_format(), ast_format_cap_iscompatible(), ast_get_indication_zone(), ast_merge_contexts_and_delete(), ast_msg_tech_register(), ast_msg_tech_unregister(), ast_remove_hint(), ast_taskprocessor_get(), ast_unregister_indication_country(), authenticate_request(), authenticate_verify(), build_callno_limits(), build_peer(), build_user(), check_manager_session_inuse(), cli_alias_passthrough(), cli_fax_show_session(), compare_weight(), complete_indications(), conf_run(), data_filter_find(), data_provider_find(), data_result_find_child(), data_search_find(), dialgroup_read(), dialgroup_write(), find_calendar(), find_database(), find_event(), find_hint_by_cb_id(), find_interface(), find_member_by_queuename_and_interface(), find_parkinglot(), find_peer(), find_profile(), find_pvt(), find_timer(), find_user(), func_confbridge_info(), generic_lock_unlock_helper(), generic_mute_unmute_helper(), get_esc_entry(), get_unused_callno(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_iax2_unregister(), handle_cli_indication_show(), iax2_destroy_helper(), inprocess_count(), join_conference_bridge(), meetmemute(), msg_data_find(), msg_send_exec(), parse_tone_zone(), peercnt_add(), peercnt_modify(), peercnt_remove_by_addr(), phoneprov_callback(), realtime_common(), realtime_sqlite3_require(), reload_single_member(), remove_from_queue(), sched_delay_remove(), set_fn(), sip_poke_peer_s(), timerfd_timer_ack(), timerfd_timer_close(), timerfd_timer_disable_continuous(), timerfd_timer_enable_continuous(), timerfd_timer_get_event(), timerfd_timer_set_rate(), update_queue(), and xml_translate().

#define ao2_iterator_next ( arg1   )     __ao2_iterator_next((arg1))

Definition at line 1138 of file astobj2.h.

Referenced by __ast_data_search_cmp_structure(), __ast_manager_event_multichan(), __data_result_print_cli(), __iax2_show_peers(), __queues_show(), action_confbridgelistrooms(), action_meetmelist(), alias_show(), ast_channel_iterator_next(), ast_data_iterator_next(), ast_data_search_match(), ast_format_cap_get_type(), ast_format_cap_has_joint(), ast_format_cap_has_type(), ast_format_cap_identical(), ast_format_cap_iter_next(), ast_format_cap_joint(), ast_format_cap_to_old_bitfield(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_next(), ast_srtp_unprotect(), ast_var_indications(), ast_var_indications_table(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), authenticate(), authenticate_reply(), build_dialplan_useage_map(), build_format_list_array(), calendar_query_exec(), check_access(), clear_queue(), cli_console_active(), cli_fax_show_sessions(), cli_list_devices(), cli_tps_report(), complete_confbridge_name(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_meetmecmd(), complete_queue_remove_member(), conf_queue_dtmf(), conf_run(), data_filter_find(), data_odbc_provider_handler(), data_provider_print_cli(), data_provider_release_all(), data_result_generate_node(), data_result_manager_output(), delete_profiles(), delete_routes(), delete_users(), destroy_pvts(), dialgroup_read(), do_parking_thread(), dump_queue_members(), extension_state_cb(), fax_session_tab_complete(), find_call(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), free_members(), get_member_status(), handle_cli_confbridge_list(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_indication_show(), handle_cli_odbc_show(), handle_feature_show(), handle_parkedcalls(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_routes(), handle_showmanconn(), handle_statechange(), hints_data_provider_get(), iax2_getpeername(), iax2_getpeertrunk(), interface_exists(), joint_copy_helper(), local_devicestate(), locals_show(), manager_iax2_show_peer_list(), manager_optimize_away(), manager_parking_status(), manager_queues_status(), manager_queues_summary(), meetme_show_cmd(), moh_rescan_files(), num_available_members(), peers_data_provider_get(), poke_all_peers(), pp_each_user_helper(), prune_peers(), prune_users(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queues_data_provider_get(), queues_data_provider_get_helper(), reload(), rt_handle_member_record(), stop_streams(), tps_taskprocessor_tab_complete(), try_calling(), unload_module(), update_realtime_members(), and users_data_provider_get().

#define ao2_link ( arg1,
arg2   )     __ao2_link((arg1), (arg2), 0)

Definition at line 791 of file astobj2.h.

Referenced by __ast_channel_alloc_ap(), _ast_odbc_request_obj2(), add_calltoken_ignore(), add_column_name(), add_new_event_cb(), add_to_queue(), ast_add_hint(), ast_change_hint(), ast_change_name(), ast_do_masquerade(), ast_extension_state_add_destroy(), ast_format_cap_add(), ast_merge_contexts_and_delete(), ast_msg_tech_register(), ast_register_indication_country(), ast_taskprocessor_get(), ast_taskprocessor_unreference(), build_calendar(), build_callno_limits(), build_device(), build_mansession(), build_parkinglot(), build_profile(), build_route(), caldav_add_event(), conf_run(), create_callno_pools(), create_dynamic_parkinglot(), create_new_sip_etag(), data_filter_add_child(), data_provider_add_child(), data_result_add_child(), data_search_add_child(), dialgroup_write(), endelm(), event_update_cache(), fax_session_new(), format_list_add_custom(), format_list_add_static(), get_lock(), icalendar_add_event(), inprocess_count(), join_conference_bridge(), kqueue_timer_open(), load_config(), local_alloc(), msg_set_var_full(), multiplexed_bridge_create(), odbc_register_class(), on_dns_update_peer(), parse_apps(), parse_config(), parse_tag(), peercnt_add(), pthread_timer_open(), realtime_common(), realtime_peer(), realtime_user(), reload_single_member(), replace_callno(), rt_handle_member_record(), set_config(), set_fn(), sip_monitor_instance_init(), store_by_peercallno(), store_by_transfercallno(), timerfd_timer_open(), and xml_translate().

#define ao2_link_nolock ( arg1,
arg2   )     __ao2_link((arg1), (arg2), OBJ_NOLOCK)

Definition at line 793 of file astobj2.h.

Referenced by ast_format_attr_reg_interface(), and ast_format_cap_add().

#define ao2_lock (  )     __ao2_lock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

Definition at line 477 of file astobj2.h.

Referenced by __ast_manager_event_multichan(), __queues_show(), _sip_show_peer(), _sip_show_peers(), _sip_tcp_helper_thread(), action_confbridgekick(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_kick_last(), action_toggle_mute_participants(), action_waitevent(), add_calltoken_ignore(), add_sdp(), add_to_queue(), ast_add_hint(), ast_bridge_change_state(), ast_bridge_depart(), ast_bridge_destroy(), ast_bridge_dtmf_stream(), ast_bridge_is_video_src(), ast_bridge_join(), ast_bridge_merge(), ast_bridge_number_video_src(), ast_bridge_remove(), ast_bridge_remove_video_src(), ast_bridge_set_internal_sample_rate(), ast_bridge_set_mixing_interval(), ast_bridge_set_single_src_video_mode(), ast_bridge_set_talker_src_video_mode(), ast_bridge_suspend(), ast_bridge_unsuspend(), ast_bridge_update_talker_src_video_mode(), ast_change_hint(), ast_do_masquerade(), ast_extension_state_add_destroy(), ast_extension_state_del(), ast_format_cap_iter_start(), ast_get_indication_tone(), ast_get_indication_zone(), ast_hook_send_action(), ast_manager_unregister(), ast_merge_contexts_and_delete(), ast_register_indication_country(), ast_remove_hint(), ast_set_indication_country(), ast_taskprocessor_get(), ast_taskprocessor_unreference(), ast_unregister_indication_country(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), attended_abort_transfer(), auth_http_callback(), awesome_locking(), bridge_channel_join(), bridge_channel_join_multithreaded(), bridge_channel_join_singlethreaded(), bridge_channel_suspend(), bridge_channel_thread(), bridge_channel_unsuspend(), bridge_hangup(), bridge_thread(), bridge_write(), build_callno_limits(), build_parkinglot(), build_peer(), build_reply_digest(), calendar_destructor(), change_callid_pvt(), check_bridge(), clear_stats(), cli_fax_show_sessions(), compare_weight(), complete_core_show_hint(), complete_queue_remove_member(), complete_sip_user(), conf_handle_dtmf(), conf_is_recording(), conf_run(), conf_start_record(), conf_stop_record(), create_addr_from_peer(), db_destructor(), db_open(), db_sync_thread(), destroy_gateway(), destroy_v21_sessions(), event_update_cache(), execute_menu_entry(), extension_state_cb(), find_member_by_queuename_and_interface(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), func_confbridge_info(), generic_fax_exec(), generic_http_callback(), generic_lock_unlock_helper(), generic_mute_unmute_helper(), generic_thread_loop(), get_input(), get_member_penalty(), get_member_status(), get_unused_callno(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_start_record(), handle_cli_misdn_send_facility(), handle_request_subscribe(), handle_show_hint(), handle_show_hints(), handle_showmanconn(), handle_statechange(), handle_video_on_exit(), handle_video_on_join(), inprocess_count(), internal_ao2_callback(), internal_ao2_iterator_next(), internal_ao2_link(), is_our_turn(), join_conference_bridge(), join_queue(), leave_conference_bridge(), leave_queue(), load_indications(), local_answer(), local_bridgedchannel(), local_call(), local_digit_begin(), local_digit_end(), local_fixup(), local_indicate(), local_queryoption(), local_queue_frame(), local_sendhtml(), local_sendtext(), local_setoption(), local_write(), locals_show(), manager_optimize_away(), manager_queues_status(), manager_queues_summary(), moh_class_destructor(), moh_release(), mohalloc(), monmp3thread(), msg_data_func_read(), msg_data_func_write(), msg_func_read(), msg_func_write(), msg_send_exec(), multiplexed_add_or_remove(), multiplexed_bridge_create(), multiplexed_bridge_destroy(), multiplexed_thread_function(), on_dns_update_peer(), peercnt_add(), peercnt_remove(), peers_data_provider_get(), play_prompt_to_channel(), post_join_marked(), post_join_unmarked(), process_events(), process_message(), pthread_timer_ack(), pthread_timer_disable_continuous(), pthread_timer_enable_continuous(), pthread_timer_get_event(), pthread_timer_open(), pthread_timer_set_rate(), purge_sessions(), queue_function_mem_read(), queue_function_mem_write(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), queues_data_provider_get(), realtime_sqlite3_execute_handle(), recalc_holdtime(), record_abandoned(), record_thread(), register_verify(), reload_queues(), reload_single_queue(), remove_from_queue(), replace_callno(), ring_entry(), rna(), run_timer(), schedule_calendar_event(), session_do(), set_eventmask(), set_member_paused(), set_member_penalty_help_members(), set_queue_variables(), sip_poke_all_peers(), sip_prune_realtime(), sip_send_mwi_to_peer(), sip_show_inuse(), sip_show_user(), sip_show_users(), sip_tcptls_write(), smart_bridge_operation(), softmix_bridge_thread(), spandsp_fax_cli_show_session(), timerfd_timer_ack(), timerfd_timer_disable_continuous(), timerfd_timer_enable_continuous(), timerfd_timer_get_event(), timerfd_timer_set_rate(), try_calling(), update_call_counter(), update_queue(), and update_realtime_members().

#define ao2_ref ( o,
delta   )     __ao2_ref((o), (delta))

Definition at line 461 of file astobj2.h.

Referenced by __ast_channel_alloc_ap(), __ast_data_add(), __ast_data_register(), __ast_data_search_cmp_structure(), __data_result_print_cli(), __find_callno(), __queues_show(), __sip_destroy(), __unload_module(), _ast_odbc_request_obj2(), _sip_tcp_helper_thread(), acf_faxopt_read(), acf_faxopt_write(), action_confbridgekick(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_confbridgestoprecord(), action_meetmelist(), add_calltoken_ignore(), add_cc_call_info_to_response(), add_column_name(), add_event_to_list(), add_hintdevice(), add_to_queue(), admin_exec(), alias_show(), announce_thread(), ao2_iterator_destroy(), ao2_iterator_init(), app_exec(), ast_add_hint(), ast_bridge_destroy(), ast_bridge_impart(), ast_bridge_join(), ast_bridge_merge(), ast_bridge_new(), ast_calendar_unref_event(), ast_cel_engine_init(), ast_cel_engine_term(), ast_cel_report_event(), ast_change_hint(), ast_closestream(), ast_config_text_file_save(), ast_data_free(), ast_data_iterator_end(), ast_data_iterator_next(), ast_data_search_match(), ast_event_get_cached(), ast_event_queue(), ast_extension_state_add_destroy(), ast_extension_state_del(), ast_format_attr_init(), ast_format_attr_reg_interface(), ast_format_attr_unreg_interface(), ast_format_cap_add(), ast_format_cap_destroy(), ast_format_cap_get_compatible_format(), ast_format_cap_get_type(), ast_format_cap_has_joint(), ast_format_cap_has_type(), ast_format_cap_identical(), ast_format_cap_iscompatible(), ast_format_cap_iter_next(), ast_format_cap_joint(), ast_format_cap_remove(), ast_format_cap_to_old_bitfield(), ast_format_get_value(), ast_format_list_destroy(), ast_format_list_get(), ast_format_list_init(), ast_merge_contexts_and_delete(), ast_msg_alloc(), ast_msg_destroy(), ast_msg_get_var(), ast_msg_queue(), ast_msg_tech_register(), ast_msg_tech_unregister(), ast_msg_var_iterator_next(), ast_msg_var_unref_current(), ast_remove_hint(), ast_rtcp_write(), ast_rtp_instance_destroy(), ast_rtp_instance_make_compatible(), ast_rtp_instance_new(), ast_rtp_prop_set(), ast_rtp_raw_write(), ast_rtp_read(), ast_rtp_stop(), ast_taskprocessor_get(), ast_taskprocessor_unreference(), ast_tcptls_client_create(), ast_tcptls_client_start(), ast_tcptls_server_root(), ast_tone_zone_ref(), ast_tone_zone_sound_ref(), ast_tone_zone_sound_unref(), ast_tone_zone_unref(), bridge_channel_alloc(), bridge_channel_destroy(), bridge_channel_join(), bridge_channel_thread(), bridge_hangup(), bridge_request(), bridge_thread(), build_callno_limits(), build_conf(), build_dialplan_useage_map(), build_format_list_array(), build_mansession(), caldav_destructor(), calendar_destructor(), calendar_devstate_change(), calendar_event_notify(), callattempt_free(), calltoken_required(), cb_events(), cc_handle_publish_error(), chan_cleanup(), chan_list_destructor(), channel_admin_exec(), clear_queue(), cli_alias_passthrough(), cli_fax_show_session(), cli_fax_show_sessions(), cli_tps_ping(), cli_tps_report(), compare_weight(), complete_confbridge_name(), complete_core_show_hint(), complete_meetmecmd(), complete_queue_remove_member(), conf_free(), conf_queue_dtmf(), conf_run(), conf_start_record(), copy_parkinglot(), copy_socket_data(), create_callno_pools(), create_esc_entry(), data_filter_add_nodes(), data_filter_alloc(), data_filter_destructor(), data_filter_find(), data_filter_generate(), data_filter_release(), data_odbc_provider_handler(), data_provider_create(), data_provider_destructor(), data_provider_find(), data_provider_new(), data_provider_print_cli(), data_provider_release(), data_provider_release_all(), data_result_create(), data_result_destructor(), data_result_find_child(), data_result_generate(), data_result_generate_node(), data_result_get_node(), data_result_manager_output(), data_search_alloc(), data_search_cmp_bool(), data_search_cmp_char(), data_search_cmp_dbl(), data_search_cmp_int(), data_search_cmp_ipaddr(), data_search_cmp_ptr(), data_search_cmp_string(), data_search_cmp_uint(), data_search_create(), data_search_destructor(), data_search_find(), data_search_get_node(), data_search_release(), db_start_batch(), destroy_callback(), destroy_escs(), destroy_faxdetect(), destroy_gateway(), destroy_hint(), destroy_queue(), destroy_session(), destroy_v21_sessions(), dialgroup_read(), dialgroup_write(), dialog_ref_debug(), dialog_unref_debug(), do_notify(), do_parking_thread(), dump_queue_members(), end_bridge_callback(), end_bridge_callback_data_fixup(), event_notification_duplicate(), event_update_cache(), eventlist_destroy(), eventlist_destructor(), eventlist_duplicate(), ewscal_destructor(), exchangecal_destructor(), expire_register(), extension_state_cb(), fax_detect_attach(), fax_detect_framehook_destroy(), fax_detect_new(), fax_gateway_attach(), fax_gateway_detect_t38(), 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(), find_details(), find_hint_by_cb_id(), find_or_create_details(), find_queue_by_name_rt(), format_cmp_helper(), format_isset_helper(), format_joint_helper(), format_set_helper(), free_members(), func_confbridge_info(), generic_fax_exec(), generic_lock_unlock_helper(), generic_mute_unmute_helper(), get_destination(), get_member_penalty(), get_member_status(), group_destroy(), gtalk_get_rtp_peer(), handle_cc_notify(), handle_cc_subscribe(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_start_record(), handle_cli_confbridge_stop_record(), handle_cli_iax2_set_debug(), handle_cli_iax2_show_callno_limits(), handle_cli_odbc_show(), handle_event(), handle_feature_show(), handle_parkedcalls(), handle_queue_remove_member(), handle_show_hint(), handle_show_hints(), handle_sip_publish_initial(), handle_sip_publish_modify(), handle_sip_publish_refresh(), handle_sip_publish_remove(), handle_statechange(), handle_tcptls_connection(), has_interface(), hintdevice_destroy(), hints_data_provider_get(), httpd_helper_thread(), iax2_destroy(), icalendar_destructor(), inprocess_count(), interface_exists(), internal_ao2_callback(), jingle_get_rtp_peer(), join_conference_bridge(), joint_copy_helper(), kqueue_timer_close(), kqueue_timer_disable_continuous(), kqueue_timer_enable_continuous(), kqueue_timer_get_event(), kqueue_timer_open(), kqueue_timer_set_rate(), leave_conference_bridge(), load_config(), load_module(), load_objects(), load_odbc_config(), local_alloc(), local_answer(), local_call(), local_devicestate(), local_digit_begin(), local_digit_end(), local_hangup(), local_indicate(), local_request(), local_sendhtml(), local_sendtext(), local_setoption(), local_write(), locals_show(), manager_optimize_away(), manager_parking_status(), manager_queues_status(), manager_queues_summary(), manager_remove_queue_member(), meetme_show_cmd(), meetmemute(), mgcp_get_rtp_peer(), misdn_attempt_transfer(), moh_rescan_files(), msg_data_alloc(), msg_data_func_read(), msg_data_func_write(), msg_destructor(), msg_ds_destroy(), msg_func_read(), msg_func_write(), msg_q_cb(), msg_send_exec(), msg_set_var_full(), multiplexed_add_or_remove(), multiplexed_bridge_create(), multiplexed_bridge_destroy(), multiplexed_thread_function(), new_iax(), num_available_members(), odbc_class_destructor(), odbc_obj_destructor(), odbc_release_obj2(), oh323_get_rtp_peer(), parkinglot_addref(), parkinglot_unref(), parse_apps(), parse_moved_contact(), peer_ref(), peer_unref(), peercnt_add(), peercnt_modify(), peercnt_remove_by_addr(), peercnt_remove_cb(), peers_data_provider_get(), pthread_timer_ack(), pthread_timer_close(), pthread_timer_disable_continuous(), pthread_timer_enable_continuous(), pthread_timer_get_event(), pthread_timer_open(), pthread_timer_set_rate(), publish_expire(), queue_function_mem_read(), queue_function_mem_write(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_ref(), queue_unref(), queues_data_provider_get_helper(), realtime_common(), realtime_sqlite3_execute(), realtime_sqlite3_require(), receivefax_exec(), record_thread(), ref_proxy(), ref_pvt(), reload(), reload_single_member(), remove_from_queue(), replace_callno(), rna(), rqm_exec(), rt_handle_member_record(), sched_delay_remove(), sendfax_exec(), session_details_new(), session_do(), set_fn(), set_member_paused(), set_member_penalty_help_members(), set_peercnt_limit(), set_socket_transport(), sip_cc_monitor_suspend(), sip_destroy_peer(), sip_get_rtp_peer(), sip_get_trtp_peer(), sip_get_vrtp_peer(), sip_handle_cc(), sip_monitor_instance_init(), sip_prepare_socket(), sip_tcp_locate(), skinny_get_rtp_peer(), skinny_get_vrtp_peer(), softmix_bridge_create(), softmix_bridge_destroy(), softmix_bridge_thread(), spandsp_fax_gw_gen_alloc(), spandsp_fax_gw_gen_release(), timerfd_timer_ack(), timerfd_timer_close(), timerfd_timer_disable_continuous(), timerfd_timer_enable_continuous(), timerfd_timer_get_event(), timerfd_timer_open(), timerfd_timer_set_rate(), tps_taskprocessor_tab_complete(), transmit_publish(), try_calling(), unistim_get_rtp_peer(), unload_module(), unref_caldav(), unref_calendar(), unref_db(), unref_ewscal(), unref_exchangecal(), unref_icalendar(), unref_instance_cond(), unref_mansession(), unref_profile(), unref_pvt(), unref_route(), unref_user(), update_queue(), update_realtime_members(), user_ref(), user_unref(), and xml_translate().

#define ao2_t_alloc ( data_size,
destructor_fn,
debug_msg   )     __ao2_alloc((data_size), (destructor_fn))

Allocate and initialize an object.

Parameters:
data_size The sizeof() of the user-defined structure.
destructor_fn The destructor function (can be NULL)
debug_msg 
Returns:
A pointer to user-data.
Allocates a struct astobj2 with sufficient space for the user-defined structure.
Note:
  • storage is zeroed; XXX maybe we want a flag to enable/disable this.
  • the refcount of the object just created is 1
  • the returned pointer cannot be free()'d or realloc()'ed; rather, we just call ao2_ref(o, -1);

Definition at line 418 of file astobj2.h.

Referenced by add_hintdevice(), add_realm_authentication(), alloc_queue(), ast_srtp_policy_alloc(), build_peer(), cc_agent_init(), cc_core_init_instance(), cc_device_monitor_init(), cc_extension_monitor_init(), cc_interfaces_datastore_init(), create_epa_entry(), create_new_generic_list(), manager_add_filter(), sip_alloc(), and temp_peer().

#define ao2_t_callback ( c,
flags,
cb_fn,
arg,
tag   )     __ao2_callback((c), (flags), (cb_fn), (arg))

ao2_callback() is a generic function that applies cb_fn() to all objects in a container, as described below.

Parameters:
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.
  • If OBJ_NODATA is set, ao2_callback will return NULL. No refcounts of any of the traversed objects will be incremented. On the converse, if it is NOT set (the default), The ref count of each object for which CMP_MATCH was set will be incremented, and you will have no way of knowing which those are, until the multiple-object-return functionality is implemented.
  • If OBJ_POINTER is set, the traversed items will be restricted to the objects in the bucket that the object key hashes to.
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.
tag used for debugging.
Returns:
when OBJ_MULTIPLE is not included in the flags parameter, the return value will be either the object found or NULL if no no matching object was found. if OBJ_MULTIPLE is included, the return value will be a pointer to an ao2_iterator object, which must be destroyed with ao2_iterator_destroy() when the caller no longer needs it.
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:

  • to perform some action (including removal from the container) on one or more objects; in this case, cb_fn() can modify the object itself, and to perform deletion should set CMP_MATCH on the matching objects, and have OBJ_UNLINK set in flags.
  • to look for a specific object in a container; in this case, cb_fn() should not modify the object, but just return a combination of CMP_MATCH and CMP_STOP on the desired object. Other usages are also possible, of course.

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 p pointer can be a pointer to an object or to a key, we can say this looking at flags value. If p 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 valued.

The use of flags argument is the follow:

OBJ_UNLINK unlinks the object found OBJ_NODATA on match, do return an object Callbacks use OBJ_NODATA as a default functions such as find() do OBJ_MULTIPLE return multiple matches Default is no. OBJ_POINTER the pointer is an object pointer

Note:
When the returned object is no longer in use, ao2_ref() should be used to free the additional reference possibly created by this function.

Definition at line 921 of file astobj2.h.

Referenced by __init_manager(), ast_cc_agent_callback(), ast_cc_monitor_count(), ast_moh_destroy(), ast_srtp_destroy(), cc_cli_output_status(), do_monitor(), find_call(), get_mohbydigit(), handle_cc_kill(), handle_statechange(), load_config(), load_moh_classes(), reload_config(), remove_hintdevice(), session_destructor(), sip_show_channels(), sip_show_channelstats(), sip_show_objects(), unlink_peers_from_tables(), and unload_module().

#define ao2_t_callback_data ( arg1,
arg2,
arg3,
arg4,
arg5,
arg6   )     __ao2_callback_data((arg1), (arg2), (arg3), (arg4), (arg5))

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_POINTER as part of the flags argument (which in turn requires passing in a prototype ao2 object 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.

See also:
ao2_callback()

Definition at line 954 of file astobj2.h.

Referenced by cccancel_exec(), ccreq_exec(), ccss_device_state(), count_agents(), kill_duplicate_offers(), match_filter(), and sip_find_peer_full().

#define ao2_t_container_alloc ( arg1,
arg2,
arg3,
arg4   )     __ao2_container_alloc((arg1), (arg2), (arg3))

Allocate and initialize a container with the desired number of buckets.

We allocate space for a struct astobj_container, struct container and the buckets[] array.

Parameters:
arg1 Number of buckets for hash
arg2 Pointer to a function computing a hash value.
arg3 Pointer to a compare function used by ao2_find. (NULL to match everything)
arg4 used for debugging.
Returns:
A pointer to a struct container.
Note:
Destructor is set implicitly.

Definition at line 737 of file astobj2.h.

Referenced by ast_cc_init(), load_module(), and res_srtp_new().

#define ao2_t_find ( arg1,
arg2,
arg3,
arg4   )     __ao2_find((arg1), (arg2), (arg3))

#define ao2_t_iterator_next ( arg1,
arg2   )     __ao2_iterator_next((arg1))

#define ao2_t_link ( arg1,
arg2,
arg3   )     __ao2_link((arg1), (arg2), 0)

Add an object to a container.

Parameters:
arg1 the container to operate on.
arg2 the object to be added.
arg3 used for debugging.
Return values:
NULL on errors.
newobj on success.
This function inserts an object in a container according its key.

Note:
Remember to set the key before calling this function.

This function automatically increases the reference count to account for the reference that the container now holds to the object.

Definition at line 790 of file astobj2.h.

Referenced by _moh_register(), add_hintdevice(), add_sdp(), ast_srtp_add_stream(), ast_srtp_create(), authenticate(), cc_core_init_instance(), change_callid_pvt(), create_new_generic_list(), manager_add_filter(), parse_register_contact(), pvt_set_needdestroy(), realtime_peer(), register_verify(), reload_config(), sip_alloc(), sip_prune_realtime(), and sip_threadinfo_create().

#define ao2_t_link_nolock ( arg1,
arg2,
arg3   )     __ao2_link((arg1), (arg2), OBJ_NOLOCK)

Definition at line 792 of file astobj2.h.

#define ao2_t_ref ( o,
delta,
tag   )     __ao2_ref((o), (delta))

Reference/unreference an object and return the old refcount.

Parameters:
o A pointer to the object
delta Value to add to the reference counter.
tag used for debugging
Returns:
The value of the reference counter before the operation.
Increase/decrease the reference counter according the value of delta.

If the refcount goes to zero, the object is destroyed.

Note:
The object must not be locked by the caller of this function, as it is invalid to try to unlock it after releasing the reference.

if we know the pointer to an object, it is because we have a reference count to it, so the only case when the object can go away is when we release our reference, and it is the last one in existence.

Definition at line 460 of file astobj2.h.

Referenced by __init_manager(), __sip_destroy(), _sip_show_peer(), _sip_tcp_helper_thread(), action_find(), add_hintdevice(), ast_hook_send_action(), ast_manager_register2(), ast_manager_register_struct(), ast_manager_unregister(), ast_srtp_add_stream(), ast_srtp_change_source(), ast_srtp_destroy(), ast_srtp_policy_destroy(), ast_srtp_unprotect(), authenticate(), build_peer(), build_reply_digest(), cc_ref(), cc_unref(), check_peer_ok(), create_addr_from_peer(), dialog_dump_func(), handle_request_do(), handle_statechange(), local_attended_transfer(), manager_add_filter(), peer_dump_func(), process_message(), reload_config(), session_destructor(), sip_alloc(), sip_call(), sip_cc_monitor_cancel_available_timer(), sip_cc_monitor_request_cc(), sip_destroy_peer(), sip_monitor_instance_destructor(), sip_prepare_socket(), sip_ref_peer(), sip_show_channel(), sip_show_history(), sip_show_settings(), sip_show_tcp(), sip_tcp_locate(), sip_tcptls_write(), sip_threadinfo_create(), sip_threadinfo_destructor(), sip_unref_peer(), temp_peer(), and unload_module().

#define ao2_t_unlink ( arg1,
arg2,
arg3   )     __ao2_unlink((arg1), (arg2), 0)

Remove an object from a container.

Parameters:
arg1 the container
arg2 the object to unlink
arg3 tag for debugging
Return values:
NULL,always 
Note:
The object requested to be unlinked must be valid. However, if it turns out that it is not in the container, this function is still safe to be called.

If the object gets unlinked from the container, the container's reference to the object will be automatically released. (The refcount will be decremented).

Definition at line 826 of file astobj2.h.

Referenced by _sip_tcp_helper_thread(), add_sdp(), build_peer(), cc_complete(), cc_failed(), cc_generic_monitor_destructor(), dialog_unlink_all(), expire_register(), parse_register_contact(), sip_prepare_socket(), sip_prune_realtime(), and unlink_peer_from_tables().

#define ao2_t_unlink_nolock ( arg1,
arg2,
arg3   )     __ao2_unlink((arg1), (arg2), OBJ_NOLOCK)

Definition at line 828 of file astobj2.h.

#define ao2_trylock (  )     __ao2_trylock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

#define ao2_unlink ( arg1,
arg2   )     __ao2_unlink((arg1), (arg2), 0)

#define ao2_unlink_nolock ( arg1,
arg2   )     __ao2_unlink((arg1), (arg2), OBJ_NOLOCK)

Definition at line 829 of file astobj2.h.

#define ao2_unlock (  )     __ao2_unlock(a, __FILE__, __PRETTY_FUNCTION__, __LINE__, #a)

Definition at line 486 of file astobj2.h.

Referenced by __ao2_iterator_next(), __ao2_iterator_next_debug(), __ao2_link(), __ao2_link_debug(), __ast_manager_event_multichan(), __queues_show(), _sip_show_peer(), _sip_show_peers(), _sip_tcp_helper_thread(), action_confbridgekick(), action_confbridgelist(), action_confbridgelistrooms(), action_confbridgesetsinglevideosrc(), action_confbridgestartrecord(), action_kick_last(), action_toggle_mute_participants(), action_waitevent(), add_calltoken_ignore(), add_sdp(), add_to_queue(), ast_add_hint(), ast_bridge_change_state(), ast_bridge_depart(), ast_bridge_destroy(), ast_bridge_dtmf_stream(), ast_bridge_is_video_src(), ast_bridge_join(), ast_bridge_merge(), ast_bridge_number_video_src(), ast_bridge_remove(), ast_bridge_remove_video_src(), ast_bridge_set_internal_sample_rate(), ast_bridge_set_mixing_interval(), ast_bridge_set_single_src_video_mode(), ast_bridge_set_talker_src_video_mode(), ast_bridge_suspend(), ast_bridge_unsuspend(), ast_bridge_update_talker_src_video_mode(), ast_change_hint(), ast_do_masquerade(), ast_extension_state_add_destroy(), ast_extension_state_del(), ast_format_cap_iter_end(), ast_get_indication_tone(), ast_get_indication_zone(), ast_hook_send_action(), ast_manager_unregister(), ast_merge_contexts_and_delete(), ast_register_indication_country(), ast_remove_hint(), ast_set_indication_country(), ast_taskprocessor_get(), ast_taskprocessor_unreference(), ast_unregister_indication_country(), astman_is_authed(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), attended_abort_transfer(), auth_http_callback(), awesome_locking(), bridge_channel_join(), bridge_channel_join_multithreaded(), bridge_channel_join_singlethreaded(), bridge_channel_suspend(), bridge_channel_thread(), bridge_channel_unsuspend(), bridge_hangup(), bridge_thread(), bridge_write(), build_callno_limits(), build_parkinglot(), build_peer(), build_reply_digest(), caldav_load_calendar(), calendar_destructor(), change_callid_pvt(), check_bridge(), clear_stats(), cli_fax_show_sessions(), compare_weight(), complete_core_show_hint(), complete_queue_remove_member(), complete_sip_user(), conf_handle_dtmf(), conf_is_recording(), conf_run(), conf_start_record(), conf_stop_record(), create_addr_from_peer(), db_destructor(), db_open(), db_sync_thread(), destroy_gateway(), destroy_v21_sessions(), event_update_cache(), ewscal_load_calendar(), exchangecal_load_calendar(), execute_menu_entry(), extension_state_cb(), find_member_by_queuename_and_interface(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), func_confbridge_info(), generic_fax_exec(), generic_http_callback(), generic_lock_unlock_helper(), generic_mute_unmute_helper(), generic_thread_loop(), get_input(), get_member_penalty(), get_member_status(), get_unused_callno(), handle_cli_confbridge_kick(), handle_cli_confbridge_list(), handle_cli_confbridge_start_record(), handle_cli_misdn_send_facility(), handle_request_subscribe(), handle_show_hint(), handle_show_hints(), handle_showmanconn(), handle_statechange(), handle_video_on_exit(), handle_video_on_join(), ical_load_calendar(), inprocess_count(), internal_ao2_callback(), is_our_turn(), join_conference_bridge(), join_queue(), leave_conference_bridge(), leave_queue(), load_indications(), local_answer(), local_bridgedchannel(), local_call(), local_digit_begin(), local_digit_end(), local_fixup(), local_hangup(), local_indicate(), local_queryoption(), local_queue_frame(), local_sendhtml(), local_sendtext(), local_setoption(), local_write(), locals_show(), manager_optimize_away(), manager_queues_status(), manager_queues_summary(), moh_class_destructor(), moh_release(), mohalloc(), monmp3thread(), msg_data_func_read(), msg_data_func_write(), msg_func_read(), msg_func_write(), msg_send_exec(), multiplexed_add_or_remove(), multiplexed_bridge_create(), multiplexed_bridge_destroy(), multiplexed_thread_function(), on_dns_update_peer(), peercnt_add(), peercnt_remove(), peers_data_provider_get(), play_prompt_to_channel(), post_join_marked(), post_join_unmarked(), process_events(), process_message(), pthread_timer_ack(), pthread_timer_disable_continuous(), pthread_timer_enable_continuous(), pthread_timer_get_event(), pthread_timer_open(), pthread_timer_set_rate(), purge_sessions(), queue_function_mem_read(), queue_function_mem_write(), queue_function_qac_dep(), queue_function_queuememberlist(), queue_function_queuewaitingcount(), queue_function_var(), queues_data_provider_get(), realtime_sqlite3_execute_handle(), recalc_holdtime(), record_abandoned(), record_thread(), register_verify(), reload_queues(), reload_single_queue(), remove_from_queue(), replace_callno(), ring_entry(), rna(), run_timer(), schedule_calendar_event(), session_do(), set_eventmask(), set_member_paused(), set_member_penalty_help_members(), set_queue_variables(), sip_poke_all_peers(), sip_prune_realtime(), sip_send_mwi_to_peer(), sip_show_inuse(), sip_show_user(), sip_show_users(), sip_tcptls_write(), smart_bridge_operation(), softmix_bridge_thread(), spandsp_fax_cli_show_session(), timerfd_timer_ack(), timerfd_timer_disable_continuous(), timerfd_timer_enable_continuous(), timerfd_timer_get_event(), timerfd_timer_set_rate(), try_calling(), update_call_counter(), update_queue(), and update_realtime_members().


Typedef Documentation

typedef int( ao2_callback_data_fn)(void *obj, void *arg, void *data, int flags)

Type of a generic callback function.

Parameters:
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()
The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.

Definition at line 632 of file astobj2.h.

typedef int( ao2_callback_fn)(void *obj, void *arg, int flags)

Type of a generic callback function.

Parameters:
obj pointer to the (user-defined part) of an object.
arg callback argument from ao2_callback()
flags flags from ao2_callback()
The return values are a combination of enum _cb_results. Callback functions are used to search or manipulate objects in a container.

Definition at line 620 of file astobj2.h.

typedef void(* ao2_destructor_fn)(void *)

Typedef for an object destructor. This is called just before freeing the memory for the object. It is passed a pointer to the user-defined data of the object.

Definition at line 384 of file astobj2.h.

typedef int( ao2_hash_fn)(const void *obj, const int flags)

Type of a generic function to generate a hash value from an object. flags is ignored at the moment. Eventually, it will include the value of OBJ_POINTER passed to ao2_callback().

Definition at line 700 of file astobj2.h.


Enumeration Type Documentation

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 641 of file astobj2.h.

00641                  {
00642    CMP_MATCH   = 0x1,   /*!< the object matches the request */
00643    CMP_STOP = 0x2,   /*!< stop the search now */
00644 };

Flags that can be passed to ao2_iterator_init() to modify the behavior of the iterator.

Enumerator:
AO2_ITERATOR_DONTLOCK  Prevents ao2_iterator_next() from locking the container while retrieving the next object from it.
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.

Definition at line 1083 of file astobj2.h.

01083                         {
01084    /*! Prevents ao2_iterator_next() from locking the container
01085     * while retrieving the next object from it.
01086     */
01087    AO2_ITERATOR_DONTLOCK = (1 << 0),
01088    /*! Indicates that the iterator was dynamically allocated by
01089     * astobj2 API and should be freed by ao2_iterator_destroy().
01090     */
01091    AO2_ITERATOR_MALLOCD = (1 << 1),
01092    /*! Indicates that before the iterator returns an object from
01093     * the container being iterated, the object should be unlinked
01094     * from the container.
01095     */
01096    AO2_ITERATOR_UNLINK = (1 << 2),
01097 };

Flags passed to ao2_callback() and ao2_hash_fn() to modify its 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 of the callback function == (CMP_STOP | CMP_MATCH).
OBJ_POINTER  obj is an object of the same type as the one being searched for, so use the object's hash function for optimized searching. The search function is unaffected (i.e. use the one passed as argument, or match_by_addr if none specified).
OBJ_CONTINUE  Continue if a match is not found in the hashed out bucket.

This flag is to be used in combination with OBJ_POINTER. This tells the ao2_callback() core to keep searching through the rest of the buckets if a match is not found in the starting bucket defined by the hash value on the argument.

OBJ_NOLOCK  By using this flag, the ao2_container being searched will _NOT_ be locked. Only use this flag if the ao2_container is being protected by another mechanism other that the internal ao2_lock.
OBJ_KEY  The data is hashable, but is not an object.

This can be used when you want to be able to pass custom data to a hash function that is not a full object, but perhaps just a string.

Note:
OBJ_KEY and OBJ_POINTER are mutually exclusive options.

Definition at line 649 of file astobj2.h.

00649                   {
00650    /*! Unlink the object for which the callback function
00651     *  returned CMP_MATCH.
00652     */
00653    OBJ_UNLINK   = (1 << 0),
00654    /*! On match, don't return the object hence do not increase
00655     *  its refcount.
00656     */
00657    OBJ_NODATA   = (1 << 1),
00658    /*! Don't stop at the first match in ao2_callback() unless the result of
00659     *  of the callback function == (CMP_STOP | CMP_MATCH).
00660     */
00661    OBJ_MULTIPLE = (1 << 2),
00662    /*! obj is an object of the same type as the one being searched for,
00663     *  so use the object's hash function for optimized searching.
00664     *  The search function is unaffected (i.e. use the one passed as
00665     *  argument, or match_by_addr if none specified).
00666     */
00667    OBJ_POINTER  = (1 << 3),
00668    /*! 
00669     * \brief Continue if a match is not found in the hashed out bucket
00670     *
00671     * This flag is to be used in combination with OBJ_POINTER.  This tells
00672     * the ao2_callback() core to keep searching through the rest of the
00673     * buckets if a match is not found in the starting bucket defined by
00674     * the hash value on the argument.
00675     */
00676    OBJ_CONTINUE     = (1 << 4),
00677    /*! 
00678     * \brief By using this flag, the ao2_container being searched will _NOT_
00679     * be locked.  Only use this flag if the ao2_container is being protected
00680     * by another mechanism other that the internal ao2_lock.
00681     */
00682    OBJ_NOLOCK     = (1 << 5),
00683    /*!
00684     * \brief The data is hashable, but is not an object.
00685     *
00686     * This can be used when you want to be able to pass custom data
00687     * to a hash function that is not a full object, but perhaps just
00688     * a string.
00689     *
00690     * \note OBJ_KEY and OBJ_POINTER are mutually exclusive options.
00691     */
00692    OBJ_KEY        = (1 << 6),
00693 };


Function Documentation

void* __ao2_alloc ( const size_t  data_size,
ao2_destructor_fn  destructor_fn 
)

Definition at line 342 of file astobj2.c.

References internal_ao2_alloc().

Referenced by __ao2_container_alloc().

00343 {
00344    return internal_ao2_alloc(data_size, destructor_fn, __FILE__, __LINE__, __FUNCTION__);
00345 }

void* __ao2_alloc_debug ( const size_t  data_size,
ao2_destructor_fn  destructor_fn,
const char *  tag,
const char *  file,
int  line,
const char *  funcname,
int  ref_debug 
)

Definition at line 322 of file astobj2.c.

References internal_ao2_alloc(), and REF_FILE.

Referenced by __ao2_container_alloc_debug(), __ast_channel_alloc_ap(), _moh_class_malloc(), and ast_dummy_channel_alloc().

00324 {
00325    /* allocation */
00326    void *obj;
00327    FILE *refo;
00328 
00329    if ((obj = internal_ao2_alloc(data_size, destructor_fn, file, line, funcname)) == NULL) {
00330       return NULL;
00331    }
00332 
00333    if (ref_debug && (refo = fopen(REF_FILE, "a"))) {
00334       fprintf(refo, "%p =1   %s:%d:%s (%s)\n", obj, file, line, funcname, tag);
00335       fclose(refo);
00336    }
00337 
00338    /* return a pointer to the user data */
00339    return obj;
00340 }

void* __ao2_callback ( struct ao2_container c,
enum search_flags  flags,
ao2_callback_fn cb_fn,
void *  arg 
)

Definition at line 784 of file astobj2.c.

References DEFAULT, and internal_ao2_callback().

Referenced by __ao2_find(), __ao2_unlink(), and container_destruct().

00786 {
00787    return internal_ao2_callback(c,flags, cb_fn, arg, NULL, DEFAULT, NULL, NULL, 0, NULL);
00788 }

void* __ao2_callback_data ( struct ao2_container c,
enum search_flags  flags,
ao2_callback_data_fn cb_fn,
void *  arg,
void *  data 
)

Definition at line 798 of file astobj2.c.

References internal_ao2_callback(), and WITH_DATA.

00800 {
00801    return internal_ao2_callback(c, flags, cb_fn, arg, data, WITH_DATA, NULL, NULL, 0, NULL);
00802 }

void* __ao2_callback_data_debug ( struct ao2_container c,
enum search_flags  flags,
ao2_callback_data_fn cb_fn,
void *  arg,
void *  data,
const char *  tag,
char *  file,
int  line,
const char *  funcname 
)

Definition at line 790 of file astobj2.c.

References internal_ao2_callback(), and WITH_DATA.

00794 {
00795    return internal_ao2_callback(c, flags, cb_fn, arg, data, WITH_DATA, tag, file, line, funcname);
00796 }

void* __ao2_callback_debug ( struct ao2_container c,
enum search_flags  flags,
ao2_callback_fn cb_fn,
void *  arg,
const char *  tag,
char *  file,
int  line,
const char *  funcname 
)

Definition at line 777 of file astobj2.c.

References DEFAULT, and internal_ao2_callback().

Referenced by __ao2_find_debug(), __ao2_unlink_debug(), and container_destruct_debug().

00780 {
00781    return internal_ao2_callback(c,flags, cb_fn, arg, NULL, DEFAULT, tag, file, line, funcname);
00782 }

struct ao2_container* __ao2_container_alloc ( const unsigned int  n_buckets,
ao2_hash_fn hash_fn,
ao2_callback_fn cmp_fn 
) [read]

Definition at line 442 of file astobj2.c.

References __ao2_alloc(), container_destruct(), and internal_ao2_container_alloc().

Referenced by internal_ao2_callback().

00444 {
00445    /* XXX maybe consistency check on arguments ? */
00446    /* compute the container size */
00447 
00448    const unsigned int num_buckets = hash_fn ? n_buckets : 1;
00449    size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket);
00450    struct ao2_container *c = __ao2_alloc(container_size, container_destruct);
00451 
00452    return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn);
00453 }

struct ao2_container* __ao2_container_alloc_debug ( const unsigned int  n_buckets,
ao2_hash_fn hash_fn,
ao2_callback_fn cmp_fn,
const char *  tag,
char *  file,
int  line,
const char *  funcname,
int  ref_debug 
) [read]

Definition at line 429 of file astobj2.c.

References __ao2_alloc_debug(), container_destruct_debug(), and internal_ao2_container_alloc().

00432 {
00433    /* XXX maybe consistency check on arguments ? */
00434    /* compute the container size */
00435    const unsigned int num_buckets = hash_fn ? n_buckets : 1;
00436    size_t container_size = sizeof(struct ao2_container) + num_buckets * sizeof(struct bucket);
00437    struct ao2_container *c = __ao2_alloc_debug(container_size, container_destruct_debug, tag, file, line, funcname, ref_debug);
00438 
00439    return internal_ao2_container_alloc(c, num_buckets, hash_fn, cmp_fn);
00440 }

void* __ao2_find ( struct ao2_container c,
const void *  arg,
enum search_flags  flags 
)

Definition at line 814 of file astobj2.c.

References __ao2_callback(), and ao2_container::cmp_fn.

Referenced by _get_mohbyname().

00815 {
00816    void *arged = (void *) arg;/* Done to avoid compiler const warning */
00817 
00818    return __ao2_callback(c, flags, c->cmp_fn, arged);
00819 }

void* __ao2_find_debug ( struct ao2_container c,
const void *  arg,
enum search_flags  flags,
const char *  tag,
char *  file,
int  line,
const char *  funcname 
)

the find function just invokes the default callback with some reasonable flags.

Definition at line 807 of file astobj2.c.

References __ao2_callback_debug(), and ao2_container::cmp_fn.

Referenced by _get_mohbyname().

00808 {
00809    void *arged = (void *) arg;/* Done to avoid compiler const warning */
00810 
00811    return __ao2_callback_debug(c, flags, c->cmp_fn, arged, tag, file, line, funcname);
00812 }

void* __ao2_iterator_next ( struct ao2_iterator a  ) 

Definition at line 937 of file astobj2.c.

References __ao2_ref(), AO2_ITERATOR_DONTLOCK, ao2_unlock, ao2_iterator::c, ao2_iterator::flags, and internal_ao2_iterator_next().

00938 {
00939    struct bucket_entry *p = NULL;
00940    void *ret = NULL;
00941 
00942    ret = internal_ao2_iterator_next(a, &p);
00943    
00944    if (p) {
00945       /* inc refcount of returned object */
00946       __ao2_ref(ret, 1);
00947    }
00948 
00949    if (!(a->flags & AO2_ITERATOR_DONTLOCK))
00950       ao2_unlock(a->c);
00951 
00952    return ret;
00953 }

void* __ao2_iterator_next_debug ( struct ao2_iterator a,
const char *  tag,
char *  file,
int  line,
const char *  funcname 
)

Definition at line 919 of file astobj2.c.

References __ao2_ref_debug(), AO2_ITERATOR_DONTLOCK, ao2_unlock, ao2_iterator::c, ao2_iterator::flags, and internal_ao2_iterator_next().

00920 {
00921    struct bucket_entry *p;
00922    void *ret = NULL;
00923 
00924    ret = internal_ao2_iterator_next(a, &p);
00925    
00926    if (p) {
00927       /* inc refcount of returned object */
00928       __ao2_ref_debug(ret, 1, tag, file, line, funcname);
00929    }
00930 
00931    if (!(a->flags & AO2_ITERATOR_DONTLOCK))
00932       ao2_unlock(a->c);
00933 
00934    return ret;
00935 }

void* __ao2_link ( struct ao2_container c,
void *  newobj,
int  flags 
)

Definition at line 523 of file astobj2.c.

References __ao2_ref(), ao2_unlock, internal_ao2_link(), and OBJ_NOLOCK.

Referenced by internal_ao2_callback().

00524 {
00525    struct bucket_entry *p = internal_ao2_link(c, user_data, flags, __FILE__, __LINE__, __PRETTY_FUNCTION__);
00526 
00527    if (p) {
00528       __ao2_ref(user_data, +1);
00529       if (!(flags & OBJ_NOLOCK)) {
00530          ao2_unlock(c);
00531       }
00532    }
00533    return p;
00534 }

void* __ao2_link_debug ( struct ao2_container c,
void *  new_obj,
int  flags,
const char *  tag,
char *  file,
int  line,
const char *  funcname 
)

Definition at line 510 of file astobj2.c.

References __ao2_ref_debug(), ao2_unlock, internal_ao2_link(), and OBJ_NOLOCK.

Referenced by internal_ao2_callback().

00511 {
00512    struct bucket_entry *p = internal_ao2_link(c, user_data, flags, file, line, funcname);
00513 
00514    if (p) {
00515       __ao2_ref_debug(user_data, +1, tag, file, line, funcname);
00516       if (!(flags & OBJ_NOLOCK)) {
00517          ao2_unlock(c);
00518       }
00519    }
00520    return p;
00521 }

int __ao2_lock ( void *  a,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Lock an object.

Parameters:
a A pointer to the object we want to lock.
Returns:
0 on success, other values on error.

Definition at line 146 of file astobj2.c.

References __ast_pthread_mutex_lock(), ast_atomic_fetchadd_int(), INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.

00147 {
00148    struct astobj2 *p = INTERNAL_OBJ(user_data);
00149 
00150    if (p == NULL)
00151       return -1;
00152 
00153 #ifdef AO2_DEBUG
00154    ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00155 #endif
00156 
00157    return __ast_pthread_mutex_lock(file, line, func, var, &p->priv_data.lock);
00158 }

int __ao2_ref ( void *  o,
int  delta 
)

Definition at line 230 of file astobj2.c.

References internal_ao2_ref(), and INTERNAL_OBJ().

Referenced by __ao2_iterator_next(), __ao2_link(), cd_cb(), and internal_ao2_callback().

00231 {
00232    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00233 
00234    if (obj == NULL)
00235       return -1;
00236 
00237    return internal_ao2_ref(user_data, delta);
00238 }

int __ao2_ref_debug ( void *  o,
int  delta,
const char *  tag,
char *  file,
int  line,
const char *  funcname 
)

Definition at line 205 of file astobj2.c.

References __priv_data::destructor_fn, internal_ao2_ref(), INTERNAL_OBJ(), astobj2::priv_data, __priv_data::ref_counter, and REF_FILE.

Referenced by __ao2_iterator_next_debug(), __ao2_link_debug(), cd_cb_debug(), dialog_ref_debug(), dialog_unref_debug(), and internal_ao2_callback().

00206 {
00207    struct astobj2 *obj = INTERNAL_OBJ(user_data);
00208    
00209    if (obj == NULL)
00210       return -1;
00211 
00212    if (delta != 0) {
00213       FILE *refo = fopen(REF_FILE, "a");
00214       if (refo) {
00215          fprintf(refo, "%p %s%d   %s:%d:%s (%s) [@%d]\n", user_data, (delta < 0 ? "" : "+"),
00216             delta, file, line, funcname, tag, obj ? obj->priv_data.ref_counter : -1);
00217          fclose(refo);
00218       }
00219    }
00220    if (obj->priv_data.ref_counter + delta == 0 && obj->priv_data.destructor_fn != NULL) { /* this isn't protected with lock; just for o/p */
00221       FILE *refo = fopen(REF_FILE, "a");
00222       if (refo) {
00223          fprintf(refo, "%p **call destructor** %s:%d:%s (%s)\n", user_data, file, line, funcname, tag);
00224          fclose(refo);
00225       }
00226    }
00227    return internal_ao2_ref(user_data, delta);
00228 }

int __ao2_trylock ( void *  a,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Try locking-- (don't block if fail).

Parameters:
a A pointer to the object we want to lock.
Returns:
0 on success, other values on error.

Definition at line 174 of file astobj2.c.

References __ast_pthread_mutex_trylock(), ast_atomic_fetchadd_int(), INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.

00175 {
00176    struct astobj2 *p = INTERNAL_OBJ(user_data);
00177    int ret;
00178    
00179    if (p == NULL)
00180       return -1;
00181    ret = __ast_pthread_mutex_trylock(file, line, func, var, &p->priv_data.lock);
00182 
00183 #ifdef AO2_DEBUG
00184    if (!ret)
00185       ast_atomic_fetchadd_int(&ao2.total_locked, 1);
00186 #endif
00187    return ret;
00188 }

void* __ao2_unlink ( struct ao2_container c,
void *  obj,
int  flags 
)

Definition at line 561 of file astobj2.c.

References __ao2_callback(), ao2_match_by_addr, INTERNAL_OBJ(), OBJ_NODATA, OBJ_POINTER, and OBJ_UNLINK.

00562 {
00563    if (INTERNAL_OBJ(user_data) == NULL)   /* safety check on the argument */
00564       return NULL;
00565 
00566    flags |= (OBJ_UNLINK | OBJ_POINTER | OBJ_NODATA);
00567    __ao2_callback(c, flags, ao2_match_by_addr, user_data);
00568 
00569    return NULL;
00570 }

void* __ao2_unlink_debug ( struct ao2_container c,
void *  obj,
int  flags,
const char *  tag,
char *  file,
int  line,
const char *  funcname 
)

Definition at line 548 of file astobj2.c.

References __ao2_callback_debug(), ao2_match_by_addr, INTERNAL_OBJ(), OBJ_NODATA, OBJ_POINTER, and OBJ_UNLINK.

00550 {
00551    if (INTERNAL_OBJ(user_data) == NULL)   /* safety check on the argument */
00552       return NULL;
00553 
00554    flags |= (OBJ_UNLINK | OBJ_POINTER | OBJ_NODATA);
00555 
00556    __ao2_callback_debug(c, flags, ao2_match_by_addr, user_data, tag, file, line, funcname);
00557 
00558    return NULL;
00559 }

int __ao2_unlock ( void *  a,
const char *  file,
const char *  func,
int  line,
const char *  var 
)

Unlock an object.

Parameters:
a A pointer to the object we want unlock.
Returns:
0 on success, other values on error.

Definition at line 160 of file astobj2.c.

References __ast_pthread_mutex_unlock(), ast_atomic_fetchadd_int(), INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.

00161 {
00162    struct astobj2 *p = INTERNAL_OBJ(user_data);
00163 
00164    if (p == NULL)
00165       return -1;
00166 
00167 #ifdef AO2_DEBUG
00168    ast_atomic_fetchadd_int(&ao2.total_locked, -1);
00169 #endif
00170 
00171    return __ast_pthread_mutex_unlock(file, line, func, var, &p->priv_data.lock);
00172 }

void ao2_bt ( void   ) 

Definition at line 79 of file astobj2.c.

00079 {}

int ao2_container_count ( struct ao2_container c  ) 

void ao2_iterator_destroy ( struct ao2_iterator i  ) 

Destroy a container iterator.

Parameters:
i the iterator to destroy
Return values:
none This function will release the container reference held by the iterator and any other resources it may be holding.
destroy an iterator

Definition at line 839 of file astobj2.c.

References AO2_ITERATOR_MALLOCD, ao2_ref, ast_free, ao2_iterator::c, and ao2_iterator::flags.

Referenced by __ast_data_search_cmp_structure(), __ast_manager_event_multichan(), __data_result_print_cli(), __iax2_show_peers(), __queues_show(), _sip_show_peers(), action_confbridgelistrooms(), action_meetmelist(), alias_show(), ast_channel_iterator_destroy(), ast_data_iterator_end(), ast_data_search_match(), ast_format_cap_get_type(), ast_format_cap_has_joint(), ast_format_cap_has_type(), ast_format_cap_identical(), ast_format_cap_iter_end(), ast_format_cap_joint(), ast_format_cap_to_old_bitfield(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_destroy(), ast_srtp_unprotect(), ast_var_indications(), ast_var_indications_table(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), authenticate(), authenticate_reply(), build_dialplan_useage_map(), build_format_list_array(), calendar_query_exec(), check_access(), clear_queue(), clear_stats(), cli_console_active(), cli_fax_show_sessions(), cli_list_devices(), cli_tps_report(), compare_weight(), complete_confbridge_name(), complete_core_id(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_meetmecmd(), complete_queue(), complete_queue_remove_member(), complete_sip_peer(), complete_sip_registered_peer(), complete_sip_user(), complete_sipch(), conf_queue_dtmf(), conf_run(), data_filter_find(), data_odbc_provider_handler(), data_provider_print_cli(), data_provider_release_all(), data_result_generate_node(), data_result_manager_output(), delete_profiles(), delete_routes(), delete_users(), destroy_pvts(), dialgroup_read(), do_parking_thread(), dump_queue_members(), extension_state_cb(), fax_session_tab_complete(), find_call(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), free_members(), get_member_status(), handle_cli_confbridge_list(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_indication_show(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_odbc_show(), handle_feature_show(), handle_parkedcalls(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_routes(), handle_showmanconn(), handle_statechange(), hints_data_provider_get(), iax2_getpeername(), iax2_getpeertrunk(), interface_exists(), joint_copy_helper(), kill_duplicate_offers(), local_devicestate(), locals_show(), manager_iax2_show_peer_list(), manager_optimize_away(), manager_parking_status(), manager_queues_status(), manager_queues_summary(), meetme_show_cmd(), moh_rescan_files(), num_available_members(), peers_data_provider_get(), poke_all_peers(), pp_each_user_helper(), prune_peers(), prune_users(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queues_data_provider_get(), queues_data_provider_get_helper(), reload(), rt_handle_member_record(), set_member_paused(), set_member_penalty(), sip_poke_all_peers(), sip_prune_realtime(), sip_show_channel(), sip_show_history(), sip_show_inuse(), sip_show_tcp(), sip_show_users(), stop_streams(), tps_taskprocessor_tab_complete(), try_calling(), unload_module(), update_queue(), update_realtime_members(), and users_data_provider_get().

00840 {
00841    ao2_ref(i->c, -1);
00842    if (i->flags & AO2_ITERATOR_MALLOCD) {
00843       ast_free(i);
00844    } else {
00845       i->c = NULL;
00846    }
00847 }

struct ao2_iterator ao2_iterator_init ( struct ao2_container c,
int  flags 
) [read]

Create an iterator for a container.

Parameters:
c the container
flags one or more flags from ao2_iterator_flags
Return values:
the constructed iterator
Note:
This function does not take a pointer to an iterator; rather, it returns an iterator structure that should be assigned to (overwriting) an existing iterator structure allocated on the stack or on the heap.
This function will take a reference on the container being iterated.

initialize an iterator so we start from the first object

Definition at line 824 of file astobj2.c.

References ao2_ref, ao2_iterator::c, and ao2_iterator::flags.

Referenced by __ast_data_search_cmp_structure(), __ast_manager_event_multichan(), __data_result_print_cli(), __iax2_show_peers(), __queues_show(), _sip_show_peers(), action_confbridgelistrooms(), action_meetmelist(), alias_show(), ast_channel_iterator_all_new(), ast_data_iterator_init(), ast_data_search_match(), ast_format_cap_get_type(), ast_format_cap_has_joint(), ast_format_cap_has_type(), ast_format_cap_identical(), ast_format_cap_iter_start(), ast_format_cap_joint(), ast_format_cap_to_old_bitfield(), ast_merge_contexts_and_delete(), ast_msg_var_iterator_init(), ast_srtp_unprotect(), ast_tone_zone_iterator_init(), astman_verify_session_readpermissions(), astman_verify_session_writepermissions(), authenticate(), authenticate_reply(), build_dialplan_useage_map(), build_format_list_array(), calendar_query_exec(), check_access(), clear_queue(), clear_stats(), cli_console_active(), cli_fax_show_sessions(), cli_list_devices(), cli_tps_report(), compare_weight(), complete_confbridge_name(), complete_core_id(), complete_core_show_hint(), complete_country(), complete_iax2_peers(), complete_iax2_unregister(), complete_meetmecmd(), complete_queue(), complete_queue_remove_member(), complete_sip_peer(), complete_sip_registered_peer(), complete_sip_user(), complete_sipch(), conf_queue_dtmf(), conf_run(), data_filter_find(), data_odbc_provider_handler(), data_provider_print_cli(), data_provider_release_all(), data_result_generate_node(), data_result_manager_output(), delete_profiles(), delete_routes(), delete_users(), destroy_pvts(), dialgroup_read(), do_parking_thread(), dump_queue_members(), extension_state_cb(), fax_session_tab_complete(), find_queue_by_name_rt(), find_session(), find_session_by_nonce(), free_members(), get_member_status(), handle_cli_confbridge_list(), handle_cli_iax2_show_callno_limits(), handle_cli_iax2_show_users(), handle_cli_moh_show_classes(), handle_cli_moh_show_files(), handle_cli_odbc_show(), handle_feature_show(), handle_parkedcalls(), handle_show_calendar(), handle_show_calendars(), handle_show_hint(), handle_show_hints(), handle_show_routes(), handle_showmanconn(), handle_statechange(), hints_data_provider_get(), iax2_getpeername(), iax2_getpeertrunk(), interface_exists(), internal_ao2_callback(), joint_copy_helper(), local_devicestate(), locals_show(), manager_iax2_show_peer_list(), manager_optimize_away(), manager_parking_status(), manager_queues_status(), manager_queues_summary(), meetme_show_cmd(), moh_rescan_files(), num_available_members(), peers_data_provider_get(), poke_all_peers(), pp_each_user_helper(), prune_peers(), prune_users(), purge_sessions(), queue_function_mem_read(), queue_function_qac_dep(), queue_function_queuememberlist(), queues_data_provider_get(), queues_data_provider_get_helper(), reload(), rt_handle_member_record(), set_member_paused(), set_member_penalty(), sip_poke_all_peers(), sip_prune_realtime(), sip_show_channel(), sip_show_history(), sip_show_inuse(), sip_show_tcp(), sip_show_users(), stop_streams(), tps_taskprocessor_tab_complete(), try_calling(), unload_module(), update_queue(), update_realtime_members(), and users_data_provider_get().

00825 {
00826    struct ao2_iterator a = {
00827       .c = c,
00828       .flags = flags
00829    };
00830 
00831    ao2_ref(c, +1);
00832    
00833    return a;
00834 }

void* ao2_object_get_lockaddr ( void *  obj  ) 

Return the lock address of an object.

Parameters:
[in] obj A pointer to the object we want.
Returns:
the address of the lock, else NULL.
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.

Since:
1.6.1

Definition at line 190 of file astobj2.c.

References INTERNAL_OBJ(), __priv_data::lock, and astobj2::priv_data.

Referenced by bridge_channel_join_multithreaded(), bridge_channel_join_singlethreaded(), and db_sync_thread().

00191 {
00192    struct astobj2 *p = INTERNAL_OBJ(obj);
00193    
00194    if (p == NULL)
00195       return NULL;
00196 
00197    return &p->priv_data.lock;
00198 }


Variable Documentation

ao2_callback_fn ao2_match_by_addr

a very common callback is one that matches by address.

Definition at line 635 of file astobj2.h.

Referenced by __ao2_unlink(), __ao2_unlink_debug(), load_module(), and load_odbc_config().


Generated on Fri Feb 10 06:34:57 2012 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6