]> granicus.if.org Git - graphviz/commitdiff
PHP binding fixes:
authorellson <devnull@localhost>
Fri, 16 Nov 2007 20:20:49 +0000 (20:20 +0000)
committerellson <devnull@localhost>
Fri, 16 Nov 2007 20:20:49 +0000 (20:20 +0000)
   - return bool success indicator instead of void so that "func() or die()" idiom works
   - Support language specific write() functions.
   - Use PHPWRITE() for buffered output when PHP used from Apache

tclpkg/gv/gv_dummy_init.cpp [new file with mode: 0644]
tclpkg/gv/gv_php_init.cpp [new file with mode: 0644]

diff --git a/tclpkg/gv/gv_dummy_init.cpp b/tclpkg/gv/gv_dummy_init.cpp
new file mode 100644 (file)
index 0000000..82e8c08
--- /dev/null
@@ -0,0 +1,3 @@
+#include <gvc.h>
+
+void gv_binding_init ( GVC_t *gvc) {}
diff --git a/tclpkg/gv/gv_php_init.cpp b/tclpkg/gv/gv_php_init.cpp
new file mode 100644 (file)
index 0000000..f4de4a2
--- /dev/null
@@ -0,0 +1,15 @@
+#include <php.h>
+#include <gvc.h>
+#include <gvplugin.h>
+#include <gvcjob.h>
+#include <gvcint.h>
+
+static size_t gv_php_writer (const char *s, int len)
+{
+       return PHPWRITE(s, len);
+}
+
+void gv_binding_init ( GVC_t *gvc)
+{
+       gvc->write_fn = gv_php_writer;
+}