ContainerTracer  0.1
Data Structures | Macros | Functions
flist.h File Reference
#include <stdlib.h>
Include dependency graph for flist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  flist_head
 

Macros

#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)
 

Functions

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))
 

Macro Definition Documentation

◆ 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

#define FLIST_HEAD (   name)    struct flist_head name = FLIST_HEAD_INIT(name)

◆ FLIST_HEAD_INIT

#define FLIST_HEAD_INIT (   name)
Value:
{ \
&(name), &(name) \
}
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)

Function Documentation

◆ __flist_add()

static void __flist_add ( struct flist_head new_entry,
struct flist_head prev,
struct flist_head next 
)
static

◆ __flist_del()

static void __flist_del ( struct flist_head prev,
struct flist_head next 
)
static

◆ __flist_splice()

static void __flist_splice ( const struct flist_head list,
struct flist_head prev,
struct flist_head next 
)
static

◆ flist_add()

static void flist_add ( struct flist_head new_entry,
struct flist_head head 
)
static

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.

Here is the call graph for this function:

◆ flist_add_tail()

static void flist_add_tail ( struct flist_head new_entry,
struct flist_head head 
)
static
Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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()

void flist_sort ( void *  priv,
struct flist_head head,
int(*)(void *priv, struct flist_head *a, struct flist_head *b)  cmp 
)

◆ flist_splice()

static void flist_splice ( const struct flist_head list,
struct flist_head head 
)
static
Here is the call graph for this function:

◆ flist_splice_init()

static void flist_splice_init ( struct flist_head list,
struct flist_head head 
)
static
Here is the call graph for this function: