list: hkl Reference Manual

## list list |

## Functions

struct list_head * | list_check ()
struct list_node * | list_check_node ()
#define | list_debug()
#define | list_debug_node()
#define | LIST_HEAD_INIT()
#define | LIST_HEAD()
void | list_head_init ()
void | list_node_init ()
#define | list_add_after()
void | list_add_after_ ()
#define | list_add()
void | list_add_ ()
#define | list_add_before()
void | list_add_before_ ()
#define | list_add_tail()
void | list_add_tail_ ()
#define | list_empty()
bool | list_empty_ ()
#define | list_empty_nodebug()
bool | list_empty_nocheck ()
#define | list_del()
void | list_del_ ()
#define | list_del_init()
void | list_del_init_ ()
void | list_del_from ()
#define | list_swap()
void | list_swap_ ()
#define | list_entry()
#define | list_top()
const void * | list_top_ ()
#define | list_pop()
const void * | list_pop_ ()
#define | list_tail()
const void * | list_tail_ ()
#define | list_for_each()
#define | list_for_each_rev()
#define | list_for_each_rev_safe()
#define | list_for_each_safe()
#define | list_next()
#define | list_prev()
#define | list_append_list()
void | list_append_list_ ()
#define | list_prepend_list()
void | list_prepend_list_ ()
#define | list_for_each_off_dir_()
#define | list_for_each_safe_off_dir_()
#define | list_for_each_off()
#define | list_for_each_rev_off()
#define | list_for_each_safe_off()
#define | list_for_each_rev_safe_off()
#define | list_entry_off()
#define | list_head_off()
#define | list_tail_off()
#define | list_add_off()
#define | list_del_off()
#define | list_del_from_off()
void * | list_node_to_off_ ()
struct list_node * | list_node_from_off_ ()
#define | list_off_()
#define | list_off_var_()
#define | list_typeof()
void * | list_entry_or_null ()

## Types and Values

struct | list_node
struct | list_head
#define | LIST_LOC

## Description

## Functions

### list_check ()

    struct list_head *
    list_check (const struct list_head *h,
                const char *abortstr);

### list_check_node ()

    struct list_node *
    list_check_node (const struct list_node *n,
                     const char *abortstr);

### list_debug()

    #define list_debug(h, loc) list_check((h), loc)

### list_debug_node()

    #define list_debug_node(n, loc) list_check_node((n), loc)

### LIST_HEAD_INIT()

    #define LIST_HEAD_INIT(name) { { &(name).n, &(name).n } }

### LIST_HEAD()

    #define             LIST_HEAD(name)

### list_head_init ()

    void
    list_head_init (struct list_head *h);

### list_node_init ()

    void
    list_node_init (struct list_node *n);

### list_add_after()

    #define list_add_after(h, p, n) list_add_after_(h, p, n, LIST_LOC)

### list_add_after_ ()

    void
    list_add_after_ (struct list_head *h,
                     struct list_node *p,
                     struct list_node *n,
                     const char *abortstr);

### list_add()

    #define list_add(h, n) list_add_(h, n, LIST_LOC)

### list_add_ ()

    void
    list_add_ (struct list_head *h,
               struct list_node *n,
               const char *abortstr);

### list_add_before()

    #define list_add_before(h, p, n) list_add_before_(h, p, n, LIST_LOC)

### list_add_before_ ()

    void
    list_add_before_ (struct list_head *h,
                      struct list_node *p,
                      struct list_node *n,
                      const char *abortstr);

### list_add_tail()

    #define list_add_tail(h, n) list_add_tail_(h, n, LIST_LOC)

### list_add_tail_ ()

    void
    list_add_tail_ (struct list_head *h,
                    struct list_node *n,
                    const char *abortstr);

### list_empty()

    #define list_empty(h) list_empty_(h, LIST_LOC)

### list_empty_ ()

    bool
    list_empty_ (const struct list_head *h,
                 const char *abortstr);

### list_empty_nodebug()

    #define list_empty_nodebug(h) list_empty(h)

### list_empty_nocheck ()

    bool
    list_empty_nocheck (const struct list_head *h);

