Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
attr.c
Go to the documentation of this file.
1
7 /*************************************************************************
8 * Copyright (c) 2011 AT&T Intellectual Property
9 * All rights reserved. This program and the accompanying materials
10 * are made available under the terms of the Eclipse Public License v1.0
11 * which accompanies this distribution, and is available at
12 * https://www.eclipse.org/legal/epl-v10.html
13 *
14 * Contributors: Details at https://graphviz.org
15 *************************************************************************/
16
17#include <cgraph/cghdr.h>
18#include <cgraph/streq.h>
19#include <cgraph/unreachable.h>
20#include <stddef.h>
21#include <stdbool.h>
22
23/*
24 * dynamic attributes
25 */
26
27/* to create a graph's data dictionary */
28
29#define MINATTR 4 /* minimum allocation */
30
31static void freesym(void *obj);
32
34 (int) offsetof(Agsym_t, name), /* use symbol name as key */
35 -1,
36 (int) offsetof(Agsym_t, link),
37 NULL,
38 freesym,
39 NULL,
40};
41
42static char DataDictName[] = "_AG_datadict";
43static void init_all_attrs(Agraph_t * g);
44static Agdesc_t ProtoDesc = {.directed = true, .no_loop = true,
45 .no_write = true};
47
50 if (rv || !cflag)
51 return rv;
53 rv = (Agdatadict_t *) aggetrec(g, DataDictName, 0);
54 return rv;
55}
56
57static Dict_t *agdictof(Agraph_t * g, int kind)
58{
59 Agdatadict_t *dd;
60 Dict_t *dict;
61
62 dd = agdatadict(g, false);
63 if (dd)
64 switch (kind) {
65 case AGRAPH:
66 dict = dd->dict.g;
67 break;
68 case AGNODE:
69 dict = dd->dict.n;
70 break;
71 case AGINEDGE:
72 case AGOUTEDGE:
73 dict = dd->dict.e;
74 break;
75 default:
76 agerrorf("agdictof: unknown kind %d\n", kind);
77 dict = NULL;
78 break;
79 } else
80 dict = NULL;
81 return dict;
82}
83
84static Agsym_t *agnewsym(Agraph_t * g, const char *name, const char *value,
85 int id, int kind) {
86 Agsym_t *sym;
87 sym = agalloc(g, sizeof(Agsym_t));
88 sym->kind = (unsigned char) kind;
89 sym->name = agstrdup(g, name);
90 sym->defval = agstrdup(g, value);
91 sym->id = id;
92 return sym;
93}
94
95static void agcopydict(Dict_t * src, Dict_t * dest, Agraph_t * g, int kind)
96{
97 Agsym_t *sym, *newsym;
98
99 assert(dtsize(dest) == 0);
100 for (sym = dtfirst(src); sym; sym = dtnext(src, sym)) {
101 newsym = agnewsym(g, sym->name, sym->defval, sym->id, kind);
102 newsym->print = sym->print;
103 newsym->fixed = sym->fixed;
104 dtinsert(dest, newsym);
105 }
106}
107
109{
110 Agraph_t *par;
111 Agdatadict_t *parent_dd, *dd;
112
113 dd = agbindrec(g, DataDictName, sizeof(Agdatadict_t), false);
114 dd->dict.n = agdtopen(g, &AgDataDictDisc, Dttree);
115 dd->dict.e = agdtopen(g, &AgDataDictDisc, Dttree);
116 dd->dict.g = agdtopen(g, &AgDataDictDisc, Dttree);
117 if ((par = agparent(g))) {
118 parent_dd = agdatadict(par, false);
119 assert(dd != parent_dd);
120 dtview(dd->dict.n, parent_dd->dict.n);
121 dtview(dd->dict.e, parent_dd->dict.e);
122 dtview(dd->dict.g, parent_dd->dict.g);
123 } else {
124 if (ProtoGraph && g != ProtoGraph) {
125 /* it's not ok to dtview here for several reasons. the proto
126 graph could change, and the sym indices don't match */
127 parent_dd = agdatadict(ProtoGraph, false);
128 agcopydict(parent_dd->dict.n, dd->dict.n, g, AGNODE);
129 agcopydict(parent_dd->dict.e, dd->dict.e, g, AGEDGE);
130 agcopydict(parent_dd->dict.g, dd->dict.g, g, AGRAPH);
131 }
132 }
133 return dd;
134}
135
136/* look up an attribute with possible viewpathing */
137static Agsym_t *agdictsym(Dict_t * dict, char *name)
138{
139 Agsym_t key;
140 key.name = name;
141 return dtsearch(dict, &key);
142}
143
144/* look up attribute in local dictionary with no view pathing */
145static Agsym_t *aglocaldictsym(Dict_t * dict, char *name)
146{
147 Agsym_t *rv;
148 Dict_t *view;
149
150 view = dtview(dict, NULL);
151 rv = agdictsym(dict, name);
152 dtview(dict, view);
153 return rv;
154}
155
156Agsym_t *agattrsym(void *obj, char *name)
157{
158 Agattr_t *data;
159 Agsym_t *rv;
160
161 data = agattrrec(obj);
162 if (data)
163 rv = agdictsym(data->dict, name);
164 else
165 rv = NULL;
166 return rv;
167}
168
169/* to create a graph's, node's edge's string attributes */
170
171char *AgDataRecName = "_AG_strdata";
172
173static int topdictsize(Agobj_t * obj)
174{
175 Dict_t *d;
176
177 d = agdictof(agroot(agraphof(obj)), AGTYPE(obj));
178 return d ? dtsize(d) : 0;
179}
180
181/* g can be either the enclosing graph, or ProtoGraph */
182static Agrec_t *agmakeattrs(Agraph_t * context, void *obj)
183{
184 int sz;
185 Agattr_t *rec;
186 Agsym_t *sym;
187 Dict_t *datadict;
188
189 rec = agbindrec(obj, AgDataRecName, sizeof(Agattr_t), false);
190 datadict = agdictof(context, AGTYPE(obj));
191 assert(datadict);
192 if (rec->dict == NULL) {
193 rec->dict = agdictof(agroot(context), AGTYPE(obj));
194 /* don't malloc(0) */
195 sz = topdictsize(obj);
196 if (sz < MINATTR)
197 sz = MINATTR;
198 rec->str = agalloc(agraphof(obj), (size_t) sz * sizeof(char *));
199 /* doesn't call agxset() so no obj-modified callbacks occur */
200 for (sym = dtfirst(datadict); sym; sym = dtnext(datadict, sym))
201 rec->str[sym->id] = agstrdup(agraphof(obj), sym->defval);
202 } else {
203 assert(rec->dict == datadict);
204 }
205 return (Agrec_t *) rec;
206}
207
208static void freeattr(Agobj_t * obj, Agattr_t * attr)
209{
210 int i, sz;
211 Agraph_t *g;
212
213 g = agraphof(obj);
214 sz = topdictsize(obj);
215 for (i = 0; i < sz; i++)
216 agstrfree(g, attr->str[i]);
217 agfree(g, attr->str);
218}
219
220static void freesym(void *obj) {
221 Agsym_t *sym;
222
223 sym = obj;
226 agfree(Ag_G_global, sym);
227}
228
230{
231 return (Agattr_t *)aggetrec(obj, AgDataRecName, 0);
232}
233
234
235static void addattr(Agraph_t * g, Agobj_t * obj, Agsym_t * sym)
236{
237 Agattr_t *attr = agattrrec(obj);
238 assert(attr != NULL);
239 if (sym->id >= MINATTR)
240 attr->str = agrealloc(g, attr->str,
241 (size_t) sym->id *
242 sizeof(char *),
243 ((size_t) sym->id +
244 1) * sizeof(char *));
245 attr->str[sym->id] = agstrdup(g, sym->defval);
246}
247
248static Agsym_t *getattr(Agraph_t *g, int kind, char *name) {
249 Agsym_t *rv = 0;
250 Dict_t *dict;
251 dict = agdictof(g, kind);
252 if (dict) {
253 rv = agdictsym(dict, name); // viewpath up to root
254 }
255 return rv;
256}
257
258static void unviewsubgraphsattr(Agraph_t *parent, char *name) {
259 Agraph_t *subg;
260 Agsym_t *psym, *lsym;
261 Dict_t *ldict;
262
263 psym = getattr(parent, AGRAPH, name);
264 if (!psym) {
265 return; // supposedly can't happen, see setattr()
266 }
267 for (subg = agfstsubg(parent); subg; subg = agnxtsubg(subg)) {
268 ldict = agdatadict(subg, true)->dict.g;
269 lsym = aglocaldictsym(ldict, name);
270 if (lsym) {
271 continue;
272 }
273 lsym = agnewsym(agroot(subg), name, agxget(subg, psym), psym->id, AGRAPH);
274 dtinsert(ldict, lsym);
275 }
276}
277
278static Agsym_t *setattr(Agraph_t * g, int kind, char *name, const char *value) {
279 Dict_t *ldict, *rdict;
280 Agsym_t *lsym, *psym, *rsym, *rv;
281 Agraph_t *root;
282 Agnode_t *n;
283 Agedge_t *e;
284
285 assert(value);
286 root = agroot(g);
287 agdatadict(g, true); /* force initialization of string attributes */
288 ldict = agdictof(g, kind);
289 lsym = aglocaldictsym(ldict, name);
290 if (lsym) { /* update old local definition */
291 if (g != root && streq(name, "layout"))
292 agwarningf("layout attribute is invalid except on the root graph\n");
293 if (kind == AGRAPH) {
294 unviewsubgraphsattr(g,name);
295 }
296 agstrfree(g, lsym->defval);
297 lsym->defval = agstrdup(g, value);
298 rv = lsym;
299 } else {
300 psym = agdictsym(ldict, name); /* search with viewpath up to root */
301 if (psym) { /* new local definition */
302 lsym = agnewsym(g, name, value, psym->id, kind);
303 dtinsert(ldict, lsym);
304 rv = lsym;
305 } else { /* new global definition */
306 rdict = agdictof(root, kind);
307 rsym = agnewsym(g, name, value, dtsize(rdict), kind);
308 dtinsert(rdict, rsym);
309 switch (kind) {
310 case AGRAPH:
311 agapply(root, (Agobj_t *)root, (agobjfn_t)addattr, rsym, true);
312 break;
313 case AGNODE:
314 for (n = agfstnode(root); n; n = agnxtnode(root, n))
315 addattr(g, (Agobj_t *) n, rsym);
316 break;
317 case AGINEDGE:
318 case AGOUTEDGE:
319 for (n = agfstnode(root); n; n = agnxtnode(root, n))
320 for (e = agfstout(root, n); e; e = agnxtout(root, e))
321 addattr(g, (Agobj_t *) e, rsym);
322 break;
323 default:
324 UNREACHABLE();
325 }
326 rv = rsym;
327 }
328 }
329 if (rv && kind == AGRAPH)
330 agxset(g, rv, value);
331 agmethod_upd(g, g, rv);
332 return rv;
333}
334
335/*
336 * create or update an existing attribute and return its descriptor.
337 * if the new value is NULL, this is only a search, no update.
338 * when a new attribute is created, existing graphs/nodes/edges
339 * receive its default value.
340 */
341Agsym_t *agattr(Agraph_t * g, int kind, char *name, const char *value) {
342 Agsym_t *rv;
343
344 if (g == 0) {
345 if (ProtoGraph == 0)
346 ProtoGraph = agopen(0, ProtoDesc, 0);
347 g = ProtoGraph;
348 }
349 if (value)
350 rv = setattr(g, kind, name, value);
351 else
352 rv = getattr(g, kind, name);
353 return rv;
354}
355
357{
358 Dict_t *d;
359 Agsym_t *rv;
360
361 if ((d = agdictof(g, kind))) {
362 if (attr)
363 rv = dtnext(d, attr);
364 else
365 rv = dtfirst(d);
366 } else
367 rv = 0;
368 return rv;
369}
370
371/* Create or delete attributes associated with an object */
372
374{
375 Agraph_t *context;
376
377 g->desc.has_attrs = true;
379 if (!(context = agparent(g)))
380 context = g;
381 agmakeattrs(context, g);
382}
383
385{
386 Agdatadict_t *dd;
387 Agattr_t *attr;
388
389 Ag_G_global = g;
390 if ((attr = agattrrec(g))) {
391 freeattr((Agobj_t *) g, attr);
392 agdelrec(g, attr->h.name);
393 }
394
395 if ((dd = agdatadict(g, false))) {
396 if (agdtclose(g, dd->dict.n)) return 1;
397 if (agdtclose(g, dd->dict.e)) return 1;
398 if (agdtclose(g, dd->dict.g)) return 1;
399 agdelrec(g, dd->h.name);
400 }
401 return 0;
402}
403
405{
406 Agattr_t *data;
407
408 data = agattrrec(n);
409 if (!data || !data->dict)
410 (void) agmakeattrs(g, n);
411}
412
414{
415 Agattr_t *rec;
416
417 if ((rec = agattrrec(n))) {
418 freeattr((Agobj_t *) n, rec);
420 }
421}
422
424{
425 Agattr_t *data;
426
427 data = agattrrec(e);
428 if (!data || !data->dict)
429 (void) agmakeattrs(g, e);
430}
431
433{
434 Agattr_t *rec;
435
436 if ((rec = agattrrec(e))) {
437 freeattr((Agobj_t *) e, rec);
439 }
440}
441
442char *agget(void *obj, char *name)
443{
444 Agsym_t *sym;
445 Agattr_t *data;
446 char *rv;
447
448 sym = agattrsym(obj, name);
449 if (sym == NULL)
450 rv = 0; /* note was "", but this provides more info */
451 else {
452 data = agattrrec(obj);
453 rv = data->str[sym->id];
454 }
455 return rv;
456}
457
458char *agxget(void *obj, Agsym_t * sym)
459{
460 Agattr_t *data;
461 char *rv;
462
463 data = agattrrec(obj);
464 assert(sym->id >= 0 && sym->id < topdictsize(obj));
465 rv = data->str[sym->id];
466 return rv;
467}
468
469int agset(void *obj, char *name, const char *value) {
470 Agsym_t *sym;
471 int rv;
472
473 sym = agattrsym(obj, name);
474 if (sym == NULL)
475 rv = FAILURE;
476 else
477 rv = agxset(obj, sym, value);
478 return rv;
479}
480
481int agxset(void *obj, Agsym_t * sym, const char *value)
482{
483 Agraph_t *g;
484 Agobj_t *hdr;
485 Agattr_t *data;
486 Agsym_t *lsym;
487
488 g = agraphof(obj);
489 hdr = obj;
490 data = agattrrec(hdr);
491 assert(sym->id >= 0 && sym->id < topdictsize(obj));
492 agstrfree(g, data->str[sym->id]);
493 data->str[sym->id] = agstrdup(g, value);
494 if (hdr->tag.objtype == AGRAPH) {
495 /* also update dict default */
496 Dict_t *dict;
497 dict = agdatadict(g, false)->dict.g;
498 if ((lsym = aglocaldictsym(dict, sym->name))) {
499 agstrfree(g, lsym->defval);
500 lsym->defval = agstrdup(g, value);
501 } else {
502 lsym = agnewsym(g, sym->name, value, sym->id, AGTYPE(hdr));
503 dtinsert(dict, lsym);
504 }
505 }
506 agmethod_upd(g, obj, sym);
507 return SUCCESS;
508}
509
510int agsafeset(void *obj, char *name, const char *value, const char *def) {
511 Agsym_t *a;
512
513 a = agattr(agraphof(obj), AGTYPE(obj), name, 0);
514 if (!a)
515 a = agattr(agraphof(obj), AGTYPE(obj), name, def);
516 return agxset(obj, a, value);
517}
518
519static void agraphattr_init_wrapper(Agraph_t *g, Agobj_t *ignored1,
520 void *ignored2) {
521 (void)ignored1;
522 (void)ignored2;
523
525}
526
527/*
528 * attach attributes to the already created graph objs.
529 * presumably they were already initialized, so we don't invoke
530 * any of the old methods.
531 */
532static void init_all_attrs(Agraph_t * g)
533{
534 Agraph_t *root;
535 Agnode_t *n;
536 Agedge_t *e;
537
538 root = agroot(g);
539 agapply(root, (Agobj_t*)root, agraphattr_init_wrapper, NULL, true);
540 for (n = agfstnode(root); n; n = agnxtnode(root, n)) {
541 agnodeattr_init(g, n);
542 for (e = agfstout(root, n); e; e = agnxtout(root, e)) {
543 agedgeattr_init(g, e);
544 }
545 }
546}
547
548/* Assumes attributes have already been declared.
549 * Do not copy key attribute for edges, as this must be distinct.
550 * Returns non-zero on failure or if objects have different type.
551 */
552int agcopyattr(void *oldobj, void *newobj)
553{
554 Agraph_t *g;
555 Agsym_t *sym;
556 Agsym_t *newsym;
557 char* val;
558 char* nval;
559 int r = 1;
560
561 g = agraphof(oldobj);
562 if (AGTYPE(oldobj) != AGTYPE(newobj))
563 return 1;
564 sym = 0;
565 while ((sym = agnxtattr(g, AGTYPE(oldobj), sym))) {
566 newsym = agattrsym(newobj, sym->name);
567 if (!newsym)
568 return 1;
569 val = agxget(oldobj, sym);
570 r = agxset(newobj, newsym, val);
571 /* FIX(?): Each graph has its own string cache, so a whole new refstr is possibly
572 * allocated. If the original was an html string, make sure the new one is as well.
573 * If cgraph goes to single string table, this can be removed.
574 */
575 if (aghtmlstr (val)) {
576 nval = agxget (newobj, newsym);
577 agmarkhtmlstr (nval);
578 }
579 }
580 return r;
581}
int agapply(Agraph_t *g, Agobj_t *obj, agobjfn_t fn, void *arg, int preorder)
Definition apply.c:60
static void agraphattr_init_wrapper(Agraph_t *g, Agobj_t *ignored1, void *ignored2)
Definition attr.c:519
static Agsym_t * agdictsym(Dict_t *dict, char *name)
Definition attr.c:137
#define MINATTR
Definition attr.c:29
static void freeattr(Agobj_t *obj, Agattr_t *attr)
Definition attr.c:208
char * AgDataRecName
Definition attr.c:171
static Agdatadict_t * agmakedatadict(Agraph_t *g)
Definition attr.c:108
static Agraph_t * ProtoGraph
Definition attr.c:46
static int topdictsize(Agobj_t *obj)
Definition attr.c:173
static Agdesc_t ProtoDesc
Definition attr.c:44
static Dict_t * agdictof(Agraph_t *g, int kind)
Definition attr.c:57
static void init_all_attrs(Agraph_t *g)
Definition attr.c:532
Dtdisc_t AgDataDictDisc
Definition attr.c:33
static Agsym_t * setattr(Agraph_t *g, int kind, char *name, const char *value)
Definition attr.c:278
static void addattr(Agraph_t *g, Agobj_t *obj, Agsym_t *sym)
Definition attr.c:235
static Agrec_t * agmakeattrs(Agraph_t *context, void *obj)
Definition attr.c:182
static void unviewsubgraphsattr(Agraph_t *parent, char *name)
Definition attr.c:258
static Agsym_t * aglocaldictsym(Dict_t *dict, char *name)
Definition attr.c:145
static void agcopydict(Dict_t *src, Dict_t *dest, Agraph_t *g, int kind)
Definition attr.c:95
static void freesym(void *obj)
Definition attr.c:220
static char DataDictName[]
Definition attr.c:42
static Agsym_t * getattr(Agraph_t *g, int kind, char *name)
Definition attr.c:248
static Agsym_t * agnewsym(Agraph_t *g, const char *name, const char *value, int id, int kind)
Definition attr.c:84
#define dtsearch(d, o)
Definition cdt.h:191
CDT_API int dtsize(Dt_t *)
Definition dtsize.c:12
#define dtinsert(d, o)
Definition cdt.h:193
CDT_API Dt_t * dtview(Dt_t *, Dt_t *)
Definition dtview.c:91
CDT_API Dtmethod_t * Dttree
Definition dttree.c:308
#define dtnext(d, o)
Definition cdt.h:188
#define dtfirst(d)
Definition cdt.h:187
cgraph.h additions
Dict_t * agdtopen(Agraph_t *g, Dtdisc_t *disc, Dtmethod_t *method)
Definition utils.c:29
Agraph_t * Ag_G_global
Definition graph.c:24
#define FAILURE
Definition cghdr.h:44
void agmarkhtmlstr(char *s)
Definition refstr.c:173
#define SUCCESS
Definition cghdr.h:43
int agdtclose(Agraph_t *g, Dict_t *dict)
Definition utils.c:45
#define parent(i)
Definition closest.c:78
disc key
Definition exparse.y:214
node NULL
Definition grammar.y:149
void * agalloc(Agraph_t *g, size_t size)
Definition mem.c:19
void agfree(Agraph_t *g, void *ptr)
Definition mem.c:49
void * agrealloc(Agraph_t *g, void *ptr, size_t oldsize, size_t size)
Definition mem.c:29
Agattr_t * agattrrec(void *obj)
Definition attr.c:229
void agnodeattr_init(Agraph_t *g, Agnode_t *n)
Definition attr.c:404
void agnodeattr_delete(Agnode_t *n)
Definition attr.c:413
Agsym_t * agattrsym(void *obj, char *name)
looks up a string attribute for a graph object given as an argument
Definition attr.c:156
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
Definition attr.c:341
int agset(void *obj, char *name, const char *value)
Definition attr.c:469
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
permits traversing the list of attributes of a given type
Definition attr.c:356
void agedgeattr_init(Agraph_t *g, Agedge_t *e)
Definition attr.c:423
int agxset(void *obj, Agsym_t *sym, const char *value)
Definition attr.c:481
void agraphattr_init(Agraph_t *g)
Definition attr.c:373
char * agget(void *obj, char *name)
Definition attr.c:442
int agsafeset(void *obj, char *name, const char *value, const char *def)
ensures the given attribute is declared before setting it locally on an object
Definition attr.c:510
void agedgeattr_delete(Agedge_t *e)
Definition attr.c:432
Agdatadict_t * agdatadict(Agraph_t *g, bool cflag)
Definition attr.c:48
char * agxget(void *obj, Agsym_t *sym)
Definition attr.c:458
int agcopyattr(void *oldobj, void *newobj)
copies all of the attributes from one object to another
Definition attr.c:552
int agraphattr_delete(Agraph_t *g)
Definition attr.c:384
void agmethod_upd(Agraph_t *g, void *obj, Agsym_t *sym)
Definition obj.c:107
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Definition edge.c:23
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Definition edge.c:38
void agwarningf(const char *fmt,...)
Definition agerror.c:173
void agerrorf(const char *fmt,...)
Definition agerror.c:165
void(* agobjfn_t)(Agraph_t *g, Agobj_t *obj, void *arg)
Definition cgraph.h:369
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
creates a new graph with the given name and kind
Definition graph.c:44
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Definition node.c:47
Agnode_t * agfstnode(Agraph_t *g)
Definition node.c:40
Agraph_t * agraphof(void *obj)
Definition obj.c:184
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
Definition cgraph.h:216
Agraph_t * agroot(void *obj)
Definition obj.c:167
@ AGOUTEDGE
Definition cgraph.h:207
@ AGEDGE
Definition cgraph.h:207
@ AGNODE
Definition cgraph.h:207
@ AGINEDGE
Definition cgraph.h:207
@ AGRAPH
Definition cgraph.h:207
Agrec_t * aggetrec(void *obj, const char *name, int move_to_front)
find record in circular list and do optional move-to-front and lock
Definition rec.c:40
void * agbindrec(void *obj, const char *name, unsigned int recsize, int move_to_front)
attaches a new record of the given size to the object
Definition rec.c:88
int agdelrec(void *obj, const char *name)
deletes a named record from one object
Definition rec.c:136
int aghtmlstr(const char *)
Definition refstr.c:163
int agstrfree(Agraph_t *, const char *)
Definition refstr.c:138
char * agstrdup(Agraph_t *, const char *)
returns a pointer to a reference-counted copy of the argument string, creating one if necessary
Definition refstr.c:130
Agraph_t * agparent(Agraph_t *g)
Definition subg.c:90
Agraph_t * agfstsubg(Agraph_t *g)
Definition subg.c:77
Agraph_t * agnxtsubg(Agraph_t *subg)
Definition subg.c:82
static uint64_t id
Definition gv2gml.c:42
static Agdesc_t kind
Definition gvpack.cpp:88
ViewInfo * view
Definition viewport.c:38
static bool streq(const char *a, const char *b)
are a and b equal?
Definition streq.h:11
string attribute container
Definition cgraph.h:631
char ** str
the attribute string values indexed by Agsym_s.id
Definition cgraph.h:634
Dict_t * dict
shared dict of Agsym_s to interpret Agattr_s.str
Definition cgraph.h:633
Agrec_t h
Definition cgraph.h:632
Dict_t * n
Definition cgraph.h:652
Dict_t * e
Definition cgraph.h:652
Dict_t * g
Definition cgraph.h:652
struct Agdatadict_s::@65 dict
Agrec_t h
< set of dictionaries per graph
Definition cgraph.h:650
graph descriptor
Definition cgraph.h:284
unsigned has_attrs
Definition cgraph.h:290
unsigned directed
Definition cgraph.h:285
a generic header of Agraph_s, Agnode_s and Agedge_s
Definition cgraph.h:210
Agtag_t tag
access with AGTAG
Definition cgraph.h:211
graph or subgraph
Definition cgraph.h:425
Agdesc_t desc
Definition cgraph.h:427
implementation of Agrec_t
Definition cgraph.h:172
char * name
Definition cgraph.h:173
string attribute descriptor symbol in Agattr_s.dict
Definition cgraph.h:639
char * name
Definition cgraph.h:641
unsigned char kind
Definition cgraph.h:644
int id
index in Agattr_s.str
Definition cgraph.h:643
unsigned char fixed
Definition cgraph.h:645
char * defval
Definition cgraph.h:642
unsigned char print
Definition cgraph.h:646
unsigned objtype
access with AGTYPE
Definition cgraph.h:199
Definition cdt.h:104
Definition legal.c:50
#define UNREACHABLE()
Definition unreachable.h:30