24 #define agfindattr(x,s) agattrsym(x,s)
25 #define agraphattr(g,n,s) agattr(g,AGRAPH,n,s)
26 #define agnodeattr(g,n,s) agattr(g,AGNODE,n,s)
27 #define agedgeattr(g,n,s) agattr(g,AGEDGE,n,s)
29 static char emptystring[] = {
'\0'};
33 static void gv_init(
void) {
85 f = fopen(filename,
"r");
100 return agsubg(g, name, 1);
107 return agnode(g, name, 1);
112 if (!gvc || !t || !h || !g)
144 static char* myagxget(
void *obj,
Agsym_t *a)
156 hs = (
char*)malloc(len + 3);
167 return myagxget(g, a);
176 return myagxget(g, a);
178 static void myagxset(
void *obj,
Agsym_t *a,
char *val)
183 if (a->
name[0] ==
'l' && val[0] ==
'<' && strcmp(a->
name,
"label") == 0) {
185 if (val[len-1] ==
'>') {
196 if (!g || !a || !val)
205 if (!g || !attr || !val)
220 return myagxget(n, a);
233 return myagxget(n, a);
237 if (!n || !a || !val)
249 if (!n || !attr || !val)
271 return myagxget(e, a);
284 return myagxget(e, a);
288 if (!e || !a || !val)
300 if (!e || !attr || !val)
320 return agsubg(g, name, 0);
327 return agnode(g, name, 0);
382 if (!g || g == g->
root)
836 err =
gvRender(gvc, g, format, stdout);
859 err =
gvRender(gvc, g, format, (FILE*)channelname);
891 ba.
data = (
char*)malloc(ba.
sz*
sizeof(
char));
894 (void)
gvRender(gvc, g, format, (FILE*)&ba);
906 (void)
gvRender(gvc, g, format, (FILE*)outdata);
922 data = (
char*)realloc(data, length + 1);
943 f = fopen(filename,
"w");
CGRAPH_API Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
CGRAPH_API Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, char *value)
Agnode_t * protonode(Agraph_t *g)
Agraph_t * strictgraph(char *name)
CGRAPH_API int aghtmlstr(char *)
int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename)
bool layout(Agraph_t *g, const char *engine)
Agraph_t * findsubg(Agraph_t *g, char *name)
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
char * nameof(Agraph_t *g)
Agnode_t * firsthead(Agnode_t *n)
CGRAPH_API Agdesc_t Agstrictundirected
CGRAPH_API Agedge_t * agfstin(Agraph_t *g, Agnode_t *n)
int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsigned int *length)
int agxset(void *obj, Agsym_t *sym, char *value)
Agedge_t * nextout(Agraph_t *g, Agedge_t *e)
int gvToolTred(graph_t *g)
Agraph_t * firstsubg(Agraph_t *g)
void gv_writer_reset(GVC_t *gvc)
CGRAPH_API Agraph_t * agread(void *chan, Agdisc_t *disc)
Agnode_t * nexttail(Agnode_t *n, Agnode_t *t)
CGRAPH_API Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
CGRAPH_API int agdelete(Agraph_t *g, void *obj)
int gvFreeLayout(GVC_t *gvc, graph_t *g)
CGRAPH_API int agwrite(Agraph_t *g, void *chan)
CGRAPH_API Agraph_t * agfstsubg(Agraph_t *g)
CGRAPH_API Agraph_t * agroot(void *obj)
CGRAPH_API Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * protoedge(Agraph_t *g)
CGRAPH_API Agdesc_t Agundirected
Agraph_t * readstring(char *string)
Agedge_t * nextin(Agraph_t *g, Agedge_t *e)
Agsym_t * findattr(Agraph_t *g, char *name)
CGRAPH_API char * agstrdup_html(Agraph_t *, char *)
CGRAPH_API Agraph_t * agraphof(void *obj)
CGRAPH_API Agraph_t * agnxtsubg(Agraph_t *subg)
CGRAPH_API Agnode_t * agtail(Agedge_t *e)
Agnode_t * firsttail(Agnode_t *n)
Agedge_t * firstin(Agraph_t *g)
CGRAPH_API Agdesc_t Agstrictdirected
CGRAPH_API Agdesc_t Agdirected
Agedge_t * firstedge(Agraph_t *g)
CGRAPH_API Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
Agedge_t * nextedge(Agraph_t *g, Agedge_t *e)
Agedge_t * findedge(Agnode_t *t, Agnode_t *h)
CGRAPH_API Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
CGRAPH_API Agraph_t * agmemread(const char *cp)
lt_symlist_t lt_preloaded_symbols[]
CGRAPH_API Agnode_t * aghead(Agedge_t *e)
char * getv(Agraph_t *g, Agsym_t *a)
char * setv(Agraph_t *g, Agsym_t *a, char *val)
void gv_string_writer_init(GVC_t *gvc)
CGRAPH_API int agclose(Agraph_t *g)
CGRAPH_API char * agnameof(void *)
CGRAPH_API Agraph_t * agparent(Agraph_t *g)
Agsym_t * firstattr(Agraph_t *g)
Agraph_t * firstsupg(Agraph_t *g)
GVC_t * gvContextPlugins(const lt_symlist_t *builtins, int demand_loading)
Agraph_t * digraph(char *name)
Agedge_t * firstout(Agraph_t *g)
CGRAPH_API Agnode_t * agfstnode(Agraph_t *g)
Agraph_t * graph(char *name)
Agraph_t * nextsubg(Agraph_t *g, Agraph_t *sg)
char * renderresult(Agraph_t *g, const char *format)
#define agnodeattr(g, n, s)
Agraph_t * strictdigraph(char *name)
CGRAPH_API Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
bool write(Agraph_t *g, FILE *f)
int gvLayout(GVC_t *gvc, graph_t *g, const char *engine)
Agraph_t * rootof(Agraph_t *g)
Agnode_t * nexthead(Agnode_t *n, Agnode_t *h)
Agraph_t * nextsupg(Agraph_t *g, Agraph_t *sg)
Agnode_t * node(Agraph_t *g, char *name)
CGRAPH_API Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
bool renderchannel(Agraph_t *g, const char *format, const char *channelname)
int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out)
Agraph_t * graphof(Agraph_t *g)
Agnode_t * findnode(Agraph_t *g, char *name)
CGRAPH_API Agedge_t * agnxtin(Agraph_t *g, Agedge_t *e)
Agnode_t * headof(Agedge_t *e)
#define agfindedge(g, t, h)
#define agraphattr(g, n, s)
char * renderdata(Agraph_t *g, const char *format)
char * agxget(void *obj, Agsym_t *sym)
void gv_channel_writer_init(GVC_t *gvc)
CGRAPH_API Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Agnode_t * nextnode(Agraph_t *g, Agnode_t *n)
Agnode_t * firstnode(Agraph_t *g)
void attach_attrs(graph_t *g)
Agnode_t * tailof(Agedge_t *e)
Agsym_t * nextattr(Agraph_t *g, Agsym_t *a)
Agedge_t * edge(Agraph_t *g, Agnode_t *t, Agnode_t *h)