#include <stddef.h>
Go to the source code of this file.
|
| #define | offsetof(TYPE, MEMBER) |
| #define | container_of(ptr, type, member) |
| #define | container_of_const(ptr, type, member) |
| #define | prefetch(x) |
| #define | LIST_POISON1 ((void *) 0x00100100) |
| #define | LIST_POISON2 ((void *) 0x00200200) |
| #define | LIST_HEAD_INIT(name) |
| #define | LIST_HEAD(name) |
| #define | list_entry(ptr, type, member) |
| #define | list_entry_const(ptr, type, member) |
| #define | list_for_each(pos, head) |
| #define | __list_for_each(pos, head) |
| #define | list_for_each_prev(pos, head) |
| #define | list_for_each_safe(pos, n, head) |
| #define | list_for_each_entry(pos, head, member) |
| #define | list_for_each_entry_reverse(pos, head, member) |
| #define | list_prepare_entry(pos, head, member) |
| #define | list_for_each_entry_continue(pos, head, member) |
| #define | list_for_each_entry_from(pos, head, member) |
| #define | list_for_each_entry_safe(pos, n, head, member) |
| #define | list_for_each_entry_safe_continue(pos, n, head, member) |
| #define | list_for_each_entry_safe_from(pos, n, head, member) |
| #define | list_for_each_entry_safe_reverse(pos, n, head, member) |
|
| static void | INIT_LIST_HEAD (struct list_head *list) |
| static void | __list_add (struct list_head *new_, struct list_head *prev, struct list_head *next) |
| static void | list_add (struct list_head *new_, struct list_head *head) |
| static void | list_add_tail (struct list_head *new_, struct list_head *head) |
| static void | __list_del (struct list_head *prev, struct list_head *next) |
| static void | list_del (struct list_head *entry) |
| static void | list_del_init (struct list_head *entry) |
| static void | list_move (struct list_head *list, struct list_head *head) |
| static void | list_move_tail (struct list_head *list, struct list_head *head) |
| static int | list_empty (const struct list_head *head) |
| static int | list_empty_careful (const struct list_head *head) |
| static void | __list_splice (struct list_head *list, struct list_head *head) |
| static void | __list_splice_tail (struct list_head *list, struct list_head *head) |
| static void | list_splice (struct list_head *list, struct list_head *head) |
| static void | list_splice_tail (struct list_head *list, struct list_head *head) |
| static void | list_splice_init (struct list_head *list, struct list_head *head) |
| static void | list_splice_tail_init (struct list_head *list, struct list_head *head) |
◆ __list_for_each
| #define __list_for_each |
( |
| pos, |
|
|
| head ) |
Value:for (pos = (
head)->next; pos != (
head); pos = pos->next)
__list_for_each - iterate over a list
- Parameters
-
| pos | the &struct list_head to use as a loop counter. |
| head | the head for your list. |
This variant differs from list_for_each() in that it's the simplest possible list iteration code, no prefetching is done. Use this for code that knows the list to be very short (empty or 1 entry) most of the time.
◆ container_of
| #define container_of |
( |
| ptr, |
|
|
| type, |
|
|
| member ) |
Value:({ \
typeof( ((
type *)0)->member ) *__mptr = (ptr); \
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
#define offsetof(TYPE, MEMBER)
Definition list.h:42
container_of - cast a member of a structure out to the containing structure
- Parameters
-
| 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. |
◆ container_of_const
| #define container_of_const |
( |
| ptr, |
|
|
| type, |
|
|
| member ) |
Value:({ \
const typeof( ((
type *)0)->member ) *__mptr = (ptr); \
◆ list_entry
| #define list_entry |
( |
| ptr, |
|
|
| type, |
|
|
| member ) |
Value:list_entry - get the struct for this entry
- Parameters
-
| 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. |
◆ list_entry_const
| #define list_entry_const |
( |
| ptr, |
|
|
| type, |
|
|
| member ) |
◆ list_for_each
| #define list_for_each |
( |
| pos, |
|
|
| head ) |
Value:
pos = pos->next)
#define prefetch(x)
Definition list.h:60
list_for_each - iterate over a list
- Parameters
-
| pos | the &struct list_head to use as a loop counter. |
| head | the head for your list. |
◆ list_for_each_entry
| #define list_for_each_entry |
( |
| pos, |
|
|
| head, |
|
|
| member ) |
Value:
prefetch(pos->member.next), &pos->member != (
head); \
pos =
list_entry(pos->member.next, typeof(*pos), member))
#define list_entry(ptr, type, member)
Definition list.h:313
list_for_each_entry - iterate over list of given type
- Parameters
-
| 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. |
◆ list_for_each_entry_continue
| #define list_for_each_entry_continue |
( |
| pos, |
|
|
| head, |
|
|
| member ) |
Value:for (pos =
list_entry(pos->member.next, typeof(*pos), member); \
prefetch(pos->member.next), &pos->member != (
head); \
pos =
list_entry(pos->member.next, typeof(*pos), member))
list_for_each_entry_continue - iterate over list of given type continuing after existing point
- Parameters
-
| 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. |
◆ list_for_each_entry_from
| #define list_for_each_entry_from |
( |
| pos, |
|
|
| head, |
|
|
| member ) |
Value:for (;
prefetch(pos->member.next), &pos->member != (
head); \
pos =
list_entry(pos->member.next, typeof(*pos), member))
list_for_each_entry_from - iterate over list of given type continuing from existing point
- Parameters
-
| 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. |
◆ list_for_each_entry_reverse
| #define list_for_each_entry_reverse |
( |
| pos, |
|
|
| head, |
|
|
| member ) |
Value:
prefetch(pos->member.prev), &pos->member != (
head); \
pos =
list_entry(pos->member.prev, typeof(*pos), member))
list_for_each_entry_reverse - iterate backwards over list of given type.
- Parameters
-
| 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. |
◆ list_for_each_entry_safe
| #define list_for_each_entry_safe |
( |
| pos, |
|
|
| n, |
|
|
| head, |
|
|
| member ) |
Value:
n =
list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (
head); \
int n
Definition crypt.c:458
list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
- Parameters
-
| 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. |
◆ list_for_each_entry_safe_continue
| #define list_for_each_entry_safe_continue |
( |
| pos, |
|
|
| n, |
|
|
| head, |
|
|
| member ) |
Value:for (pos =
list_entry(pos->member.next, typeof(*pos), member), \
n =
list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (
head); \
list_for_each_entry_safe_continue - iterate over list of given type continuing after existing point safe against removal of list entry
- Parameters
-
| 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. |
◆ list_for_each_entry_safe_from
| #define list_for_each_entry_safe_from |
( |
| pos, |
|
|
| n, |
|
|
| head, |
|
|
| member ) |
Value:for (
n =
list_entry(pos->member.next, typeof(*pos), member); \
&pos->member != (
head); \
list_for_each_entry_safe_from - iterate over list of given type from existing point safe against removal of list entry
- Parameters
-
| 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. |
◆ list_for_each_entry_safe_reverse
| #define list_for_each_entry_safe_reverse |
( |
| pos, |
|
|
| n, |
|
|
| head, |
|
|
| member ) |
Value:
n =
list_entry(pos->member.prev, typeof(*pos), member); \
&pos->member != (
head); \
list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against removal of list entry
- Parameters
-
| 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. |
◆ list_for_each_prev
| #define list_for_each_prev |
( |
| pos, |
|
|
| head ) |
Value:list_for_each_prev - iterate over a list backwards
- Parameters
-
| pos | the &struct list_head to use as a loop counter. |
| head | the head for your list. |
◆ list_for_each_safe
| #define list_for_each_safe |
( |
| pos, |
|
|
| n, |
|
|
| head ) |
Value:for (pos = (
head)->next,
n = pos->next; pos != (
head); \
list_for_each_safe - iterate over a list safe against removal of list entry
- Parameters
-
| pos | the &struct list_head to use as a loop counter. |
| n | another &struct list_head to use as temporary storage |
| head | the head for your list. |
◆ LIST_HEAD
| #define LIST_HEAD |
( |
| name | ) |
|
Value:
static const char * name
Definition pugl.h:1582
#define LIST_HEAD_INIT(name)
Definition list.h:84
◆ LIST_HEAD_INIT
| #define LIST_HEAD_INIT |
( |
| name | ) |
|
◆ LIST_POISON1
| #define LIST_POISON1 ((void *) 0x00100100) |
◆ LIST_POISON2
| #define LIST_POISON2 ((void *) 0x00200200) |
◆ list_prepare_entry
| #define list_prepare_entry |
( |
| pos, |
|
|
| head, |
|
|
| member ) |
Value:list_prepare_entry - prepare a pos entry for use as a start point in list_for_each_entry_continue
- Parameters
-
| pos | the type * to use as a start point |
| head | the head of the list |
| member | the name of the list_struct within the struct. |
◆ offsetof
| #define offsetof |
( |
| TYPE, |
|
|
| MEMBER ) |
Value:((size_t) &((
TYPE *)0)->MEMBER)
@ TYPE
Definition inflate.h:35
◆ prefetch
Value:
unsigned x[BMAX+1]
Definition inflate.c:1586
◆ __list_add()
◆ __list_del()
◆ __list_splice()
◆ __list_splice_tail()
◆ INIT_LIST_HEAD()
◆ list_add()
list_add - add a new entry
- Parameters
-
| 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()
list_add_tail - add a new entry
- Parameters
-
| 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.
◆ list_del()
list_del - deletes entry from list.
- Parameters
-
| entry | the element to delete from the list. Note: list_empty on entry does not return true after this, the entry is in an undefined state. |
◆ list_del_init()
list_del_init - deletes entry from list and reinitialize it.
- Parameters
-
| entry | the element to delete from the list. |
◆ list_empty()
list_empty - tests whether a list is empty
- Parameters
-
◆ list_empty_careful()
list_empty_careful - tests whether a list is empty and checks that no other CPU might be in the process of still modifying either member
NOTE: using list_empty_careful() without synchronization can only be safe if the only activity that can happen to the list entry is list_del_init(). Eg. it cannot be used if another CPU could re-list_add() it.
- Parameters
-
◆ list_move()
list_move - delete from one list and add as another's head
- Parameters
-
| list | the entry to move |
| head | the head that will precede our entry |
◆ list_move_tail()
list_move_tail - delete from one list and add as another's tail
- Parameters
-
| list | the entry to move |
| head | the head that will follow our entry |
◆ list_splice()
list_splice - join two lists
- Parameters
-
| list | the new list to add. |
| head | the place to add it in the first list. |
◆ list_splice_init()
list_splice_init - join two lists and reinitialise the emptied list.
- Parameters
-
| list | the new list to add. |
| head | the place to add it in the first list. |
The list at list is reinitialised
◆ list_splice_tail()
list_splice_tail - join two lists
- Parameters
-
| list | the new list to add. |
| head | the place to add it in the first list. |
list goes to the end (at head->prev)
◆ list_splice_tail_init()
list_splice_tail_init - join two lists and reinitialise the emptied list.
- Parameters
-
| list | the new list to add. |
| head | the place to add it in the first list. |
The list list is reinitialised list goes to the end (at head->prev)