int main(int argc, char **argv) { Agraph_t *g; Agnode_t *n; ingraph_state ig; int i = 0; int code = 0; Dict_t *Q; init(argc, argv); newIngraph(&ig, Files, gread); Q = dtopen(&MyDisc, Dtoset); while ((g = nextGraph(&ig)) != 0) { dtclear(Q); if ((n = agnode(g, Nodes[i], 0))) dijkstra(Q, g, n); else { fprintf(stderr, "%s: no node %s in graph %s in %s\n", CmdName, Nodes[i], agnameof(g), fileName(&ig)); code = 1; } agwrite(g, stdout); fflush(stdout); agclose(g); i++; } exit(code); }
/* clearGrid: * Reset grid. This clears the dictionary, * and reuses available memory. */ void clearGrid(Grid * g) { dtclear(g->data); g->listCur = g->listMem; g->cellCur = g->cellMem; g->cellCur->cur = g->cellCur->mem; }
void clearPM(PointMap * ps) { dtclear(ps); }
/* clearNodeset: * Remove all items from a node set. */ void clearNodeset(nodeset_t * s) { dtclear(s); }