77 agerrorf(
"agdictof: unknown kind %d\n", kind);
88 sym->
kind = (
unsigned char) kind;
119 assert(dd != parent_dd);
200 for (sym =
dtfirst(datadict); sym; sym =
dtnext(datadict, sym))
203 assert(rec->
dict == datadict);
215 for (i = 0; i < sz; i++)
238 assert(attr !=
NULL);
277 Agsym_t *lsym, *psym, *rsym, *rv;
288 if (g != root &&
streq(name,
"layout"))
289 agwarningf(
"layout attribute is invalid except on the root graph\n");
299 lsym =
agnewsym(g, name, value, psym->
id, kind);
347 rv =
setattr(g, kind, name, value);
466int agset(
void *obj,
char *name,
const char *value) {
474 rv =
agxset(obj, sym, value);
507int agsafeset(
void *obj,
char *name,
const char *value,
const char *def) {
513 return agxset(obj, a, value);
566 val =
agxget(oldobj, sym);
567 r =
agxset(newobj, newsym, val);
573 nval =
agxget (newobj, newsym);
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
int agapply(Agraph_t *g, Agobj_t *obj, agobjfn_t fn, void *arg, int preorder)
static void agraphattr_init_wrapper(Agraph_t *g, Agobj_t *ignored1, void *ignored2)
static Agsym_t * agdictsym(Dict_t *dict, char *name)
static void freeattr(Agobj_t *obj, Agattr_t *attr)
static Agdatadict_t * agmakedatadict(Agraph_t *g)
static Agraph_t * ProtoGraph
static int topdictsize(Agobj_t *obj)
static Agdesc_t ProtoDesc
static Dict_t * agdictof(Agraph_t *g, int kind)
static void init_all_attrs(Agraph_t *g)
static Agsym_t * setattr(Agraph_t *g, int kind, char *name, const char *value)
static void addattr(Agraph_t *g, Agobj_t *obj, Agsym_t *sym)
static Agrec_t * agmakeattrs(Agraph_t *context, void *obj)
static void unviewsubgraphsattr(Agraph_t *parent, char *name)
static Agsym_t * aglocaldictsym(Dict_t *dict, char *name)
static void agcopydict(Dict_t *src, Dict_t *dest, Agraph_t *g, int kind)
static void freesym(void *obj)
static char DataDictName[]
static Agsym_t * getattr(Agraph_t *g, int kind, char *name)
static Agsym_t * agnewsym(Agraph_t *g, const char *name, const char *value, int id, int kind)
CDT_API int dtsize(Dt_t *)
CDT_API Dt_t * dtview(Dt_t *, Dt_t *)
CDT_API Dtmethod_t * Dttree
Dict_t * agdtopen(Agraph_t *g, Dtdisc_t *disc, Dtmethod_t *method)
void agmarkhtmlstr(char *s)
int agdtclose(Agraph_t *g, Dict_t *dict)
Agattr_t * agattrrec(void *obj)
void agnodeattr_init(Agraph_t *g, Agnode_t *n)
void agnodeattr_delete(Agnode_t *n)
Agsym_t * agattrsym(void *obj, char *name)
looks up a string attribute for a graph object given as an argument
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
int agset(void *obj, char *name, const char *value)
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
permits traversing the list of attributes of a given type
void agedgeattr_init(Agraph_t *g, Agedge_t *e)
int agxset(void *obj, Agsym_t *sym, const char *value)
void agraphattr_init(Agraph_t *g)
char * agget(void *obj, char *name)
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
void agedgeattr_delete(Agedge_t *e)
Agdatadict_t * agdatadict(Agraph_t *g, bool cflag)
char * agxget(void *obj, Agsym_t *sym)
int agcopyattr(void *oldobj, void *newobj)
copies all of the attributes from one object to another
int agraphattr_delete(Agraph_t *g)
void agmethod_upd(Agraph_t *g, void *obj, Agsym_t *sym)
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
void agwarningf(const char *fmt,...)
void agerrorf(const char *fmt,...)
void(* agobjfn_t)(Agraph_t *g, Agobj_t *obj, void *arg)
Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
creates a new graph with the given name and kind
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
Agraph_t * agraphof(void *obj)
#define AGTYPE(obj)
returns AGRAPH, AGNODE, or AGEDGE depending on the type of the object
Agraph_t * agroot(void *obj)
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
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
int agdelrec(void *obj, const char *name)
deletes a named record from one object
int aghtmlstr(const char *)
int agstrfree(Agraph_t *, const char *)
char * agstrdup(Agraph_t *, const char *)
returns a pointer to a reference-counted copy of the argument string, creating one if necessary
Agraph_t * agparent(Agraph_t *g)
Agraph_t * agfstsubg(Agraph_t *g)
Agraph_t * agnxtsubg(Agraph_t *subg)
static bool streq(const char *a, const char *b)
are a and b equal?
string attribute container
char ** str
the attribute string values indexed by Agsym_s.id
Dict_t * dict
shared dict of Agsym_s to interpret Agattr_s.str
struct Agdatadict_s::@64 dict
Agrec_t h
< set of dictionaries per graph
a generic header of Agraph_s, Agnode_s and Agedge_s
Agtag_t tag
access with AGTAG
implementation of Agrec_t
unsigned objtype
access with AGTYPE