]> granicus.if.org Git - graphviz/commitdiff
Reset gvc->write_fn in gv.renderchannel and gv.renderresult so that later
authorEmden R. Gansner <erg@alum.mit.edu>
Mon, 27 Jan 2014 00:38:09 +0000 (19:38 -0500)
committerEmden R. Gansner <erg@alum.mit.edu>
Mon, 27 Jan 2014 00:38:09 +0000 (19:38 -0500)
calls to gv.render, which requires the default I/O, work.

tclpkg/gv/gv.cpp
tclpkg/gv/gv_dummy_init.c
tclpkg/gv/gv_php_init.c
tclpkg/gv/gv_tcl_init.c

index a8459f8435ad70acb3657352a42eb1fdadec6fb8..cf98d4326f8a009e8ed98cb19a34cf0f9f8b6438 100644 (file)
@@ -18,6 +18,7 @@
 extern "C" {
 extern void gv_string_writer_init(GVC_t *gvc);
 extern void gv_channel_writer_init(GVC_t *gvc);
+extern void gv_writer_reset(GVC_t *gvc);
 }
 
 #define agfindattr(x,s) agattrsym(x,s)
@@ -850,6 +851,7 @@ bool renderchannel(Agraph_t *g, const char *format, const char *channelname)
         return false;
     gv_channel_writer_init(gvc);
     err = gvRender(gvc, g, format, (FILE*)channelname);
+    gv_writer_reset (gvc);   /* Reset to default */
     return (! err);
 }
 
@@ -873,6 +875,7 @@ void renderresult(Agraph_t *g, const char *format, char *outdata)
         return;
     gv_string_writer_init(gvc);
     err = gvRender(gvc, g, format, (FILE*)outdata);
+    gv_writer_reset (gvc);   /* Reset to default */
 }
 
 // render to a malloc'ed data string, to be free'd by caller.
index 096f2a97099ba7ad5327174a7360a5d0c84c1aaa..dfdf2b986b024597e53ffc5929376e81839b2d1a 100644 (file)
@@ -2,3 +2,4 @@
 
 void gv_string_writer_init (GVC_t *gvc) {}
 void gv_channel_writer_init (GVC_t *gvc) {}
+void gv_writer_reset (GVC_t *gvc) {}
index a56b273b6aefeaa2a2a4995764805f22c550e16b..57503cfc7d385a9f663c8f7756299abf473ed9b1 100644 (file)
@@ -43,3 +43,4 @@ void gv_channel_writer_init(GVC_t *gvc)
     gvc->write_fn = gv_channel_writer;
 }
 
+void gv_writer_reset (GVC_t *gvc) {gvc->write_fn = NULL;}
index dca5fa746f63d218c337441becd11c5af0b84e10..9940540a5b6de7bc779a77e741448a07abbe7ab9 100644 (file)
@@ -37,3 +37,5 @@ void gv_channel_writer_init(GVC_t *gvc)
 {
     gvc->write_fn = gv_channel_writer;
 }
+
+void gv_writer_reset (GVC_t *gvc) {gvc->write_fn = NULL;}