BRL-CAD
list.h File Reference
#include "common.h"
#include "bu/defines.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(_hp)
 
#define BU_LIST_INIT_MAGIC(_hp, _magic)
 
#define BU_LIST_INIT_ZERO   { 0, BU_LIST_NULL, BU_LIST_NULL }
 
#define BU_LIST_IS_INITIALIZED(_hp)   (((struct bu_list *)(_hp) != BU_LIST_NULL) && LIKELY((_hp)->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(hp, p)   BU_LIST_APPEND(hp, (struct bu_list *)(p))
 
#define BU_LIST_POP(structure, hp, p)
 
#define BU_LIST_POP_T(hp, type)   (type *)bu_list_pop(hp)
 
#define BU_LIST_INSERT_LIST(dest_hp, src_hp)
 
#define BU_LIST_APPEND_LIST(dest_hp, src_hp)
 
#define BU_LIST_IS_EMPTY(hp)   ((hp)->forw == (hp))
 
#define BU_LIST_NON_EMPTY(hp)   ((hp)->forw != (hp))
 
#define BU_LIST_NON_EMPTY_P(p, structure, hp)   (((p)=(struct structure *)((hp)->forw)) != (struct structure *)(hp))
 
#define BU_LIST_IS_CLEAR(hp)
 
#define BU_LIST_LAST(structure, hp)   ((struct structure *)((hp)->back))
 
#define BU_LIST_BACK(structure, hp)   ((struct structure *)((hp)->back))
 
#define BU_LIST_PREV(structure, hp)   ((struct structure *)((hp)->back))
 
#define BU_LIST_FIRST(structure, hp)   ((struct structure *)((hp)->forw))
 
#define BU_LIST_FORW(structure, hp)   ((struct structure *)((hp)->forw))
 
#define BU_LIST_NEXT(structure, hp)   ((struct structure *)((hp)->forw))
 
#define BU_LIST_IS_HEAD(p, hp)   (((struct bu_list *)(p)) == (struct bu_list *)(hp))
 
#define BU_LIST_NOT_HEAD(p, hp)   (!BU_LIST_IS_HEAD(p, hp))
 
#define BU_LIST_PREV_IS_HEAD(p, hp)   (((struct bu_list *)(p))->back == (struct bu_list *)(hp))
 
#define BU_LIST_PREV_NOT_HEAD(p, hp)   (!BU_LIST_PREV_IS_HEAD(p, hp))
 
#define BU_LIST_NEXT_IS_HEAD(p, hp)   (((struct bu_list *)(p))->forw == (struct bu_list *)(hp))
 
#define BU_LIST_NEXT_NOT_HEAD(p, hp)   (!BU_LIST_NEXT_IS_HEAD(p, hp))
 
#define BU_LIST_EACH(hp, p, type)
 
#define BU_LIST_REVEACH(hp, p, type)
 
#define BU_LIST_TAIL(hp, start, p, type)
 
#define BU_LIST_FOR(p, structure, hp)
 
#define BU_LIST_FOR_BACKWARDS(p, structure, hp)
 
#define BU_LIST_FOR_CIRC(p, structure, hp)
 
#define BU_LIST_FOR2(p1, p2, structure, hp1, hp2)
 
#define BU_LIST_WHILE(p, structure, hp)   (((p)=(struct structure *)((hp)->forw)) != (struct structure *)(hp))
 
#define BU_LIST_FIRST_MAGIC(hp)   ((hp)->forw->magic)
 
#define BU_LIST_LAST_MAGIC(hp)   ((hp)->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 *hp)
 
int bu_list_len (const struct bu_list *hd)
 
void bu_list_reverse (struct bu_list *hd)
 
void bu_list_free (struct bu_list *hd)
 
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 *hd, const char *str)
 
void bu_ck_list_magic (const struct bu_list *hd, const char *str, const uint32_t magic)