.ico Version of the fancy new logo.
[paraslash.git] / list.h
diff --git a/list.h b/list.h
index ba6211ba191395e40fd63d526ab9ddacc2b7f697..de04ab9eed1184451f5338b06a7a2be9106aac5d 100644 (file)
--- a/list.h
+++ b/list.h
@@ -9,6 +9,7 @@
 
 #include <stddef.h> /* offsetof */
 
 
 #include <stddef.h> /* offsetof */
 
+/** get the struct this entry is embedded in */
 #define container_of(ptr, type, member) ({                      \
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
        (type *)( (char *)__mptr - offsetof(type,member) );})
 #define container_of(ptr, type, member) ({                      \
        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
        (type *)( (char *)__mptr - offsetof(type,member) );})
  */
 #define LIST_POISON2  ((void *) 0x00200200)
 
  */
 #define LIST_POISON2  ((void *) 0x00200200)
 
-/**
- * Simple doubly linked list implementation.
- *
+/** Simple doubly linked list implementation. */
+struct list_head {
+       /** pointer to the next list entry */
+       struct list_head *next;
+       /** pointer to the previous list entry */
+       struct list_head *prev;
+};
+
+/** must be called before using any other list functions */
+#define INIT_LIST_HEAD(ptr) do { \
+       (ptr)->next = (ptr); (ptr)->prev = (ptr); \
+} while (0)
+
+
+/*
  * Some of the internal functions ("__xxx") are useful when
  * manipulating whole lists rather than single entries, as
  * sometimes we already know the next/prev entries and we can
  * generate better code by using them directly rather than
  * using the generic single-entry routines.
  */
  * Some of the internal functions ("__xxx") are useful when
  * manipulating whole lists rather than single entries, as
  * sometimes we already know the next/prev entries and we can
  * generate better code by using them directly rather than
  * using the generic single-entry routines.
  */
-struct list_head {
-       struct list_head *next, *prev;
-};
 
 
-#define INIT_LIST_HEAD(ptr) do { \
-       (ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
 
 /*
  * Insert a new entry between two known consecutive entries.
 
 /*
  * Insert a new entry between two known consecutive entries.