Back to index

glibc  2.9
Classes | Defines | Typedefs | Functions
list.h File Reference

Go to the source code of this file.

Classes

struct  list_head

Defines

#define LIST_HEAD(name)   list_t name = { &(name), &(name) }
#define INIT_LIST_HEAD(ptr)   (ptr)->next = (ptr)->prev = (ptr)
#define list_entry(ptr, type, member)   ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
#define list_for_each(pos, head)   for (pos = (head)->next; pos != (head); pos = pos->next)
#define list_for_each_prev(pos, head)   for (pos = (head)->prev; pos != (head); pos = pos->prev)
#define list_for_each_prev_safe(pos, p, head)

Typedefs

typedef struct list_head list_t

Functions

static void list_add (list_t *newp, list_t *head)
static void list_add_tail (list_t *newp, list_t *head)
static void list_del (list_t *elem)
static void list_splice (list_t *add, list_t *head)

Class Documentation

struct list_head

Definition at line 29 of file list.h.

Collaboration diagram for list_head:
Class Members
struct list_head * next
struct list_head * prev

Define Documentation

#define INIT_LIST_HEAD (   ptr)    (ptr)->next = (ptr)->prev = (ptr)

Definition at line 41 of file list.h.

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

Definition at line 92 of file list.h.

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

Definition at line 98 of file list.h.

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

Definition at line 103 of file list.h.

#define list_for_each_prev_safe (   pos,
  p,
  head 
)
Value:
for (pos = (head)->prev, p = pos->prev; \
       pos != (head); \
       pos = p, p = pos->prev)

Definition at line 109 of file list.h.

#define LIST_HEAD (   name)    list_t name = { &(name), &(name) }

Definition at line 37 of file list.h.


Typedef Documentation

typedef struct list_head list_t

Function Documentation

static void list_add ( list_t newp,
list_t head 
) [inline, static]

Definition at line 47 of file list.h.

{
  head->next->prev = newp;
  newp->next = head->next;
  newp->prev = head;
  head->next = newp;
}

Here is the caller graph for this function:

static void list_add_tail ( list_t newp,
list_t head 
) [inline, static]

Definition at line 58 of file list.h.

{
  head->prev->next = newp;
  newp->next = head;
  newp->prev = head->prev;
  head->prev = newp;
}

Here is the caller graph for this function:

static void list_del ( list_t elem) [inline, static]

Definition at line 69 of file list.h.

{
  elem->next->prev = elem->prev;
  elem->prev->next = elem->next;
}

Here is the caller graph for this function:

static void list_splice ( list_t add,
list_t head 
) [inline, static]

Definition at line 78 of file list.h.

{
  /* Do nothing if the list which gets added is empty.  */
  if (add != add->next)
    {
      add->next->prev = head;
      add->prev->next = head->next;
      head->next->prev = add->prev;
      head->next = add->next;
    }
}

Here is the caller graph for this function: