Graphviz 13.0.0~dev.20250121.0651
|
implementation of dynamic attributes More...
#include <cgraph/cghdr.h>
#include <stdbool.h>
#include <stdlib.h>
#include <util/alloc.h>
#include <util/streq.h>
#include <util/unreachable.h>
Go to the source code of this file.
Macros | |
#define | MINATTR 4 /* minimum allocation */ |
Functions | |
static void | freesym (void *obj) |
static void | init_all_attrs (Agraph_t *g) |
Agdatadict_t * | agdatadict (Agraph_t *g, bool cflag) |
static Dict_t * | agdictof (Agraph_t *g, int kind) |
static Agsym_t * | agnewsym (Agraph_t *g, const char *name, const char *value, bool is_html, int id, int kind) |
static void | agcopydict (Dict_t *src, Dict_t *dest, Agraph_t *g, int kind) |
static Agdatadict_t * | agmakedatadict (Agraph_t *g) |
static Agsym_t * | agdictsym (Dict_t *dict, char *name) |
static Agsym_t * | aglocaldictsym (Dict_t *dict, char *name) |
Agsym_t * | agattrsym (void *obj, char *name) |
looks up a string attribute for a graph object given as an argument | |
static int | topdictsize (Agobj_t *obj) |
static Agrec_t * | agmakeattrs (Agraph_t *context, void *obj) |
static void | freeattr (Agobj_t *obj, Agattr_t *attr) |
Agattr_t * | agattrrec (void *obj) |
static void | addattr (Agraph_t *g, Agobj_t *obj, Agsym_t *sym) |
static Agsym_t * | getattr (Agraph_t *g, int kind, char *name) |
static void | unviewsubgraphsattr (Agraph_t *parent, char *name) |
static int | agxset_ (void *obj, Agsym_t *sym, const char *value, bool is_html) |
static Agsym_t * | setattr (Agraph_t *g, int kind, char *name, const char *value, bool is_html) |
static Agsym_t * | agattr_ (Agraph_t *g, int kind, char *name, const char *value, bool is_html) |
Agsym_t * | agattr (Agraph_t *g, int kind, char *name, const char *value) |
creates or looks up attributes of a graph | |
Agsym_t * | agattr_html (Agraph_t *g, int kind, char *name, const char *value) |
agattr , but creates HTML-like values | |
Agsym_t * | agnxtattr (Agraph_t *g, int kind, Agsym_t *attr) |
permits traversing the list of attributes of a given type | |
void | agraphattr_init (Agraph_t *g) |
int | agraphattr_delete (Agraph_t *g) |
void | agnodeattr_init (Agraph_t *g, Agnode_t *n) |
void | agnodeattr_delete (Agnode_t *n) |
void | agedgeattr_init (Agraph_t *g, Agedge_t *e) |
void | agedgeattr_delete (Agedge_t *e) |
char * | agget (void *obj, char *name) |
char * | agxget (void *obj, Agsym_t *sym) |
int | agset (void *obj, char *name, const char *value) |
int | agxset (void *obj, Agsym_t *sym, const char *value) |
int | agxset_html (void *obj, Agsym_t *sym, const char *value) |
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 | |
static void | agraphattr_init_wrapper (Agraph_t *g, Agobj_t *ignored1, void *ignored2) |
int | agcopyattr (void *oldobj, void *newobj) |
copies all of the attributes from one object to another | |
Variables | |
Dtdisc_t | AgDataDictDisc |
static char | DataDictName [] = "_AG_datadict" |
static Agdesc_t | ProtoDesc |
static Agraph_t * | ProtoGraph |
char * | AgDataRecName = "_AG_strdata" |
Definition at line 242 of file attr.c.
References agattrrec(), aghtmlstr(), agstrdup(), agstrdup_html(), Agsym_s::defval, gv_recalloc(), Agsym_s::id, MINATTR, NULL, and Agattr_s::str.
Referenced by setattr().
|
static |
Definition at line 355 of file attr.c.
References agopen(), getattr(), ProtoDesc, ProtoGraph, and setattr().
Referenced by agattr(), and agattr_html().
Definition at line 96 of file attr.c.
References aghtmlstr(), agnewsym(), Agsym_s::defval, dtfirst, dtinsert, dtnext, dtsize(), Agsym_s::fixed, Agsym_s::id, Agsym_s::name, and Agsym_s::print.
Referenced by agmakedatadict().
Definition at line 58 of file attr.c.
References agdatadict(), agerrorf(), AGINEDGE, AGNODE, AGOUTEDGE, AGRAPH, Agdatadict_s::dict, Agdatadict_s::e, Agdatadict_s::g, Agdatadict_s::n, and NULL.
Referenced by agmakeattrs(), agnxtattr(), getattr(), setattr(), and topdictsize().
Definition at line 139 of file attr.c.
References dtsearch, and Agsym_s::name.
Referenced by agattrsym(), aglocaldictsym(), getattr(), and setattr().
Definition at line 147 of file attr.c.
References agdictsym(), dtview(), NULL, and view.
Referenced by agxset_(), setattr(), and unviewsubgraphsattr().
Definition at line 184 of file attr.c.
References agbindrec(), AgDataRecName, agdictof(), aghtmlstr(), agraphof(), agroot(), agstrdup(), agstrdup_html(), AGTYPE, Agsym_s::defval, Agattr_s::dict, dtfirst, dtnext, gv_calloc(), Agsym_s::id, MINATTR, NULL, Agattr_s::str, and topdictsize().
Referenced by agedgeattr_init(), agnodeattr_init(), and agraphattr_init().
|
static |
Definition at line 110 of file attr.c.
References agbindrec(), agcopydict(), agdatadict(), AgDataDictDisc, agdtopen(), AGEDGE, AGNODE, agparent(), AGRAPH, DataDictName, Agdatadict_s::dict, Dttree, dtview(), Agdatadict_s::e, Agdatadict_s::g, Agdatadict_s::n, and ProtoGraph.
Referenced by agraphattr_init().
|
static |
is_html | Is value an HTML-like string? |
Definition at line 86 of file attr.c.
References agstrdup(), agstrdup_html(), Agsym_s::defval, gv_alloc(), id, Agsym_s::id, Agsym_s::kind, and Agsym_s::name.
Referenced by agcopydict(), agxset_(), setattr(), and unviewsubgraphsattr().
Definition at line 549 of file attr.c.
References agraphattr_init().
Referenced by init_all_attrs().
|
static |
Definition at line 504 of file attr.c.
References agattrrec(), agdatadict(), aghtmlstr(), aglocaldictsym(), agmethod_upd(), agnewsym(), AGRAPH, agraphof(), agstrdup(), agstrdup_html(), agstrfree(), AGTYPE, Agsym_s::defval, Agdatadict_s::dict, dtinsert, Agdatadict_s::g, Agsym_s::id, Agsym_s::name, Agtag_s::objtype, SUCCESS, Agobj_s::tag, and topdictsize().
Referenced by agxset(), agxset_html(), and setattr().
Definition at line 215 of file attr.c.
References aghtmlstr(), agraphof(), agstrfree(), free(), Agattr_s::str, and topdictsize().
Referenced by agedgeattr_delete(), agnodeattr_delete(), and agraphattr_delete().
|
static |
Definition at line 227 of file attr.c.
References Ag_G_global, aghtmlstr(), agstrfree(), Agsym_s::defval, free(), and Agsym_s::name.
Definition at line 256 of file attr.c.
References agdictof(), and agdictsym().
Referenced by agattr_(), and unviewsubgraphsattr().
|
static |
Definition at line 562 of file attr.c.
References agapply(), agedgeattr_init(), agfstnode(), agfstout(), agnodeattr_init(), agnxtnode(), agnxtout(), agraphattr_init_wrapper(), agroot(), and NULL.
Referenced by agdatadict().
|
static |
is_html | Is value an HTML-like string? |
Definition at line 291 of file attr.c.
References addattr(), agapply(), agdatadict(), agdictof(), agdictsym(), agfstnode(), agfstout(), aghtmlstr(), AGINEDGE, aglocaldictsym(), agmethod_upd(), agnewsym(), AGNODE, agnxtnode(), agnxtout(), AGOUTEDGE, AGRAPH, agroot(), agstrdup(), agstrdup_html(), agstrfree(), agwarningf(), agxset_(), Agsym_s::defval, dtinsert, dtsize(), Agsym_s::id, streq(), UNREACHABLE, and unviewsubgraphsattr().
Referenced by agattr_().
|
static |
Definition at line 175 of file attr.c.
References agdictof(), agraphof(), agroot(), AGTYPE, and dtsize().
Referenced by agmakeattrs(), agxget(), agxset_(), and freeattr().
|
static |
Definition at line 266 of file attr.c.
References agdatadict(), agfstsubg(), aghtmlstr(), aglocaldictsym(), agnewsym(), agnxtsubg(), AGRAPH, agroot(), agxget(), Agdatadict_s::dict, dtinsert, Agdatadict_s::g, getattr(), Agsym_s::id, and parent.
Referenced by setattr().
Dtdisc_t AgDataDictDisc |
char* AgDataRecName = "_AG_strdata" |
Definition at line 173 of file attr.c.
Referenced by agattrrec(), agedgeattr_delete(), agmakeattrs(), agnodeattr_delete(), newedge(), and newnode().
|
static |
Definition at line 43 of file attr.c.
Referenced by agdatadict(), and agmakedatadict().
|
static |
|
static |
Definition at line 47 of file attr.c.
Referenced by agattr_(), and agmakedatadict().