#include "asterisk/lock.h"
Go to the source code of this file.
Defines | |
#define | AST_LIST_APPEND_LIST(head, list, field) |
Appends a whole list to the tail of a list. | |
#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_INIT_VALUE |
Defines initial values for a declaration of AST_LIST_HEAD. | |
#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_NOLOCK_INIT_VALUE |
Defines initial values for a declaration of AST_LIST_HEAD_NOLOCK. | |
#define | AST_LIST_HEAD_NOLOCK_STATIC(name, type) |
Defines a structure to be used to hold a list of specified type, statically initialized. | |
#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_LAST(head) ((head)->last) |
Returns the last entry contained in 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.
|
Appends a whole list to the tail of a list.
Definition at line 439 of file linkedlists.h. Referenced by clone_variables(). |
|
Checks whether the specified list contains any entries.
Definition at line 230 of file linkedlists.h. Referenced by app_exec(), ast_cdr_free_vars(), dundi_lookup_local(), get_destination(), loopback_helper(), 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 199 of file linkedlists.h. |
|
Returns the first entry contained in a list.
Definition at line 208 of file linkedlists.h. Referenced by __ast_device_state_changed_literal(), ast_add_extension2(), clone_variables(), gen_readframe(), and spy_cleanup(). |
|
Value: Defines a structure to be used to hold a list of specified type.
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 362 of file linkedlists.h. |
|
Value: { \ (head)->first = NULL; \ (head)->last = NULL; \ ast_mutex_init(&(head)->lock); \ }
Definition at line 348 of file linkedlists.h. Referenced by app_exec(), and ast_merge_contexts_and_delete(). |
|
Value: { \ (head)->first = NULL; \ (head)->last = NULL; \ }
Definition at line 376 of file linkedlists.h. Referenced by ast_channel_spy_add(), dundi_lookup_local(), load_pbx(), and loopback_helper(). |
|
Value: { \ .first = NULL, \ .last = NULL, \ .lock = AST_MUTEX_INIT_VALUE, \ }
Definition at line 106 of file linkedlists.h. |
|
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: { \ .first = NULL, \ .last = NULL, \ }
Definition at line 115 of file linkedlists.h. |
|
Value: Defines a structure to be used to hold a list of specified type, statically initialized.This is the same as AST_LIST_HEAD_STATIC, except without the lock included. Definition at line 149 of file linkedlists.h. |
|
Value: do { \ (head)->first = (entry); \ (head)->last = (entry); \ ast_mutex_init(&(head)->lock); \ } while (0)
Definition at line 163 of file linkedlists.h. |
|
Value: do { \ (head)->first = (entry); \ (head)->last = (entry); \ } while (0)
Definition at line 177 of file linkedlists.h. |
|
Value: struct name { \ struct type *first; \ struct type *last; \ ast_mutex_t lock; \ } name = AST_LIST_HEAD_INIT_VALUE
Example usage: static AST_LIST_HEAD_STATIC(entry_list, entry);
This would define Definition at line 137 of file linkedlists.h. |
|
Inserts a list entry after a given entry.
Definition at line 390 of file linkedlists.h. |
|
Inserts a list entry at the head of a list.
Definition at line 404 of file linkedlists.h. Referenced by add_identifier(), add_to_interfaces(), ast_cdr_copy_vars(), ast_cdr_register(), ast_channel_spy_add(), ast_devstate_add(), ast_dnsmgr_get(), ast_register_feature(), 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 422 of file linkedlists.h. Referenced by __ast_device_state_changed_literal(), add_sip_domain(), app_exec(), ast_channel_inherit_variables(), ast_channel_spy_add(), gen_readframe(), and local_call(). |
|
Returns the last entry contained in a list.
Definition at line 214 of file linkedlists.h. |
|
|
Returns the next entry in the list after the given entry.
Definition at line 222 of file linkedlists.h. |
|
Removes a specific entry from a list.
Definition at line 477 of file linkedlists.h. Referenced by ast_channel_spy_remove(), ast_dnsmgr_release(), ast_unregister_feature(), del_identifier(), and pbx_builtin_setvar_helper(). |
|
Removes the current entry from a list during a traversal.
Definition at line 327 of file linkedlists.h. Referenced by ast_cdr_unregister(), ast_channel_spy_stop_by_type(), ast_devstate_del(), ast_unregister_file_version(), clone_variables(), detach_spies(), and remove_from_interfaces(). |
|
Removes and returns the head entry from a list.
Definition at line 458 of file linkedlists.h. Referenced by app_exec(), ast_cdr_free_vars(), ast_channel_free(), ast_unregister_features(), clear_and_free_interfaces(), 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 268 of file linkedlists.h. Referenced by add_identifier(), add_to_interfaces(), aPGSQL_fetch(), ast_cdr_copy_vars(), ast_cdr_getvar_internal(), ast_cdr_register(), ast_cdr_serialize_variables(), ast_channel_inherit_variables(), changethread(), check_sip_domain(), complete_show_version_files(), del_identifier(), do_state_change(), feature_exec_app(), find_feature(), find_identifier(), group_list_function_read(), group_show_channels(), handle_cli_status(), handle_show_version_files(), 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 304 of file linkedlists.h. Referenced by ast_cdr_unregister(), ast_channel_spy_stop_by_type(), ast_devstate_del(), ast_unregister_file_version(), clone_variables(), detach_spies(), and remove_from_interfaces(). |
|
Closes a safe loop traversal block.
Definition at line 339 of file linkedlists.h. Referenced by ast_cdr_unregister(), ast_channel_spy_stop_by_type(), ast_devstate_del(), ast_unregister_file_version(), clone_variables(), detach_spies(), and remove_from_interfaces(). |
|
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(), add_to_interfaces(), app_exec(), ast_cdr_register(), ast_cdr_unregister(), ast_devstate_add(), ast_devstate_del(), ast_dnsmgr_get(), ast_dnsmgr_release(), ast_register_feature(), ast_register_file_version(), ast_unregister_feature(), ast_unregister_features(), ast_unregister_file_version(), changethread(), check_sip_domain(), clear_and_free_interfaces(), clear_sip_domains(), complete_show_version_files(), del_identifier(), do_devstate_changes(), do_state_change(), feature_exec_app(), find_feature(), find_identifier(), gen_readframe(), handle_cli_status(), handle_show_version_files(), post_cdr(), refresh_list(), remove_from_interfaces(), and sip_show_domains(). |