Graphviz  2.39.20141218.0545
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  int i;
720 
721  if (!g || !a)
722  return NULL;
723  g = agroot(g);
724  return agnxtattr(g,AGRAPH,a);
725 }
726 
728 {
729  Agraph_t *g;
730 
731  if (!n)
732  return NULL;
733  g = agraphof(n);
734  return agnxtattr(g,AGNODE,NULL);
735 }
736 
738 {
739  Agraph_t *g;
740  int i;
741 
742  if (!n || !a)
743  return NULL;
744  g = agraphof(n);
745  return agnxtattr(g,AGNODE,a);
746 }
747 
749 {
750  Agraph_t *g;
751 
752  if (!e)
753  return NULL;
754  g = agraphof(agtail(e));
755  return agnxtattr(g,AGEDGE,NULL);
756 }
757 
759 {
760  Agraph_t *g;
761  int i;
762 
763  if (!e || !a)
764  return NULL;
765  g = agraphof(agtail(e));
766  return agnxtattr(g,AGEDGE,a);
767 }
768 
769 bool rm(Agraph_t *g)
770 {
771  Agedge_t *e;
772 
773  if (!g)
774  return false;
775 #if 0
776  Agraph_t* sg;
777  for (sg = agfstsubg (g); sg; sg = agnxtsubg (sg))
778  rm(sg);
779  if (g == agroot(g))
780  agclose(g);
781  else
782  agdelete(agparent(g), g);
783 #endif
784  /* The rm function appears to have the semantics of agclose, so
785  * we should just do that, and let cgraph take care of all the
786  * details.
787  */
788  agclose(g);
789  return true;
790 }
791 
792 bool rm(Agnode_t *n)
793 {
794  if (!n)
795  return false;
796  // removal of the protonode is not permitted
797  if (agnameof(n)[0] == '\001' && strcmp (agnameof(n), "\001proto") ==0)
798  return false;
799  agdelete(agraphof(n), n);
800  return true;
801 }
802 
803 bool rm(Agedge_t *e)
804 {
805  if (!e)
806  return false;
807  // removal of the protoedge is not permitted
808  if ((agnameof(aghead(e))[0] == '\001' && strcmp (agnameof(aghead(e)), "\001proto") == 0)
809  || (agnameof(agtail(e))[0] == '\001' && strcmp (agnameof(agtail(e)), "\001proto") == 0))
810  return false;
811  agdelete(agroot(agraphof(aghead(e))), e);
812  return true;
813 }
814 
815 bool layout(Agraph_t *g, const char *engine)
816 {
817  int err;
818 
819  if (!g)
820  return false;
821  err = gvFreeLayout(gvc, g); /* ignore errors */
822  err = gvLayout(gvc, g, engine);
823  return (! err);
824 }
825 
826 // annotate the graph with layout information
827 bool render(Agraph_t *g)
828 {
829  if (!g)
830  return false;
831  attach_attrs(g);
832  return true;
833 }
834 
835 // render to stdout
836 bool render(Agraph_t *g, const char *format)
837 {
838  int err;
839 
840  if (!g)
841  return false;
842  err = gvRender(gvc, g, format, stdout);
843  return (! err);
844 }
845 
846 // render to an open FILE
847 bool render(Agraph_t *g, const char *format, FILE *f)
848 {
849  int err;
850 
851  if (!g)
852  return false;
853  err = gvRender(gvc, g, format, f);
854  return (! err);
855 }
856 
857 // render to an open channel
858 bool renderchannel(Agraph_t *g, const char *format, const char *channelname)
859 {
860  int err;
861 
862  if (!g)
863  return false;
865  err = gvRender(gvc, g, format, (FILE*)channelname);
866  gv_writer_reset (gvc); /* Reset to default */
867  return (! err);
868 }
869 
870 // render to a filename
871 bool render(Agraph_t *g, const char *format, const char *filename)
872 {
873  int err;
874 
875  if (!g)
876  return false;
877  err = gvRenderFilename(gvc, g, format, filename);
878  return (! err);
879 }
880 
881 typedef struct {
882  char* data;
883  int sz; /* buffer size */
884  int len; /* length of array */
885 } BA;
886 
887 // render to string result, using binding-dependent gv_string_writer()
888 char* renderresult(Agraph_t *g, const char *format)
889 {
890  int err;
891  BA ba;
892 
893  if (!g)
894  return NULL;
895  if (!GD_alg(g))
896  return NULL;
897  ba.sz = BUFSIZ;
898  ba.data = (char*)malloc(ba.sz*sizeof(char)); /* must be freed by wrapper code */
899  ba.len = 0;
901  err = gvRender(gvc, g, format, (FILE*)&ba);
902  gv_writer_reset (gvc); /* Reset to default */
903  *((int*)GD_alg(g)) = ba.len;
904  return ba.data;
905 }
906 
907 // render to string result, using binding-dependent gv_string_writer()
908 void renderresult(Agraph_t *g, const char *format, char *outdata)
909 {
910  int err;
911 
912  if (!g)
913  return;
915  err = gvRender(gvc, g, format, (FILE*)outdata);
916  gv_writer_reset (gvc); /* Reset to default */
917 }
918 
919 // render to a malloc'ed data string, to be free'd by caller.
920 char* renderdata(Agraph_t *g, const char *format)
921 {
922  int err;
923  char *data;
924  unsigned int length;
925 
926  if (!g)
927  return NULL;
928  err = gvRenderData(gvc, g, format, &data, &length);
929  if (err)
930  return NULL;
931  data = (char*)realloc(data, length + 1);
932  return data;
933 }
934 
935 bool write(Agraph_t *g, FILE *f)
936 {
937  int err;
938 
939  if (!g)
940  return false;
941  err = agwrite(g, f);
942  return (! err);
943 }
944 
945 bool write(Agraph_t *g, const char *filename)
946 {
947  FILE *f;
948  int err;
949 
950  if (!g)
951  return false;
952  f = fopen(filename, "w");
953  if (!f)
954  return false;
955  err = agwrite(g, f);
956  fclose(f);
957  return (! err);
958 }
Agnode_t * agtail(Agedge_t *e)
Definition: edge.c:494
Agnode_t * aghead(Agedge_t *e)
Definition: edge.c:502
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
int agdelete(Agraph_t *g, void *obj)
Definition: obj.c:16
int gvRenderFilename(GVC_t *gvc, graph_t *g, const char *format, const char *filename)
Definition: gvc.c:129
bool layout(Agraph_t *g, const char *engine)
Definition: gv.cpp:815
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
int gvRenderData(GVC_t *gvc, graph_t *g, const char *format, char **result, unsigned int *length)
Definition: gvc.c:194
int agxset(void *obj, Agsym_t *sym, char *value)
Definition: attr.c:468
char * name
Definition: cgraph.h:330
Agedge_t * nextout(Agraph_t *g, Agedge_t *e)
Definition: gv.cpp:522
Agraph_t * firstsubg(Agraph_t *g)
Definition: gv.cpp:483
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Definition: edge.c:25
void gv_writer_reset(GVC_t *gvc)
Definition: gv_dummy_init.c:5
Agdesc_t Agstrictundirected
Definition: graph.c:279
int aghtmlstr(char *)
Definition: refstr.c:178
Agedge_t * agfstin(Agraph_t *g, Agnode_t *n)
Definition: edge.c:56
int agclose(Agraph_t *g)
Definition: graph.c:93
Agraph_t * agmemread(const char *cp)
Definition: io.c:131
bool render(Agraph_t *g)
Definition: gv.cpp:827
Agnode_t * nexttail(Agnode_t *n, Agnode_t *t)
Definition: gv.cpp:662
int gvFreeLayout(GVC_t *gvc, graph_t *g)
Definition: gvlayout.c:102
bool ok(Agraph_t *g)
Definition: gv.cpp:458
Agedge_t * agfstedge(Agraph_t *g, Agnode_t *n)
Definition: edge.c:86
Agdesc_t Agstrictdirected
Definition: graph.c:277
Agedge_t * protoedge(Agraph_t *g)
Definition: gv.cpp:420
Agedge_t * agnxtin(Agraph_t *g, Agedge_t *e)
Definition: edge.c:70
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
#define AGTYPE(obj)
Definition: cgraph.h:100
Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
Definition: node.c:142
Agnode_t * firsttail(Agnode_t *n)
Definition: gv.cpp:650
Agedge_t * firstin(Agraph_t *g)
Definition: gv.cpp:608
char * malloc()
Agedge_t * firstedge(Agraph_t *g)
Definition: gv.cpp:539
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
void free()
Agdesc_t Agundirected
Definition: graph.c:278
lt_symlist_t lt_preloaded_symbols[]
Definition: dot_builtins.c:38
int i
Definition: gvdevice.c:448
#define AGMKIN(e)
Definition: cgraph.h:406
char * getv(Agraph_t *g, Agsym_t *a)
Definition: gv.cpp:165
Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
Definition: subg.c:52
char * realloc()
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:882
Definition: gvcint.h:70
Agraph_t * agroot(void *obj)
Definition: obj.c:169
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Definition: node.c:45
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
Definition: graph.c:44
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:48
Agraph_t * digraph(char *name)
Definition: gv.cpp:45
Agdesc_t Agdirected
Definition: graph.c:276
Agedge_t * firstout(Agraph_t *g)
Definition: gv.cpp:508
#define AGMKOUT(e)
Definition: cgraph.h:405
Agnode_t * agfstnode(Agraph_t *g)
Definition: node.c:38
#define GD_alg(g)
Definition: types.h:341
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:888
#define AGNODE
Definition: cgraph.h:88
Agraph_t * parent
Definition: cgraph.h:241
#define agnodeattr(g, n, s)
Definition: gv.cpp:26
Agraph_t * strictdigraph(char *name)
Definition: gv.cpp:59
Agraph_t * agraphof(void *obj)
Definition: obj.c:185
#define NULL
Definition: logic.h:50
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Definition: edge.c:40
bool write(Agraph_t *g, FILE *f)
Definition: gv.cpp:935
int gvLayout(GVC_t *gvc, graph_t *g, const char *engine)
Definition: gvc.c:65
Agraph_t * agread(void *chan, Agdisc_t *disc)
Definition: grammar.c:2336
Agraph_t * rootof(Agraph_t *g)
Definition: gv.cpp:405
GVC_t * gvc
Definition: htmlparse.c:87
char * agnameof(void *)
Definition: id.c:143
int len
Definition: gv.cpp:884
Agnode_t * nexthead(Agnode_t *n, Agnode_t *h)
Definition: gv.cpp:575
Agraph_t * agfstsubg(Agraph_t *g)
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
bool renderchannel(Agraph_t *g, const char *format, const char *channelname)
Definition: gv.cpp:858
Agedge_t * agnxtedge(Agraph_t *g, Agedge_t *e, Agnode_t *n)
Definition: edge.c:95
int gvRender(GVC_t *gvc, graph_t *g, const char *format, FILE *out)
Definition: gvc.c:97
Agraph_t * graphof(Agraph_t *g)
Definition: gv.cpp:380
int agwrite(Agraph_t *g, void *chan)
Definition: write.c:673
Definition: gv.cpp:881
Agnode_t * findnode(Agraph_t *g, char *name)
Definition: gv.cpp:323
Agnode_t * headof(Agedge_t *e)
Definition: gv.cpp:362
#define agfindedge(g, t, h)
Definition: types.h:564
bool rm(Agraph_t *g)
Definition: gv.cpp:769
char * agstrdup_html(Agraph_t *, char *)
Definition: refstr.c:123
#define agraphattr(g, n, s)
Definition: gv.cpp:25
Agraph_t * root
Definition: cgraph.h:241
char * renderdata(Agraph_t *g, const char *format)
Definition: gv.cpp:920
Agraph_t * agparent(Agraph_t *g)
Definition: subg.c:85
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
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:91
Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Definition: edge.c:281
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:883
Agraph_t * read(FILE *f)
Definition: gv.cpp:73
Agraph_t * agnxtsubg(Agraph_t *subg)
Definition: subg.c:77
Agedge_t * edge(Agraph_t *g, Agnode_t *t, Agnode_t *h)
Definition: gv.cpp:110
#define AGRAPH
Definition: cgraph.h:87