* equivalent.
* Returns NULL if the argument is trivial.
*/
-char *safefile(const char *filename)
+const char *safefile(const char *filename)
{
static boolean onetime = TRUE;
static char *safefilename = NULL;
{
#ifndef WITH_CGRAPH
extern Agdict_t *agdictof(void *);
+ Agdict_t *d;
+ Agsym_t **list;
#endif /* WITH_CGRAPH */
node_t *nn;
char *name;
graph_t *g = agraphof(n);
-#ifndef WITH_CGRAPH
- Agdict_t *d;
-#endif /* WITH_CGRAPH */
- Agsym_t **list;
Agsym_t *sym;
if (!(IS_CLUST_NODE(n)))
/* Can use pointer comparison because of ref strings. */
if (agxget(nn, sym->index) != sym->value)
agxset(nn, sym->index, sym->value);
+ }
#else /* WITH_CGRAPH */
- sym=0;
- while (sym = agnxtattr(g, AGNODE, sym))
- {
- if (agxget(nn, sym) != sym->defval)
+ for (sym = agnxtattr(g, AGNODE, NULL); sym; (sym = agnxtattr(g, AGNODE, sym))) {
+ if (agxget(nn, sym) != sym->defval)
agxset(nn, sym, sym->defval);
-#endif /* WITH_CGRAPH */
}
+#endif /* WITH_CGRAPH */
return nn;
}
extern void UF_setname(Agnode_t *, Agnode_t *);
extern char *Fgets(FILE * fp);
- extern char *safefile(const char *filename);
+ extern const char *safefile(const char *filename);
extern boolean mapbool(char *);
extern int maptoken(char *, char **, int *);
}
}
fprintf(Output_file, " (shape\n"
- " (id %d)\n"
- " (layer %d)\n"
+ " (id %ld)\n"
+ " (layer %ld)\n"
" (type %s)\n", AGID(n) + 1, AGID(n), p->vtxshape);
}
static void vtx_begin_edge(edge_t * e)
{
fprintf(Output_file, " (connection\n"
- " (id %d)\n"
- " (layer %d)\n"
+ " (id %ld)\n"
+ " (layer %ld)\n"
" (rotation 0)\n"
" (textRotation 0)\n"
" (locked F)\n"
- " (start %d)\n"
- " (end %d)\n",
+ " (start %ld)\n"
+ " (end %ld)\n",
AGID(e) + 1, AGID(e), AGID(agtail(e)) + 1, AGID(aghead(e)) + 1);
}