list.h revision e345e2670a8c17f5e1145cc554b7a7646e271032
/*
* Simple doubly linked list implementation.
*
* Based on list.h in the Linux kernel source tree, licensed under
* the GNU GPL version 2.
*/
#ifndef _LIST_H
#define _LIST_H
/**
* container_of:
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
* cast a member of a structure out to the containing structure
*/
/*
* These are non-NULL pointers that will result in page faults
* under normal circumstances, used to verify that nobody uses
* non-initialized list entries.
*/
#define LIST_POISON1 ((void *) 0x00100100)
#define LIST_POISON2 ((void *) 0x00200200)
struct list_head {
};
#define INIT_LIST_HEAD(ptr) do { \
} while (0)
/* Insert a new entry between two known consecutive entries. */
{
}
/**
* list_add:
* @new: new entry to be added
* @head: list head to add it after
*
* Insert a new entry after the specified head.
* This is good for implementing stacks.
*/
{
}
/**
* list_add_tail:
* @new: new entry to be added
* @head: list head to add it before
*
* Insert a new entry before the specified head.
* This is useful for implementing queues.
*/
{
}
/*
* point to each other.
*/
{
}
/**
* list_del:
* @entry: the element to delete from the list.
*
* deletes entry from list.
*
* Note: list_empty on entry does not return true after this, the entry is
* in an undefined state.
*/
{
}
/**
* list_move
* @list: the entry to move
* @head: the head that will precede our entry
* delete from one list and add as another's head
*/
{
}
/**
* list_move_tail
* @list: the entry to move
* @head: the head that will follow our entry
*
* delete from one list and add as another's tail
*/
{
}
/**
* list_empty:
* @head: the list to test.
*
* tests whether a list is empty
*/
{
}
/**
* list_entry:
* @ptr: the &struct list_head pointer.
* @type: the type of the struct this is embedded in.
* @member: the name of the list_struct within the struct.
*
* get the struct for this entry
*/
/**
* list_for_each_entry:
* @pos: the type * to use as a loop counter.
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* iterate over list of given type
*/
/**
* list_for_each_entry_safe:
* @pos: the type * to use as a loop counter.
* @n: another type * to use as temporary storage
* @head: the head for your list.
* @member: the name of the list_struct within the struct.
*
* iterate over list of given type safe against removal of list entry
*/
#endif /* _LIST_H */