Asterisk - The Open Source Telephony Project GIT-master-f3e88d3
Macros
dlinkedlists.h File Reference

A set of macros to manage doubly-linked lists. More...

#include "asterisk/lock.h"
Include dependency graph for dlinkedlists.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AST_DLLIST_APPEND_DLLIST(head, list, field)
 Appends a whole list to the tail of a list. More...
 
#define AST_DLLIST_EMPTY(head)   (AST_DLLIST_FIRST(head) == NULL)
 Checks whether the specified list contains any entries. More...
 
#define AST_DLLIST_ENTRY(type)   AST_DLLIST_HEAD_NOLOCK(, type)
 Declare previous/forward links inside a list entry. More...
 
#define AST_DLLIST_FIRST(head)   ((head)->first)
 Returns the first entry contained in a list. More...
 
#define AST_DLLIST_HEAD(name, type)
 Defines a structure to be used to hold a list of specified type. More...
 
#define AST_DLLIST_HEAD_DESTROY(head)
 Destroys a list head structure. More...
 
#define AST_DLLIST_HEAD_INIT(head)
 Initializes a list head structure. More...
 
#define AST_DLLIST_HEAD_INIT_NOLOCK(head)
 Initializes a list head structure. More...
 
#define AST_DLLIST_HEAD_INIT_VALUE
 Defines initial values for a declaration of AST_DLLIST_HEAD. More...
 
#define AST_DLLIST_HEAD_NOLOCK(name, type)
 Defines a structure to be used to hold a list of specified type (with no lock). More...
 
#define AST_DLLIST_HEAD_NOLOCK_INIT_VALUE
 Defines initial values for a declaration of AST_DLLIST_HEAD_NOLOCK. More...
 
#define AST_DLLIST_HEAD_NOLOCK_STATIC(name, type)
 Defines a structure to be used to hold a list of specified type, statically initialized. More...
 
#define AST_DLLIST_HEAD_SET(head, entry)
 Initializes a list head structure with a specified first entry. More...
 
#define AST_DLLIST_HEAD_SET_NOLOCK(head, entry)
 Initializes a list head structure with a specified first entry. More...
 
#define AST_DLLIST_HEAD_STATIC(name, type)
 Defines a structure to be used to hold a list of specified type, statically initialized. More...
 
#define AST_DLLIST_INSERT_AFTER(head, listelm, elm, field)
 Inserts a list entry after a given entry. More...
 
#define AST_DLLIST_INSERT_AFTER_CURRENT(elm, field)
 Inserts a list node after the current node during a traversal. More...
 
#define AST_DLLIST_INSERT_BEFORE(head, listelm, elm, field)
 Inserts a list entry before a given entry. More...
 
#define AST_DLLIST_INSERT_BEFORE_CURRENT(elm, field)
 Inserts a list node before the current node during a traversal. More...
 
#define AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS(elm, field)    AST_DLLIST_INSERT_AFTER_CURRENT(elm, field)
 Inserts a list entry after the current entry during a backwards traversal. Since this is a backwards traversal, this will insert the entry AFTER the current element. Since this is a backwards traveral, though, this would be BEFORE the current entry in traversal order. Confusing? More...
 
#define AST_DLLIST_INSERT_HEAD(head, elm, field)
 Inserts a list entry at the head of a list. More...
 
#define AST_DLLIST_INSERT_TAIL(head, elm, field)
 Appends a list entry to the tail of a list. More...
 
#define AST_DLLIST_IS_MEMBER(head, elm, field)
 Checks whether the specified list contains the element. More...
 
#define AST_DLLIST_LAST(head)   ((head)->last)
 Returns the last entry contained in a list. More...
 
#define AST_DLLIST_LOCK(head)    ast_mutex_lock(&(head)->lock)
 Locks a list. More...
 
#define AST_DLLIST_MOVE_CURRENT(newhead, field)
 Move the current list entry to another list at the tail. More...
 
#define AST_DLLIST_MOVE_CURRENT_BACKWARDS(newhead, field)
 Move the current list entry to another list at the head. More...
 
#define AST_DLLIST_NEXT(elm, field)   AST_DLLIST_NEXT_DIRECTION(elm, field, first)
 Returns the next entry in the list after the given entry. More...
 
#define AST_DLLIST_NEXT_DIRECTION(elm, field, direction)   ((elm)->field.direction)
 
#define AST_DLLIST_PREV(elm, field)   AST_DLLIST_NEXT_DIRECTION(elm, field, last)
 Returns the previous entry in the list before the given entry. More...
 
#define AST_DLLIST_REMOVE(head, elm, field)
 Removes a specific entry from a list. More...
 
#define AST_DLLIST_REMOVE_CURRENT(field)
 Removes the current entry from a list during a traversal. More...
 
#define AST_DLLIST_REMOVE_HEAD(head, field)
 Removes and returns the head entry from a list. More...
 
#define AST_DLLIST_REMOVE_TAIL(head, field)
 Removes and returns the tail node from a list. More...
 
#define AST_DLLIST_REMOVE_VERIFY(head, elm, field)
 Removes a specific node from a list if it is in the list. More...
 
#define AST_DLLIST_TRAVERSE(head, var, field)    AST_DLLIST_TRAVERSE_DIRECTION(head, var, field, first)
 Loops over (traverses) the entries in a list. More...
 
#define AST_DLLIST_TRAVERSE_BACKWARDS(head, var, field)    AST_DLLIST_TRAVERSE_DIRECTION(head, var, field, last)
 Loops over (traverses) the entries in a list in reverse order, starting at the end. More...
 
#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN(head, var, field)    AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN(head, var, field, last)
 Loops safely over (traverses) the entries in a list. More...
 
#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END
 Closes a safe loop traversal block. More...
 
#define AST_DLLIST_TRAVERSE_DIRECTION(head, var, field, start)    for ((var) = (head)->start; (var); (var) = AST_DLLIST_NEXT_DIRECTION(var, field, start))
 Traverse a doubly linked list using the specified direction list. More...
 
#define AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN(head, var, field, start)
 Safe traversal of a doubly linked list using the specified direction list. More...
 
#define AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END    } while (0)
 
#define AST_DLLIST_TRAVERSE_SAFE_BEGIN(head, var, field)    AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN(head, var, field, first)
 Loops safely over (traverses) the entries in a list. More...
 
