-/**
- * Linked lists.
- * Shamelessly adapted from the linux kernel.
- */
-
-#ifndef _FIRM_LIST_H
-#define _FIRM_LIST_H
-#include "firm_config.h"
-
-/*
+/**
+ * @file
+ * @brief Doubly linked lists.
+ * @version $Id$
+ *
* Simple doubly linked list implementation.
*
* Some of the internal functions ("__xxx") are useful when
* 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.
- */
+ */
+#ifndef FIRM_ADT_LIST_H
+#define FIRM_ADT_LIST_H
+
+#include "firm_config.h"
struct list_head {
struct list_head *next, *prev;
* @param head the head for your list.
*/
#define list_for_each(pos, head) \
- for (pos = (head)->next, (pos->next); pos != (head); \
- pos = pos->next, (pos->next))
+ for (pos = (head)->next; pos != (head); pos = pos->next)
/**
* __list_for_each - iterate over a list
* @param head the head for your list.
*/
#define list_for_each_prev(pos, head) \
- for (pos = (head)->prev, (pos->prev); pos != (head); \
- pos = pos->prev, (pos->prev))
+ for (pos = (head)->prev; pos != (head); pos = pos->prev)
/**
* list_for_each_safe - iterate over a list safe against removal of list entry