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

graphviz.spec.in
lib/gvc/gvcint.h
lib/gvc/gvdevice.c

index b351acc938de366f7faad24e134d1ffcee8de000..cb19c298f5ab1f34b0990713dd91f08a1f3b5b44 100644 (file)
@@ -227,7 +227,7 @@ Requires:         graphviz = %{version}-%{release}
 %description devil
 Graphviz plugin for renderers based on DevIL.  (Unless you absolutely have
 to use BMP, TIF, or TGA, you are recommended to use the PNG format instead
-support directly by the cairo+pango based renderer in the base graphviz rpm.)
+supported directly by the cairo+pango based renderer in the base graphviz rpm.)
 
 # run "dot -c" to generate plugin config in %{_libdir}/graphviz/config
 %post devil
index a5fef9d3b2f4e08aa948b420cbb19a1e3fcea49a..df2b76b387e7e5e316b1ae1ce1c3e310fc61f339 100644 (file)
@@ -93,6 +93,9 @@ extern "C" {
        int numkeys;
        void *keycodes;
 
+        /* externally provided write() displine */
+       size_t (*write_fn) (const char *s, int len);
+
 /* FIXME - everything below should probably move to GVG_t */
 
        /* gvrender_config() */
index acfe229ac4716abd652d4dacb231832d4ffcbc2c..d28523be9ef6c75fcc0f95dd4999cd4bc751458e 100644 (file)
@@ -79,6 +79,8 @@ void gvdevice_printf(GVJ_t * job, const char *format, ...)
 
 size_t gvdevice_write (GVJ_t * job, const unsigned char *s, unsigned int len)
 {
+    if (job->gvc->write_fn)   /* externally provided write dicipline */
+       return (job->gvc->write_fn)(s, len);
     if (job->flags & GVDEVICE_COMPRESSED_FORMAT) {
 #ifdef HAVE_LIBZ
        return gzwrite((gzFile *) (job->output_file), s, len);