#define AST_DLLIST_TRAVERSE_SAFE_END   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END
 Closes a safe loop traversal block. More...
 
#define AST_DLLIST_TRYLOCK(head)    ast_mutex_trylock(&(head)->lock)
 Locks a list, without blocking if the list is locked. More...
 
#define AST_DLLIST_UNLOCK(head)    ast_mutex_unlock(&(head)->lock)
 Attempts to unlock a list. More...
 
#define AST_RWDLLIST_APPEND_DLLIST   AST_DLLIST_APPEND_DLLIST
 
#define AST_RWDLLIST_EMPTY   AST_DLLIST_EMPTY
 
#define AST_RWDLLIST_ENTRY   AST_DLLIST_ENTRY
 
#define AST_RWDLLIST_FIRST   AST_DLLIST_FIRST
 
#define AST_RWDLLIST_HEAD(name, type)
 Defines a structure to be used to hold a read/write list of specified type. More...
 
#define AST_RWDLLIST_HEAD_DESTROY(head)
 Destroys an rwlist head structure. More...
 
#define AST_RWDLLIST_HEAD_INIT(head)
 Initializes an rwlist head structure. More...
 
#define AST_RWDLLIST_HEAD_INIT_VALUE
 Defines initial values for a declaration of AST_RWDLLIST_HEAD. More...
 
#define AST_RWDLLIST_HEAD_SET(head, entry)
 Initializes an rwlist head structure with a specified first entry. More...
 
#define AST_RWDLLIST_HEAD_STATIC(name, type)
 Defines a structure to be used to hold a read/write list of specified type, statically initialized. More...
 
#define AST_RWDLLIST_INSERT_AFTER   AST_DLLIST_INSERT_AFTER
 
#define AST_RWDLLIST_INSERT_AFTER_CURRENT   AST_DLLIST_INSERT_AFTER_CURRENT
 
#define AST_RWDLLIST_INSERT_BEFORE   AST_DLLIST_INSERT_BEFORE
 
#define AST_RWDLLIST_INSERT_BEFORE_CURRENT   AST_DLLIST_INSERT_BEFORE_CURRENT
 
#define AST_RWDLLIST_INSERT_BEFORE_CURRENT_BACKWARDS   AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS
 
#define AST_RWDLLIST_INSERT_HEAD   AST_DLLIST_INSERT_HEAD
 
#define AST_RWDLLIST_INSERT_TAIL   AST_DLLIST_INSERT_TAIL
 
#define AST_RWDLLIST_IS_MEMBER   AST_DLLIST_IS_MEMBER
 
#define AST_RWDLLIST_LAST   AST_DLLIST_LAST
 
#define AST_RWDLLIST_MOVE_CURRENT   AST_DLLIST_MOVE_CURRENT
 
#define AST_RWDLLIST_MOVE_CURRENT_BACKWARDS   AST_DLLIST_MOVE_CURRENT_BACKWARDS
 
#define AST_RWDLLIST_NEXT   AST_DLLIST_NEXT
 
#define AST_RWDLLIST_NEXT_DIRECTION   AST_DLLIST_NEXT_DIRECTION
 
#define AST_RWDLLIST_PREV   AST_DLLIST_PREV
 
#define AST_RWDLLIST_RDLOCK(head)    ast_rwlock_rdlock(&(head)->lock)
 Read locks a list. More...
 
#define AST_RWDLLIST_REMOVE   AST_DLLIST_REMOVE
 
#define AST_RWDLLIST_REMOVE_CURRENT   AST_DLLIST_REMOVE_CURRENT
 
#define AST_RWDLLIST_REMOVE_HEAD   AST_DLLIST_REMOVE_HEAD
 
#define AST_RWDLLIST_REMOVE_TAIL   AST_DLLIST_REMOVE_TAIL
 
#define AST_RWDLLIST_REMOVE_VERIFY   AST_DLLIST_REMOVE_VERIFY
 
#define AST_RWDLLIST_TRAVERSE   AST_DLLIST_TRAVERSE
 
#define AST_RWDLLIST_TRAVERSE_BACKWARDS   AST_DLLIST_TRAVERSE_BACKWARDS
 
#define AST_RWDLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN   AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN
 
#define AST_RWDLLIST_TRAVERSE_BACKWARDS_SAFE_END   AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END
 
#define AST_RWDLLIST_TRAVERSE_DIRECTION   AST_DLLIST_TRAVERSE_DIRECTION
 
#define AST_RWDLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN
 
#define AST_RWDLLIST_TRAVERSE_DIRECTION_SAFE_END   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END
 
#define AST_RWDLLIST_TRAVERSE_SAFE_BEGIN   AST_DLLIST_TRAVERSE_SAFE_BEGIN
 
#define AST_RWDLLIST_TRAVERSE_SAFE_END   AST_DLLIST_TRAVERSE_SAFE_END
 
#define AST_RWDLLIST_TRYRDLOCK(head)    ast_rwlock_tryrdlock(&(head)->lock)
 Read locks a list, without blocking if the list is locked. More...
 
#define AST_RWDLLIST_TRYWRLOCK(head)    ast_rwlock_trywrlock(&(head)->lock)
 Write locks a list, without blocking if the list is locked. More...
 
#define AST_RWDLLIST_UNLOCK(head)    ast_rwlock_unlock(&(head)->lock)
 Attempts to unlock a read/write based list. More...
 
#define AST_RWDLLIST_WRLOCK(head)    ast_rwlock_wrlock(&(head)->lock)
 Write locks a list. More...
 

Detailed Description

A set of macros to manage doubly-linked lists.

Definition in file dlinkedlists.h.

Macro Definition Documentation

◆ AST_DLLIST_APPEND_DLLIST

#define AST_DLLIST_APPEND_DLLIST (   head,
  list,
  field 
)

Appends a whole list to the tail of a list.

Parameters
headThis is a pointer to the list head structure
listThis is a pointer to the list to be appended.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.

Note: The source list (the list parameter) will be empty after calling this macro (the list entries are moved to the target list).

Since
1.6.1

Definition at line 1116 of file dlinkedlists.h.

◆ AST_DLLIST_EMPTY

#define AST_DLLIST_EMPTY (   head)    (AST_DLLIST_FIRST(head) == NULL)

Checks whether the specified list contains any entries.

Parameters
headThis is a pointer to the list head structure
Returns
non-zero if the list has entries
zero if not.
Since
1.6.1

