}
+static void printstring(FILE * f, char *prefix, char *s)
+{
+ if (prefix) agputs(prefix, f);
+ agputs(s, f);
+}
+
static void printint(FILE * f, char *prefix, int i)
{
char buf[BUFSIZ];
name = canon (agraphof(node), strchr(agnameof(node), ':') + 1);
else
name = agcanonStr (agnameof(node));
- print(f, " %s", name);
+ printstring(f, " ", name);
if (port && *port)
- print(f, ":%s", agcanonStr(port));
+ printstring(f, ":", agcanonStr(port));
}
/* _write_plain:
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
if (IS_CLUST_NODE(n))
continue;
- print(f, "node %s", agcanonStr(agnameof(n)));
+ printstring(f, "node ", agcanonStr(agnameof(n)));
printpoint(f, ND_coord(n));
if (ND_label(n)->html) /* if html, get original text */
lbl = agcanonStr (agxget(n, N_label));
lbl = canon(agraphof(n),ND_label(n)->text);
printdouble(f, " ", ND_width(n));
printdouble(f, " ", ND_height(n));
- print(f, " %s", lbl);
- print(f, " %s", late_nnstring(n, N_style, "solid"));
- print(f, " %s", ND_shape(n)->name);
- print(f, " %s", late_nnstring(n, N_color, DEFAULT_COLOR));
+ printstring(f, " ", lbl);
+ printstring(f, " ", late_nnstring(n, N_style, "solid"));
+ printstring(f, " ", ND_shape(n)->name);
+ printstring(f, " ", late_nnstring(n, N_color, DEFAULT_COLOR));
fillcolor = late_nnstring(n, N_fillcolor, "");
if (fillcolor[0] == '\0')
fillcolor = late_nnstring(n, N_color, DEFAULT_FILL);
- print(f, " %s", fillcolor);
+ printstring(f, " ", fillcolor);
agputc('\n', f);
}
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
bz = ED_spl(e)->list[i];
splinePoints += bz.size;
}
- print(f, "edge");
+ printstring(f, NULL, "edge");
writenodeandport(f, agtail(e), tport);
writenodeandport(f, aghead(e), hport);
printint(f, " ", splinePoints);
}
}
if (ED_label(e)) {
- print(f, " %s", canon(agraphof(agtail(e)),ED_label(e)->text));
+ printstring(f, " ", canon(agraphof(agtail(e)),ED_label(e)->text));
printpoint(f, ED_label(e)->pos);
}
- print(f, " %s", late_nnstring(e, E_style, "solid"));
- print(f, " %s", late_nnstring(e, E_color, DEFAULT_COLOR));
+ printstring(f, " ", late_nnstring(e, E_style, "solid"));
+ printstring(f, " ", late_nnstring(e, E_color, DEFAULT_COLOR));
agputc('\n', f);
}
}