#define NUMNODES 5
Agnode_t *node[NUMNODES];
+ Agedge_t *e;
Agraph_t *g;
Agraph_t *sg;
int j, k;
#else /* WITH_CGRAPH */
node[j] = agnode(g, name, 1);
agbindrec(node[j], "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
-
#endif /* WITH_CGRAPH */
}
#ifndef WITH_CGRAPH
agedge(g, node[j], node[k]);
#else /* WITH_CGRAPH */
- agedge(g, node[j], node[k], NULL, 1);
+ e = agedge(g, node[j], node[k], NULL, 1);
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE); //edge custom data
#endif /* WITH_CGRAPH */
}
}
{
graph_t *prev = NULL;
int r, rc = 0;
-#ifndef WITH_CGRAPH
-#endif /* WITH_CGRAPH */
Gvc = gvContextPlugins(lt_preloaded_symbols, DEMAND_LOADING);
GvExitOnUsage = 1;
}
else {
while ((G = gvNextInputGraph(Gvc))) {
-#ifdef WITH_CGRAPH
-
-
-#endif /* WITH_CGRAPH */
if (prev) {
gvFreeLayout(Gvc, prev);
agclose(prev);
}
gvFinalize(Gvc);
-
r = gvFreeContext(Gvc);
return (MAX(rc,r));
}
else
free(GD_rank(g));
}
- if (g != agroot(g))
#ifndef WITH_CGRAPH
+ if (g != agroot(g))
memset(&(g->u), 0, sizeof(Agraphinfo_t));
#else /* WITH_CGRAPH */
+ if (g != agroot(g))
agdelrec(g,"Agraphinfo_t");
#endif /* WITH_CGRAPH */
}
}
#ifndef WITH_CGRAPH
e = agedge(g, tail, head);
+ agbindrec(ce, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
#else
e = agedge(g, tail, head, NULL, 1);
Tcl_AppendResult(interp, obj2cmd(e), NULL);
/* if odd number of args then argv[2] is name */
#ifdef WITH_CGRAPH
n = agnode(g, argv[2], 1);
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
#else
n = agnode(g, argv[2]);
if (!(np = (Agnode_t **) tclhandleXlateIndex(ictx->nodeTblPtr, AGID(n))) || *np != n) {
} else {
#ifdef WITH_CGRAPH
n = agnode(g, NULL, 1); /* anon node */
+ agbindrec(n, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE);
#else
/* else use handle as name */
np = (Agnode_t **) tclhandleAlloc(ictx->nodeTblPtr, Tcl_GetStringResult(interp), &id);
}
#ifdef WITH_CGRAPH
e = agedge(g, n, head, NULL, 1);
+ agbindrec(e, "Agedgeinfo_t", sizeof(Agedgeinfo_t), TRUE);
Tcl_AppendResult(interp, obj2cmd(e), NULL);
#else
e = agedge(g, n, head);