Llist

## Files

file | llist.h
| Simple double-linked list.

## Classes

struct | llist_head

## Macros

#define | LLIST_HEAD_INIT(name) { &(name), &(name) }
#define | LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name)
#define | llist_entry(ptr, type, member) ((type *)( (char *)(ptr) - offsetof(type, member) ))
| Get the struct for this entry. More...
#define | llist_for_each_entry(type, pos, head, member)
| Iterate over llist of given type. More...

## Functions

static void | llist_add (struct llist_head *_new, struct llist_head *head)
| Add a new entry after the specified head. More...
static void | llist_del (struct llist_head *entry)
| Deletes entry from llist. More...

## Detailed Description

## Macro Definition Documentation

## llist_entry

#define llist_entry | ( |  | ptr,
|  |  | type,
|  |  | member
| ) |  | ((type *)( (char *)(ptr) - offsetof(type, member) ))

Get the struct for this entry.

Parameters

  [in] | ptr | the &struct llist_head pointer
  [in] | type | the type of the struct this is embedded in
  [in] | member | the name of the llist_struct within the struct

Returns
  The struct for this entry

## llist_for_each_entry

#define llist_for_each_entry | ( |  | type,
|  |  | pos,
|  |  | head,
|  |  | member
| ) |  |

Value:
for (pos = llist_entry((head)->next, type, member); \
&pos->member != (head); \
pos = llist_entry(pos->member.next, type, member))

Iterate over llist of given type.

Parameters

  [in] | type | the type of the loop counter
  [out] | pos | the type * to use as a loop counter
  [in] | head | the head for your llist
  [in] | member | the name of the llist_struct within the struct

## LLIST_HEAD

#define LLIST_HEAD | ( |  | name | ) | struct llist_head name = LLIST_HEAD_INIT(name)

## LLIST_HEAD_INIT

#define LLIST_HEAD_INIT | ( |  | name | ) | { &(name), &(name) }

## Function Documentation

## llist_add()

static void llist_add | ( | struct llist_head * | _new,
|  | struct llist_head * | head
| ) |  |

inline static

Add a new entry after the specified head.

Parameters

  [in] | new | new entry to be added
  [in] | head | llist head to add it after

References llist_head::next, and llist_head::prev.

## llist_del()

static void llist_del | ( | struct llist_head * | entry | ) |

inline static

Deletes entry from llist.

Parameters

  [in] | entry | the element to delete from the llist

References llist_head::next, and llist_head::prev.

llist_entry
#define llist_entry(ptr, type, member)
Get the struct for this entry.
Definition: llist.h:79
llist_head::next
struct llist_head * next
Definition: llist.h:39