### list_del()

    #define list_del(n) list_del_(n, LIST_LOC)

### list_del_ ()

    void
    list_del_ (struct list_node *n,
               const char *abortstr);

### list_del_init()

    #define list_del_init(n) list_del_init_(n, LIST_LOC)

### list_del_init_ ()

    void
    list_del_init_ (struct list_node *n,
                    const char *abortstr);

### list_del_from ()

    void
    list_del_from (struct list_head *h,
                   struct list_node *n);

Example: list_del_init(&child->list); parent->num_children--;

[), list_del(]

### list_swap()

    #define list_swap(o, n) list_swap_(o, n, LIST_LOC)

### list_swap_ ()

    void
    list_swap_ (struct list_node *o,
                struct list_node *n,
                const char *abortstr);

### list_entry()

    #define list_entry(n, type, member) container_of(n, type, member)

### list_top()

    #define             list_top(h, type, member)

### list_top_ ()

    const void *
    list_top_ (const struct list_head *h,
               size_t off);

### list_pop()

    #define             list_pop(h, type, member)

### list_pop_ ()

    const void *
    list_pop_ (const struct list_head *h,
               size_t off);

### list_tail()

    #define             list_tail(h, type, member)

### list_tail_ ()

    const void *
    list_tail_ (const struct list_head *h,
                size_t off);

### list_for_each()

    #define             list_for_each(h, i, member)

### list_for_each_rev()

    #define             list_for_each_rev(h, i, member)

### list_for_each_rev_safe()

    #define             list_for_each_rev_safe(h, i, nxt, member)

### list_for_each_safe()

    #define             list_for_each_safe(h, i, nxt, member)

### list_next()

    #define             list_next(h, i, member)

### list_prev()

    #define             list_prev(h, i, member)

### list_append_list()

    #define             list_append_list(t, f)

### list_append_list_ ()

    void
    list_append_list_ (struct list_head *to,
                       struct list_head *from,
                       const char *abortstr);

### list_prepend_list()

    #define list_prepend_list(t, f) list_prepend_list_(t, f, LIST_LOC)

### list_prepend_list_ ()

    void
    list_prepend_list_ (struct list_head *to,
                        struct list_head *from,
                        const char *abortstr);

### list_for_each_off_dir_()

    #define             list_for_each_off_dir_(h, i, off, dir)

### list_for_each_safe_off_dir_()

    #define             list_for_each_safe_off_dir_(h, i, nxt, off, dir)

### list_for_each_off()

    #define             list_for_each_off(h, i, off)

### list_for_each_rev_off()

    #define             list_for_each_rev_off(h, i, off)

### list_for_each_safe_off()

    #define             list_for_each_safe_off(h, i, nxt, off)

### list_for_each_rev_safe_off()

    #define             list_for_each_rev_safe_off(h, i, nxt, off)

### list_entry_off()

    #define             list_entry_off(n, type, off)

### list_head_off()

    #define             list_head_off(h, type, off)

### list_tail_off()

    #define             list_tail_off(h, type, off)

### list_add_off()

    #define             list_add_off(h, n, off)

### list_del_off()

    #define             list_del_off(n, off)

### list_del_from_off()

    #define             list_del_from_off(h, n, off)

### list_node_to_off_ ()

    void *
    list_node_to_off_ (struct list_node *node,
                       size_t off);

### list_node_from_off_ ()

    struct list_node *
    list_node_from_off_ (void *ptr,
                         size_t off);

### list_off_()

    #define             list_off_(type, member)

### list_off_var_()

    #define             list_off_var_(var, member)

### list_typeof()

    #define list_typeof(var) typeof(var)

### list_entry_or_null ()

    void *
    list_entry_or_null (const struct list_head *h,
                        const struct list_node *n,
                        size_t off);

## Types and Values

### struct list_node

    struct list_node {
    	struct list_node *next, *prev;
    };

### struct list_head

    struct list_head {
    	struct list_node n;
    };

### LIST_LOC

    #define LIST_LOC __FILE__  ":" stringify(__LINE__)