list: Add cds_list_first_entry
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 4 Sep 2011 23:48:20 +0000 (19:48 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 4 Sep 2011 23:48:20 +0000 (19:48 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/list.h

index 7d2a9a11e39b12d061e6a68b90b6918f307af17a..04dad80929ef1d6f2ec1a3adcd302d8f2f962533 100644 (file)
@@ -126,12 +126,15 @@ cds_list_splice (struct cds_list_head *add, struct cds_list_head *head)
     }
 }
 
-
 /* Get typed element from list at a given position.  */
 #define cds_list_entry(ptr, type, member) \
   ((type *) ((char *) (ptr) - (unsigned long) (&((type *) 0)->member)))
 
 
+/* Get first entry from a list. */
+#define cds_list_first_entry(ptr, type, member) \
+       cds_list_entry((ptr)->next, type, member)
+
 
 /* Iterate forward over the elements of the list.  */
 #define cds_list_for_each(pos, head) \
This page took 0.025439 seconds and 4 git commands to generate.