Switch pqueue to size_t.
[libfirm] / include / libfirm / adt / list.h
index 92007c4..1cd8ea4 100644 (file)
@@ -1,4 +1,3 @@
-
 /**
  * @file
  * @brief   Doubly linked lists.
 #ifndef FIRM_ADT_LIST_H
 #define FIRM_ADT_LIST_H
 
-#include "firm_config.h"
 #include <stdlib.h>
 
+#include "../begin.h"
+
+typedef struct list_head list_head;
 struct list_head {
        struct list_head *next, *prev;
 };
@@ -43,7 +44,7 @@ struct list_head {
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static INLINE void __list_add(struct list_head *new_node,
+static inline void __list_add(struct list_head *new_node,
                              struct list_head *prev,
                              struct list_head *next)
 {
@@ -61,7 +62,7 @@ static INLINE void __list_add(struct list_head *new_node,
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static INLINE void list_add(struct list_head *new_node, struct list_head *head)
+static inline void list_add(struct list_head *new_node, struct list_head *head)
 {
        __list_add(new_node, head, head->next);
 }
@@ -74,7 +75,7 @@ static INLINE void list_add(struct list_head *new_node, struct list_head *head)
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static INLINE void list_add_tail(struct list_head *new_node, struct list_head *head)
+static inline void list_add_tail(struct list_head *new_node, struct list_head *head)
 {
        __list_add(new_node, head->prev, head);
 }
@@ -86,7 +87,7 @@ static INLINE void list_add_tail(struct list_head *new_node, struct list_head *h
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static INLINE void __list_del(struct list_head * prev, struct list_head * next)
+static inline void __list_del(struct list_head * prev, struct list_head * next)
 {
        next->prev = prev;
        prev->next = next;
@@ -96,11 +97,11 @@ static INLINE void __list_del(struct list_head * prev, struct list_head * next)
  * list_del - deletes entry from list.
  * @param entry  the element to delete from the list.
  *
- * @Note
+ * @note
  *   list_empty on entry does not return true after this, the entry is
  *   in an undefined state.
  */
-static INLINE void list_del(struct list_head *entry)
+static inline void list_del(struct list_head *entry)
 {
        __list_del(entry->prev, entry->next);
        entry->next = NULL;
@@ -112,7 +113,7 @@ static INLINE void list_del(struct list_head *entry)
  * list_del_init - deletes entry from list and reinitialize it.
  * @param entry   the element to delete from the list.
  */
-static INLINE void list_del_init(struct list_head *entry)
+static inline void list_del_init(struct list_head *entry)
 {
        __list_del(entry->prev, entry->next);
        INIT_LIST_HEAD(entry);
@@ -123,7 +124,7 @@ static INLINE void list_del_init(struct list_head *entry)
  * @param list   the entry to move
  * @param head   the head that will precede our entry
  */
-static INLINE void list_move(struct list_head *list, struct list_head *head)
+static inline void list_move(struct list_head *list, struct list_head *head)
 {
         __list_del(list->prev, list->next);
         list_add(list, head);
@@ -134,7 +135,7 @@ static INLINE void list_move(struct list_head *list, struct list_head *head)
  * @param list   the entry to move
  * @param head   the head that will follow our entry
  */
-static INLINE void list_move_tail(struct list_head *list,
+static inline void list_move_tail(struct list_head *list,
                                  struct list_head *head)
 {
         __list_del(list->prev, list->next);
@@ -145,12 +146,12 @@ static INLINE void list_move_tail(struct list_head *list,
  * list_empty - tests whether a list is empty
  * @param head   the list to test.
  */
-static INLINE int list_empty(const struct list_head *head)
+static inline int list_empty(const struct list_head *head)
 {
        return head->next == head;
 }
 
-static INLINE void __list_splice(struct list_head *list,
+static inline void __list_splice(struct list_head *list,
                                 struct list_head *head)
 {
        struct list_head *first = list->next;
@@ -169,7 +170,7 @@ static INLINE void __list_splice(struct list_head *list,
  * @param list   the new list to add.
  * @param head   the place to add it in the first list.
  */
-static INLINE void list_splice(struct list_head *list, struct list_head *head)
+static inline void list_splice(struct list_head *list, struct list_head *head)
 {
        if (!list_empty(list))
                __list_splice(list, head);
@@ -182,7 +183,7 @@ static INLINE void list_splice(struct list_head *list, struct list_head *head)
  *
  * The list at list is reinitialized
  */
-static INLINE void list_splice_init(struct list_head *list,
+static inline void list_splice_init(struct list_head *list,
                                    struct list_head *head)
 {
        if (!list_empty(list)) {
@@ -278,5 +279,6 @@ static INLINE void list_splice_init(struct list_head *list,
             &pos->member != (head);                                    \
             pos = n, n = list_entry(n->member.next, type, member))
 
+#include "../end.h"
 
 #endif