#include <stdlib.h>
Go to the source code of this file.
|
#define | offsetof(TYPE, MEMBER) ((size_t) & ((TYPE *)0)->MEMBER) |
|
#define | container_of(ptr, type, member) |
|
#define | FLIST_HEAD_INIT(name) |
|
#define | FLIST_HEAD(name) struct flist_head name = FLIST_HEAD_INIT(name) |
|
#define | INIT_FLIST_HEAD(ptr) |
|
#define | flist_entry(ptr, type, member) container_of(ptr, type, member) |
|
#define | flist_for_each(pos, head) for (pos = (head)->next; pos != (head); pos = pos->next) |
|
#define | flist_for_each_safe(pos, n, head) |
|
|
static void | __flist_add (struct flist_head *new_entry, struct flist_head *prev, struct flist_head *next) |
|
static void | flist_add (struct flist_head *new_entry, struct flist_head *head) |
|
static void | flist_add_tail (struct flist_head *new_entry, struct flist_head *head) |
|
static void | __flist_del (struct flist_head *prev, struct flist_head *next) |
|
static void | flist_del (struct flist_head *entry) |
|
static void | flist_del_init (struct flist_head *entry) |
|
static int | flist_empty (const struct flist_head *head) |
|
static void | __flist_splice (const struct flist_head *list, struct flist_head *prev, struct flist_head *next) |
|
static void | flist_splice (const struct flist_head *list, struct flist_head *head) |
|
static void | flist_splice_init (struct flist_head *list, struct flist_head *head) |
|
void | flist_sort (void *priv, struct flist_head *head, int(*cmp)(void *priv, struct flist_head *a, struct flist_head *b)) |
|
◆ container_of
#define container_of |
( |
|
ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| |
Value:({ \
const typeof(((type *)0)->member) *__mptr = (ptr); \
(type *)((
char *)__mptr -
offsetof(type, member)); \
})
#define offsetof(TYPE, MEMBER)
Definition: flist.h:10
◆ flist_entry
#define flist_entry |
( |
|
ptr, |
|
|
|
type, |
|
|
|
member |
|
) |
| container_of(ptr, type, member) |
flist_entry - get the struct for this entry : the &struct flist_head pointer. : the type of the struct this is embedded in. : the name of the flist_struct within the struct.
◆ flist_for_each
#define flist_for_each |
( |
|
pos, |
|
|
|
head |
|
) |
| for (pos = (head)->next; pos != (head); pos = pos->next) |
flist_for_each - iterate over a list : the &struct flist_head to use as a loop counter. : the head for your list.
◆ flist_for_each_safe
#define flist_for_each_safe |
( |
|
pos, |
|
|
|
n, |
|
|
|
head |
|
) |
| |
Value:for (pos = (head)->next, n = pos->next; pos != (head); \
pos = n, n = pos->next)
flist_for_each_safe - iterate over a list safe against removal of list entry : the &struct flist_head to use as a loop counter.
: another &struct flist_head to use as temporary storage : the head for your list.
◆ FLIST_HEAD
◆ FLIST_HEAD_INIT
#define FLIST_HEAD_INIT |
( |
|
name | ) |
|
Value:{ \
}
name
Definition: setup.py:13
◆ INIT_FLIST_HEAD
#define INIT_FLIST_HEAD |
( |
|
ptr | ) |
|
Value:do { \
(ptr)->next = (ptr); \
(ptr)->prev = (ptr); \
} while (0)
◆ offsetof
#define offsetof |
( |
|
TYPE, |
|
|
|
MEMBER |
|
) |
| ((size_t) & ((TYPE *)0)->MEMBER) |
◆ __flist_add()
◆ __flist_del()
◆ __flist_splice()
◆ flist_add()
flist_add - add a new entry : new entry to be added : list head to add it after
Insert a new entry after the specified head. This is good for implementing stacks.
◆ flist_add_tail()
◆ flist_del()
static void flist_del |
( |
struct flist_head * |
entry | ) |
|
|
static |
flist_del - deletes entry from list. : the element to delete from the list. Note: flist_empty on entry does not return true after this, the entry is in an undefined state.
◆ flist_del_init()
static void flist_del_init |
( |
struct flist_head * |
entry | ) |
|
|
static |
flist_del_init - deletes entry from list and reinitialize it. : the element to delete from the list.
◆ flist_empty()
static int flist_empty |
( |
const struct flist_head * |
head | ) |
|
|
static |
flist_empty - tests whether a list is empty : the list to test.
◆ flist_sort()
◆ flist_splice()
◆ flist_splice_init()