Definition at line 469 of file dlinkedlists.h.

◆ AST_DLLIST_ENTRY

#define AST_DLLIST_ENTRY (   type)    AST_DLLIST_HEAD_NOLOCK(, type)

Declare previous/forward links inside a list entry.

Parameters
typeThis is the type of each list entry.

This macro declares a structure to be used to doubly link list entries together. It must be used inside the definition of the structure named in type, as follows:

struct list_entry {
...
AST_DLLIST_ENTRY(list_entry) list;
}
#define AST_DLLIST_ENTRY(type)
Declare previous/forward links inside a list entry.
Definition: dlinkedlists.h:413

The field name list here is arbitrary, and can be anything you wish.

Since
1.6.1

Definition at line 413 of file dlinkedlists.h.

◆ AST_DLLIST_FIRST

#define AST_DLLIST_FIRST (   head)    ((head)->first)

Returns the first entry contained in a list.

Parameters
headThis is a pointer to the list head structure
Since
1.6.1

Definition at line 422 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD

#define AST_DLLIST_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *first; \
struct type *last; \
ast_mutex_t lock; \
}
struct sla_ringing_trunk * first
Definition: app_sla.c:332
ast_mutex_t lock
Definition: app_sla.c:331
struct sla_ringing_trunk * last
Definition: app_sla.c:332
static const char type[]
Definition: chan_ooh323.c:109
static const char name[]
Definition: format_mp3.c:68

Defines a structure to be used to hold a list of specified type.

Parameters
nameThis will be the name of the defined structure.
typeThis is the type of each list entry.

This macro creates a structure definition that can be used to hold a list of the entries of type type. It does not actually declare (allocate) a structure; to do that, either follow this macro with the desired name of the instance you wish to declare, or use the specified name to declare instances elsewhere.

Example usage:

static AST_DLLIST_HEAD(entry_list, entry) entries;
#define AST_DLLIST_HEAD(name, type)
Defines a structure to be used to hold a list of specified type.
Definition: dlinkedlists.h:158
Definition: search.h:40

This would define struct entry_list, and declare an instance of it named entries, all intended to hold a list of type struct entry.

Since
1.6.1

Definition at line 158 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_DESTROY

#define AST_DLLIST_HEAD_DESTROY (   head)
Value:
{ \
(head)->first = NULL; \
(head)->last = NULL; \
ast_mutex_destroy(&(head)->lock); \
}
#define NULL
Definition: resample.c:96

Destroys a list head structure.

Parameters
headThis is a pointer to the list head structure

This macro destroys a list head structure by setting the head entry to NULL (empty list) and destroying the embedded lock. It does not free the structure from memory.

Since
1.6.1

Definition at line 964 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_INIT

#define AST_DLLIST_HEAD_INIT (   head)
Value:
{ \
(head)->first = NULL; \
(head)->last = NULL; \
ast_mutex_init(&(head)->lock); \
}

Initializes a list head structure.

Parameters
headThis is a pointer to the list head structure

This macro initializes a list head structure by setting the head entry to NULL (empty list) and recreating the embedded lock.

Since
1.6.1

Definition at line 933 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_INIT_NOLOCK

#define AST_DLLIST_HEAD_INIT_NOLOCK (   head)
Value:
{ \
(head)->first = NULL; \
(head)->last = NULL; \
}

Initializes a list head structure.

Parameters
headThis is a pointer to the list head structure

This macro initializes a list head structure by setting the head entry to NULL (empty list). There is no embedded lock handling with this macro.

Since
1.6.1

Definition at line 996 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_INIT_VALUE

#define AST_DLLIST_HEAD_INIT_VALUE
Value:
{ \
.first = NULL, \
.last = NULL, \
}
#define AST_MUTEX_INIT_VALUE
Definition: lock.h:95

Defines initial values for a declaration of AST_DLLIST_HEAD.

Since
1.6.1

Definition at line 222 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_NOLOCK

#define AST_DLLIST_HEAD_NOLOCK (   name,
  type 
)
Value:
struct name { \
struct type *first; \
struct type *last; \
}

Defines a structure to be used to hold a list of specified type (with no lock).

Parameters
nameThis will be the name of the defined structure.
typeThis is the type of each list entry.

This macro creates a structure definition that can be used to hold a list of the entries of type type. It does not actually declare (allocate) a structure; to do that, either follow this macro with the desired name of the instance you wish to declare, or use the specified name to declare instances elsewhere.

Example usage:

#define AST_DLLIST_HEAD_NOLOCK(name, type)
Defines a structure to be used to hold a list of specified type (with no lock).
Definition: dlinkedlists.h:212

This would define struct entry_list, and declare an instance of it named entries, all intended to hold a list of type struct entry.

Since
1.6.1

Definition at line 212 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_NOLOCK_INIT_VALUE

#define AST_DLLIST_HEAD_NOLOCK_INIT_VALUE
Value:
{ \
.first = NULL, \
.last = NULL, \
}

Defines initial values for a declaration of AST_DLLIST_HEAD_NOLOCK.

Since
1.6.1

Definition at line 244 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_NOLOCK_STATIC

#define AST_DLLIST_HEAD_NOLOCK_STATIC (   name,
  type 
)
Value:
struct name { \
struct type *first; \
struct type *last; \
#define AST_DLLIST_HEAD_NOLOCK_INIT_VALUE
Defines initial values for a declaration of AST_DLLIST_HEAD_NOLOCK.
Definition: dlinkedlists.h:244

Defines a structure to be used to hold a list of specified type, statically initialized.

This is the same as AST_DLLIST_HEAD_STATIC, except without the lock included.

Since
1.6.1

Definition at line 342 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_SET

#define AST_DLLIST_HEAD_SET (   head,
  entry 
)
Value:
do { \
(head)->first = (entry); \
(head)->last = (entry); \
ast_mutex_init(&(head)->lock); \
} while (0)

Initializes a list head structure with a specified first entry.

Parameters
headThis is a pointer to the list head structure
entrypointer to the list entry that will become the head of the list

This macro initializes a list head structure by setting the head entry to the supplied value and recreating the embedded lock.

Since
1.6.1

Definition at line 357 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_SET_NOLOCK

#define AST_DLLIST_HEAD_SET_NOLOCK (   head,
  entry 
)
Value:
do { \
(head)->first = (entry); \
(head)->last = (entry); \
} while (0)

