Graphviz  2.41.20170921.2350
tcldot-graphcmd.c
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 "tcldot.h"
15 
16 int graphcmd(ClientData clientData, Tcl_Interp * interp,
17 #ifndef TCLOBJ
18  int argc, char *argv[]
19 #else
20  int argc, Tcl_Obj * CONST objv[]
21 #endif
22  )
23 {
24 
25  Agraph_t *g, *sg;
26  Agnode_t *n, *tail, *head;
27  Agedge_t *e;
28  gctx_t *gctx = (gctx_t *)clientData;
29  ictx_t *ictx = gctx->ictx;
30  Agsym_t *a;
31  char c, buf[256], **argv2;
32  int i, j, length, argc2, rc;
33  GVC_t *gvc = ictx->gvc;
34  GVJ_t *job = gvc->job;
35 
36  if (argc < 2) {
37  Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0], " option ?arg arg ...?\"", NULL);
38  return TCL_ERROR;
39  }
40  g = cmd2g(argv[0]);
41  if (!g) {
42  Tcl_AppendResult(interp, "Graph \"", argv[0], "\" not found", NULL);
43  return TCL_ERROR;
44  }
45 
46  c = argv[1][0];
47  length = strlen(argv[1]);
48 
49  if ((c == 'a') && (strncmp(argv[1], "addedge", length) == 0)) {
50  if ((argc < 4) || (argc % 2)) {
51  Tcl_AppendResult(interp, "Wrong # args: should be \"", argv[0],
52  " addedge tail head ?attributename attributevalue? ?...?\"",
53  NULL);
54  return TCL_ERROR;
55  }
56  tail = cmd2n(argv[2]);
57  if (!tail) {
58  if (!(tail = agfindnode(g, argv[2]))) {
59  Tcl_AppendResult(interp, "Tail node \"", argv[2], "\" not found.", NULL);
60  return TCL_ERROR;
61  }
62  }
63  if (agroot(g) != agroot(agraphof(tail))) {
64  Tcl_AppendResult(interp, "Tail node ", argv[2], " is not in the graph.", NULL);
65  return TCL_ERROR;
66  }
67  head = cmd2n(argv[3]);
68  if (!head) {
69  if (!(head = agfindnode(g, argv[3]))) {
70  Tcl_AppendResult(interp, "Head node \"", argv[3], "\" not found.", NULL);
71  return TCL_ERROR;
72  }
73  }
74  if (agroot(g) != agroot(agraphof(head))) {
75  Tcl_AppendResult(interp, "Head node ", argv[3], " is not in the graph.", NULL);
76  return TCL_ERROR;
77  }
78  e = agedge(g, tail, head, NULL, 1);
79  Tcl_AppendResult(interp, obj2cmd(e), NULL);
80  setedgeattributes(agroot(g), e, &argv[4], argc - 4);
81  return TCL_OK;
82 
83  } else if ((c == 'a') && (strncmp(argv[1], "addnode", length) == 0)) {
84  if (argc % 2) {
85  /* if odd number of args then argv[2] is name */
86  n = agnode(g, argv[2], 1);
87  i = 3;
88  } else {
89  n = agnode(g, NULL, 1); /* anon node */
90  i = 2;
91  }
92  Tcl_AppendResult(interp, obj2cmd(n), NULL);
93  setnodeattributes(agroot(g), n, &argv[i], argc - i);
94  return TCL_OK;
95 
96  } else if ((c == 'a')
97  && (strncmp(argv[1], "addsubgraph", length) == 0)) {
98  if (argc < 2) {
99  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
100  "\" addsubgraph ?name? ?attributename attributevalue? ?...?",
101  NULL);
102  }
103  if (argc % 2) {
104  /* if odd number of args then argv[2] is name */
105  sg = agsubg(g, argv[2], 1);
106  Tcl_AppendResult(interp, obj2cmd(sg), NULL);
107  i = 3;
108  } else {
109  sg = agsubg(g, NULL, 1); /* anon subgraph */
110  i = 2;
111  }
112  setgraphattributes(sg, &argv[i], argc - i);
113  return TCL_OK;
114 
115  } else if ((c == 'c') && (strncmp(argv[1], "countnodes", length) == 0)) {
116  sprintf(buf, "%d", agnnodes(g));
117  Tcl_AppendResult(interp, buf, NULL);
118  return TCL_OK;
119 
120  } else if ((c == 'c') && (strncmp(argv[1], "countedges", length) == 0)) {
121  sprintf(buf, "%d", agnedges(g));
122  Tcl_AppendResult(interp, buf, NULL);
123  return TCL_OK;
124 
125  } else if ((c == 'd') && (strncmp(argv[1], "delete", length) == 0)) {
126  deleteGraph(gctx, g);
127  return TCL_OK;
128 
129  } else if ((c == 'f') && (strncmp(argv[1], "findedge", length) == 0)) {
130  if (argc < 4) {
131  Tcl_AppendResult(interp, "wrong # args: should be \"",
132  argv[0], " findedge tailnodename headnodename\"", NULL);
133  return TCL_ERROR;
134  }
135  if (!(tail = agfindnode(g, argv[2]))) {
136  Tcl_AppendResult(interp, "Tail node \"", argv[2], "\" not found.", NULL);
137  return TCL_ERROR;
138  }
139  if (!(head = agfindnode(g, argv[3]))) {
140  Tcl_AppendResult(interp, "Head node \"", argv[3], "\" not found.", NULL);
141  return TCL_ERROR;
142  }
143  if (!(e = agfindedge(g, tail, head))) {
144  Tcl_AppendResult(interp, "Edge \"", argv[2], " - ", argv[3], "\" not found.", NULL);
145  return TCL_ERROR;
146  }
147  Tcl_AppendElement(interp, obj2cmd(e));
148  return TCL_OK;
149 
150  } else if ((c == 'f') && (strncmp(argv[1], "findnode", length) == 0)) {
151  if (argc < 3) {
152  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " findnode nodename\"", NULL);
153  return TCL_ERROR;
154  }
155  if (!(n = agfindnode(g, argv[2]))) {
156  Tcl_AppendResult(interp, "Node not found.", NULL);
157  return TCL_ERROR;
158  }
159  Tcl_AppendResult(interp, obj2cmd(n), NULL);
160  return TCL_OK;
161 
162  } else if ((c == 'l')
163  && (strncmp(argv[1], "layoutedges", length) == 0)) {
164  g = agroot(g);
165  if (!aggetrec (g, "Agraphinfo_t",0))
166  tcldot_layout(gvc, g, (argc > 2) ? argv[2] : NULL);
167  return TCL_OK;
168 
169  } else if ((c == 'l')
170  && (strncmp(argv[1], "layoutnodes", length) == 0)) {
171  g = agroot(g);
172  if (!aggetrec (g, "Agraphinfo_t",0))
173  tcldot_layout(gvc, g, (argc > 2) ? argv[2] : NULL);
174  return TCL_OK;
175 
176  } else if ((c == 'l')
177  && (strncmp(argv[1], "listattributes", length) == 0)) {
178  listGraphAttrs(interp, g);
179  return TCL_OK;
180 
181  } else if ((c == 'l')
182  && (strncmp(argv[1], "listedgeattributes", length) == 0)) {
183  listEdgeAttrs (interp, g);
184  return TCL_OK;
185 
186  } else if ((c == 'l')
187  && (strncmp(argv[1], "listnodeattributes", length) == 0)) {
188  listNodeAttrs (interp, g);
189  return TCL_OK;
190 
191  } else if ((c == 'l') && (strncmp(argv[1], "listedges", length) == 0)) {
192  for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
193  for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
194  Tcl_AppendElement(interp, obj2cmd(e));
195  }
196  }
197  return TCL_OK;
198 
199  } else if ((c == 'l') && (strncmp(argv[1], "listnodes", length) == 0)) {
200  for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
201  Tcl_AppendElement(interp, obj2cmd(n));
202 
203  }
204  return TCL_OK;
205 
206  } else if ((c == 'l')
207  && (strncmp(argv[1], "listnodesrev", length) == 0)) {
208  for (n = aglstnode(g); n; n = agprvnode(g, n)) {
209  Tcl_AppendElement(interp, obj2cmd(n));
210  }
211  return TCL_OK;
212 
213  } else if ((c == 'l')
214  && (strncmp(argv[1], "listsubgraphs", length) == 0)) {
215  for (sg = agfstsubg(g); sg; sg = agnxtsubg(sg)) {
216  Tcl_AppendElement(interp, obj2cmd(g));
217  }
218  return TCL_OK;
219 
220  } else if ((c == 'q')
221  && (strncmp(argv[1], "queryattributes", length) == 0)) {
222  for (i = 2; i < argc; i++) {
223  if (Tcl_SplitList
224  (interp, argv[i], &argc2,
225  (CONST84 char ***) &argv2) != TCL_OK)
226  return TCL_ERROR;
227  for (j = 0; j < argc2; j++) {
228  if ((a = agfindgraphattr(g, argv2[j]))) {
229  Tcl_AppendElement(interp, agxget(g, a));
230  } else {
231  Tcl_AppendResult(interp, " No attribute named \"", argv2[j], "\"", NULL);
232  return TCL_ERROR;
233  }
234  }
235  Tcl_Free((char *) argv2);
236  }
237  return TCL_OK;
238 
239  } else if ((c == 'q')
240  && (strncmp(argv[1], "queryattributevalues", length) ==
241  0)) {
242  for (i = 2; i < argc; i++) {
243  if (Tcl_SplitList
244  (interp, argv[i], &argc2,
245  (CONST84 char ***) &argv2) != TCL_OK)
246  return TCL_ERROR;
247  for (j = 0; j < argc2; j++) {
248  if ((a = agfindgraphattr(g, argv2[j]))) {
249  Tcl_AppendElement(interp, argv2[j]);
250  Tcl_AppendElement(interp, agxget(g, a));
251  } else {
252  Tcl_AppendResult(interp, " No attribute named \"", argv2[j], "\"", NULL);
253  return TCL_ERROR;
254  }
255  }
256  Tcl_Free((char *) argv2);
257  }
258  return TCL_OK;
259 
260  } else if ((c == 'q')
261  && (strncmp(argv[1], "queryedgeattributes", length) == 0)) {
262  for (i = 2; i < argc; i++) {
263  if (Tcl_SplitList
264  (interp, argv[i], &argc2,
265  (CONST84 char ***) &argv2) != TCL_OK)
266  return TCL_ERROR;
267  for (j = 0; j < argc2; j++) {
268  if ((a = agfindedgeattr(g, argv2[j]))) {
269  Tcl_AppendElement(interp, agxget(g, a));
270  } else {
271  Tcl_AppendResult(interp, " No attribute named \"", argv2[j], "\"", NULL);
272  return TCL_ERROR;
273  }
274  }
275  Tcl_Free((char *) argv2);
276  }
277  return TCL_OK;
278 
279  } else if ((c == 'q')
280  && (strncmp(argv[1], "queryedgeattributevalues", length) == 0)) {
281  for (i = 2; i < argc; i++) {
282  if (Tcl_SplitList
283  (interp, argv[i], &argc2,
284  (CONST84 char ***) &argv2) != TCL_OK)
285  return TCL_ERROR;
286  for (j = 0; j < argc2; j++) {
287  if ((a = agfindedgeattr(g, argv2[j]))) {
288  Tcl_AppendElement(interp, argv2[j]);
289  Tcl_AppendElement(interp, agxget(g, a));
290  } else {
291  Tcl_AppendResult(interp, " No attribute named \"",
292  argv2[j], "\"", NULL);
293  return TCL_ERROR;
294  }
295  }
296  Tcl_Free((char *) argv2);
297  }
298  return TCL_OK;
299 
300  } else if ((c == 'q')
301  && (strncmp(argv[1], "querynodeattributes", length) == 0)) {
302  for (i = 2; i < argc; i++) {
303  if (Tcl_SplitList
304  (interp, argv[i], &argc2,
305  (CONST84 char ***) &argv2) != TCL_OK)
306  return TCL_ERROR;
307  for (j = 0; j < argc2; j++) {
308  if ((a = agfindnodeattr(g, argv2[j]))) {
309  Tcl_AppendElement(interp, agxget(g, a));
310  } else {
311  Tcl_AppendResult(interp, " No attribute named \"",
312  argv2[j], "\"", NULL);
313  return TCL_ERROR;
314  }
315  }
316  Tcl_Free((char *) argv2);
317  }
318  return TCL_OK;
319 
320  } else if ((c == 'q')
321  && (strncmp(argv[1], "querynodeattributevalues", length) ==
322  0)) {
323  for (i = 2; i < argc; i++) {
324  if (Tcl_SplitList
325  (interp, argv[i], &argc2,
326  (CONST84 char ***) &argv2) != TCL_OK)
327  return TCL_ERROR;
328  for (j = 0; j < argc2; j++) {
329  if ((a = agfindnodeattr(g, argv2[j]))) {
330  Tcl_AppendElement(interp, argv2[j]);
331  Tcl_AppendElement(interp, agxget(g, a));
332  } else {
333  Tcl_AppendResult(interp, " No attribute named \"", argv2[j], "\"", NULL);
334  return TCL_ERROR;
335  }
336  }
337  Tcl_Free((char *) argv2);
338  }
339  return TCL_OK;
340 
341  } else if ((c == 'r') && (strncmp(argv[1], "render", length) == 0)) {
342  char *canvas;
343 
344  if (argc < 3) {
345  canvas = "$c";
346  } else {
347  canvas = argv[2];
348 #if 0 /* not implemented */
349  if (argc < 4) {
350  tkgendata.eval = FALSE;
351  } else {
352  if ((Tcl_GetBoolean(interp, argv[3], &tkgendata.eval)) !=
353  TCL_OK) {
354  Tcl_AppendResult(interp, " Invalid boolean: \"",
355  argv[3], "\"", NULL);
356  return TCL_ERROR;
357  }
358  }
359 #endif
360  }
361  rc = gvjobs_output_langname(gvc, "tk");
362  if (rc == NO_SUPPORT) {
363  Tcl_AppendResult(interp, " Format: \"tk\" not recognized.\n", NULL);
364  return TCL_ERROR;
365  }
366 
368  job = gvc->job;
369  job->imagedata = canvas;
370  job->context = (void *)interp;
371  job->external_context = TRUE;
372  job->output_file = stdout;
373 
374  /* make sure that layout is done */
375  g = agroot(g);
376  if (!aggetrec (g, "Agraphinfo_t",0) || argc > 3)
377  tcldot_layout (gvc, g, (argc > 3) ? argv[3] : NULL);
378 
379  /* render graph TK canvas commands */
380  gvc->common.viewNum = 0;
381  gvRenderJobs(gvc, g);
382  gvrender_end_job(job);
383  gvdevice_finalize(job);
384  fflush(job->output_file);
385  gvjobs_delete(gvc);
386  return TCL_OK;
387 
388 #if 0
389 #if HAVE_LIBGD
390  } else if ((c == 'r') && (strncmp(argv[1], "rendergd", length) == 0)) {
391 #if 0
392  void **hdl;
393 #endif
394 
395  if (argc < 3) {
396  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
397  " rendergd gdhandle ?DOT|NEATO|TWOPI|FDP|CIRCO?\"", NULL);
398  return TCL_ERROR;
399  }
400  rc = gvjobs_output_langname(gvc, "gd:gd:gd");
401  if (rc == NO_SUPPORT) {
402  Tcl_AppendResult(interp, " Format: \"gd\" not recognized.\n", NULL);
403  return TCL_ERROR;
404  }
405  job = gvc->job;
406 
407 #if 0
408  if (! (hdl = tclhandleXlate(GDHandleTable, argv[2]))) {
409  Tcl_AppendResult(interp, "GD Image not found.", NULL);
410  return TCL_ERROR;
411  }
412  job->context = *hdl;
413 #else
414  job->context = (void*)(((Tcl_Obj*)(argv[2]))->internalRep.otherValuePtr);
415 #endif
416  job->external_context = TRUE;
417 
418  /* make sure that layout is done */
419  g = agroot(g);
420  if (!aggetrec (g, "Agraphinfo_t",0) || argc > 4)
421  tcldot_layout(gvc, g, (argc > 4) ? argv[4] : NULL);
422 
423  gvc->common.viewNum = 0;
424  gvRenderJobs(gvc, g);
425  gvrender_end_job(job);
426  gvdevice_finalize(job);
427  fflush(job->output_file);
428  gvjobs_delete(gvc);
429  Tcl_AppendResult(interp, argv[2], NULL);
430  return TCL_OK;
431 #endif
432 #endif
433 
434  } else if ((c == 's')
435  && (strncmp(argv[1], "setattributes", length) == 0)) {
436  if (argc == 3) {
437  if (Tcl_SplitList
438  (interp, argv[2], &argc2,
439  (CONST84 char ***) &argv2) != TCL_OK)
440  return TCL_ERROR;
441  if ((argc2 == 0) || (argc2 % 2)) {
442  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
443  "\" setattributes attributename attributevalue ?attributename attributevalue? ?...?",
444  NULL);
445  Tcl_Free((char *) argv2);
446  return TCL_ERROR;
447  }
448  setgraphattributes(g, argv2, argc2);
449  Tcl_Free((char *) argv2);
450  }
451  if (argc == 4 && strcmp(argv[2], "viewport") == 0) {
452  /* special case to allow viewport to be set without resetting layout */
453  setgraphattributes(g, &argv[2], argc - 2);
454  } else {
455  if ((argc < 4) || (argc % 2)) {
456  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
457  "\" setattributes attributename attributevalue ?attributename attributevalue? ?...?",
458  NULL);
459  return TCL_ERROR;
460  }
461  setgraphattributes(g, &argv[2], argc - 2);
462  }
463  return TCL_OK;
464 
465  } else if ((c == 's')
466  && (strncmp(argv[1], "setedgeattributes", length) == 0)) {
467  if (argc == 3) {
468  if (Tcl_SplitList
469  (interp, argv[2], &argc2,
470  (CONST84 char ***) &argv2) != TCL_OK)
471  return TCL_ERROR;
472  if ((argc2 == 0) || (argc2 % 2)) {
473  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
474  "\" setedgeattributes attributename attributevalue ?attributename attributevalue? ?...?",
475  NULL);
476  Tcl_Free((char *) argv2);
477  return TCL_ERROR;
478  }
479  setedgeattributes(g, NULL, argv2, argc2);
480  Tcl_Free((char *) argv2);
481  } else {
482  if ((argc < 4) || (argc % 2)) {
483  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
484  "\" setedgeattributes attributename attributevalue ?attributename attributevalue? ?...?",
485  NULL);
486  }
487  setedgeattributes(g, NULL, &argv[2], argc - 2);
488  }
489  return TCL_OK;
490 
491  } else if ((c == 's')
492  && (strncmp(argv[1], "setnodeattributes", length) == 0)) {
493  if (argc == 3) {
494  if (Tcl_SplitList
495  (interp, argv[2], &argc2,
496  (CONST84 char ***) &argv2) != TCL_OK)
497  return TCL_ERROR;
498  if ((argc2 == 0) || (argc2 % 2)) {
499  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
500  "\" setnodeattributes attributename attributevalue ?attributename attributevalue? ?...?",
501  NULL);
502  Tcl_Free((char *) argv2);
503  return TCL_ERROR;
504  }
505  setnodeattributes(g, NULL, argv2, argc2);
506  Tcl_Free((char *) argv2);
507  } else {
508  if ((argc < 4) || (argc % 2)) {
509  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
510  "\" setnodeattributes attributename attributevalue ?attributename attributevalue? ?...?",
511  NULL);
512  }
513  setnodeattributes(g, NULL, &argv[2], argc - 2);
514  }
515  return TCL_OK;
516 
517  } else if ((c == 's') && (strncmp(argv[1], "showname", length) == 0)) {
518  Tcl_SetResult(interp, agnameof(g), TCL_STATIC);
519  return TCL_OK;
520 
521  } else if ((c == 'w') && (strncmp(argv[1], "write", length) == 0)) {
522  g = agroot(g);
523  if (argc < 3) {
524  Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
525  " write fileHandle ?language ?DOT|NEATO|TWOPI|FDP|CIRCO|NOP??\"",
526  NULL);
527  return TCL_ERROR;
528  }
529 
530  /* process lang first to create job */
531  if (argc < 4) {
532  i = gvjobs_output_langname(gvc, "dot");
533  } else {
534  i = gvjobs_output_langname(gvc, argv[3]);
535  }
536  if (i == NO_SUPPORT) {
537  const char *s = gvplugin_list(gvc, API_render, argv[3]);
538  Tcl_AppendResult(interp, "Bad langname: \"", argv[3], "\". Use one of:", s, NULL);
539  return TCL_ERROR;
540  }
541 
543  job = gvc->job;
544 
545  /* populate new job struct with output language and output file data */
546  job->output_lang = gvrender_select(job, job->output_langname);
547 
548 // if (Tcl_GetOpenFile (interp, argv[2], 1, 1, &outfp) != TCL_OK)
549 // return TCL_ERROR;
550 // job->output_file = (FILE *)outfp;
551 
552  {
553  Tcl_Channel chan;
554  int mode;
555 
556  chan = Tcl_GetChannel(interp, argv[2], &mode);
557 
558  if (!chan) {
559  Tcl_AppendResult(interp, "Channel not open: \"", argv[2], NULL);
560  return TCL_ERROR;
561  }
562  if (!(mode & TCL_WRITABLE)) {
563  Tcl_AppendResult(interp, "Channel not writable: \"", argv[2], NULL);
564  return TCL_ERROR;
565  }
566  job->output_file = (FILE *)chan;
567  }
568  job->output_filename = NULL;
569 
570  /* make sure that layout is done - unless canonical output */
571  if ((!aggetrec (g, "Agraphinfo_t",0) || argc > 4) && !(job->flags & LAYOUT_NOT_REQUIRED))
572  tcldot_layout(gvc, g, (argc > 4) ? argv[4] : NULL);
573 
574  gvc->common.viewNum = 0;
575  gvRenderJobs(gvc, g);
576  gvdevice_finalize(job);
577 // fflush(job->output_file);
578  gvjobs_delete(gvc);
579  return TCL_OK;
580 
581  } else {
582  Tcl_AppendResult(interp, "bad option \"", argv[1],
583  "\": must be one of:",
584  "\n\taddedge, addnode, addsubgraph, countedges, countnodes,",
585  "\n\tlayout, listattributes, listedgeattributes, listnodeattributes,",
586  "\n\tlistedges, listnodes, listsubgraphs, render, rendergd,",
587  "\n\tqueryattributes, queryedgeattributes, querynodeattributes,",
588  "\n\tqueryattributevalues, queryedgeattributevalues, querynodeattributevalues,",
589  "\n\tsetattributes, setedgeattributes, setnodeattributes,",
590  "\n\tshowname, write.", NULL);
591  return TCL_ERROR;
592  }
593 } /* graphcmd */
Agraph_t * cmd2g(char *cmd)
Definition: tcldot-util.c:30
GVC_t * gvc
Definition: tcldot.h:51
CGRAPH_API Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
Definition: node.c:142
char * imagedata
Definition: gvcjob.h:306
#define LAYOUT_NOT_REQUIRED
Definition: gvcjob.h:110
void listNodeAttrs(Tcl_Interp *interp, Agraph_t *g)
Definition: tcldot-util.c:203
Agnode_t * cmd2n(char *cmd)
Definition: tcldot-util.c:37
#define head
Definition: dthdr.h:19
Definition: tcldot.h:46
void * context
Definition: gvcjob.h:304
void setgraphattributes(Agraph_t *g, char *argv[], int argc)
Definition: tcldot-util.c:143
char * obj2cmd(void *obj)
Definition: tcldot-util.c:55
CGRAPH_API Agnode_t * agprvnode(Agraph_t *g, Agnode_t *n)
Definition: node.c:60
void listGraphAttrs(Tcl_Interp *interp, Agraph_t *g)
Definition: tcldot-util.c:196
int gvRenderJobs(GVC_t *gvc, graph_t *g)
Definition: emit.c:4094
const char * output_filename
Definition: gvcjob.h:285
int flags
Definition: gvcjob.h:308
CGRAPH_API Agraph_t * agfstsubg(Agraph_t *g)
Definition: subg.c:72
Definition: gvcjob.h:271
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
#define NO_SUPPORT
Definition: const.h:151
void listEdgeAttrs(Tcl_Interp *interp, Agraph_t *g)
Definition: tcldot-util.c:210
CGRAPH_API Agraph_t * agraphof(void *obj)
Definition: obj.c:185
CGRAPH_API Agraph_t * agnxtsubg(Agraph_t *subg)
Definition: subg.c:77
size_t Tcldot_channel_writer(GVJ_t *job, const char *s, size_t len)
Definition: tcldot-util.c:23
CGRAPH_API Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
Definition: subg.c:52
CGRAPH_API Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Definition: node.c:45
int viewNum
Definition: gvcommon.h:31
void gvdevice_finalize(GVJ_t *job)
Definition: gvdevice.c:323
Definition: gvcint.h:70
CGRAPH_API char * agnameof(void *)
Definition: id.c:143
size_t Tcldot_string_writer(GVJ_t *job, const char *s, size_t len)
Definition: tcldot-util.c:17
#define agfindedgeattr(g, a)
Definition: types.h:614
CGRAPH_API Agnode_t * aglstnode(Agraph_t *g)
Definition: node.c:53
CGRAPH_API Agnode_t * agfstnode(Agraph_t *g)
Definition: node.c:38
CGRAPH_API Agrec_t * aggetrec(void *obj, char *name, int move_to_front)
Definition: rec.c:34
Definition: grammar.c:79
ictx_t * ictx
Definition: tcldot.h:59
#define agfindnode(g, n)
Definition: types.h:611
#define NULL
Definition: logic.h:39
Definition: tcldot.h:57
#define agfindgraphattr(g, a)
Definition: types.h:612
boolean external_context
Definition: gvcjob.h:305
GVC_t * gvc
Definition: htmlparse.c:87
void setedgeattributes(Agraph_t *g, Agedge_t *e, char *argv[], int argc)
Definition: tcldot-util.c:155
CGRAPH_API int agnnodes(Agraph_t *g)
Definition: graph.c:162
char * gvplugin_list(GVC_t *gvc, api_t api, const char *str)
Definition: gvplugin.c:342
CGRAPH_API Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Definition: edge.c:281
int graphcmd(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
boolean gvjobs_output_langname(GVC_t *gvc, const char *name)
Definition: gvjobs.c:64
void setnodeattributes(Agraph_t *g, Agnode_t *n, char *argv[], int argc)
Definition: tcldot-util.c:178
GVCOMMON_t common
Definition: gvcint.h:71
#define agfindedge(g, t, h)
Definition: types.h:610
void deleteGraph(gctx_t *gctx, Agraph_t *g)
Definition: tcldot-util.c:108
CGRAPH_API int agnedges(Agraph_t *g)
Definition: graph.c:167
void gvrender_end_job(GVJ_t *job)
Definition: gvrender.c:123
int gvrender_select(GVJ_t *job, const char *lang)
Definition: gvrender.c:47
char * agxget(void *obj, Agsym_t *sym)
Definition: attr.c:444
int output_lang
Definition: gvcjob.h:292
CGRAPH_API Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Definition: edge.c:40
void tcldot_layout(GVC_t *gvc, Agraph_t *g, char *engine)
Definition: tcldot-util.c:218
void gvjobs_delete(GVC_t *gvc)
Definition: gvjobs.c:135
FILE * output_file
Definition: gvcjob.h:286
#define agfindnodeattr(g, a)
Definition: types.h:613
GVJ_t * job
Definition: gvcint.h:104
#define FALSE
Definition: cgraph.h:35
const char * output_langname
Definition: gvcjob.h:291
#define CONST84
Definition: tcldot.h:25
size_t(* write_fn)(GVJ_t *job, const char *s, size_t len)
Definition: gvcint.h:92
#define TRUE
Definition: cgraph.h:38