linkedlists.h File Reference

#include <asterisk/lock.h>

Include dependency graph for linkedlists.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define AST_LIST_LOCK(head)   ast_mutex_lock(&head->lock)
#define AST_LIST_UNLOCK(head)   ast_mutex_unlock(&head->lock)
#define AST_LIST_HEAD(name, type)
#define AST_LIST_HEAD_SET(head, entry)
#define AST_LIST_ENTRY(type)
#define AST_LIST_FIRST(head)   ((head)->first)
#define AST_LIST_NEXT(elm, field)   ((elm)->field.next)
#define AST_LIST_EMPTY(head)   (AST_LIST_FIRST(head) == NULL)
#define AST_LIST_TRAVERSE(head, var, field)   for((var) = (head)->first; (var); (var) = (var)->field.next)
#define AST_LIST_HEAD_INIT(head)
#define AST_LIST_INSERT_AFTER(listelm, elm, field)
#define AST_LIST_INSERT_HEAD(head, elm, field)
#define AST_LIST_INSERT_TAIL(head, elm, type, field)
#define AST_LIST_REMOVE_HEAD(head, field)
#define AST_LIST_REMOVE(head, elm, type, field)


Define Documentation

#define AST_LIST_EMPTY ( head   )     (AST_LIST_FIRST(head) == NULL)

Definition at line 32 of file linkedlists.h.

#define AST_LIST_ENTRY ( type   ) 

Value:

struct {                      \
   struct type *next;                  \
}

Definition at line 23 of file linkedlists.h.

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

Definition at line 28 of file linkedlists.h.

#define AST_LIST_HEAD ( name,
type   ) 

Value:

struct name {                       \
   struct type *first;                 \
   ast_mutex_t lock;                \
}

Definition at line 12 of file linkedlists.h.

#define AST_LIST_HEAD_INIT ( head   ) 

Value:

{                 \
   (head)->first = NULL;                  \
   ast_pthread_mutex_init(&(head)->lock,NULL);           \
}

Definition at line 37 of file linkedlists.h.

#define AST_LIST_HEAD_SET ( head,
entry   ) 

Value:

do {           \
   (head)->first=(entry);                 \
   ast_pthread_mutex_init(&(head)->lock,NULL);           \
} while (0)

Definition at line 18 of file linkedlists.h.

#define AST_LIST_INSERT_AFTER ( listelm,
elm,
field   ) 

Value:

do {     \
   (elm)->field.next = (listelm)->field.next;         \
   (listelm)->field.next = (elm);            \
} while (0)

Definition at line 42 of file linkedlists.h.

#define AST_LIST_INSERT_HEAD ( head,
elm,
field   ) 

Value:

do {        \
      (elm)->field.next = (head)->first;        \
      (head)->first = (elm);              \
} while (0)

Definition at line 47 of file linkedlists.h.

#define AST_LIST_INSERT_TAIL ( head,
elm,
type,
field   ) 

Definition at line 52 of file linkedlists.h.

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

Definition at line 6 of file linkedlists.h.

#define AST_LIST_NEXT ( elm,
field   )     ((elm)->field.next)

Definition at line 30 of file linkedlists.h.

#define AST_LIST_REMOVE ( head,
elm,
type,
field   ) 

Definition at line 69 of file linkedlists.h.

#define AST_LIST_REMOVE_HEAD ( head,
field   ) 

Value:

do {              \
      (head)->first = (head)->first->field.next;         \
   } while (0)

Definition at line 65 of file linkedlists.h.

#define AST_LIST_TRAVERSE ( head,
var,
field   )     for((var) = (head)->first; (var); (var) = (var)->field.next)

Definition at line 34 of file linkedlists.h.

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

Definition at line 9 of file linkedlists.h.


Generated on Wed Oct 28 17:00:56 2009 for Asterisk by  doxygen 1.5.6