Graphviz  2.41.20171026.1811
gv.cpp
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #include <string.h>
15 #include <stdlib.h>
16 #include "gvc.h"
17 
18 extern "C" {
19 extern void gv_string_writer_init(GVC_t *gvc);
20 extern void gv_channel_writer_init(GVC_t *gvc);
21 extern void gv_writer_reset(GVC_t *gvc);
22 }
23 
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)
28 
29 static char emptystring[] = {'\0'};
30 
31 static GVC_t *gvc;
32 
33 static void gv_init(void) {
34  /* list of builtins, enable demand loading */
35  gvc = gvContextPlugins(lt_preloaded_symbols, DEMAND_LOADING);
36 }
37 
38 Agraph_t *graph(char *name)
39 {
40  if (!gvc)
41  gv_init();
42  return agopen(name, Agundirected, 0);
43 }
44 
45 Agraph_t *digraph(char *name)
46 {
47  if (!gvc)
48  gv_init();
49  return agopen(name, Agdirected, 0);
50 }
51 
52 Agraph_t *strictgraph(char *name)
53 {
54  if (!gvc)
55  gv_init();
56  return agopen(name, Agstrictundirected, 0);
57 }
58 
59 Agraph_t *strictdigraph(char *name)
60 {
61  if (!gvc)
62  gv_init();
63  return agopen(name, Agstrictdirected, 0);
64 }
65 
66 Agraph_t *readstring(char *string)
67 {
68  if (!gvc)
69  gv_init();
70  return agmemread(string);
71 }
72 
73 Agraph_t *read(FILE *f)
74 {
75  if (!gvc)
76  gv_init();
77  return agread(f, NULL);
78 }
79 
80 Agraph_t *read(const char *filename)
81 {
82  FILE *f;
83  Agraph_t *g;
84 
85  f = fopen(filename, "r");
86  if (!f)
87  return NULL;
88  if (!gvc)
89  gv_init();
90  g = agread(f, NULL);
91  fclose(f);
92  return g;
93 }
94 
95 //-------------------------------------------------
96 Agraph_t *graph(Agraph_t *g, char *name)
97 {
98  if (!gvc)
99  gv_init();
100  return agsubg(g, name, 1);
101 }
102 
103 Agnode_t *node(Agraph_t *g, char *name)
104 {
105  if (!gvc)
106  return NULL;
107  return agnode(g, name, 1);
108 }
109 
111 {
112  if (!gvc || !t || !h || !g)
113  return NULL;
114  // edges from/to the protonode are not permitted
115  if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)
116  return NULL;
117  return agedge(g, t, h, NULL, 1);
118 }
119 
121 {
122  return edge(agraphof(t), t, h);
123 }
124 
125 // induce tail if necessary
126 Agedge_t *edge(char *tname, Agnode_t *h)
127 {
128  return edge(node(agraphof(h), tname), h);
129 }
130 
131 // induce head if necessary
132 Agedge_t *edge(Agnode_t *t, char *hname)
133 {
134  return edge(t, node(agraphof(t), hname));
135 }
136 
137 // induce tail/head if necessary
138 Agedge_t *edge(Agraph_t *g, char *tname, char *hname)
139 {
140  return edge(g, node(g, tname), node(g, hname));
141 }
142 
143 //-------------------------------------------------
144 static char* myagxget(void *obj, Agsym_t *a)
145 {
146  int len;
147  char *val, *hs;
148 
149  if (!obj || !a)
150  return emptystring;
151  val = agxget(obj, a);
152  if (!val)
153  return emptystring;
154  if (a->name[0] == 'l' && strcmp(a->name, "label") == 0 && aghtmlstr(val)) {
155  len = strlen(val);
156  hs = (char*)malloc(len + 3);
157  hs[0] = '<';
158  strcpy(hs+1, val);
159  hs[len+1] = '>';
160  hs[len+2] = '\0';
161  return hs;
162  }
163  return val;
164 }
165 char *getv(Agraph_t *g, Agsym_t *a)
166 {
167  return myagxget(g, a);
168 }
169 char *getv(Agraph_t *g, char *attr)
170 {
171  Agsym_t *a;
172 
173  if (!g || !attr)
174  return NULL;
175  a = agfindattr(agroot(g), attr);
176  return myagxget(g, a);
177 }
178 static void myagxset(void *obj, Agsym_t *a, char *val)
179 {
180  int len;
181  char *hs;
182 
183  if (a->name[0] == 'l' && val[0] == '<' && strcmp(a->name, "label") == 0) {
184  len = strlen(val);
185  if (val[len-1] == '>') {
186  hs = strdup(val+1);
187  *(hs+len-2) = '\0';
188  val = agstrdup_html(agraphof(obj),hs);
189  free(hs);
190  }
191  }
192  agxset(obj, a, val);
193 }
194 char *setv(Agraph_t *g, Agsym_t *a, char *val)
195 {
196  if (!g || !a || !val)
197  return NULL;
198  myagxset(g, a, val);
199  return val;
200 }
201 char *setv(Agraph_t *g, char *attr, char *val)
202 {
203  Agsym_t *a;
204 
205  if (!g || !attr || !val)
206  return NULL;
207  a = agfindattr(agroot(g), attr);
208  if (!a)
209  a = agraphattr(g->root, attr, emptystring);
210  myagxset(g, a, val);
211  return val;
212 }
213 //-------------------------------------------------
214 char *getv(Agnode_t *n, Agsym_t *a)
215 {
216  if (!n || !a)
217  return NULL;
218  if (AGTYPE(n) == AGRAPH) // protonode
219  return NULL; // FIXME ??
220  return myagxget(n, a);
221 }
222 char *getv(Agnode_t *n, char *attr)
223 {
224  Agraph_t *g;
225  Agsym_t *a;
226 
227  if (!n || !attr)
228  return NULL;
229  if (AGTYPE(n) == AGRAPH) // protonode
230  return NULL; // FIXME ??
231  g = agroot(agraphof(n));
232  a = agattr(g, AGNODE, attr, NULL);
233  return myagxget(n, a);
234 }
235 char *setv(Agnode_t *n, Agsym_t *a, char *val)
236 {
237  if (!n || !a || !val)
238  return NULL;
239  if (AGTYPE(n) == AGRAPH) // protonode
240  return NULL; // FIXME ??
241  myagxset(n, a, val);
242  return val;
243 }
244 char *setv(Agnode_t *n, char *attr, char *val)
245 {
246  Agraph_t *g;
247  Agsym_t *a;
248 
249  if (!n || !attr || !val)
250  return NULL;
251  if (AGTYPE(n) == AGRAPH) { // protonode
252  g = (Agraph_t*)n;
253  a = agattr(g, AGNODE, attr, val); // create default attribute in psuodo protonode
254  // FIXME? - deal with html in "label" attributes
255  return val;
256  }
257  g = agroot(agraphof(n));
258  a = agattr(g, AGNODE, attr, NULL);
259  if (!a)
260  a = agnodeattr(g, attr, emptystring);
261  myagxset(n, a, val);
262  return val;
263 }
264 //-------------------------------------------------
265 char *getv(Agedge_t *e, Agsym_t *a)
266 {
267  if (!e || !a)
268  return NULL;
269  if (AGTYPE(e) == AGRAPH) // protoedge
270  return NULL; // FIXME ??
271  return myagxget(e, a);
272 }
273 char *getv(Agedge_t *e, char *attr)
274 {
275  Agraph_t *g;
276  Agsym_t *a;
277 
278  if (!e || !attr)
279  return NULL;
280  if (AGTYPE(e) == AGRAPH) // protoedge
281  return NULL; // FIXME ??
282  g = agraphof(agtail(e));
283  a = agattr(g, AGEDGE, attr, NULL);
284  return myagxget(e, a);
285 }
286 char *setv(Agedge_t *e, Agsym_t *a, char *val)
287 {
288  if (!e || !a || !val)
289  return NULL;
290  if (AGTYPE(e) == AGRAPH) // protoedge
291  return NULL; // FIXME ??
292  myagxset(e, a, val);
293  return val;
294 }
295 char *setv(Agedge_t *e, char *attr, char *val)
296 {
297  Agraph_t *g;
298  Agsym_t *a;
299 
300  if (!e || !attr || !val)
301  return NULL;
302  if (AGTYPE(e) == AGRAPH) { // protoedge
303  g = (Agraph_t*)e;
304  a = agattr(g, AGEDGE, attr, val); // create default attribute in pseudo protoedge
305  // FIXME? - deal with html in "label" attributes
306  return val;
307  }
308  g = agroot(agraphof(agtail(e)));
309  a = agattr(g, AGEDGE, attr, NULL);
310  if (!a)
311  a = agattr(g, AGEDGE, attr, emptystring);
312  myagxset(e, a, val);
313  return val;
314 }
315 //-------------------------------------------------
316 Agraph_t *findsubg(Agraph_t *g, char *name)
317 {
318  if (!g || !name)
319  return NULL;
320  return agsubg(g, name, 0);
321 }
322 
323 Agnode_t *findnode(Agraph_t *g, char *name)
324 {
325  if (!g || !name)
326  return NULL;
327  return agnode(g, name, 0);
328 }
329 
331 {
332  if (!t || !h)
333  return NULL;
334  if (AGTYPE(t) == AGRAPH || AGTYPE(h) == AGRAPH)
335  return NULL;
336  return agfindedge(agraphof(t), t, h);
337 }
338 
339 Agsym_t *findattr(Agraph_t *g, char *name)
340 {
341  if (!g || !name)
342  return NULL;
343  return agfindattr(g, name);
344 }
345 
346 Agsym_t *findattr(Agnode_t *n, char *name)
347 {
348  if (!n || !name)
349  return NULL;
350  return agfindattr(n, name);
351 }
352 
353 Agsym_t *findattr(Agedge_t *e, char *name)
354 {
355  if (!e || !name)
356  return NULL;
357  return agfindattr(e, name);
358 }
359 
360 //-------------------------------------------------
361 
363 {
364  if (!e)
365  return NULL;
366  if (AGTYPE(e) == AGRAPH)
367  return NULL;
368  return aghead(e);
369 }
370 
372 {
373  if (!e)
374  return NULL;
375  if (AGTYPE(e) == AGRAPH)
376  return NULL;
377  return agtail(e);
378 }
379 
381 {
382  if (!g || g == g->root)
383  return NULL;
384  return agroot(g);
385 }
386 
388 {
389  if (!e)
390  return NULL;
391  if (AGTYPE(e) == AGRAPH)
392  return (Agraph_t*)e; /* graph of protoedge is itself recast */
393  return agraphof(agtail(e));
394 }
395 
397 {
398  if (!n)
399  return NULL;
400  if (AGTYPE(n) == AGRAPH)
401  return (Agraph_t*)n; /* graph of protonode is itself recast */
402  return agraphof(n);
403 }
404 
406 {
407  if (!g)
408  return NULL;
409  return agroot(g);
410 }
411 
412 //-------------------------------------------------
414 {
415  if (!g)
416  return NULL;
417  return (Agnode_t *)g; // gross abuse of the type system!
418 }
419 
421 {
422  if (!g)
423  return NULL;
424  return (Agedge_t *)g; // gross abuse of the type system!
425 }
426 
427 //-------------------------------------------------
428 char *nameof(Agraph_t *g)
429 {
430  if (!g)
431  return NULL;
432  return agnameof(g);
433 }
434 char *nameof(Agnode_t *n)
435 {
436  if (!n)
437  return NULL;
438  if (AGTYPE(n) == AGRAPH)
439  return NULL;
440  return agnameof(n);
441 }
442 //char *nameof(Agedge_t *e)
443 //{
444 // if (!e)
445 // return NULL;
446 // if (AGTYPE(e) == AGRAPH)
447 // return NULL;
448 // return agnameof(e);
449 //}
450 char *nameof(Agsym_t *a)
451 {
452  if (!a)
453  return NULL;
454  return a->name;
455 }
456 
457 //-------------------------------------------------
458 bool ok(Agraph_t *g)
459 {
460  if (!g)
461  return false;
462  return true;
463 }
464 bool ok(Agnode_t *n)
465 {
466  if (!n)
467  return false;
468  return true;
469 }
470 bool ok(Agedge_t *e)
471 {
472  if (!e)
473  return false;
474  return true;
475 }
476 bool ok(Agsym_t *a)
477 {
478  if (!a)
479  return false;
480  return true;
481 }
482 //-------------------------------------------------
484 {
485  if (!g)
486  return NULL;
487  return agfstsubg(g);
488 }
489 
491 {
492 
493  if (!g || !sg)
494  return NULL;
495  return agnxtsubg(sg);
496 }
497 
499 {
500  return g->parent;
501 }
502 
504 {
505  return NULL;
506 }
507 
509 {
510  Agnode_t *n;
511  Agedge_t *e;
512 
513  if (!g)
514  return NULL;
515  for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
516  e = agfstout(g, n);
517  if (e) return e;
518  }
519  return NULL;
520 }
521 
523 {
524  Agnode_t *n;
525  Agedge_t *ne;
526 
527  if (!g || !e)
528  return NULL;
529  ne = agnxtout(g, e);
530  if (ne)
531  return (ne);
532  for (n = agnxtnode(g, agtail(e)); n; n = agnxtnode(g, n)) {
533  ne = agfstout(g, n);
534  if (ne) return ne;
535  }
536  return NULL;
537 }
538 
540 {
541  return firstout(g);
542 }
543 
545 {
546  return nextout(g, e);
547 }
548 
550 {
551  if (!n)
552  return NULL;
553  return agfstout(agraphof(n), n);
554 }
555 
557 {
558  if (!n || !e)
559  return NULL;
560  return agnxtout(agraphof(n), e);
561 }
562 
564 {
565  Agedge_t *e;
566 
567  if (!n)
568  return NULL;
569  e = agfstout(agraphof(n), n);
570  if (!e)
571  return NULL;
572  return aghead(e);
573 }
574 
576 {
577  Agedge_t *e;
578  Agraph_t *g;
579 
580  if (!n || !h)
581  return NULL;
582  g = agraphof(n);
583  e = agfindedge(g, n, h);
584  if (!e)
585  return NULL;
586  do {
587  e = agnxtout(g, AGMKOUT(e));
588  if (!e)
589  return NULL;
590  } while (aghead(e) == h);
591  return aghead(e);
592 }
593 
595 {
596  if (!n)
597  return NULL;
598  return agfstedge(agraphof(n), n);
599 }
600 
602 {
603  if (!n || !e)
604  return NULL;
605  return agnxtedge(agraphof(n), e, n);
606 }
607 
609 {
610  Agnode_t *n;
611 
612  if (!g)
613  return NULL;
614  n = agfstnode(g);
615  if (!n)
616  return NULL;
617  return agfstin(g, n);
618 }
619 
621 {
622  Agnode_t *n;
623  Agedge_t *ne;
624 
625  if (!g || !e)
626  return NULL;
627  ne = agnxtin(g, e);
628  if (ne)
629  return (ne);
630  n = agnxtnode(g, aghead(e));
631  if (!n)
632  return NULL;
633  return agfstin(g, n);
634 }
635 
637 {
638  if (!n)
639  return NULL;
640  return agfstin(agraphof(n), n);
641 }
642 
644 {
645  if (!n || !e)
646  return NULL;
647  return agnxtin(agraphof(n), e);
648 }
649 
651 {
652  Agedge_t *e;
653 
654  if (!n)
655  return NULL;
656  e = agfstin(agraphof(n), n);
657  if (!e)
658  return NULL;
659  return agtail(e);
660 }
661 
663 {
664  Agedge_t *e;
665  Agraph_t *g;
666 
667  if (!n || !t)
668  return NULL;
669  g = agraphof(n);
670  e = agfindedge(g, t, n);
671  if (!e)
672  return NULL;
673  do {
674  e = agnxtin(g, AGMKIN(e));
675  if (!e)
676  return NULL;
677  } while (agtail(e) == t);
678  return agtail(e);
679 }
680 
682 {
683  if (!g)
684  return NULL;
685  return agfstnode(g);
686 }
687 
689 {
690  if (!g || !n)
691  return NULL;
692  return agnxtnode(g, n);
693 }
694 
696 {
697  if (!e)
698  return NULL;
699  return agtail(e);
700 }
701 
703 {
704  if (!e || n != agtail(e))
705  return NULL;
706  return aghead(e);
707 }
708 
710 {
711  if (!g)
712  return NULL;
713  g = agroot(g);
714  return agnxtattr(g,AGRAPH,NULL);
715 }
716 
718 {
719  if (!g || !a)
720  return NULL;
721  g = agroot(g);
722  return agnxtattr(g,AGRAPH,a);
723 }
724 
726 {
727  Agraph_t *g;
728 
729  if (!n)
730  return NULL;
731  g = agraphof(n);
732  return agnxtattr(g,AGNODE,NULL);
733 }
734 
736 {
737  Agraph_t *g;
738 
739  if (!n || !a)
740  return NULL;
741  g = agraphof(n);
742  return agnxtattr(g,AGNODE,a);
743 }
744 
746 {
747  Agraph_t *g;
748 
749  if (!e)
750  return NULL;
751  g = agraphof(agtail(e));
752  return agnxtattr(g,AGEDGE,NULL);
753 }
754 
756 {
757  Agraph_t *g;
758 
759  if (!e || !a)
760  return NULL;
761  g = agraphof(agtail(e));
762  return agnxtattr(g,AGEDGE,a);
763 }
764 
765 bool rm(Agraph_t *g)
766 {
767  if (!g)
768  return false;
769 #if 0
770  Agraph_t* sg;
771  for (sg = agfstsubg (g); sg; sg = agnxtsubg (sg))
772  rm(sg);
773  if (g == agroot(g))
774  agclose(g);
775  else
776  agdelete(agparent(g), g);
777 #endif
778  /* The rm function appears to have the semantics of agclose, so
779  * we should just do that, and let cgraph take care of all the
780  * details.
781  */
782  agclose(g);
783  return true;
784 }
785 
786 bool rm(Agnode_t *n)
787 {
788  if (!n)
789  return false;
790  // removal of the protonode is not permitted
791  if (agnameof(n)[0] == '\001' && strcmp (agnameof(n), "\001proto") ==0)
792  return false;
793  agdelete(agraphof(n), n);
794  return true;
795 }
796 
797 bool rm(Agedge_t *e)
798 {
799  if (!e)
800  return false;
801  // removal of the protoedge is not permitted
802  if ((agnameof(aghead(e))[0] == '\001' && strcmp (agnameof(aghead(e)), "\001proto") == 0)
803  || (agnameof(agtail(e))[0] == '\001' && strcmp (agnameof(agtail(e)), "\001proto") == 0))
804  return false;
805  agdelete(agroot(agraphof(aghead(e))), e);
806  return true;
807 }
808 
809 bool layout(Agraph_t *g, const char *engine)
810 {
811  int err;
812 
813  if (!g)
814  return false;
815  err = gvFreeLayout(gvc, g); /* ignore errors */
816  err = gvLayout(gvc, g, engine);
817  return (! err);
818 }
819 
820 // annotate the graph with layout information
821 bool render(Agraph_t *g)
822 {
823  if (!g)
824  return false;
825  attach_attrs(g);
826  return true;
827 }
828 
829 // render to stdout
830 bool render(Agraph_t *g, const char *format)
831 {
832  int err;
833 
834  if (!g)
835  return false;
836  err = gvRender(gvc, g, format, stdout);
837  return (! err);
838 }
839 
840 // render to an open FILE
841 bool render(Agraph_t *g, const char *format, FILE *f)
842 {
843  int err;
844 
845  if (!g)
846  return false;
847  err = gvRender(gvc, g, format, f);
848  return (! err);
849 }
850 
851 // render to an open channel
852 bool renderchannel(Agraph_t *g, const char *format, const char *channelname)
853 {
854  int err;
855 
856  if (!g)
857  return false;
859  err = gvRender(gvc, g, format, (FILE*)channelname);
860  gv_writer_reset (gvc); /* Reset to default */
861  return (! err);
862 }
863 
864 // render to a filename
865 bool render(Agraph_t *g, const char *format, const char *filename)
866 {
867  int err;
868 
869  if (!g)
870  return false;
871  err = gvRenderFilename(gvc, g, format, filename);
872  return (! err);
873 }
874 
875 typedef struct {
876  char* data;
877  int sz; /* buffer size */
878  int len; /* length of array */
879 } BA;
880 
881 // render to string result, using binding-dependent gv_string_writer()
882 char* renderresult(Agraph_t *g, const char *format)
883 {
884  BA ba;
885 
886  if (!g)
887  return NULL;
888  if (!GD_alg(g))
889  return NULL;
890  ba.sz = BUFSIZ;
891  ba.data = (char*)malloc(ba.sz*sizeof(char)); /* must be freed by wrapper code */
892  ba.len = 0;
894  (void)gvRender(gvc, g, format, (FILE*)&ba);
895  gv_writer_reset (gvc); /* Reset to default */
896  *((int*)GD_alg(g)) = ba.len;
897  return ba.data;
898 }
899 
900 // render to string result, using binding-dependent gv_string_writer()
901 void renderresult(Agraph_t *g, const char *format, char *outdata)
902 {
903  if (!g)
904  return;
906  (void)gvRender(gvc, g, format, (FILE*)outdata);
907  gv_writer_reset (gvc); /* Reset to default */
908 }
909 
910 // render to a malloc'ed data string, to be free'd by caller.
911 char* renderdata(Agraph_t *g, const char *format)
912 {
913  int err;
914  char *data;
915  unsigned int length;
916 
917  if (!g)
918  return NULL;
919  err = gvRenderData(gvc, g, format, &data, &length);
920  if (err)
921  return NULL;
922  data = (char*)realloc(data, length + 1);
923  return data;
924 }
925 
926 bool write(Agraph_t *g, FILE *f)
927 {
928  int err;
929 
930  if (!g)
931  return false;
932  err = agwrite(g, f);
933  return (! err);
934 }
935 
936 bool write(Agraph_t *g, const char *filename)
937 {
938  FILE *f;
939  int err;
940 
941  if (!g)
942  return false;
943  f = fopen(filename, "w");
944  if (!f)
945  return false;
946  err = agwrite(g, f);
947  fclose(f);
948  return (! err);
949 }
950 
951 bool tred(Agraph_t *g)
952 {
953  int err;
954 
955  if (!g)
956  return false;
957  err = gvToolTred(g);
958  return (! err);
959 }
960 
CGRAPH_API Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
Definition: node.c:142
CGRAPH_API Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
Definition: graph.c:44
Agsym_t * agattr(Agraph_t *g, int kind, char *name, char *value)
Definition: attr.c:324
Agnode_t * protonode(Agraph_t *g)
Definition: gv.cpp:413
Agraph_t * strictgraph(char *name)
Definition: gv.cpp:52
CGRAPH_API int aghtmlstr(char *)
Definition: refstr.c:178
int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename)
Definition: gvc.c:117
bool layout(Agraph_t *g, const char *engine)
Definition: gv.cpp:809
Agraph_t * findsubg(Agraph_t *g, char *name)
Definition: gv.cpp:316
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
Definition: attr.c:340
char * nameof(Agraph_t *g)
Definition: gv.cpp:428
Agnode_t * firsthead(Agnode_t *n)
Definition: gv.cpp:563
CGRAPH_API Agdesc_t Agstrictundirected
Definition: cgraph.h:421
CGRAPH_API Agedge_t * agfstin(Agraph_t *g, Agnode_t *n)
Definition: edge.c:56
int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsigned int *length)
Definition: gvc.c:182
int agxset(void *obj, Agsym_t *sym, char *value)
Definition: attr.c:468
char * name
Definition: cgraph.h:326
Agedge_t * nextout(Agraph_t *g, Agedge_t *e)
Definition: gv.cpp:522
int gvToolTred(graph_t *g)
Definition: gvtool_tred.c:73
Agraph_t * firstsubg(Agraph_t *g)
Definition: gv.cpp:483
void gv_writer_reset(GVC_t *gvc)
Definition: gv_dummy_init.c:5
bool render(Agraph_t *g)
Definition: gv.cpp:821
CGRAPH_API Agraph_t * agread(void *chan, Agdisc_t *disc)
Definition: grammar.c:2349
Agnode_t * nexttail(Agnode_t *n, Agnode_t *t)
Definition: gv.cpp:662
CGRAPH_API Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
Definition: edge.c:86
CGRAPH_API int agdelete(Agraph_t *g, void *obj)
Definition: obj.c:16
int gvFreeLayout(GVC_t *gvc, graph_t *g)
Definition: gvlayout.c:102
CGRAPH_API int agwrite(Agraph_t *g, void *chan)
Definition: write.c:678
bool ok(Agraph_t *g)
Definition: gv.cpp:458
CGRAPH_API Agraph_t * agfstsubg(Agraph_t *g)
Definition: subg.c:72
CGRAPH_API Agraph_t * agroot(void *obj)
Definition: obj.c:169
CGRAPH_API Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Definition: edge.c:25
Agedge_t * protoedge(Agraph_t *g)
Definition: gv.cpp:420
CGRAPH_API Agdesc_t Agundirected
Definition: cgraph.h:420
Agraph_t * readstring(char *string)
Definition: gv.cpp:66
Agedge_t * nextin(Agraph_t *g, Agedge_t *e)
Definition: gv.cpp:620
Agsym_t * findattr(Agraph_t *g, char *name)
Definition: gv.cpp:339
CGRAPH_API char * agstrdup_html(Agraph_t *, char *)
Definition: refstr.c:123
#define AGTYPE(obj)
Definition: cgraph.h:113
CGRAPH_API Agraph_t * agraphof(void *obj)
Definition: obj.c:185
CGRAPH_API Agraph_t * agnxtsubg(Agraph_t *subg)
Definition: subg.c:77
CGRAPH_API Agnode_t * agtail(Agedge_t *e)
Definition: edge.c:525
Agnode_t * firsttail(Agnode_t *n)
Definition: gv.cpp:650
Agedge_t * firstin(Agraph_t *g)
Definition: gv.cpp:608
CGRAPH_API Agdesc_t Agstrictdirected
Definition: cgraph.h:419
CGRAPH_API Agdesc_t Agdirected
Definition: cgraph.h:418
Agedge_t * firstedge(Agraph_t *g)
Definition: gv.cpp:539
CGRAPH_API Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
Definition: subg.c:52
Agedge_t * nextedge(Agraph_t *g, Agedge_t *e)
Definition: gv.cpp:544
Agedge_t * findedge(Agnode_t *t, Agnode_t *h)
Definition: gv.cpp:330
CGRAPH_API Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Definition: node.c:45
CGRAPH_API Agraph_t * agmemread(const char *cp)
Definition: io.c:131
lt_symlist_t lt_preloaded_symbols[]
Definition: dot_builtins.c:36
CGRAPH_API Agnode_t * aghead(Agedge_t *e)
Definition: edge.c:533
#define AGMKIN(e)
Definition: cgraph.h:405
char * getv(Agraph_t *g, Agsym_t *a)
Definition: gv.cpp:165
char * setv(Agraph_t *g, Agsym_t *a, char *val)
Definition: gv.cpp:194
void gv_string_writer_init(GVC_t *gvc)
Definition: gv_dummy_init.c:3
char * data
Definition: gv.cpp:876
Definition: gvcint.h:70
CGRAPH_API int agclose(Agraph_t *g)
Definition: graph.c:93
CGRAPH_API char * agnameof(void *)
Definition: id.c:143
CGRAPH_API Agraph_t * agparent(Agraph_t *g)
Definition: subg.c:85
Agsym_t * firstattr(Agraph_t *g)
Definition: gv.cpp:709
Agraph_t * firstsupg(Agraph_t *g)
Definition: gv.cpp:498
GVC_t * gvContextPlugins(const lt_symlist_t *builtins, int demand_loading)
Definition: gvc.c:36
Agraph_t * digraph(char *name)
Definition: gv.cpp:45
Agedge_t * firstout(Agraph_t *g)
Definition: gv.cpp:508
#define AGMKOUT(e)
Definition: cgraph.h:404
CGRAPH_API Agnode_t * agfstnode(Agraph_t *g)
Definition: node.c:38
#define GD_alg(g)
Definition: types.h:361
Agraph_t * graph(char *name)
Definition: gv.cpp:38
Agraph_t * nextsubg(Agraph_t *g, Agraph_t *sg)
Definition: gv.cpp:490
char * renderresult(Agraph_t *g, const char *format)
Definition: gv.cpp:882
#define AGNODE
Definition: cgraph.h:101
Agraph_t * parent
Definition: cgraph.h:247
#define agnodeattr(g, n, s)
Definition: gv.cpp:26
Agraph_t * strictdigraph(char *name)
Definition: gv.cpp:59
#define NULL
Definition: logic.h:39
CGRAPH_API Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
Definition: edge.c:95
bool write(Agraph_t *g, FILE *f)
Definition: gv.cpp:926
int gvLayout(GVC_t *gvc, graph_t *g, const char *engine)
Definition: gvc.c:53
Agraph_t * rootof(Agraph_t *g)
Definition: gv.cpp:405
GVC_t * gvc
Definition: htmlparse.c:87
int len
Definition: gv.cpp:878
Agnode_t * nexthead(Agnode_t *n, Agnode_t *h)
Definition: gv.cpp:575
Agraph_t * nextsupg(Agraph_t *g, Agraph_t *sg)
Definition: gv.cpp:503
#define agfindattr(x, s)
Definition: gv.cpp:24
Agnode_t * node(Agraph_t *g, char *name)
Definition: gv.cpp:103
CGRAPH_API Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Definition: edge.c:281
bool renderchannel(Agraph_t *g, const char *format, const char *channelname)
Definition: gv.cpp:852
int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out)
Definition: gvc.c:85
Agraph_t * graphof(Agraph_t *g)
Definition: gv.cpp:380
Definition: gv.cpp:875
Agnode_t * findnode(Agraph_t *g, char *name)
Definition: gv.cpp:323
CGRAPH_API Agedge_t * agnxtin(Agraph_t *g, Agedge_t *e)
Definition: edge.c:70
bool tred(Agraph_t *g)
Definition: gv.cpp:951
Agnode_t * headof(Agedge_t *e)
Definition: gv.cpp:362
#define agfindedge(g, t, h)
Definition: types.h:610
bool rm(Agraph_t *g)
Definition: gv.cpp:765
#define agraphattr(g, n, s)
Definition: gv.cpp:25
Agraph_t * root
Definition: cgraph.h:247
char * renderdata(Agraph_t *g, const char *format)
Definition: gv.cpp:911
char * agxget(void *obj, Agsym_t *sym)
Definition: attr.c:444
void gv_channel_writer_init(GVC_t *gvc)
Definition: gv_dummy_init.c:4
CGRAPH_API Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Definition: edge.c:40
Agnode_t * nextnode(Agraph_t *g, Agnode_t *n)
Definition: gv.cpp:688
Agnode_t * firstnode(Agraph_t *g)
Definition: gv.cpp:681
#define AGEDGE
Definition: cgraph.h:104
void attach_attrs(graph_t *g)
Definition: output.c:399
Agnode_t * tailof(Agedge_t *e)
Definition: gv.cpp:371
Agsym_t * nextattr(Agraph_t *g, Agsym_t *a)
Definition: gv.cpp:717
Definition: legal.c:60
int sz
Definition: gv.cpp:877
Agraph_t * read(FILE *f)
Definition: gv.cpp:73
Agedge_t * edge(Agraph_t *g, Agnode_t *t, Agnode_t *h)
Definition: gv.cpp:110
#define AGRAPH
Definition: cgraph.h:100