Graphviz 13.0.0~dev.20250608.0154
Loading...
Searching...
No Matches
gxl2gv.c
Go to the documentation of this file.
1
6/*************************************************************************
7 * Copyright (c) 2011 AT&T Intellectual Property
8 * All rights reserved. This program and the accompanying materials
9 * are made available under the terms of the Eclipse Public License v1.0
10 * which accompanies this distribution, and is available at
11 * https://www.eclipse.org/legal/epl-v10.html
12 *
13 * Contributors: Details at https://graphviz.org
14 *************************************************************************/
15
16#include <assert.h>
17#include "convert.h"
18#include <stdbool.h>
19#include <stdio.h>
20#include <util/agxbuf.h>
21#include <util/alloc.h>
22#include <util/exit.h>
23#include <util/gv_ctype.h>
24#include <util/list.h>
25#include <util/startswith.h>
26#include <util/unreachable.h>
27#ifdef HAVE_EXPAT
28#include <expat.h>
29#include <limits.h>
30#include <stdlib.h>
31
32#ifndef XML_STATUS_ERROR
33#define XML_STATUS_ERROR 0
34#endif
35
36#define NAMEBUF 100
37
38#define GXL_ATTR "_gxl_"
39#define GXL_ID "_gxl_id"
40#define GXL_ROLE "_gxl_role"
41#define GXL_HYPER "_gxl_hypergraph"
42#define GXL_FROM "_gxl_fromorder"
43#define GXL_TO "_gxl_toorder"
44#define GXL_TYPE "_gxl_type"
45#define GXL_COMP "_gxl_composite_"
46#define GXL_LOC "_gxl_locator_"
47
48typedef enum {
49 TAG_NONE,
50 TAG_GRAPH,
51 TAG_NODE,
52 TAG_EDGE,
53 TAG_HTML_LIKE_STRING,
54} attr_t;
55
56typedef struct {
57 agxbuf xml_attr_name;
58 agxbuf xml_attr_value;
59 agxbuf composite_buffer;
60 bool listen;
61 attr_t closedElementType;
62 attr_t globalAttrType;
63 bool compositeReadState;
64 bool edgeinverted;
65 Dt_t *nameMap;
66} userdata_t;
67
68static Agraph_t *root; /* root graph */
69static attr_t Current_class; /* Current element type */
70static Agraph_t *G; /* Current graph */
71static Agnode_t *N; /* Set if Current_class == TAG_NODE */
72static Agedge_t *E; /* Set if Current_class == TAG_EDGE */
73
74DEFINE_LIST(graph_stack, Agraph_t *)
75static graph_stack_t Gstack;
76
77typedef struct {
78 Dtlink_t link;
79 char *name;
80 char *unique_name;
81} namev_t;
82
83static void *make_nitem(void *p, Dtdisc_t *disc){
84 (void)disc;
85 namev_t *objp = p;
86
87 namev_t *np = malloc(sizeof(namev_t));
88 if (np == NULL)
89 return NULL;
90 np->name = objp->name;
91 np->unique_name = 0;
92 return np;
93}
94
95static void free_nitem(void *name) {
96 namev_t *np = name;
97 free(np->unique_name);
98 free(np);
99}
100
101static Dtdisc_t nameDisc = {
102 .key = offsetof(namev_t, name),
103 .size = -1,
104 .link = offsetof(namev_t, link),
105 .makef = make_nitem,
106 .freef = free_nitem,
107};
108
109static userdata_t genUserdata(void) {
110 userdata_t user = {0};
111 user.listen = false;
112 user.closedElementType = TAG_NONE;
113 user.globalAttrType = TAG_NONE;
114 user.compositeReadState = false;
115 user.edgeinverted = false;
116 user.nameMap = dtopen(&nameDisc, Dtoset);
117 return user;
118}
119
120static void freeUserdata(userdata_t ud) {
121 dtclose(ud.nameMap);
122 agxbfree(&ud.xml_attr_name);
123 agxbfree(&ud.xml_attr_value);
124 agxbfree(&ud.composite_buffer);
125}
126
127static void addToMap(Dt_t * map, char *name, char *uniqueName)
128{
129 namev_t obj;
130 namev_t *objp;
131
132 obj.name = name;
133 objp = dtinsert(map, &obj);
134 assert(objp->unique_name == 0);
135 objp->unique_name = gv_strdup(uniqueName);
136}
137
138static char *mapLookup(Dt_t *nm, const char *name) {
139 namev_t *objp = dtmatch(nm, name);
140 if (objp)
141 return objp->unique_name;
142 else
143 return 0;
144}
145
146static int isAnonGraph(const char *name)
147{
148 if (*name++ != '%')
149 return 0;
150 while (gv_isdigit(*name))
151 name++; /* skip over digits */
152 return (*name == '\0');
153}
154
155static void push_subg(Agraph_t * g)
156{
157 // insert the new graph
158 graph_stack_push_back(&Gstack, g);
159
160 // save the root if this is the first graph
161 if (graph_stack_size(&Gstack) == 1) {
162 root = g;
163 }
164
165 // update the top graph
166 G = g;
167}
168
169static Agraph_t *pop_subg(void)
170{
171 // is the stack empty?
172 if (graph_stack_is_empty(&Gstack)) {
173 fprintf(stderr, "gxl2gv: Gstack underflow in graph parser\n");
174 graphviz_exit(EXIT_FAILURE);
175 }
176
177 // pop the top graph
178 Agraph_t *g = graph_stack_pop_back(&Gstack);
179
180 // update the top graph
181 if (!graph_stack_is_empty(&Gstack))
182 G = *graph_stack_back(&Gstack);
183
184 return g;
185}
186
187static Agnode_t *bind_node(const char *name)
188{
189 N = agnode(G, (char *) name, 1);
190 return N;
191}
192
193static Agedge_t *bind_edge(const char *tail, const char *head)
194{
195 Agnode_t *tailNode, *headNode;
196 char *key = 0;
197
198 tailNode = agnode(G, (char *) tail, 1);
199 headNode = agnode(G, (char *) head, 1);
200 E = agedge(G, tailNode, headNode, key, 1);
201 return E;
202}
203
204static int get_xml_attr(char *attrname, const char **atts)
205{
206 int count = 0;
207 while (atts[count] != NULL) {
208 if (strcmp(attrname, atts[count]) == 0) {
209 return count + 1;
210 }
211 count += 2;
212 }
213 return -1;
214}
215
216static void setName(Dt_t * names, Agobj_t * n, char *value)
217{
218 Agsym_t *const ap = agattr_text(root, AGTYPE(n), GXL_ID, "");
219 agxset(n, ap, agnameof(n));
220 char *const oldName = agxget(n, ap); // set/get gives us new copy
221 addToMap(names, oldName, value);
222 agrename(n, value);
223}
224
225static char *defval = "";
226
227static void
228setNodeAttr(Agnode_t * np, char *name, char *value, userdata_t * ud,
229 bool is_html)
230{
231 if (strcmp(name, "name") == 0) {
232 setName(ud->nameMap, (Agobj_t *) np, value);
233 } else {
234 Agsym_t *ap = agattr_text(root, AGNODE, name, 0);
235 if (!ap)
236 ap = agattr_text(root, AGNODE, name, defval);
237 if (is_html) {
238 agxset_html(np, ap, value);
239 } else {
240 agxset(np, ap, value);
241 }
242 }
243}
244
245#define NODELBL "node:"
246#define NLBLLEN (sizeof(NODELBL)-1)
247#define EDGELBL "edge:"
248#define ELBLLEN (sizeof(EDGELBL)-1)
249
250/* setGlobalNodeAttr:
251 * Set global node attribute.
252 * The names must always begin with "node:".
253 */
254static void
255setGlobalNodeAttr(Agraph_t * g, char *name, char *value)
256{
257 if (!startswith(name, NODELBL))
258 fprintf(stderr,
259 "Warning: global node attribute %s in graph %s does not begin with the prefix %s\n",
260 name, agnameof(g), NODELBL);
261 else
262 name += NLBLLEN;
263 if ((g != root) && !agattr_text(root, AGNODE, name, 0))
264 agattr_text(root, AGNODE, name, defval);
265 agattr_text(G, AGNODE, name, value);
266}
267
268static void
269setEdgeAttr(Agedge_t * ep, char *name, char *value, userdata_t * ud,
270 bool is_html)
271{
272 Agsym_t *ap;
273 char *attrname;
274
275 if (strcmp(name, "headport") == 0) {
276 if (ud->edgeinverted)
277 attrname = "tailport";
278 else
279 attrname = "headport";
280 ap = agattr_text(root, AGEDGE, attrname, 0);
281 if (!ap)
282 ap = agattr_text(root, AGEDGE, attrname, defval);
283 } else if (strcmp(name, "tailport") == 0) {
284 if (ud->edgeinverted)
285 attrname = "headport";
286 else
287 attrname = "tailport";
288 ap = agattr_text(root, AGEDGE, attrname, 0);
289 if (!ap)
290 ap = agattr_text(root, AGEDGE, attrname, defval);
291 } else {
292 ap = agattr_text(root, AGEDGE, name, 0);
293 if (!ap)
294 ap = agattr_text(root, AGEDGE, name, defval);
295 }
296
297 if (is_html) {
298 agxset_html(ep, ap, value);
299 } else {
300 agxset(ep, ap, value);
301 }
302}
303
304/* setGlobalEdgeAttr:
305 * Set global edge attribute.
306 * The names always begin with "edge:".
307 */
308static void
309setGlobalEdgeAttr(Agraph_t * g, char *name, char *value)
310{
311 if (!startswith(name, EDGELBL))
312 fprintf(stderr,
313 "Warning: global edge attribute %s in graph %s does not begin with the prefix %s\n",
314 name, agnameof(g), EDGELBL);
315 else
316 name += ELBLLEN;
317 if ((g != root) && !agattr_text(root, AGEDGE, name, 0))
318 agattr_text(root, AGEDGE, name, defval);
319 agattr_text(g, AGEDGE, name, value);
320}
321
322static void
323setGraphAttr(Agraph_t * g, char *name, char *value, userdata_t * ud)
324{
325 Agsym_t *ap;
326
327 if ((g == root) && !strcmp(name, "strict") && !strcmp(value, "true")) {
328 g->desc.strict = true;
329 } else if (strcmp(name, "name") == 0)
330 setName(ud->nameMap, (Agobj_t *) g, value);
331 else {
332 ap = agattr_text(root, AGRAPH, name, 0);
333 if (ap)
334 agxset(g, ap, value);
335 else if (g == root)
336 agattr_text(root, AGRAPH, name, value);
337 else {
338 ap = agattr_text(root, AGRAPH, name, defval);
339 agxset(g, ap, value);
340 }
341 }
342}
343
344static void setAttr(char *name, char *value, userdata_t * ud, bool is_html)
345{
346 switch (Current_class) {
347 case TAG_GRAPH:
348 setGraphAttr(G, name, value, ud);
349 break;
350 case TAG_NODE:
351 setNodeAttr(N, name, value, ud, is_html);
352 break;
353 case TAG_EDGE:
354 setEdgeAttr(E, name, value, ud, is_html);
355 break;
356 default:
357 break;
358 }
359}
360
361/*------------- expat handlers ----------------------------------*/
362
363static void
364startElementHandler(void *userData, const char *name, const char **atts)
365{
366 int pos;
367 userdata_t *ud = userData;
368 Agraph_t *g = NULL;
369
370 if (strcmp(name, "gxl") == 0) {
371 /* do nothing */
372 } else if (strcmp(name, "graph") == 0) {
373 const char *edgeMode = "";
374 char buf[NAMEBUF]; /* holds % + number */
375
376 Current_class = TAG_GRAPH;
377 if (ud->closedElementType == TAG_GRAPH) {
378 fprintf(stderr,
379 "Warning: Node contains more than one graph.\n");
380 }
381 pos = get_xml_attr("id", atts);
382 if (pos <= 0) {
383 fprintf(stderr, "Error: Graph has no ID attribute.\n");
384 graphviz_exit(EXIT_FAILURE);
385 }
386 const char *id = atts[pos];
387 pos = get_xml_attr("edgemode", atts);
388 if (pos > 0) {
389 edgeMode = atts[pos];
390 }
391
392 if (graph_stack_is_empty(&Gstack)) {
393 if (strcmp(edgeMode, "directed") == 0) {
394 g = agopen((char *) id, Agdirected, &AgDefaultDisc);
395 } else if (strcmp(edgeMode, "undirected") == 0) {
396 g = agopen((char *) id, Agundirected, &AgDefaultDisc);
397 } else {
398 fprintf(stderr,
399 "Warning: graph has no edgemode attribute");
400 fprintf(stderr, " - assume directed\n");
401 g = agopen((char *) id, Agdirected, &AgDefaultDisc);
402 }
403 push_subg(g);
404 } else {
405 Agraph_t *subg;
406 if (isAnonGraph(id)) {
407 static int anon_id = 1;
408 snprintf(buf, sizeof(buf), "%%%d", anon_id++);
409 id = buf;
410 }
411 subg = agsubg(G, (char *) id, 1);
412 push_subg(subg);
413 }
414
415 pos = get_xml_attr("role", atts);
416 if (pos > 0) {
417 setGraphAttr(G, GXL_ROLE, (char *) atts[pos], ud);
418 }
419
420 pos = get_xml_attr("hypergraph", atts);
421 if (pos > 0) {
422 setGraphAttr(G, GXL_HYPER, (char *) atts[pos], ud);
423 }
424
425 } else if (strcmp(name, "node") == 0) {
426 Current_class = TAG_NODE;
427 pos = get_xml_attr("id", atts);
428 if (pos > 0) {
429 const char *attrname;
430 attrname = atts[pos];
431
432 if (attrname != NULL && strcmp(attrname, "") != 0) {
433 bind_node(attrname);
434 }
435 }
436
437 } else if (strcmp(name, "edge") == 0) {
438 const char *head = "", *tail = "";
439 char *tname;
440 Agnode_t *t;
441
442 Current_class = TAG_EDGE;
443 pos = get_xml_attr("from", atts);
444 if (pos > 0)
445 tail = atts[pos];
446 pos = get_xml_attr("to", atts);
447 if (pos > 0)
448 head = atts[pos];
449
450 tname = mapLookup(ud->nameMap, tail);
451 if (tname)
452 tail = tname;
453
454 tname = mapLookup(ud->nameMap, head);
455 if (tname)
456 head = tname;
457
458 bind_edge(tail, head);
459
460 t = AGTAIL(E);
461 tname = agnameof(t);
462
463 if (strcmp(tname, tail) == 0) {
464 ud->edgeinverted = false;
465 } else if (strcmp(tname, head) == 0) {
466 ud->edgeinverted = true;
467 }
468
469 pos = get_xml_attr("fromorder", atts);
470 if (pos > 0) {
471 setEdgeAttr(E, GXL_FROM, (char *) atts[pos], ud, false);
472 }
473
474 pos = get_xml_attr("toorder", atts);
475 if (pos > 0) {
476 setEdgeAttr(E, GXL_TO, (char *) atts[pos], ud, false);
477 }
478
479 pos = get_xml_attr("id", atts);
480 if (pos > 0) {
481 setEdgeAttr(E, GXL_ID, (char *) atts[pos], ud, false);
482 }
483 } else if (strcmp(name, "attr") == 0) {
484 const char *attrname = atts[get_xml_attr("name", atts)];
485
486 agxbput(&ud->xml_attr_name, attrname);
487 pos = get_xml_attr("kind", atts);
488
489 if (pos > 0) {
490 if (strcmp("node", atts[pos]) == 0)
491 ud->globalAttrType = TAG_NODE;
492 else if (strcmp("edge", atts[pos]) == 0)
493 ud->globalAttrType = TAG_EDGE;
494 else if (strcmp("graph", atts[pos]) == 0)
495 ud->globalAttrType = TAG_GRAPH;
496 else if (strcmp("HTML-like string", atts[pos]) == 0)
497 ud->globalAttrType = TAG_HTML_LIKE_STRING;
498 } else {
499 ud->globalAttrType = TAG_NONE;
500 }
501
502 } else if (strcmp(name, "string") == 0
503 || strcmp(name, "bool") == 0
504 || strcmp(name, "int") == 0 || strcmp(name, "float") == 0) {
505
506 ud->listen = true;
507 if (ud->compositeReadState) {
508 agxbprint(&ud->composite_buffer, "<%s>", name);
509 }
510 } else if (strcmp(name, "rel") == 0 || strcmp(name, "relend") == 0) {
511 fprintf(stderr, "%s element is ignored by DOT\n", name);
512 } else if (strcmp(name, "type") == 0) {
513 pos = get_xml_attr("xlink:href", atts);
514 if (pos > 0) {
515 setAttr(GXL_TYPE, (char *) atts[pos], ud, false);
516 }
517 } else if (strcmp(name, "locator") == 0) {
518 pos = get_xml_attr("xlink:href", atts);
519 if (pos > 0) {
520 const char *href = atts[pos];
521 agxbprint(&ud->xml_attr_value, "%s%s", GXL_LOC, href);
522 }
523 } else if (strcmp(name, "seq") == 0
524 || strcmp(name, "set") == 0
525 || strcmp(name, "bag") == 0
526 || strcmp(name, "tup") == 0 || strcmp(name, "enum") == 0) {
527
528 ud->compositeReadState = true;
529 agxbprint(&ud->composite_buffer, "<%s>", name);
530 } else {
531 /* must be some extension */
532 fprintf(stderr,
533 "Unknown node %s; DOT does not support extensions.\n",
534 name);
535 }
536}
537
538static void endElementHandler(void *userData, const char *name)
539{
540 userdata_t *ud = userData;
541
542 if (strcmp(name, "graph") == 0) {
543 pop_subg();
544 ud->closedElementType = TAG_GRAPH;
545 } else if (strcmp(name, "node") == 0) {
546 Current_class = TAG_GRAPH;
547 N = 0;
548 ud->closedElementType = TAG_NODE;
549 } else if (strcmp(name, "edge") == 0) {
550 Current_class = TAG_GRAPH;
551 E = 0;
552 ud->closedElementType = TAG_EDGE;
553 ud->edgeinverted = false;
554 } else if (strcmp(name, "attr") == 0) {
555 agxbuf new_name = {0};
556 char *value;
557
558 ud->closedElementType = TAG_NONE;
559 if (ud->compositeReadState) {
560 agxbprint(&new_name, "%s%s", GXL_COMP, agxbuse(&ud->xml_attr_name));
561 value = agxbuse(&ud->composite_buffer);
562 agxbclear(&ud->xml_attr_value);
563 ud->compositeReadState = false;
564 } else {
565 agxbput(&new_name, agxbuse(&ud->xml_attr_name));
566 value = agxbuse(&ud->xml_attr_value);
567 }
568
569 switch (ud->globalAttrType) {
570 case TAG_NONE:
571 setAttr(agxbuse(&new_name), value, ud, false);
572 break;
573 case TAG_NODE:
574 setGlobalNodeAttr(G, agxbuse(&new_name), value);
575 break;
576 case TAG_EDGE:
577 setGlobalEdgeAttr(G, agxbuse(&new_name), value);
578 break;
579 case TAG_GRAPH:
580 setGraphAttr(G, agxbuse(&new_name), value, ud);
581 break;
582 case TAG_HTML_LIKE_STRING:
583 setAttr(agxbuse(&new_name), value, ud, true);
584 break;
585 default:
586 UNREACHABLE();
587 }
588 agxbfree(&new_name);
589 ud->globalAttrType = TAG_NONE;
590 } else if (strcmp(name, "string") == 0
591 || strcmp(name, "bool") == 0
592 || strcmp(name, "int") == 0 || strcmp(name, "float") == 0) {
593 ud->listen = false;
594 if (ud->compositeReadState) {
595 agxbprint(&ud->composite_buffer, "</%s>", name);
596 }
597 } else if (strcmp(name, "seq") == 0
598 || strcmp(name, "set") == 0
599 || strcmp(name, "bag") == 0
600 || strcmp(name, "tup") == 0 || strcmp(name, "enum") == 0) {
601 agxbprint(&ud->composite_buffer, "</%s>", name);
602 }
603}
604
605static void characterDataHandler(void *userData, const char *s, int length)
606{
607 userdata_t *ud = userData;
608
609 assert(length >= 0 && "Expat returned negative length data");
610 size_t len = (size_t)length;
611
612 if (!ud->listen)
613 return;
614
615 if (ud->compositeReadState) {
616 agxbput_n(&ud->composite_buffer, s, len);
617 return;
618 }
619
620 agxbput_n(&ud->xml_attr_value, s, len);
621}
622
623Agraph_t *gxl_to_gv(FILE * gxlFile)
624{
625 char buf[BUFSIZ];
626 int done;
627 userdata_t udata = genUserdata();
628 XML_Parser parser = XML_ParserCreate(NULL);
629
630 XML_SetUserData(parser, &udata);
631 XML_SetElementHandler(parser, startElementHandler, endElementHandler);
632 XML_SetCharacterDataHandler(parser, characterDataHandler);
633
634 Current_class = TAG_GRAPH;
635 root = 0;
636 do {
637 size_t len = fread(buf, 1, sizeof(buf), gxlFile);
638 if (len == 0)
639 break;
640 done = len < sizeof(buf);
641 assert(len <= INT_MAX && "too large data for Expat API");
642 if (XML_Parse(parser, buf, (int)len, done) == XML_STATUS_ERROR) {
643 fprintf(stderr,
644 "%s at line %lu\n",
645 XML_ErrorString(XML_GetErrorCode(parser)),
646 XML_GetCurrentLineNumber(parser));
647 graphviz_exit(1);
648 }
649 } while (!done);
650 XML_ParserFree(parser);
651 freeUserdata(udata);
652 graph_stack_free(&Gstack);
653
654 return root;
655}
656
657#endif
static void agxbfree(agxbuf *xb)
free any malloced resources
Definition agxbuf.h:78
static size_t agxbput_n(agxbuf *xb, const char *s, size_t ssz)
append string s of length ssz into xb
Definition agxbuf.h:250
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
Definition agxbuf.h:234
static void agxbclear(agxbuf *xb)
resets pointer to data
Definition agxbuf.h:294
static WUR char * agxbuse(agxbuf *xb)
Definition agxbuf.h:307
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
Definition alloc.h:101
#define N(n)
Definition bcomps.c:58
#define dtmatch(d, o)
Definition cdt.h:184
#define dtinsert(d, o)
Definition cdt.h:185
CDT_API int dtclose(Dt_t *)
Definition dtclose.c:8
CDT_API Dtmethod_t * Dtoset
ordered set (self-adjusting tree)
Definition dttree.c:304
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
Definition dtopen.c:9
int agrename(Agobj_t *obj, char *newname)
Definition obj.c:41
Agsym_t * setAttr(graph_t *g, void *obj, char *name, char *value, Agsym_t *ap)
Definition utils.c:701
static Extype_t length(Exid_t *rhs, Exdisc_t *disc)
Definition compile.c:1614
DOT-GXL converter API for gxl2gv.c and gv2gxl.c.
#define head
Definition dthdr.h:15
static NORETURN void graphviz_exit(int status)
Definition exit.h:23
static Dtdisc_t disc
Definition exparse.y:207
#define E
Definition gdefs.h:6
#define G
Definition gdefs.h:7
static double len(glCompPoint p)
Definition glutils.c:150
void * malloc(YYSIZE_T)
void free(void *)
node NULL
Definition grammar.y:180
Agsym_t * agattr_text(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up text attributes of a graph
Definition attr.c:348
int agxset(void *obj, Agsym_t *sym, const char *value)
Definition attr.c:536
int agxset_html(void *obj, Agsym_t *sym, const char *value)
Definition attr.c:555
char * agxget(void *obj, Agsym_t *sym)
Definition attr.c:472
Agdisc_t AgDefaultDisc
Definition graph.c:277
Agedge_t * agedge(Agraph_t *g, Agnode_t *t, Agnode_t *h, char *name, int createflag)
Definition edge.c:253
#define AGTAIL(e)
Definition cgraph.h:984
Agdesc_t Agundirected
undirected
Definition graph.c:274
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
creates a new graph with the given name and kind
Definition graph.c:42
Agdesc_t Agdirected
directed
Definition graph.c:272
Agnode_t * agnode(Agraph_t *g, char *name, int createflag)
Definition node.c:141
char * agnameof(void *)
returns a string descriptor for the object.
Definition id.c:143
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
Definition cgraph.h:216
@ AGEDGE
Definition cgraph.h:207
@ AGNODE
Definition cgraph.h:207
@ AGRAPH
Definition cgraph.h:207
Agraph_t * agsubg(Agraph_t *g, char *name, int cflag)
Definition subg.c:53
#define GXL_FROM
Definition gv2gxl.c:33
static Dtdisc_t nameDisc
Definition gv2gxl.c:65
static char * mapLookup(Dt_t *nm, char *name)
Definition gv2gxl.c:201
static void * make_nitem(void *p, Dtdisc_t *disc)
Definition gv2gxl.c:55
#define GXL_COMP
Definition gv2gxl.c:36
#define GXL_LOC
Definition gv2gxl.c:37
#define GXL_ID
Definition gv2gxl.c:32
#define GXL_TYPE
Definition gv2gxl.c:35
static void addToMap(Dt_t *map, char *name, char *uniqueName)
Definition gv2gxl.c:242
#define GXL_TO
Definition gv2gxl.c:34
#define GXL_HYPER
Definition gv2gxl.c:31
#define GXL_ROLE
Definition gv2gxl.c:30
replacements for ctype.h functions
static bool gv_isdigit(int c)
Definition gv_ctype.h:41
agxbput(xb, staging)
#define XML_STATUS_ERROR
Definition htmllex.c:41
#define DEFINE_LIST(name, type)
Definition list.h:22
static bool startswith(const char *s, const char *prefix)
does the string s begin with the string prefix?
Definition startswith.h:11
unsigned strict
Definition cgraph.h:286
a generic header of Agraph_s, Agnode_s and Agedge_s
Definition cgraph.h:210
graph or subgraph
Definition cgraph.h:424
Agdesc_t desc
Definition cgraph.h:426
string attribute descriptor symbol in Agattr_s.dict
Definition cgraph.h:651
Definition cdt.h:100
int key
Definition cdt.h:85
char * unique_name
Definition gv2gxl.c:52
char * name
Definition gv2gxl.c:51
Definition grammar.c:89
#define UNREACHABLE()
Definition unreachable.h:30