From 0ba3bfdaf2adc9afc01dd6acddfa66e769b8b96d Mon Sep 17 00:00:00 2001 From: ellson Date: Fri, 16 Nov 2007 20:20:49 +0000 Subject: [PATCH] PHP binding fixes: - 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 | 2 +- lib/gvc/gvcint.h | 3 +++ lib/gvc/gvdevice.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/graphviz.spec.in b/graphviz.spec.in index b351acc93..cb19c298f 100644 --- a/graphviz.spec.in +++ b/graphviz.spec.in @@ -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 diff --git a/lib/gvc/gvcint.h b/lib/gvc/gvcint.h index a5fef9d3b..df2b76b38 100644 --- a/lib/gvc/gvcint.h +++ b/lib/gvc/gvcint.h @@ -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() */ diff --git a/lib/gvc/gvdevice.c b/lib/gvc/gvdevice.c index acfe229ac..d28523be9 100644 --- a/lib/gvc/gvdevice.c +++ b/lib/gvc/gvdevice.c @@ -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); -- 2.50.1