Initializes a list head structure with a specified first entry.

Parameters
headThis is a pointer to the list head structure
entrypointer to the list entry that will become the head of the list

This macro initializes a list head structure by setting the head entry to the supplied value.

Since
1.6.1

Definition at line 389 of file dlinkedlists.h.

◆ AST_DLLIST_HEAD_STATIC

#define AST_DLLIST_HEAD_STATIC (   name,
  type 
)
Value:
struct name { \
struct type *first; \
struct type *last; \
ast_mutex_t lock; \
#define AST_DLLIST_HEAD_INIT_VALUE
Defines initial values for a declaration of AST_DLLIST_HEAD.
Definition: dlinkedlists.h:222

Defines a structure to be used to hold a list of specified type, statically initialized.

Parameters
nameThis will be the name of the defined structure.
typeThis is the type of each list entry.

This macro creates a structure definition that can be used to hold a list of the entries of type type, and allocates an instance of it, initialized to be empty.

Example usage:

#define AST_DLLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a list of specified type, statically initialized.
Definition: dlinkedlists.h:285

This would define struct entry_list, intended to hold a list of type struct entry.

Since
1.6.1

Definition at line 285 of file dlinkedlists.h.

◆ AST_DLLIST_INSERT_AFTER

#define AST_DLLIST_INSERT_AFTER (   head,
  listelm,
  elm,
  field 
)

Inserts a list entry after a given entry.

Parameters
headThis is a pointer to the list head structure
listelmThis is a pointer to the entry after which the new entry should be inserted.
elmThis is a pointer to the entry to be inserted.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Since
1.6.1

Definition at line 1012 of file dlinkedlists.h.

◆ AST_DLLIST_INSERT_AFTER_CURRENT

#define AST_DLLIST_INSERT_AFTER_CURRENT (   elm,
  field 
)

Inserts a list node after the current node during a traversal.

Parameters
elmThis is a pointer to the node to be inserted.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link nodes of this list together.
Since
11

Definition at line 723 of file dlinkedlists.h.

◆ AST_DLLIST_INSERT_BEFORE

#define AST_DLLIST_INSERT_BEFORE (   head,
  listelm,
  elm,
  field 
)

Inserts a list entry before a given entry.

Parameters
headThis is a pointer to the list head structure
listelmThis is a pointer to the entry before which the new entry should be inserted.
elmThis is a pointer to the entry to be inserted.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Since
1.6.1

Definition at line 1038 of file dlinkedlists.h.

◆ AST_DLLIST_INSERT_BEFORE_CURRENT

#define AST_DLLIST_INSERT_BEFORE_CURRENT (   elm,
  field 
)

Inserts a list node before the current node during a traversal.

Parameters
elmThis is a pointer to the entry to be inserted.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link nodes of this list together.
Since
1.6.1

Definition at line 696 of file dlinkedlists.h.

◆ AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS

#define AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS (   elm,
  field 
)     AST_DLLIST_INSERT_AFTER_CURRENT(elm, field)

Inserts a list entry after the current entry during a backwards traversal. Since this is a backwards traversal, this will insert the entry AFTER the current element. Since this is a backwards traveral, though, this would be BEFORE the current entry in traversal order. Confusing?

Parameters
elmThis is a pointer to the entry to be inserted.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Since
1.6.1

Definition at line 904 of file dlinkedlists.h.

◆ AST_DLLIST_INSERT_HEAD

#define AST_DLLIST_INSERT_HEAD (   head,
  elm,
  field 
)

Inserts a list entry at the head of a list.

Parameters
headThis is a pointer to the list head structure
elmThis is a pointer to the entry to be inserted.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Since
1.6.1

Definition at line 1062 of file dlinkedlists.h.

◆ AST_DLLIST_INSERT_TAIL

#define AST_DLLIST_INSERT_TAIL (   head,
  elm,
  field 
)

Appends a list entry to the tail of a list.

Parameters
headThis is a pointer to the list head structure
elmThis is a pointer to the entry to be appended.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.

Note: The link field in the appended entry is not modified, so if it is actually the head of a list itself, the entire list will be appended temporarily (until the next AST_DLLIST_INSERT_TAIL is performed).

Since
1.6.1

Definition at line 1089 of file dlinkedlists.h.

◆ AST_DLLIST_IS_MEMBER

#define AST_DLLIST_IS_MEMBER (   head,
  elm,
  field 
)

Checks whether the specified list contains the element.

Parameters
headThis is a pointer to the list head structure
elmThis is a pointer to the list element to see if in list.
fieldList node field for the next node information.
Returns
elm if the list has elm in it.
NULL if not.
Since
11

Definition at line 483 of file dlinkedlists.h.

◆ AST_DLLIST_LAST

#define AST_DLLIST_LAST (   head)    ((head)->last)

Returns the last entry contained in a list.

Parameters
headThis is a pointer to the list head structure
Since
1.6.1

Definition at line 431 of file dlinkedlists.h.

◆ AST_DLLIST_LOCK

#define AST_DLLIST_LOCK (   head)     ast_mutex_lock(&(head)->lock)

Locks a list.

Parameters
headThis is a pointer to the list head structure

This macro attempts to place an exclusive lock in the list head structure pointed to by head.

Return values
0on success
non-zeroon failure
Since
1.6.1

Definition at line 46 of file dlinkedlists.h.

◆ AST_DLLIST_MOVE_CURRENT

#define AST_DLLIST_MOVE_CURRENT (   newhead,
  field 
)
Value:
do { \
typeof ((newhead)->first) __list_cur = __list_current; \
AST_DLLIST_REMOVE_CURRENT(field); \
AST_DLLIST_INSERT_TAIL((newhead), __list_cur, field); \
} while (0)

Move the current list entry to another list at the tail.

Note
This is a silly macro. It should be done explicitly otherwise the field parameter must be the same for the two lists.

AST_DLLIST_REMOVE_CURRENT(field); AST_DLLIST_INSERT_TAIL(newhead, var, other_field);

Definition at line 782 of file dlinkedlists.h.

◆ AST_DLLIST_MOVE_CURRENT_BACKWARDS

#define AST_DLLIST_MOVE_CURRENT_BACKWARDS (   newhead,
  field 
)
Value:
do { \
typeof ((newhead)->first) __list_cur = __list_current; \
AST_DLLIST_REMOVE_CURRENT(field); \
AST_DLLIST_INSERT_HEAD((newhead), __list_cur, field); \
} while (0)

