56 assert((uintptr_t)
s % 2 == 0 &&
57 "heap pointer with low bit set will collide with anonymous IDs");
88 return (
char *)(uintptr_t)
id;
93static void idregister(
void *state,
int objtype,
void *obj)
113 IDTYPE *result,
bool createflag) {
143 return (
int)
AGDISC(g,
id)->alloc(
AGCLOS(g,
id), objtype, request);
Memory allocation wrappers that exit on failure.
static void * gv_alloc(size_t size)
int aginternalmapdelete(Agraph_t *g, int objtype, IDTYPE id)
void aginternalmapinsert(Agraph_t *g, int objtype, char *str, IDTYPE result)
char * aginternalmapprint(Agraph_t *g, int objtype, IDTYPE id)
bool aginternalmaplookup(Agraph_t *g, int objtype, char *str, IDTYPE *result)
static void print(Excc_t *cc, Exnode_t *exnode)
Agraph_t * agraphof(void *obj)
char * agnameof(void *obj)
returns a string descriptor for the object.
#define AGID(obj)
returns the unique integer ID associated with the object
uint64_t IDTYPE
unique per main graph ID
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
int agstrfree(Agraph_t *, const char *)
char * agstrdup(Agraph_t *, const char *)
returns a pointer to a reference-counted copy of the argument string, creating one if necessary
char * agstrbind(Agraph_t *g, const char *)
textitem scanner parser str
void agfreeid(Agraph_t *g, int objtype, IDTYPE id)
static void * idopen(Agraph_t *g, Agdisc_t *disc)
int agmapnametoid(Agraph_t *g, int objtype, char *str, IDTYPE *result, bool createflag)
int agallocid(Agraph_t *g, int objtype, IDTYPE request)
static long idalloc(void *state, int objtype, IDTYPE request)
void agregister(Agraph_t *g, int objtype, void *obj)
static char * idprint(void *state, int objtype, IDTYPE id)
static void idfree(void *state, int objtype, IDTYPE id)
static void idregister(void *state, int objtype, void *obj)
static long idmap(void *state, int objtype, char *str, IDTYPE *id, int createflag)
object ID allocator discipline
long(* map)(void *state, int objtype, char *str, IDTYPE *id, int createflag)
information the ID allocator needs to do its job
IDTYPE counter
base to derive next identifier from