Paraslash Audio Streaming | |
About News Download Documentation Development |
Doubly linked list implementation. More...
#include <stddef.h>
Data Structures | |
struct | list_head |
A list head is just a pair of pointers. More... | |
Macros | |
#define | container_of(ptr, type, member) |
Get the struct this entry is embedded in. More... | |
#define | INITIALIZED_LIST_HEAD(name) struct list_head name = {&(name), &(name)} |
Define an initialized list head. More... | |
#define | list_entry(ptr, type, member) container_of(ptr, type, member) |
Get the struct in which this entry is embedded in. More... | |
#define | list_for_each_entry(pos, head, member) |
Iterate over a list. More... | |
#define | list_for_each_entry_safe(pos, n, head, member) |
Iterate over list, safe against removal of list entry. More... | |
#define | list_first_entry(ptr, type, member) list_entry((ptr)->next, type, member) |
Get the first element of a list. More... | |
#define | list_last_entry(ptr, type, member) list_entry((ptr)->prev, type, member) |
Doubly linked list implementation.
#define container_of | ( | ptr, | |
type, | |||
member | |||
) |
Get the struct this entry is embedded in.
#define INITIALIZED_LIST_HEAD | ( | name | ) | struct list_head name = {&(name), &(name)} |
Define an initialized list head.
#define list_entry | ( | ptr, | |
type, | |||
member | |||
) | container_of(ptr, type, member) |
Get the struct in which this entry is embedded in.
ptr | The list head pointer. |
type | The type of containing structure. |
member | The name of the list head member within the structure. |
#define list_for_each_entry | ( | pos, | |
head, | |||
member | |||
) |
Iterate over a list.
pos | A struct pointer which serves as the iterator. |
head | The head of the list. |
member | The name of the list head member within the structure. |
#define list_for_each_entry_safe | ( | pos, | |
n, | |||
head, | |||
member | |||
) |
Iterate over list, safe against removal of list entry.
pos | The iterator struct pointer. |
n | A second struct pointer which is used as temporary storage. |
head | The head of the list. |
member | The name of the list head member within the structure. |
#define list_first_entry | ( | ptr, | |
type, | |||
member | |||
) | list_entry((ptr)->next, type, member) |
Get the first element of a list.
ptr | The list head to take the element from. |
type | The type of the struct this is embedded in. |
member | The name of the list_struct within the struct. |
Note that the list is expected to be non-empty.
#define list_last_entry | ( | ptr, | |
type, | |||
member | |||
) | list_entry((ptr)->prev, type, member) |