36 static char DataDictName[] =
"_AG_datadict";
37 static void init_all_attrs(
Agraph_t * g);
38 static Agdesc_t ProtoDesc = { 1, 0, 1, 0, 1, 1 };
71 agerr(
AGERR,
"agdictof: unknown kind %d\n", kind);
121 if (ProtoGraph && (g != ProtoGraph)) {
137 key.
name = (
char *) name;
171 static int topdictsize(
Agobj_t * obj)
193 sz = topdictsize(obj);
213 sz = topdictsize(obj);
214 for (i = 0; i < sz; i++)
249 1) *
sizeof(
char *));
255 static Agsym_t *setattr(
Agraph_t * g,
int kind,
char *name,
char *value)
259 Agsym_t *lsym, *psym, *rsym, *rv;
276 lsym =
agnewsym(g, name, value, psym->
id, kind);
290 addattr(g, (
Agobj_t *) n, rsym);
296 addattr(g, (
Agobj_t *) e, rsym);
302 if (rv && (kind ==
AGRAPH))
330 ProtoGraph =
agopen(0, ProtoDesc, 0);
334 rv = setattr(g, kind, name, value);
336 rv = getattr(g, kind, name);
367 agmakeattrs(context, g);
395 if ((!data) || (!data->
dict))
396 (void) agmakeattrs(g, n);
414 if ((!data) || (!data->
dict))
415 (void) agmakeattrs(g, e);
439 rv = (
char *) (data->
str[sym->
id]);
450 assert((sym->
id >= 0) && (sym->
id < topdictsize(obj)));
451 rv = (
char *) (data->
str[sym->
id]);
455 int agset(
void *obj,
char *name,
char *value)
464 rv =
agxset(obj, sym, value);
478 assert((sym->
id >= 0) && (sym->
id < topdictsize(obj)));
497 int agsafeset(
void *obj,
char *name,
char *value,
char *def)
504 return agxset(obj, a, value);
513 static void init_all_attrs(
Agraph_t * g)
552 val =
agxget(oldobj, sym);
553 r =
agxset(newobj, newsym, val);
559 nval =
agxget (newobj, newsym);
void agnodeattr_init(Agraph_t *g, Agnode_t *n)
int(* Dtcompar_f)(Dt_t *, void *, void *, Dtdisc_t *)
unsigned int(* Dthash_f)(Dt_t *, void *, Dtdisc_t *)
CGRAPH_API Agraph_t * agopen(char *name, Agdesc_t desc, Agdisc_t *disc)
void agraphattr_init(Agraph_t *g)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, char *value)
void agmarkhtmlstr(char *s)
void *(* Dtmake_f)(Dt_t *, void *, Dtdisc_t *)
struct Agdatadict_s::@3 dict
CGRAPH_API int aghtmlstr(char *)
int agdtclose(Agraph_t *g, Dict_t *dict)
Agsym_t * agdictsym(Dict_t *dict, char *name)
Agsym_t * agnxtattr(Agraph_t *g, int kind, Agsym_t *attr)
int agxset(void *obj, Agsym_t *sym, char *value)
CDT_API Dt_t * dtview(Dt_t *, Dt_t *)
int agerr(agerrlevel_t level, const char *fmt,...)
CGRAPH_API Agraph_t * agroot(void *obj)
CGRAPH_API Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agdatadict_t * agdatadict(Agraph_t *g, int cflag)
CGRAPH_API void agfree(Agraph_t *g, void *ptr)
void agedgeattr_init(Agraph_t *g, Agedge_t *e)
char * agget(void *obj, char *name)
CGRAPH_API Agraph_t * agraphof(void *obj)
int agset(void *obj, char *name, char *value)
void agedgeattr_delete(Agedge_t *e)
CGRAPH_API Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agsym_t * agattrsym(void *obj, char *name)
Agsym_t * agnewsym(Agraph_t *g, char *name, char *value, int id, int kind)
CGRAPH_API Agraph_t * agparent(Agraph_t *g)
CGRAPH_API int agstrfree(Agraph_t *, char *)
CGRAPH_API char * agstrdup(Agraph_t *, char *)
EXTERN Agraph_t * Ag_G_global
CDT_API int dtsize(Dt_t *)
CGRAPH_API Agnode_t * agfstnode(Agraph_t *g)
CGRAPH_API Agrec_t * aggetrec(void *obj, char *name, int move_to_front)
int agsafeset(void *obj, char *name, char *value, char *def)
Dict_t * agdictof(Agraph_t *g, int kind)
Agattr_t * agattrrec(void *obj)
int agcopyattr(void *oldobj, void *newobj)
Dict_t * agdtopen(Agraph_t *g, Dtdisc_t *disc, Dtmethod_t *method)
CGRAPH_API int agdelrec(void *obj, char *name)
Agsym_t * aglocaldictsym(Dict_t *dict, char *name)
CDT_API Dtmethod_t * Dttree
CGRAPH_API void * agalloc(Agraph_t *g, size_t size)
void agmethod_upd(Agraph_t *g, void *obj, Agsym_t *sym)
CGRAPH_API void * agbindrec(void *obj, char *name, unsigned int size, int move_to_front)
void agnodeattr_delete(Agnode_t *n)
char * agxget(void *obj, Agsym_t *sym)
CGRAPH_API Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
int agapply(Agraph_t *g, Agobj_t *obj, agobjfn_t fn, void *arg, int preorder)
void(* agobjfn_t)(Agraph_t *g, Agobj_t *obj, void *arg)
int agraphattr_delete(Agraph_t *g)