Move the current list entry to another list at the head.

Note
This is a silly macro. It should be done explicitly otherwise the field parameter must be the same for the two lists.

AST_DLLIST_REMOVE_CURRENT(field); AST_DLLIST_INSERT_HEAD(newhead, var, other_field);

Definition at line 801 of file dlinkedlists.h.

◆ AST_DLLIST_NEXT

#define AST_DLLIST_NEXT (   elm,
  field 
)    AST_DLLIST_NEXT_DIRECTION(elm, field, first)

Returns the next entry in the list after the given entry.

Parameters
elmThis is a pointer to the current entry.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Since
1.6.1

Definition at line 446 of file dlinkedlists.h.

◆ AST_DLLIST_NEXT_DIRECTION

#define AST_DLLIST_NEXT_DIRECTION (   elm,
  field,
  direction 
)    ((elm)->field.direction)

Definition at line 435 of file dlinkedlists.h.

◆ AST_DLLIST_PREV

#define AST_DLLIST_PREV (   elm,
  field 
)    AST_DLLIST_NEXT_DIRECTION(elm, field, last)

Returns the previous entry in the list before the given entry.

Parameters
elmThis is a pointer to the current entry.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Since
1.6.1

Definition at line 457 of file dlinkedlists.h.

◆ AST_DLLIST_REMOVE

#define AST_DLLIST_REMOVE (   head,
  elm,
  field 
)

Removes a specific entry from a list.

Parameters
headThis is a pointer to the list head structure
elmThis is a pointer to the entry to be removed.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Warning
The removed entry is not freed.
Since
1.6.1

Definition at line 1199 of file dlinkedlists.h.

◆ AST_DLLIST_REMOVE_CURRENT

#define AST_DLLIST_REMOVE_CURRENT (   field)

Removes the current entry from a list during a traversal.

Parameters
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.
Note
This macro can only be used inside an AST_DLLIST_TRAVERSE_SAFE_BEGIN() block; it is used to unlink the current entry from the list without affecting the list traversal (and without having to re-traverse the list to modify the previous entry, if any).
Since
1.6.1

Definition at line 753 of file dlinkedlists.h.

◆ AST_DLLIST_REMOVE_HEAD

#define AST_DLLIST_REMOVE_HEAD (   head,
  field 
)

Removes and returns the head entry from a list.

Parameters
headThis is a pointer to the list head structure
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.

Removes the head entry from the list, and returns a pointer to it. This macro is safe to call on an empty list.

Since
1.6.1

Definition at line 1142 of file dlinkedlists.h.

◆ AST_DLLIST_REMOVE_TAIL

#define AST_DLLIST_REMOVE_TAIL (   head,
  field 
)

Removes and returns the tail node from a list.

Parameters
headThis is a pointer to the list head structure
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link nodes of this list together.

Removes the tail entry from the list, and returns a pointer to it. This macro is safe to call on an empty list.

Since
11

Definition at line 1171 of file dlinkedlists.h.

◆ AST_DLLIST_REMOVE_VERIFY

#define AST_DLLIST_REMOVE_VERIFY (   head,
  elm,
  field 
)
Value:
({ \
typeof((elm)) __res = AST_DLLIST_IS_MEMBER(head, elm, field); \
AST_DLLIST_REMOVE(head, __res, field); \
__res; \
})
#define AST_DLLIST_IS_MEMBER(head, elm, field)
Checks whether the specified list contains the element.
Definition: dlinkedlists.h:483

Removes a specific node from a list if it is in the list.

Parameters
headThis is a pointer to the list head structure
elmThis is a pointer to the node to be removed.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link nodes of this list together.
Warning
The removed node is not freed.
Returns
elm if the list had elm in it.
NULL if not.
Since
11

Definition at line 1231 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE

#define AST_DLLIST_TRAVERSE (   head,
  var,
  field 
)     AST_DLLIST_TRAVERSE_DIRECTION(head, var, field, first)

Loops over (traverses) the entries in a list.

Parameters
headThis is a pointer to the list head structure
varThis is the name of the variable that will hold a pointer to the current list entry on each iteration. It must be declared before calling this macro.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.

This macro is use to loop over (traverse) the entries in a list. It uses a for loop, and supplies the enclosed code with a pointer to each list entry as it loops. It is typically used as follows:

static AST_DLLIST_HEAD(entry_list, list_entry) entries;
...
struct list_entry {
...
AST_DLLIST_ENTRY(list_entry) list;
}
...
struct list_entry *current;
...
AST_DLLIST_TRAVERSE(&entries, current, list) {
(do something with current here)
}
size_t current
Definition: main/cli.c:113
Warning
If you modify the forward-link pointer contained in the current entry while inside the loop, the behavior will be unpredictable. At a minimum, the following macros will modify the forward-link pointer, and should not be used inside AST_DLLIST_TRAVERSE() against the entry pointed to by the current pointer without careful consideration of their consequences:
Since
1.6.1

Definition at line 576 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_BACKWARDS

#define AST_DLLIST_TRAVERSE_BACKWARDS (   head,
  var,
  field 
)     AST_DLLIST_TRAVERSE_DIRECTION(head, var, field, last)

Loops over (traverses) the entries in a list in reverse order, starting at the end.

Parameters
headThis is a pointer to the list head structure
varThis is the name of the variable that will hold a pointer to the current list entry on each iteration. It must be declared before calling this macro.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.

This macro is use to loop over (traverse) the entries in a list in reverse order. It uses a for loop, and supplies the enclosed code with a pointer to each list entry as it loops. It is typically used as follows:

static AST_DLLIST_HEAD(entry_list, list_entry) entries;
...
struct list_entry {
...
AST_DLLIST_ENTRY(list_entry) list;
}
...
struct list_entry *current;
...
AST_DLLIST_TRAVERSE_BACKWARDS(&entries, current, list) {
(do something with current here)
}
Warning
If you modify the forward-link pointer contained in the current entry while inside the loop, the behavior will be unpredictable. At a minimum, the following macros will modify the forward-link pointer, and should not be used inside AST_DLLIST_TRAVERSE() against the entry pointed to by the current pointer without careful consideration of their consequences:
Since
1.6.1

Definition at line 618 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN

