]> granicus.if.org Git - graphviz/commitdiff
Make output.c compatible with cgraph
authorerg <devnull@localhost>
Fri, 10 Jul 2009 21:22:54 +0000 (21:22 +0000)
committererg <devnull@localhost>
Fri, 10 Jul 2009 21:22:54 +0000 (21:22 +0000)
lib/common/output.c

index c14cf7ea16392d257cc6d4d802e55b9096ca80c3..994a1acd9a39e83e69df54e9c59b5954a9a322ce 100644 (file)
 int Y_off;           /* ymin + ymax */
 double YF_off;       /* Y_off in inches */
 
+#ifdef WITH_CGRAPH
+static int (*putstr) (void *chan, const char *str);
+
+static void agputs (const char* s, FILE* fp)
+{
+    putstr ((void*)fp, s);
+}
+static void agputc (int c, FILE* fp)
+{
+    static char buf[2] = {'\0','\0'};
+    buf[1] = c;
+    agputs (buf, fp);
+}
+
+#endif
+
 static void printstring(FILE * f, char *prefix, char *s)
 {
     if (prefix) agputs(prefix, f);
@@ -110,6 +126,9 @@ void write_plain(GVJ_t * job, graph_t * g, FILE * f, boolean extend)
     pointf pt;
     char *lbl;
 
+#ifdef WITH_CGRAPH
+    putstr = g->clos->disc.io->putstr;
+#endif
 //    setup_graph(job, g);
     setYInvert(g);
     pt = GD_bb(g).UR;