BRL-CAD
#include "common.h"
#include "bu/defines.h"
#include "bu/assert.h"
#include "bu/magic.h"
Include dependency graph for list.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bu_list
 

Macros

#define BU_LIST_NULL   ((struct bu_list *)0)
 
#define BU_LIST_MAGIC_SET(_l, _magic)   {(_l)->magic = (_magic);}
 
#define BU_LIST_MAGIC_EQUAL(_l, _magic)   ((_l)->magic == (_magic))
 
#define BU_CK_LIST_HEAD(_p)   BU_CKMAG((_p), BU_LIST_HEAD_MAGIC, "bu_list")
 
#define BU_LIST_INIT(_headp)
 
#define BU_LIST_INIT_MAGIC(_headp, _magic)
 
#define BU_LIST_INIT_ZERO   { 0, BU_LIST_NULL, BU_LIST_NULL }
 
#define BU_LIST_IS_INITIALIZED(_headp)   (((struct bu_list *)(_headp) != BU_LIST_NULL) && LIKELY((_headp)->forw != BU_LIST_NULL))
 
#define BU_LIST_INSERT(old, new)
 
#define BU_LIST_APPEND(old, new)
 
#define BU_LIST_DEQUEUE(cur)
 
#define BU_LIST_DQ(cur)
 
#define BU_LIST_DQ_T(cur, type)
 
#define BU_LIST_DEQUEUE_T(cur, type)
 
#define BU_LIST_PUSH(headp, p)    BU_LIST_APPEND(headp, (struct bu_list *)(p))
 
#define BU_LIST_POP(structure, headp, p)
 
#define BU_LIST_POP_T(headp, type)    (type *)bu_list_pop(headp)
 
#define BU_LIST_INSERT_LIST(dest_headp, src_headp)
 
#define BU_LIST_APPEND_LIST(dest_headp, src_headp)
 
#define BU_LIST_IS_EMPTY(headp)   ((headp)->forw == (headp))
 
#define BU_LIST_NON_EMPTY(headp)   ((headp)->forw != (headp))
 
#define BU_LIST_NON_EMPTY_P(p, structure, headp)    (((p)=(struct structure *)((headp)->forw)) != (struct structure *)(headp))
 
#define BU_LIST_IS_CLEAR(headp)
 
#define BU_LIST_LAST(structure, headp)    ((struct structure *)((headp)->back))
 
#define BU_LIST_BACK(structure, headp)    ((struct structure *)((headp)->back))
 
#define BU_LIST_PREV(structure, headp)    ((struct structure *)((headp)->back))
 
#define BU_LIST_FIRST(structure, headp)    ((struct structure *)((headp)->forw))
 
#define BU_LIST_FORW(structure, headp)    ((struct structure *)((headp)->forw))
 
#define BU_LIST_NEXT(structure, headp)    ((struct structure *)((headp)->forw))
 
#define BU_LIST_IS_HEAD(p, headp)    (((struct bu_list *)(p)) == (struct bu_list *)(headp))
 
#define BU_LIST_NOT_HEAD(p, headp)    (!BU_LIST_IS_HEAD(p, headp))
 
#define BU_LIST_PREV_IS_HEAD(p, headp)    (((struct bu_list *)(p))->back == (struct bu_list *)(headp))
 
#define BU_LIST_PREV_NOT_HEAD(p, headp)    (!BU_LIST_PREV_IS_HEAD(p, headp))
 
#define BU_LIST_NEXT_IS_HEAD(p, headp)    (((struct bu_list *)(p))->forw == (struct bu_list *)(headp))
 
#define BU_LIST_NEXT_NOT_HEAD(p, headp)    (!BU_LIST_NEXT_IS_HEAD(p, headp))
 
#define BU_LIST_EACH(headp, p, type)
 
#define BU_LIST_REVEACH(headp, p, type)
 
#define BU_LIST_TAIL(headp, start, p, type)
 
#define BU_LIST_FOR(p, structure, headp)
 
#define BU_LIST_FOR_BACKWARDS(p, structure, headp)
 
#define BU_LIST_FOR_CIRC(p, structure, headp)
 
#define BU_LIST_FOR2(p1, p2, structure, headp1, headp2)
 
#define BU_LIST_WHILE(p, structure, headp)    (((p)=(struct structure *)((headp)->forw)) != (struct structure *)(headp))
 
#define BU_LIST_FIRST_MAGIC(headp)   ((headp)->forw->magic)
 
#define BU_LIST_LAST_MAGIC(headp)   ((headp)->back->magic)
 
#define BU_LIST_PNEXT(structure, p)    ((struct structure *)(((struct bu_list *)(p))->forw))
 
#define BU_LIST_PLAST(structure, p)    ((struct structure *)(((struct bu_list *)(p))->back))
 
#define BU_LIST_PNEXT_PNEXT(structure, p)    ((struct structure *)(((struct bu_list *)(p))->forw->forw))
 
#define BU_LIST_PNEXT_PLAST(structure, p)    ((struct structure *)(((struct bu_list *)(p))->forw->back))
 
#define BU_LIST_PLAST_PNEXT(structure, p)    ((struct structure *)(((struct bu_list *)(p))->back->forw))
 
#define BU_LIST_PLAST_PLAST(structure, p)    ((struct structure *)(((struct bu_list *)(p))->back->back))
 
#define BU_LIST_PNEXT_CIRC(structure, p)
 
#define BU_LIST_PPREV_CIRC(structure, p)
 
#define BU_LIST_MAIN_PTR(_type, _ptr2, _name2)    ((struct _type *)(((char *)(_ptr2)) - (bu_offsetof(struct _type, _name2) + bu_offsetof(struct bu_list, magic))))
 

Typedefs

typedef struct bu_list bu_list_t
 

Functions

struct bu_listbu_list_new (void)
 
struct bu_listbu_list_pop (struct bu_list *headp)
 
int bu_list_len (const struct bu_list *headp)
 
void bu_list_reverse (struct bu_list *headp)
 
void bu_list_free (struct bu_list *headp)
 
void bu_list_parallel_append (struct bu_list *headp, struct bu_list *itemp)
 
struct bu_listbu_list_parallel_dequeue (struct bu_list *headp)
 
void bu_ck_list (const struct bu_list *headp, const char *str)
 
void bu_ck_list_magic (const struct bu_list *headp, const char *str, const uint32_t magic)