for (sym = (Agsym_t *) dtfirst(src); sym;
sym = (Agsym_t *) dtnext(src, sym)) {
newsym = agnewsym(g, sym->name, sym->defval, sym->id, kind);
+ newsym->print = sym->print;
+ newsym->fixed = sym->fixed;
dtinsert(dest, newsym);
}
}
}
}
+/* attach node/edge specific attributes */
static void applyattrs(void *obj)
{
item *aptr;
for (aptr = Attrlist.first; aptr; aptr = aptr->next) {
if (aptr->tag == T_attr) {
- if (aptr->u.asym && !aptr->u.asym->fixed) {
+ if (aptr->u.asym) {
agxset(obj,aptr->u.asym,aptr->str);
}
}
/* attrstmt:
* First argument is always attrtype, so switch covers all cases.
+ * This function is used to handle default attribute value assignment.
*/
static void attrstmt(int tkind, char *macroname)
{
}
bindattrs(kind); /* set up defaults for new attributes */
for (aptr = Attrlist.first; aptr; aptr = aptr->next) {
- sym = agattr(G,kind,aptr->u.asym->name,aptr->str);
+ if (!(aptr->u.asym->fixed) || (G->root != G))
+ sym = agattr(G,kind,aptr->u.asym->name,aptr->str);
if (G->root == G)
sym->print = TRUE;
}
if (val) {
if ((attr = agattr(G,AGEDGE,name,NIL(char*))) == NILsym)
attr = agattr(G,AGEDGE,name,"");
- if (!attr->fixed)
- agxset(e,attr,val);
+ agxset(e,attr,val);
}
}