17#define agfindattr(x, s) agattrsym(x, s)
18#define agraphattr(g, n, s) agattr(g, AGRAPH, n, s)
19#define agnodeattr(g, n, s) agattr(g, AGNODE, n, s)
20#define agedgeattr(g, n, s) agattr(g, AGEDGE, n, s)
68 FILE *f = fopen(filename,
"r");
92 if (!
gvc || !t || !h || !g)
97 return agedge(g, t, h,
nullptr, 1);
121 char *val =
agxget(obj, a);
125 size_t len = strlen(val);
126 auto hs =
reinterpret_cast<char *
>(
malloc(
len + 3));
143 if (strcmp(a->
name,
"label") == 0 && val[0] ==
'<') {
144 size_t len = strlen(val);
145 if (val[
len - 1] ==
'>') {
146 std::string hs(val + 1,
len - 2);
153 if (!g || !a || !val)
159 if (!g || !attr || !val)
185 if (!n || !a || !val)
194 if (!n || !attr || !val)
197 auto g =
reinterpret_cast<Agraph_t *
>(n);
228 if (!e || !a || !val)
236 if (!e || !attr || !val)
239 auto g =
reinterpret_cast<Agraph_t *
>(e);
256 return agsubg(g, name, 0);
262 return agnode(g, name, 0);
310 if (!g || g == g->
root)
319 return reinterpret_cast<Agraph_t *
>(
328 return reinterpret_cast<Agraph_t *
>(
341 return reinterpret_cast<Agnode_t *
>(g);
345 return reinterpret_cast<Agedge_t *
>(g);
604 if (strcmp(
agnameof(n),
"\001proto") == 0)
686 ba.
data =
reinterpret_cast<char *
>(
malloc(ba.
sz *
sizeof(
char)));
691 *
reinterpret_cast<int *
>(
GD_alg(g)) = ba.
len;
726 FILE *f = fopen(filename,
"w");
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, unsigned int *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)
#define agnodeattr(g, n, s)
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