18#define agfindattr(x, s) agattrsym(x, s)
19#define agraphattr(g, n, s) agattr(g, AGRAPH, n, s)
67 FILE *f = fopen(filename,
"r");
91 if (!
gvc || !t || !h || !g)
96 return agedge(g, t, h,
nullptr, 1);
120 char *val =
agxget(obj, a);
124 const std::string buf = std::string(
"<") + val +
">";
137 if (strcmp(a->
name,
"label") == 0 && val[0] ==
'<') {
138 size_t len = strlen(val);
139 if (val[
len - 1] ==
'>') {
140 std::string hs(val + 1,
len - 2);
147 if (!g || !a || !val)
153 if (!g || !attr || !val)
179 if (!n || !a || !val)
188 if (!n || !attr || !val)
191 auto g =
reinterpret_cast<Agraph_t *
>(n);
222 if (!e || !a || !val)
230 if (!e || !attr || !val)
233 auto g =
reinterpret_cast<Agraph_t *
>(e);
250 return agsubg(g, name, 0);
256 return agnode(g, name, 0);
304 if (!g || g == g->
root)
313 return reinterpret_cast<Agraph_t *
>(
322 return reinterpret_cast<Agraph_t *
>(
335 return reinterpret_cast<Agnode_t *
>(g);
339 return reinterpret_cast<Agedge_t *
>(g);
598 if (strcmp(
agnameof(n),
"\001proto") == 0)
685 *
reinterpret_cast<int *
>(
GD_alg(g)) = ba.
len;
720 FILE *f = fopen(filename,
"w");
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
static void * gv_calloc(size_t nmemb, size_t size)
lt_symlist_t lt_preloaded_symbols[]
static double len(glCompPoint p)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
permits traversing the list of attributes of a given type
int agxset(void *obj, Agsym_t *sym, const char *value)
char * agxget(void *obj, Agsym_t *sym)
Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Agedge_t * agnxtin(Agraph_t *g, Agedge_t *e)
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
#define agfindedge(g, t, h)
Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
Agedge_t * agfstin(Agraph_t *g, Agnode_t *n)
Agdesc_t Agundirected
undirected
Agdesc_t Agstrictundirected
strict undirected
int agclose(Agraph_t *g)
deletes a graph, freeing its associated storage
Agdesc_t Agstrictdirected
strict directed. A strict graph cannot have multi-edges or self-arcs.
Agraph_t * agmemread(const char *cp)
reads a graph from the input string
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
creates a new graph with the given name and kind
int agwrite(Agraph_t *g, void *chan)
Return 0 on success, EOF on failure.
Agraph_t * agread(void *chan, Agdisc_t *disc)
constructs a new graph
Agdesc_t Agdirected
directed
Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
Agraph_t * agraphof(void *obj)
char * agnameof(void *)
returns a string descriptor for the object.
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
int agdelete(Agraph_t *g, void *obj)
deletes object. Equivalent to agclose, agdelnode, and agdeledge for obj being a graph,...
Agraph_t * agroot(void *obj)
int aghtmlstr(const char *)
char * agstrdup_html(Agraph_t *, const char *)
Agraph_t * agfstsubg(Agraph_t *g)
Agraph_t * agnxtsubg(Agraph_t *subg)
Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
int gvFreeLayout(GVC_t *gvc, graph_t *g)
int gvLayout(GVC_t *gvc, graph_t *g, const char *engine)
int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out)
int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, size_t *length)
GVC_t * gvContextPlugins(const lt_symlist_t *builtins, int demand_loading)
int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename)
void attach_attrs(graph_t *g)
int gvToolTred(graph_t *g)
static char emptystring[]
Agraph_t * firstsubg(Agraph_t *g)
Agraph_t * nextsubg(Agraph_t *g, Agraph_t *sg)
Agraph_t * readstring(char *string)
static char * myagxget(void *obj, Agsym_t *a)
Agraph_t * findsubg(Agraph_t *g, char *name)
static void gv_init(void)
Agraph_t * strictgraph(char *name)
Agedge_t * nextout(Agraph_t *g, Agedge_t *e)
bool write(Agraph_t *g, FILE *f)
Agraph_t * rootof(Agraph_t *g)
Agnode_t * headof(Agedge_t *e)
Agnode_t * firsttail(Agnode_t *n)
char * renderresult(Agraph_t *g, const char *format)
Agraph_t * strictdigraph(char *name)
bool renderchannel(Agraph_t *g, const char *format, const char *channelname)
char * getv(Agraph_t *g, Agsym_t *a)
Agedge_t * firstedge(Agraph_t *g)
Agraph_t * graphof(Agraph_t *g)
char * nameof(Agraph_t *g)
Agnode_t * firstnode(Agraph_t *g)
Agedge_t * firstout(Agraph_t *g)
Agraph_t * nextsupg(Agraph_t *, Agraph_t *)
char * setv(Agraph_t *g, Agsym_t *a, char *val)
static void myagxset(void *obj, Agsym_t *a, char *val)
bool layout(Agraph_t *g, const char *engine)
Agsym_t * nextattr(Agraph_t *g, Agsym_t *a)
Agnode_t * tailof(Agedge_t *e)
char * renderdata(Agraph_t *g, const char *format)
Agnode_t * protonode(Agraph_t *g)
Agnode_t * findnode(Agraph_t *g, char *name)
Agnode_t * nexttail(Agnode_t *n, Agnode_t *t)
Agraph_t * firstsupg(Agraph_t *g)
Agsym_t * findattr(Agraph_t *g, char *name)
Agraph_t * digraph(char *name)
Agedge_t * firstin(Agraph_t *g)
Agnode_t * nextnode(Agraph_t *g, Agnode_t *n)
Agraph_t * graph(char *name)
Agsym_t * firstattr(Agraph_t *g)
Agedge_t * nextin(Agraph_t *g, Agedge_t *e)
Agedge_t * nextedge(Agraph_t *g, Agedge_t *e)
Agedge_t * findedge(Agnode_t *t, Agnode_t *h)
Agnode_t * firsthead(Agnode_t *n)
Agnode_t * nexthead(Agnode_t *n, Agnode_t *h)
#define agraphattr(g, n, s)
Agedge_t * protoedge(Agraph_t *g)
language-specific bindings API
void gv_channel_writer_init(GVC_t *gvc)
void gv_writer_reset(GVC_t *gvc)
void gv_string_writer_init(GVC_t *gvc)
Graphviz context library.
GVIO_API const char * format
static gvloadimage_engine_t engine
Agraph_t * root
subgraphs - ancestors