return xml_escape(s, flags, put, stream);
}
-static void
-emitAttr (char* name, char* value, FILE* outFile, int ix)
-{
+static void emitAttr(char *name, char *value, int ix) {
indent (ix, outFile);
if (isNumber (value))
fprintf (outFile, "%s %s\n", name, value);
v = agxget (np, s);
if (streq("\\N", v)) {
label = agnameof(np);
- emitAttr (s->name, label, outFile, ix);
+ emitAttr(s->name, label, ix);
doLabelGraphics = 1;
}
else if (*v) {
label = v;
- emitAttr (s->name, label, outFile, ix);
+ emitAttr(s->name, label, ix);
doLabelGraphics = 1;
}
}
}
else {
v = agxget (np, s);
- emitAttr (s->name, v, outFile, ix);
+ emitAttr(s->name, v, ix);
}
}
emitInt ("hasFill", 1, outFile, ix+1);
}
if (attrs.type) {
- emitAttr ("type", attrs.type, outFile, ix+1);
+ emitAttr("type", attrs.type, ix+1);
}
if (attrs.image) {
- emitAttr ("image", attrs.image, outFile, ix+1);
+ emitAttr("image", attrs.image, ix+1);
}
if (attrs.fill) {
- emitAttr ("fill", attrs.fill, outFile, ix+1);
+ emitAttr("fill", attrs.fill, ix+1);
}
if (attrs.outline) {
- emitAttr ("outline", attrs.outline, outFile, ix+1);
+ emitAttr("outline", attrs.outline, ix+1);
}
if (attrs.width) {
- emitAttr ("width", attrs.width, outFile, ix+1);
+ emitAttr("width", attrs.width, ix+1);
}
if (attrs.outlineStyle) {
- emitAttr ("outlineStyle", attrs.outlineStyle, outFile, ix+1);
+ emitAttr("outlineStyle", attrs.outlineStyle, ix+1);
}
fprintf (outFile, " ]\n");
}
if (doLabelGraphics) {
fprintf (outFile, " LabelGraphics [\n");
- if (label) emitAttr ("text", label, outFile, ix+1);
+ if (label) emitAttr("text", label, ix+1);
if (attrs.fontColor) {
- emitAttr ("fontColor", attrs.fontColor, outFile, ix+1);
+ emitAttr("fontColor", attrs.fontColor, ix+1);
}
if (attrs.fontSize) {
- emitAttr ("fontSize", attrs.fontSize, outFile, ix+1);
+ emitAttr("fontSize", attrs.fontSize, ix+1);
}
if (attrs.fontName) {
- emitAttr ("fontName", attrs.fontName, outFile, ix+1);
+ emitAttr("fontName", attrs.fontName, ix+1);
}
fprintf (outFile, " ]\n");
}
else if (streq(s->name, "label")) {
if (*(v = agxget (ep, s))) {
label = v;
- emitAttr (s->name, label, outFile, ix);
+ emitAttr(s->name, label, ix);
doLabelGraphics = 1;
}
}
}
else {
v = agxget (ep, s);
- emitAttr (s->name, v, outFile, ix);
+ emitAttr(s->name, v, ix);
}
}
emitInt ("visible", 0, outFile, ix+1);
}
if (attrs.fill) {
- emitAttr ("fill", attrs.fill, outFile, ix+1);
+ emitAttr("fill", attrs.fill, ix+1);
}
if (attrs.width) {
- emitAttr ("width", attrs.width, outFile, ix+1);
+ emitAttr("width", attrs.width, ix+1);
}
if (attrs.arrowhead) {
- emitAttr ("targetArrow", attrs.arrowhead, outFile, ix+1);
+ emitAttr("targetArrow", attrs.arrowhead, ix+1);
}
if (attrs.arrowtail) {
- emitAttr ("sourceArrow", attrs.arrowtail, outFile, ix+1);
+ emitAttr("sourceArrow", attrs.arrowtail, ix+1);
}
if (attrs.flags & DASH) {
- emitAttr ("style", "dashed", outFile, ix+1);
+ emitAttr("style", "dashed", ix+1);
}
else if (attrs.flags & DOT) {
- emitAttr ("style", "dotted", outFile, ix+1);
+ emitAttr("style", "dotted", ix+1);
}
else if (attrs.flags & LINE) {
- emitAttr ("style", "line", outFile, ix+1);
+ emitAttr("style", "line", ix+1);
}
if (attrs.arrow) {
if (streq(attrs.arrow,"forward"))
- emitAttr ("arrow", "first", outFile, ix+1);
+ emitAttr("arrow", "first", ix+1);
else if (streq(attrs.arrow,"back"))
- emitAttr ("arrow", "last", outFile, ix+1);
+ emitAttr("arrow", "last", ix+1);
else if (streq(attrs.arrow,"both"))
- emitAttr ("arrow", "both", outFile, ix+1);
+ emitAttr("arrow", "both", ix+1);
else if (streq(attrs.arrow,"none"))
- emitAttr ("arrow", "none", outFile, ix+1);
+ emitAttr("arrow", "none", ix+1);
}
fprintf (outFile, " ]\n");
}
if (doLabelGraphics) {
fprintf (outFile, " LabelGraphics [\n");
- if (label) emitAttr ("text", label, outFile, ix+1);
+ if (label) emitAttr("text", label, ix+1);
if (attrs.fontColor) {
- emitAttr ("fontColor", attrs.fontColor, outFile, ix+1);
+ emitAttr("fontColor", attrs.fontColor, ix+1);
}
if (attrs.fontSize) {
- emitAttr ("fontSize", attrs.fontSize, outFile, ix+1);
+ emitAttr("fontSize", attrs.fontSize, ix+1);
}
if (attrs.fontName) {
- emitAttr ("fontName", attrs.fontName, outFile, ix+1);
+ emitAttr("fontName", attrs.fontName, ix+1);
}
fprintf (outFile, " ]\n");
}
for (s = agnxtattr (G, AGRAPH, NULL); s; s = agnxtattr (G, AGRAPH, s)) {
if (*(v = agxget (G, s))) {
- emitAttr (s->name, v, outFile, 1);
+ emitAttr(s->name, v, 1);
}
}
}