60#define BU_PTBL_NULL ((struct bu_ptbl *)0)
65#define BU_CK_PTBL(_p) BU_CKMAG(_p, BU_PTBL_MAGIC, "bu_ptbl")
71#define BU_PTBL_INIT(_p) { \
72 BU_LIST_INIT_MAGIC(&(_p)->l, BU_PTBL_MAGIC); \
75 (_p)->buffer = NULL; \
83#define BU_PTBL_INIT_ZERO { {BU_PTBL_MAGIC, BU_LIST_NULL, BU_LIST_NULL}, 0, 0, NULL }
89#define BU_PTBL_IS_INITIALIZED(_p) (((struct bu_ptbl *)(_p) != BU_PTBL_NULL) && LIKELY((_p)->l.magic == BU_PTBL_MAGIC))
95#define BU_PTBL_LEN(ptbl) (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->end:0)
96#define BU_PTBL_TEST(ptbl) (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->l.magic == BU_PTBL_MAGIC:0)
97#define BU_PTBL_GET(ptbl, i) ((ptbl)->buffer[(i)])
98#define BU_PTBL_SET(ptbl, i, val) ((ptbl)->buffer[(i)] = (long*)(val))
101#define BU_PTBL_END(ptbl) ((ptbl)->end)
103#define BU_PTBL_BASEADDR(ptbl) (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->buffer:NULL)
105#define BU_PTBL_LASTADDR(ptbl) (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->buffer + (ptbl)->end - 1:NULL)
119#define BU_PTBL_FOR(ip, cast, ptbl) \
120 ip = cast BU_PTBL_LASTADDR(ptbl); ip >= cast BU_PTBL_BASEADDR(ptbl); ip--
Header file for the BRL-CAD common definitions.
void bu_ptbl_cat(struct bu_ptbl *dest, const struct bu_ptbl *src)
size_t bu_ptbl_rm(struct bu_ptbl *b, const long *p)
void bu_ptbl_free(struct bu_ptbl *b)
intmax_t bu_ptbl_locate(const struct bu_ptbl *b, const long *p)
void bu_ptbl_trunc(struct bu_ptbl *tbl, size_t end)
void bu_ptbl_reset(struct bu_ptbl *b)
void bu_ptbl_cat_uniq(struct bu_ptbl *dest, const struct bu_ptbl *src)
size_t bu_ptbl_ins(struct bu_ptbl *b, long *p)
intmax_t bu_ptbl_ins_unique(struct bu_ptbl *b, long *p)
void bu_ptbl_init(struct bu_ptbl *b, size_t len, const char *str)
void bu_pr_ptbl(const char *title, const struct bu_ptbl *tbl, int verbose)
void bu_ptbl_zero(struct bu_ptbl *b, const long *p)
Global registry of recognized magic numbers.