u_double_list.h File Reference

List macros heavily inspired by the Linux kernel list handling. More...

Include dependency graph for u_double_list.h:

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

Go to the source code of this file.

Data Structures

struct  list_head

Defines

#define LIST_INITHEAD(__item)
#define LIST_ADD(__item, __list)
#define LIST_ADDTAIL(__item, __list)
#define LIST_REPLACE(__from, __to)
#define LIST_DEL(__item)
#define LIST_DELINIT(__item)
#define LIST_ENTRY(__type, __item, __field)   ((__type *)(((char *)(__item)) - offsetof(__type, __field)))


Detailed Description

List macros heavily inspired by the Linux kernel list handling.

No list looping yet.

Is not threadsafe, so common operations need to be protected using an external mutex.

Definition in file u_double_list.h.


Define Documentation

#define LIST_ADD ( __item,
__list   ) 

Value:

do {                                            \
    (__item)->prev = (__list);                  \
    (__item)->next = (__list)->next;            \
    (__list)->next->prev = (__item);            \
    (__list)->next = (__item);                  \
  } while (0)

Definition at line 57 of file u_double_list.h.

#define LIST_ADDTAIL ( __item,
__list   ) 

Value:

do {                                            \
    (__item)->next = (__list);                  \
    (__item)->prev = (__list)->prev;            \
    (__list)->prev->next = (__item);            \
    (__list)->prev = (__item);                  \
  } while(0)

Definition at line 65 of file u_double_list.h.

#define LIST_DEL ( __item   ) 

Value:

do {                                            \
    (__item)->prev->next = (__item)->next;      \
    (__item)->next->prev = (__item)->prev;      \
  } while(0)

Definition at line 81 of file u_double_list.h.

#define LIST_DELINIT ( __item   ) 

Value:

do {                                            \
    (__item)->prev->next = (__item)->next;      \
    (__item)->next->prev = (__item)->prev;      \
    (__item)->next = (__item);                  \
    (__item)->prev = (__item);                  \
  } while(0)

Definition at line 87 of file u_double_list.h.

#define LIST_ENTRY ( __type,
__item,
__field   )     ((__type *)(((char *)(__item)) - offsetof(__type, __field)))

Definition at line 95 of file u_double_list.h.

#define LIST_INITHEAD ( __item   ) 

Value:

do {                                            \
    (__item)->prev = (__item);                  \
    (__item)->next = (__item);                  \
  } while (0)

Definition at line 51 of file u_double_list.h.

#define LIST_REPLACE ( __from,
__to   ) 

Value:

do {                                            \
    (__to)->prev = (__from)->prev;              \
    (__to)->next = (__from)->next;              \
    (__from)->next->prev = (__to);              \
    (__from)->prev->next = (__to);              \
  } while (0)

Definition at line 73 of file u_double_list.h.


Generated on Tue Sep 29 06:25:28 2009 for Gallium3D by  doxygen 1.5.4