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

Go to the source code of this file.

Data Structures

struct  bu_ptbl
 

Macros

#define BU_PTBL_NULL   ((struct bu_ptbl *)0)
 
#define BU_CK_PTBL(_p)   BU_CKMAG(_p, BU_PTBL_MAGIC, "bu_ptbl")
 
#define BU_PTBL_INIT(_p)
 
#define BU_PTBL_INIT_ZERO   { {BU_PTBL_MAGIC, BU_LIST_NULL, BU_LIST_NULL}, 0, 0, NULL }
 
#define BU_PTBL_IS_INITIALIZED(_p)   (((struct bu_ptbl *)(_p) != BU_PTBL_NULL) && LIKELY((_p)->l.magic == BU_PTBL_MAGIC))
 
#define BU_PTBL_LEN(ptbl)   (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->end:0)
 
#define BU_PTBL_TEST(ptbl)   (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->l.magic == BU_PTBL_MAGIC:0)
 
#define BU_PTBL_GET(ptbl, i)   ((ptbl)->buffer[(i)])
 
#define BU_PTBL_SET(ptbl, i, val)   ((ptbl)->buffer[(i)] = (long*)(val))
 
#define BU_PTBL_END(ptbl)   ((ptbl)->end)
 
#define BU_PTBL_BASEADDR(ptbl)   (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->buffer:NULL)
 
#define BU_PTBL_LASTADDR(ptbl)   (((uintptr_t)(ptbl) != (uintptr_t)NULL)?(ptbl)->buffer + (ptbl)->end - 1:NULL)
 
#define BU_PTBL_FOR(ip, cast, ptbl)    ip = cast BU_PTBL_LASTADDR(ptbl); ip >= cast BU_PTBL_BASEADDR(ptbl); ip--
 

Typedefs

typedef struct bu_ptbl bu_ptbl_t
 

Functions

void bu_ptbl_init (struct bu_ptbl *b, size_t len, const char *str)
 
void bu_ptbl_reset (struct bu_ptbl *b)
 
size_t bu_ptbl_ins (struct bu_ptbl *b, long *p)
 
intmax_t bu_ptbl_locate (const struct bu_ptbl *b, const long *p)
 
void bu_ptbl_zero (struct bu_ptbl *b, const long *p)
 
intmax_t bu_ptbl_ins_unique (struct bu_ptbl *b, long *p)
 
size_t bu_ptbl_rm (struct bu_ptbl *b, const long *p)
 
void bu_ptbl_cat (struct bu_ptbl *dest, const struct bu_ptbl *src)
 
void bu_ptbl_cat_uniq (struct bu_ptbl *dest, const struct bu_ptbl *src)
 
void bu_ptbl_free (struct bu_ptbl *b)
 
void bu_pr_ptbl (const char *title, const struct bu_ptbl *tbl, int verbose)
 
void bu_ptbl_trunc (struct bu_ptbl *tbl, size_t end)