From: Uwe Steinmann Date: Tue, 7 Mar 2000 20:51:15 +0000 (+0000) Subject: - support for pdflib 3.0 X-Git-Tag: PHP-4.0-RC1~229 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70a6f84862604df8c39e6d03b3c28906993559fb;p=php - support for pdflib 3.0 --- diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c index c981a4fbc0..d83eb33908 100644 --- a/ext/pdf/pdf.c +++ b/ext/pdf/pdf.c @@ -192,7 +192,6 @@ static void _free_outline(int *outline) if(outline) efree(outline); } -#if PDFLIB_MAJORVERSION > 1 & PDFLIB_MINORVERSION > 0 static void custom_errorhandler(PDF *p, int type, const char*shortmsg) { switch (type){ case PDF_NonfatalError: @@ -226,7 +225,6 @@ static void *pdf_realloc(PDF *p, void *mem, size_t size, const char *caller) { static void pdf_efree(PDF *p, void *mem) { return(efree(mem)); } -#endif #if PDFLIB_MAJORVERSION >= 3 | (PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 10) static size_t pdf_flushwrite(PDF *p, void *data, size_t size){ @@ -254,7 +252,7 @@ PHP_MINFO_FUNCTION(pdf) { php_printf("Support for in memory pdf creation."); #endif -#if PDFLIB_MINORVERSION > 0 +#if PDFLIB_MAJORVERSION >= 3 | PDFLIB_MINORVERSION > 0 php_printf("The function pdf_put_image() and pdf_execute_image() are not available"); #else php_printf("The function pdf_put_image() and pdf_execute_image() are available"); @@ -420,7 +418,7 @@ PHP_FUNCTION(pdf_open) { int argc; PDF_TLS_VARS; -#if PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 10 +#if PDFLIB_MAJORVERSION >= 3 | (PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 10) argc = ARG_COUNT(ht); if(argc > 1) WRONG_PARAM_COUNT; @@ -440,11 +438,7 @@ PHP_FUNCTION(pdf_open) { /* XXX should do anzend_list_addref for here! */ #endif -#if PDFLIB_MAJORVERSION > 1 & PDFLIB_MINORVERSION > 0 pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL); -#else - pdf = PDF_new(); -#endif #if PDFLIB_MAJORVERSION >= 2 & PDFLIB_MINORVERSION >= 10 & defined PDF_OPEN_MEM_SUPPORTED if(fp) {