#include "asterisk/lock.h"
Go to the source code of this file.
Defines | |
#define | AST_LIST_EMPTY(head) (AST_LIST_FIRST(head) == NULL) |
Checks whether the specified list contains any entries. | |
#define | AST_LIST_ENTRY(type) |
Declare a forward link structure inside a list entry. | |
#define | AST_LIST_FIRST(head) ((head)->first) |
Returns the first entry contained in a list. | |
#define | AST_LIST_HEAD(name, type) |
Defines a structure to be used to hold a list of specified type. | |
#define | AST_LIST_HEAD_DESTROY(head) |
Destroys a list head structure. | |
#define | AST_LIST_HEAD_INIT(head) |
Initializes a list head structure. | |
#define | AST_LIST_HEAD_INIT_NOLOCK(head) |
Initializes a list head structure. | |
#define | AST_LIST_HEAD_NOLOCK(name, type) |
Defines a structure to be used to hold a list of specified type (with no lock). | |
#define | AST_LIST_HEAD_SET(head, entry) |
Initializes a list head structure with a specified first entry. | |
#define | AST_LIST_HEAD_SET_NOLOCK(head, entry) |
Initializes a list head structure with a specified first entry. | |
#define | AST_LIST_HEAD_STATIC(name, type) |
Defines a structure to be used to hold a list of specified type, statically initialized. | |
#define | AST_LIST_INSERT_AFTER(head, listelm, elm, field) |
Inserts a list entry after a given entry. | |
#define | AST_LIST_INSERT_HEAD(head, elm, field) |
Inserts a list entry at the head of a list. | |
#define | AST_LIST_INSERT_TAIL(head, elm, field) |
Appends a list entry to the tail of a list. | |
#define | AST_LIST_LOCK(head) ast_mutex_lock(&(head)->lock) |
Attempts to lock a list. | |
#define | AST_LIST_NEXT(elm, field) ((elm)->field.next) |
Returns the next entry in the list after the given entry. | |
#define | AST_LIST_REMOVE(head, elm, field) |
Removes a specific entry from a list. | |
#define | AST_LIST_REMOVE_CURRENT(head, field) |
Removes the current entry from a list during a traversal. | |
#define | AST_LIST_REMOVE_HEAD(head, field) |
Removes and returns the head entry from a list. | |
#define | AST_LIST_TRAVERSE(head, var, field) for((var) = (head)->first; (var); (var) = (var)->field.next) |
Loops over (traverses) the entries in a list. | |
#define | AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field) |
Loops safely over (traverses) the entries in a list. | |
#define | AST_LIST_TRAVERSE_SAFE_END } |
Closes a safe loop traversal block. | |
#define | AST_LIST_UNLOCK(head) ast_mutex_unlock(&(head)->lock) |
Attempts to unlock a list. |
Definition in file linkedlists.h.
|
Checks whether the specified list contains any entries.
Definition at line 200 of file linkedlists.h. Referenced by app_exec(), ast_cdr_free_vars(), ast_channel_spy_remove(), dundi_lookup_local(), get_destination(), handle_showfeatures(), loopback_helper(), pbx_builtin_clear_globals(), register_verify(), reload_config(), sip_show_domains(), and sip_show_settings(). |
|
Value: struct { \ struct type *next; \ }
struct list_entry { ... AST_LIST_ENTRY(list_entry) list; } The field name list here is arbitrary, and can be anything you wish. Definition at line 175 of file linkedlists.h. |
|
Returns the first entry contained in a list.
Definition at line 184 of file linkedlists.h. Referenced by __ast_device_state_changed_literal(), ast_add_extension2(), clone_variables(), and gen_readframe(). |
|
Value: struct name { \ struct type *first; \ struct type *last; \ ast_mutex_t lock; \ }
Example usage: static AST_LIST_HEAD(entry_list, entry) entries;
This would define Definition at line 71 of file linkedlists.h. |
|
Value: { \ (head)->first = NULL; \ (head)->last = NULL; \ ast_mutex_destroy(&(head)->lock); \ }
Definition at line 331 of file linkedlists.h. |
|
Value: { \ (head)->first = NULL; \ (head)->last = NULL; \ ast_mutex_init(&(head)->lock); \ }
Definition at line 317 of file linkedlists.h. Referenced by app_exec(), ast_merge_contexts_and_delete(), dnsmgr_init(), and load_module(). |
|
Value: { \ (head)->first = NULL; \ (head)->last = NULL; \ }
Definition at line 344 of file linkedlists.h. Referenced by ast_channel_alloc(), ast_channel_spy_add(), ast_do_masquerade(), dundi_lookup_local(), load_pbx(), and loopback_helper(). |
|
Value: Defines a structure to be used to hold a list of specified type (with no lock).
Example usage: static AST_LIST_HEAD_NOLOCK(entry_list, entry) entries;
This would define Definition at line 97 of file linkedlists.h. |
|
Value: do { \ (head)->first = (entry); \ (head)->last = (entry); \ ast_mutex_init(&(head)->lock); \ } while (0)
Definition at line 139 of file linkedlists.h. |
|
Value: do { \ (head)->first = (entry); \ (head)->last = (entry); \ } while (0)
Definition at line 153 of file linkedlists.h. |
|
Defines a structure to be used to hold a list of specified type, statically initialized.
Example usage: static AST_LIST_HEAD_STATIC(entry_list, entry);
This would define Definition at line 120 of file linkedlists.h. |
|
Inserts a list entry after a given entry.
Definition at line 358 of file linkedlists.h. |
|
Inserts a list entry at the head of a list.
Definition at line 372 of file linkedlists.h. Referenced by add_identifier(), ast_cdr_copy_vars(), ast_cdr_register(), ast_cdr_setvar(), ast_channel_spy_add(), ast_devstate_add(), ast_dnsmgr_get(), AST_LIST_HEAD(), ast_merge_contexts_and_delete(), ast_register_file_version(), dundi_lookup_local(), loopback_helper(), pbx_builtin_pushvar_helper(), and pbx_builtin_setvar_helper(). |
|
Appends a list entry to the tail of a list.
Definition at line 390 of file linkedlists.h. Referenced by __ast_device_state_changed_literal(), add_sip_domain(), app_exec(), ast_channel_inherit_variables(), ast_channel_spy_add(), clone_variables(), gen_readframe(), and local_call(). |
|
Attempts to lock a list.
Definition at line 38 of file linkedlists.h. Referenced by __ast_device_state_changed_literal(), add_identifier(), add_sip_domain(), app_exec(), ast_cdr_register(), ast_cdr_unregister(), ast_devstate_add(), ast_devstate_del(), ast_dnsmgr_get(), ast_dnsmgr_release(), AST_LIST_HEAD(), ast_register_file_version(), ast_unregister_feature(), ast_unregister_features(), ast_unregister_file_version(), check_sip_domain(), clear_sip_domains(), complete_show_version_files(), del_identifier(), do_devstate_changes(), do_state_change(), feature_exec_app(), find_feature(), gen_readframe(), handle_cli_status(), handle_show_version_files(), handle_showfeatures(), post_cdr(), refresh_list(), and sip_show_domains(). |
|
Returns the next entry in the list after the given entry.
Definition at line 192 of file linkedlists.h. |
|
Removes a specific entry from a list.
Definition at line 428 of file linkedlists.h. Referenced by ast_channel_spy_remove(), ast_dnsmgr_release(), ast_unregister_feature(), clone_variables(), del_identifier(), and pbx_builtin_setvar_helper(). |
|
Removes the current entry from a list during a traversal.
Definition at line 296 of file linkedlists.h. Referenced by ast_cdr_setvar(), ast_cdr_unregister(), ast_devstate_del(), and ast_unregister_file_version(). |
|
Removes and returns the head entry from a list.
Definition at line 409 of file linkedlists.h. Referenced by app_exec(), ast_cdr_free_vars(), ast_channel_free(), ast_merge_contexts_and_delete(), ast_unregister_features(), clear_sip_domains(), do_devstate_changes(), dundi_lookup_local(), gen_nextfile(), loopback_helper(), and pbx_builtin_clear_globals(). |
|
Loops over (traverses) the entries in a list.
static AST_LIST_HEAD(entry_list, list_entry) entries; ... struct list_entry { ... AST_LIST_ENTRY(list_entry) list; } ... struct list_entry *current; ... AST_LIST_TRAVERSE(&entries, current, list) { (do something with current here) }
Definition at line 238 of file linkedlists.h. Referenced by add_identifier(), aPGSQL_fetch(), ast_cdr_copy_vars(), ast_cdr_getvar_internal(), ast_cdr_register(), ast_cdr_serialize_variables(), ast_channel_inherit_variables(), ast_channel_spy_stop_by_type(), AST_LIST_HEAD(), check_sip_domain(), complete_show_version_files(), del_identifier(), detach_spies(), do_state_change(), feature_exec_app(), find_feature(), group_list_function_read(), group_show_channels(), handle_cli_status(), handle_show_version_files(), handle_showfeatures(), launch_page(), local_call(), mgcp_call(), pbx_builtin_getvar_helper(), pbx_builtin_serialize_variables(), pbx_builtin_setvar_helper(), pbx_retrieve_variable(), post_cdr(), queue_frame_to_spies(), refresh_list(), sip_call(), sip_show_domains(), and transmit_invite(). |
|
Loops safely over (traverses) the entries in a list.
static AST_LIST_HEAD(entry_list, list_entry) entries; ... struct list_entry { ... AST_LIST_ENTRY(list_entry) list; } ... struct list_entry *current; ... AST_LIST_TRAVERSE_SAFE_BEGIN(&entries, current, list) { (do something with current here) } AST_LIST_TRAVERSE_SAFE_END; It differs from AST_LIST_TRAVERSE() in that the code inside the loop can modify (or even free, after calling AST_LIST_REMOVE_CURRENT()) the entry pointed to by the current pointer without affecting the loop traversal. Definition at line 274 of file linkedlists.h. Referenced by ast_cdr_setvar(), ast_cdr_unregister(), ast_devstate_del(), ast_unregister_file_version(), clone_variables(), and detach_spies(). |
|
Closes a safe loop traversal block.
Definition at line 308 of file linkedlists.h. |
|
Attempts to unlock a list.
Definition at line 49 of file linkedlists.h. Referenced by __ast_device_state_changed_literal(), add_identifier(), add_sip_domain(), app_exec(), ast_cdr_register(), ast_cdr_unregister(), ast_devstate_add(), ast_devstate_del(), ast_dnsmgr_get(), ast_dnsmgr_release(), AST_LIST_HEAD(), ast_register_file_version(), ast_unregister_feature(), ast_unregister_features(), ast_unregister_file_version(), check_sip_domain(), clear_sip_domains(), complete_show_version_files(), del_identifier(), do_devstate_changes(), do_state_change(), feature_exec_app(), find_feature(), gen_readframe(), handle_cli_status(), handle_show_version_files(), handle_showfeatures(), post_cdr(), refresh_list(), and sip_show_domains(). |