]> granicus.if.org Git - graphviz/commitdiff
initial fix for rendering to string in tcldot
authorellson <devnull@localhost>
Wed, 20 Aug 2008 03:20:09 +0000 (03:20 +0000)
committerellson <devnull@localhost>
Wed, 20 Aug 2008 03:20:09 +0000 (03:20 +0000)
lib/gvc/gvcint.h
lib/gvc/gvdevice.c
tclpkg/gv/gv_php_init.cpp
tclpkg/tcldot/tcldot.c

index 03e6d93a9b3f3ff9248543a1d1bd10b4b5cd3fad..271112142af0f714a48d1d69e0aeb3f78bd5335e 100644 (file)
@@ -92,7 +92,7 @@ extern "C" {
        void *keycodes;
 
         /* externally provided write() displine */
-       size_t (*write_fn) (const char *s, int len);
+       size_t (*write_fn) (GVJ_t *job, const char *s, int len);
 
 /* FIXME - everything below should probably move to GVG_t */
 
index c1995262f99b9c7d1b9e47991943aa6d3f878440..19ba6b84746e1a0c28ac7678f2fddcd22ea03094 100644 (file)
@@ -54,7 +54,7 @@ static const int PAGE_ALIGN = 4095;           /* align to a 4K boundary (less one), typic
 size_t gvdevice_write (GVJ_t * job, const unsigned char *s, unsigned int len)
 {
     if (job->gvc->write_fn && job->output_file == stdout)   /* externally provided write dicipline */
-       return (job->gvc->write_fn)((char*)s, len);
+       return (job->gvc->write_fn)(job, (char*)s, len);
     if (job->flags & GVDEVICE_COMPRESSED_FORMAT) {
 #ifdef HAVE_LIBZ
        return gzwrite((gzFile *) (job->output_file), s, len);
index f4de4a2ff0fa1ebe4408a7988a192f6f6c92decc..0559e4b49be9fc65550bee80a5b72377e15fe2b4 100644 (file)
@@ -1,15 +1,15 @@
 #include <php.h>
-#include <gvc.h>
-#include <gvplugin.h>
-#include <gvcjob.h>
-#include <gvcint.h>
+#include "gvc.h"
+#include "gvplugin.h"
+#include "gvcjob.h"
+#include "gvcint.h"
 
-static size_t gv_php_writer (const char *s, int len)
+static size_t gv_php_writer (GVJ_t *job, const char *s, int len)
 {
        return PHPWRITE(s, len);
 }
 
-void gv_binding_init ( GVC_t *gvc)
+void gv_binding_init (GVC_t *gvc)
 {
        gvc->write_fn = gv_php_writer;
 }
index 226314f674ca47101fbc70df616bb8e33608d1b3..06efae73bb3f106c292be995765424a33a9e2c20 100644 (file)
@@ -1632,9 +1632,10 @@ static int dotstring(ClientData clientData, Tcl_Interp * interp,
     return (tcldot_fixup(interp, gvc, g));
 }
 
-static size_t Tcldot_writer(const char *s, int len)
+static size_t Tcldot_writer(GVJ_t *job, const char *s, int len)
 {
-    return fwrite(s, sizeof(char), len, stdout);
+    Tcl_AppendResult((Tcl_Interp*)(job->context), s, (char *) NULL);
+    return len;
 }
 
 #if defined(_BLD_tcldot) && defined(_DLL)