CUBRID Engine  latest
es_list.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  es_list_head
 

Macros

#define ES_LIST_HEAD_INIT(name)   { &(name), &(name) }
 
#define ES_LIST_HEAD(name)   struct es_list_head name = ES_LIST_HEAD_INIT(name)
 
#define ES_INIT_LIST_HEAD(ptr)
 
#define ES_LIST_FIRST(name)   (name)->next
 
#define ES_LIST_LAST(name)   (name)->prev
 
#define ES_LIST_ENTRY(ptr, type, member)   ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
 
#define ES_LIST_FOR_EACH(pos, head)   for (pos = (head)->next; pos != (head); pos = pos->next)
 
#define ES_LIST_FOR_REVERSE_EACH(pos, head)   for (pos = (head)->prev; pos != (head); pos = pos->prev)
 
#define ES_LIST_FOR_EACH_SAFE(pos, n, head)
 

Typedefs

typedef struct es_list_head es_list_head_t
 

Functions

static void __list_add (struct es_list_head *new_item, struct es_list_head *prev, struct es_list_head *next)
 
static void es_list_add (struct es_list_head *new_item, struct es_list_head *head)
 
static void es_list_add_tail (struct es_list_head *new_item, struct es_list_head *head)
 
static void __list_del (struct es_list_head *prev, struct es_list_head *next)
 
static void es_list_del (struct es_list_head *entry)
 
static void es_list_del_init (struct es_list_head *entry)
 
static int es_list_empty (struct es_list_head *head)
 
static void es_list_splice (struct es_list_head *list, struct es_list_head *head)
 

Macro Definition Documentation

#define ES_INIT_LIST_HEAD (   ptr)
Value:
do { \
(ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)

Definition at line 50 of file es_list.h.

Referenced by es_list_del_init().

#define ES_LIST_ENTRY (   ptr,
  type,
  member 
)    ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))

ES_LIST_ENTRY - get the struct for this entry : the &struct es_list_head pointer. : the type of the struct this is embedded in. : the name of the list_struct within the struct.

Definition at line 168 of file es_list.h.

#define ES_LIST_FIRST (   name)    (name)->next

Definition at line 54 of file es_list.h.

#define ES_LIST_FOR_EACH (   pos,
  head 
)    for (pos = (head)->next; pos != (head); pos = pos->next)

ES_LIST_FOR_EACH - iterate over a list : the &struct es_list_head to use as a loop counter. : the head for your list.

Definition at line 176 of file es_list.h.

#define ES_LIST_FOR_EACH_SAFE (   pos,
  n,
  head 
)
Value:
for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)

LIST_FOR_EACH_SAFE - iterate over a list safe against removal of list entry : the &struct es_list_head to use as a loop counter.
: another &struct es_list_head to use as temporary storage : the head for your list.

Definition at line 193 of file es_list.h.

#define ES_LIST_FOR_REVERSE_EACH (   pos,
  head 
)    for (pos = (head)->prev; pos != (head); pos = pos->prev)

LIST_FOR_REVERSE_EACH - iterate over a list with reverse order : the &struct es_list_head to use as a loop counter. : the head for your list.

Definition at line 184 of file es_list.h.

#define ES_LIST_HEAD (   name)    struct es_list_head name = ES_LIST_HEAD_INIT(name)

Definition at line 47 of file es_list.h.

#define ES_LIST_HEAD_INIT (   name)    { &(name), &(name) }

Definition at line 45 of file es_list.h.

#define ES_LIST_LAST (   name)    (name)->prev

Definition at line 55 of file es_list.h.

Typedef Documentation

typedef struct es_list_head es_list_head_t

Definition at line 43 of file es_list.h.

Function Documentation

static void __list_add ( struct es_list_head new_item,
struct es_list_head prev,
struct es_list_head next 
)
inlinestatic

Definition at line 63 of file es_list.h.

References es_list_head::next, and es_list_head::prev.

Referenced by es_list_add(), and es_list_add_tail().

Here is the caller graph for this function:

static void __list_del ( struct es_list_head prev,
struct es_list_head next 
)
inlinestatic

Definition at line 104 of file es_list.h.

References es_list_head::next, and es_list_head::prev.

Referenced by es_list_del(), and es_list_del_init().

Here is the caller graph for this function:

static void es_list_add ( struct es_list_head new_item,
struct es_list_head head 
)
inlinestatic

es_list_add - add a new entry : new entry to be added : list head to add it after

Insert a new entry after the specified head. This is good for implementing stacks.

Definition at line 79 of file es_list.h.

References __list_add(), and es_list_head::next.

static void es_list_add_tail ( struct es_list_head new_item,
struct es_list_head head 
)
inlinestatic

es_list_add_tail - add a new entry : new entry to be added : list head to add it before

Insert a new entry before the specified head. This is useful for implementing queues.

Definition at line 92 of file es_list.h.

References __list_add(), and es_list_head::prev.

static void es_list_del ( struct es_list_head entry)
inlinestatic

es_list_del - deletes entry from list. : the element to delete from the list. Note: es_list_empty on entry does not return true after this, the entry is in an undefined state.

Definition at line 115 of file es_list.h.

References __list_del(), es_list_head::next, and es_list_head::prev.

static void es_list_del_init ( struct es_list_head entry)
inlinestatic

es_list_del_init - deletes entry from list and reinitialize it. : the element to delete from the list.

Definition at line 125 of file es_list.h.

References __list_del(), ES_INIT_LIST_HEAD, es_list_head::next, and es_list_head::prev.

static int es_list_empty ( struct es_list_head head)
inlinestatic

es_list_empty - tests whether a list is empty : the list to test.

Definition at line 135 of file es_list.h.

References es_list_head::next.

static void es_list_splice ( struct es_list_head list,
struct es_list_head head 
)
inlinestatic

LIST_SPLICE - join two lists : the new list to add. : the place to add it in the first list.

Definition at line 145 of file es_list.h.

References es_list_head::next, and es_list_head::prev.