42 static block_t *newBlock(
int size)
49 newb->endp = newb->mem + size;
50 newb->cur = newb->mem;
86 if (bp->cur == bp->endp) {
88 bp->
next = newBlock(2 * (bp->endp - bp->mem));
103 if ((diff = (p1->
i - p2->
i)))
106 return (p1->
j - p2->
j);
115 static void *newCell(
Dt_t * d,
void *obj,
Dtdisc_t * disc)
121 newp = getCell(_grid);
122 newp->
p.
i = cellp->
p.
i;
123 newp->
p.
j = cellp->
p.
j;
149 offsetof(
cell, link),
172 g->
cellMem = newBlock(cellHint);
231 fprintf(stderr,
"grid(%d,%d): %s\n", i, j,
agnameof(n));
int(* Dtcompar_f)(Dt_t *, void *, void *, Dtdisc_t *)
unsigned int(* Dthash_f)(Dt_t *, void *, Dtdisc_t *)
CDT_API int dtclose(Dt_t *)
void *(* Dtmake_f)(Dt_t *, void *, Dtdisc_t *)
CDT_API Dtmethod_t * Dtoset
int(* walkfn_t)(Dt_t *, void *, void *)
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
CGRAPH_API char * agnameof(void *)
void addGrid(Grid *g, int i, int j, Agnode_t *n)
Grid * mkGrid(int cellHint)
void *(* Dtmemory_f)(Dt_t *, void *, size_t, Dtdisc_t *)
void walkGrid(Grid *g, int(*walkf)(Dt_t *, cell *, Grid *))
void adjustGrid(Grid *g, int nnodes)
CDT_API int dtwalk(Dt_t *, int(*)(Dt_t *, void *, void *), void *)
EXTERN unsigned char Verbose
cell * findGrid(Grid *g, int i, int j)
void freeBlock(block_t *sp)
int(* Dtevent_f)(Dt_t *, int, void *, Dtdisc_t *)
void(* Dtfree_f)(Dt_t *, void *, Dtdisc_t *)