47 newb->endp = newb->mem + size;
48 newb->cur = newb->mem;
84 if (bp->cur == bp->endp) {
95static int ijcmpf(
void *point1,
void *point2) {
125 newp->
p.
i = cellp->
p.
i;
126 newp->
p.
j = cellp->
p.
j;
152 offsetof(
cell, link),
166 memset(g, 0,
sizeof(*g));
226 fprintf(stderr,
"grid(%d,%d): %s\n", i, j,
agnameof(n));
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
CDT_API int dtwalk(Dt_t *, int(*)(void *, void *), void *)
CDT_API int dtclose(Dt_t *)
CDT_API Dtmethod_t * Dtoset
ordered set (self-adjusting tree)
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
static double len(glCompPoint p)
static void freeBlock(block_t *b)
static void * newCell(void *obj, Dtdisc_t *disc)
void walkGrid(Grid *g, int(*walkf)(cell *, Grid *))
void adjustGrid(Grid *g, int nnodes)
static int ijcmpf(void *point1, void *point2)
int(* walkfn_t)(void *, void *)
static cell * getCell(Grid *g)
static node_list * newNode(Grid *g, Agnode_t *n, node_list *nxt)
void addGrid(Grid *g, int i, int j, Agnode_t *n)
static block_t * newBlock(int size)
cell * findGrid(Grid *g, int i, int j)
Grid * mkGrid(int cellHint)
char * agnameof(void *)
returns a string descriptor for the object.
result of partitioning available space, part of maze