#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN (   head,
  var,
  field 
)     AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN(head, var, field, last)

Loops safely over (traverses) the entries in a list.

Parameters
headThis is a pointer to the list head structure
varThis is the name of the variable that will hold a pointer to the current list entry on each iteration. It must be declared before calling this macro.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.

This macro is used to safely loop over (traverse) the entries in a list. It uses a for loop, and supplies the enclosed code with a pointer to each list entry as it loops. It is typically used as follows:

static AST_DLLIST_HEAD(entry_list, list_entry) entries;
...
struct list_entry {
...
AST_DLLIST_ENTRY(list_entry) list;
}
...
struct list_entry *current;
...
AST_DLLIST_TRAVERSE_SAFE_BEGIN(&entries, current, list) {
(do something with current here)
}
#define AST_DLLIST_TRAVERSE_SAFE_END
Closes a safe loop traversal block.
Definition: dlinkedlists.h:913

It differs from AST_DLLIST_TRAVERSE() in that the code inside the loop can modify (or even free, after calling AST_DLLIST_REMOVE_CURRENT()) the entry pointed to by the current pointer without affecting the loop traversal.

Since
1.6.1

Definition at line 888 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END

#define AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END

Closes a safe loop traversal block.

Since
1.6.1

Definition at line 921 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_DIRECTION

#define AST_DLLIST_TRAVERSE_DIRECTION (   head,
  var,
  field,
  start 
)     for ((var) = (head)->start; (var); (var) = AST_DLLIST_NEXT_DIRECTION(var, field, start))

Traverse a doubly linked list using the specified direction list.

Parameters
headList head structure pointer.
varThis is the name of the variable that will hold a pointer to the current list node on each iteration. It must be declared before calling this macro.
fieldList node field for the next node information. (declared using AST_DLLIST_ENTRY())
startSpecified list node to start traversal: first or last

This macro is use to loop over (traverse) the nodes in a list. It uses a for loop, and supplies the enclosed code with a pointer to each list node as it loops. It is typically used as follows:

static AST_DLLIST_HEAD(entry_list, list_entry) entries;
...
struct list_entry {
...
AST_DLLIST_ENTRY(list_entry) list;
}
...
struct list_entry *current;
...
AST_DLLIST_TRAVERSE_DIRECTION(&entries, current, list, first) {
(do something with current here (travers list in forward direction))
}
...
AST_DLLIST_TRAVERSE_DIRECTION(&entries, current, list, last) {
(do something with current here (travers list in reverse direction))
}
direction
FILE * in
Definition: utils/frame.c:33
Since
11

Definition at line 534 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN

#define AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN (   head,
  var,
  field,
  start 
)

Safe traversal of a doubly linked list using the specified direction list.

Parameters
headList head structure pointer.
varThis is the name of the variable that will hold a pointer to the current list node on each iteration. It must be declared before calling this macro.
fieldList node field for the next node information. (declared using AST_DLLIST_ENTRY())
startSpecified list node to start traversal: first or last

This macro is used to safely loop over (traverse) the nodes in a list. It uses a for loop, and supplies the enclosed code with a pointer to each list node as it loops. It is typically used as follows:

static AST_DLLIST_HEAD(entry_list, list_entry) entries;
...
struct list_entry {
...
AST_DLLIST_ENTRY(list_entry) list;
}
...
struct list_entry *current;
...
AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN(&entries, current, list, first) {
(do something with current here (travers list in forward direction))
}
...
AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN(&entries, current, list, last) {
(do something with current here (travers list in reverse direction))
}
#define AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END
Definition: dlinkedlists.h:810

It differs from AST_DLLIST_TRAVERSE() in that the code inside the loop can modify (or even free, after calling AST_DLLIST_REMOVE_CURRENT()) the entry pointed to by the current pointer without affecting the loop traversal.

Since
11

Definition at line 663 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END

#define AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END    } while (0)

Definition at line 810 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_SAFE_BEGIN

#define AST_DLLIST_TRAVERSE_SAFE_BEGIN (   head,
  var,
  field 
)     AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN(head, var, field, first)

Loops safely over (traverses) the entries in a list.

Parameters
headThis is a pointer to the list head structure
varThis is the name of the variable that will hold a pointer to the current list entry on each iteration. It must be declared before calling this macro.
fieldThis is the name of the field (declared using AST_DLLIST_ENTRY()) used to link entries of this list together.

This macro is used to safely loop over (traverse) the entries in a list. It uses a for loop, and supplies the enclosed code with a pointer to each list entry as it loops. It is typically used as follows:

static AST_DLLIST_HEAD(entry_list, list_entry) entries;
...
struct list_entry {
...
AST_DLLIST_ENTRY(list_entry) list;
}
...
struct list_entry *current;
...
AST_DLLIST_TRAVERSE_SAFE_BEGIN(&entries, current, list) {
(do something with current here)
}

It differs from AST_DLLIST_TRAVERSE() in that the code inside the loop can modify (or even free, after calling AST_DLLIST_REMOVE_CURRENT()) the entry pointed to by the current pointer without affecting the loop traversal.

Since
1.6.1

Definition at line 849 of file dlinkedlists.h.

◆ AST_DLLIST_TRAVERSE_SAFE_END

#define AST_DLLIST_TRAVERSE_SAFE_END   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END

Closes a safe loop traversal block.

Since
1.6.1

Definition at line 913 of file dlinkedlists.h.

◆ AST_DLLIST_TRYLOCK

#define AST_DLLIST_TRYLOCK (   head)     ast_mutex_trylock(&(head)->lock)

Locks a list, without blocking if the list is locked.

Parameters
headThis is a pointer to the list head structure

This macro attempts to place an exclusive lock in the list head structure pointed to by head.

Return values
0on success
non-zeroon failure
Since
1.6.1

Definition at line 85 of file dlinkedlists.h.

◆ AST_DLLIST_UNLOCK

#define AST_DLLIST_UNLOCK (   head)     ast_mutex_unlock(&(head)->lock)

Attempts to unlock a list.

Parameters
headThis is a pointer to the list head structure

This macro attempts to remove an exclusive lock from the list head structure pointed to by head. If the list was not locked by this thread, this macro has no effect.

Since
1.6.1

Definition at line 123 of file dlinkedlists.h.

◆ AST_RWDLLIST_APPEND_DLLIST

#define AST_RWDLLIST_APPEND_DLLIST   AST_DLLIST_APPEND_DLLIST

Definition at line 1130 of file dlinkedlists.h.

◆ AST_RWDLLIST_EMPTY

#define AST_RWDLLIST_EMPTY   AST_DLLIST_EMPTY

Definition at line 471 of file dlinkedlists.h.

◆ AST_RWDLLIST_ENTRY

#define AST_RWDLLIST_ENTRY   AST_DLLIST_ENTRY

Definition at line 415 of file dlinkedlists.h.

◆ AST_RWDLLIST_FIRST

#define AST_RWDLLIST_FIRST   AST_DLLIST_FIRST

Definition at line 424 of file dlinkedlists.h.

◆ AST_RWDLLIST_HEAD

#define AST_RWDLLIST_HEAD (   name,
  type 
)
Value:
struct name { \
struct type *first; \
struct type *last; \
ast_rwlock_t lock; \
}

Defines a structure to be used to hold a read/write list of specified type.

Parameters
nameThis will be the name of the defined structure.
typeThis is the type of each list entry.

This macro creates a structure definition that can be used to hold a list of the entries of type type. It does not actually declare (allocate) a structure; to do that, either follow this macro with the desired name of the instance you wish to declare, or use the specified name to declare instances elsewhere.

Example usage:

#define AST_RWDLLIST_HEAD(name, type)
Defines a structure to be used to hold a read/write list of specified type.
Definition: dlinkedlists.h:185

This would define struct entry_list, and declare an instance of it named entries, all intended to hold a list of type struct entry.

Since
1.6.1

Definition at line 185 of file dlinkedlists.h.

◆ AST_RWDLLIST_HEAD_DESTROY

#define AST_RWDLLIST_HEAD_DESTROY (   head)
Value:
{ \
(head)->first = NULL; \
(head)->last = NULL; \
ast_rwlock_destroy(&(head)->lock); \
}

Destroys an rwlist head structure.

Parameters
headThis is a pointer to the list head structure

This macro destroys a list head structure by setting the head entry to NULL (empty list) and destroying the embedded lock. It does not free the structure from memory.

Since
1.6.1

Definition at line 980 of file dlinkedlists.h.

◆ AST_RWDLLIST_HEAD_INIT

#define AST_RWDLLIST_HEAD_INIT (   head)
Value:
{ \
(head)->first = NULL; \
(head)->last = NULL; \
ast_rwlock_init(&(head)->lock); \
}

Initializes an rwlist head structure.

Parameters
headThis is a pointer to the list head structure

This macro initializes a list head structure by setting the head entry to NULL (empty list) and recreating the embedded lock.

Since
1.6.1

Definition at line 948 of file dlinkedlists.h.

◆ AST_RWDLLIST_HEAD_INIT_VALUE

#define AST_RWDLLIST_HEAD_INIT_VALUE
Value:
{ \
.first = NULL, \
.last = NULL, \
}
#define AST_RWLOCK_INIT_VALUE
Definition: lock.h:98

Defines initial values for a declaration of AST_RWDLLIST_HEAD.

Since
1.6.1

Definition at line 233 of file dlinkedlists.h.

◆ AST_RWDLLIST_HEAD_SET

#define AST_RWDLLIST_HEAD_SET (   head,
  entry 
)
Value:
do { \
(head)->first = (entry); \
(head)->last = (entry); \
ast_rwlock_init(&(head)->lock); \
} while (0)

Initializes an rwlist head structure with a specified first entry.

Parameters
headThis is a pointer to the list head structure
entrypointer to the list entry that will become the head of the list

This macro initializes a list head structure by setting the head entry to the supplied value and recreating the embedded lock.

Since
1.6.1

Definition at line 373 of file dlinkedlists.h.

◆ AST_RWDLLIST_HEAD_STATIC

#define AST_RWDLLIST_HEAD_STATIC (   name,
  type 
)
Value:
struct name { \
struct type *first; \
struct type *last; \
ast_rwlock_t lock; \
#define AST_RWDLLIST_HEAD_INIT_VALUE
Defines initial values for a declaration of AST_RWDLLIST_HEAD.
Definition: dlinkedlists.h:233

Defines a structure to be used to hold a read/write list of specified type, statically initialized.

Parameters
nameThis will be the name of the defined structure.
typeThis is the type of each list entry.

This macro creates a structure definition that can be used to hold a list of the entries of type type, and allocates an instance of it, initialized to be empty.

Example usage:

#define AST_RWDLLIST_HEAD_STATIC(name, type)
Defines a structure to be used to hold a read/write list of specified type, statically initialized.
Definition: dlinkedlists.h:328

This would define struct entry_list, intended to hold a list of type struct entry.

Since
1.6.1

Definition at line 328 of file dlinkedlists.h.

◆ AST_RWDLLIST_INSERT_AFTER

#define AST_RWDLLIST_INSERT_AFTER   AST_DLLIST_INSERT_AFTER

Definition at line 1026 of file dlinkedlists.h.

◆ AST_RWDLLIST_INSERT_AFTER_CURRENT

#define AST_RWDLLIST_INSERT_AFTER_CURRENT   AST_DLLIST_INSERT_AFTER_CURRENT

Definition at line 740 of file dlinkedlists.h.

◆ AST_RWDLLIST_INSERT_BEFORE

#define AST_RWDLLIST_INSERT_BEFORE   AST_DLLIST_INSERT_BEFORE

Definition at line 1052 of file dlinkedlists.h.

◆ AST_RWDLLIST_INSERT_BEFORE_CURRENT

#define AST_RWDLLIST_INSERT_BEFORE_CURRENT   AST_DLLIST_INSERT_BEFORE_CURRENT

Definition at line 713 of file dlinkedlists.h.

◆ AST_RWDLLIST_INSERT_BEFORE_CURRENT_BACKWARDS

#define AST_RWDLLIST_INSERT_BEFORE_CURRENT_BACKWARDS   AST_DLLIST_INSERT_BEFORE_CURRENT_BACKWARDS

Definition at line 907 of file dlinkedlists.h.

◆ AST_RWDLLIST_INSERT_HEAD

#define AST_RWDLLIST_INSERT_HEAD   AST_DLLIST_INSERT_HEAD

Definition at line 1075 of file dlinkedlists.h.

◆ AST_RWDLLIST_INSERT_TAIL

#define AST_RWDLLIST_INSERT_TAIL   AST_DLLIST_INSERT_TAIL

Definition at line 1103 of file dlinkedlists.h.

◆ AST_RWDLLIST_IS_MEMBER

#define AST_RWDLLIST_IS_MEMBER   AST_DLLIST_IS_MEMBER

Definition at line 498 of file dlinkedlists.h.

◆ AST_RWDLLIST_LAST

#define AST_RWDLLIST_LAST   AST_DLLIST_LAST

Definition at line 433 of file dlinkedlists.h.

◆ AST_RWDLLIST_MOVE_CURRENT

#define AST_RWDLLIST_MOVE_CURRENT   AST_DLLIST_MOVE_CURRENT

Definition at line 789 of file dlinkedlists.h.

◆ AST_RWDLLIST_MOVE_CURRENT_BACKWARDS

#define AST_RWDLLIST_MOVE_CURRENT_BACKWARDS   AST_DLLIST_MOVE_CURRENT_BACKWARDS

Definition at line 808 of file dlinkedlists.h.

◆ AST_RWDLLIST_NEXT

#define AST_RWDLLIST_NEXT   AST_DLLIST_NEXT

Definition at line 448 of file dlinkedlists.h.

◆ AST_RWDLLIST_NEXT_DIRECTION

#define AST_RWDLLIST_NEXT_DIRECTION   AST_DLLIST_NEXT_DIRECTION

Definition at line 437 of file dlinkedlists.h.

◆ AST_RWDLLIST_PREV

#define AST_RWDLLIST_PREV   AST_DLLIST_PREV

Definition at line 459 of file dlinkedlists.h.

◆ AST_RWDLLIST_RDLOCK

#define AST_RWDLLIST_RDLOCK (   head)     ast_rwlock_rdlock(&(head)->lock)

Read locks a list.

Parameters
headThis is a pointer to the list head structure

This macro attempts to place a read lock in the list head structure pointed to by head.

Return values
0on success
non-zeroon failure
Since
1.6.1

Definition at line 72 of file dlinkedlists.h.

◆ AST_RWDLLIST_REMOVE

#define AST_RWDLLIST_REMOVE   AST_DLLIST_REMOVE

Definition at line 1218 of file dlinkedlists.h.

◆ AST_RWDLLIST_REMOVE_CURRENT

#define AST_RWDLLIST_REMOVE_CURRENT   AST_DLLIST_REMOVE_CURRENT

Definition at line 770 of file dlinkedlists.h.

◆ AST_RWDLLIST_REMOVE_HEAD

#define AST_RWDLLIST_REMOVE_HEAD   AST_DLLIST_REMOVE_HEAD

Definition at line 1159 of file dlinkedlists.h.

◆ AST_RWDLLIST_REMOVE_TAIL

#define AST_RWDLLIST_REMOVE_TAIL   AST_DLLIST_REMOVE_TAIL

Definition at line 1188 of file dlinkedlists.h.

◆ AST_RWDLLIST_REMOVE_VERIFY

#define AST_RWDLLIST_REMOVE_VERIFY   AST_DLLIST_REMOVE_VERIFY

Definition at line 1238 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE

#define AST_RWDLLIST_TRAVERSE   AST_DLLIST_TRAVERSE

Definition at line 579 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_BACKWARDS

#define AST_RWDLLIST_TRAVERSE_BACKWARDS   AST_DLLIST_TRAVERSE_BACKWARDS

Definition at line 621 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN

#define AST_RWDLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN   AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_BEGIN

Definition at line 891 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_BACKWARDS_SAFE_END

#define AST_RWDLLIST_TRAVERSE_BACKWARDS_SAFE_END   AST_DLLIST_TRAVERSE_BACKWARDS_SAFE_END

Definition at line 923 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_DIRECTION

#define AST_RWDLLIST_TRAVERSE_DIRECTION   AST_DLLIST_TRAVERSE_DIRECTION

Definition at line 537 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN

#define AST_RWDLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_BEGIN

Definition at line 686 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_DIRECTION_SAFE_END

#define AST_RWDLLIST_TRAVERSE_DIRECTION_SAFE_END   AST_DLLIST_TRAVERSE_DIRECTION_SAFE_END

Definition at line 813 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_SAFE_BEGIN

#define AST_RWDLLIST_TRAVERSE_SAFE_BEGIN   AST_DLLIST_TRAVERSE_SAFE_BEGIN

Definition at line 852 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRAVERSE_SAFE_END

#define AST_RWDLLIST_TRAVERSE_SAFE_END   AST_DLLIST_TRAVERSE_SAFE_END

Definition at line 915 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRYRDLOCK

#define AST_RWDLLIST_TRYRDLOCK (   head)     ast_rwlock_tryrdlock(&(head)->lock)

Read locks a list, without blocking if the list is locked.

Parameters
headThis is a pointer to the list head structure

This macro attempts to place a read lock in the list head structure pointed to by head.

Return values
0on success
non-zeroon failure
Since
1.6.1

Definition at line 111 of file dlinkedlists.h.

◆ AST_RWDLLIST_TRYWRLOCK

#define AST_RWDLLIST_TRYWRLOCK (   head)     ast_rwlock_trywrlock(&(head)->lock)

Write locks a list, without blocking if the list is locked.

Parameters
headThis is a pointer to the list head structure

This macro attempts to place an exclusive write lock in the list head structure pointed to by head.

Return values
0on success
non-zeroon failure
Since
1.6.1

Definition at line 98 of file dlinkedlists.h.

◆ AST_RWDLLIST_UNLOCK

#define AST_RWDLLIST_UNLOCK (   head)     ast_rwlock_unlock(&(head)->lock)

Attempts to unlock a read/write based list.

Parameters
headThis is a pointer to the list head structure

This macro attempts to remove a read or write lock from the list head structure pointed to by head. If the list was not locked by this thread, this macro has no effect.

Since
1.6.1

Definition at line 135 of file dlinkedlists.h.

◆ AST_RWDLLIST_WRLOCK

#define AST_RWDLLIST_WRLOCK (   head)     ast_rwlock_wrlock(&(head)->lock)

Write locks a list.

Parameters
headThis is a pointer to the list head structure

This macro attempts to place an exclusive write lock in the list head structure pointed to by head.

Return values
0on success
non-zeroon failure
Since
1.6.1

Definition at line 59 of file dlinkedlists.h.