cvs: php4 /ext/pdf Makefile.in config.m4 pdf.c

From: Date: Mon, 12 Feb 2001 17:50:39 +0000
Subject: cvs: php4 /ext/pdf Makefile.in config.m4 pdf.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3991@lists.php.net to get a copy of this message
rjs Mon Feb 12 09:50:39 2001 EDT Modified files: /php4/ext/pdf Makefile.in config.m4 pdf.c Log: added module support (for dl()) for PDFlib the PDF files now tell that they are generated by the PHP binding. Index: php4/ext/pdf/Makefile.in diff -u php4/ext/pdf/Makefile.in:1.6 php4/ext/pdf/Makefile.in:1.7 --- php4/ext/pdf/Makefile.in:1.6 Mon May 1 15:38:31 2000 +++ php4/ext/pdf/Makefile.in Mon Feb 12 09:50:37 2001 @@ -1,5 +1,8 @@ LTLIBRARY_NAME = libpdf.la LTLIBRARY_SOURCES = pdf.c +LTLIBRARY_SHARED_NAME = libpdf_php.la +PDFLIB_SHARED_LIBBADD = -lpdf +LTLIBRARY_SHARED_LIBADD = $(PDFLIB_SHARED_LIBBADD) include $(top_srcdir)/build/dynlib.mk Index: php4/ext/pdf/config.m4 diff -u php4/ext/pdf/config.m4:1.13 php4/ext/pdf/config.m4:1.14 --- php4/ext/pdf/config.m4:1.13 Sun Mar 26 11:47:25 2000 +++ php4/ext/pdf/config.m4 Mon Feb 12 09:50:38 2001 @@ -1,18 +1,19 @@ -dnl $Id: config.m4,v 1.13 2000/03/26 19:47:25 sas Exp $ +dnl $Id: config.m4,v 1.14 2001/02/12 17:50:38 rjs Exp $ AC_MSG_CHECKING(whether to include Pdflib 3.x support) -AC_ARG_WITH(pdflib, -[ --with-pdflib[=DIR] Include pdflib 3.x support. - DIR is the pdflib install directory, - defaults to /usr/local.], -[ -echo $withval - case "$withval" in + +PHP_ARG_WITH(pdflib,whether to include pdflib support, +[ --with-pdflib[=DIR] Include pdflib 3.x support. DIR is the pdflib + base install directory, defaults to /usr/local + Set DIR to "shared" to build as dl, or "shared,DIR" + to build as dl and still specify DIR.]) + + case "$PHP_PDFLIB" in no) AC_MSG_RESULT(no) ;; yes) AC_MSG_RESULT(yes) - PHP_EXTENSION(pdf) + PHP_EXTENSION(pdf, $ext_shared) old_LDFLAGS=$LDFLAGS old_LIBS=$LIBS LIBS="$LIBS -ltiff -ljpeg -lpng -lz" @@ -20,7 +21,8 @@ [AC_MSG_ERROR(pdflib extension requires at least pdflib 3.x. You may also need libtiff and libjpeg. If so, use the options --with-tiff-dir=<DIR> and --with-jpeg-dir=<DIR>)]) LIBS=$old_LIBS LDFLAGS=$old_LDFLAGS - AC_ADD_LIBRARY(pdf) + PHP_SUBST(PDFLIB_SHARED_LIBADD) + AC_ADD_LIBRARY(pdf, PDFLIB_SHARED_LIBADD) AC_ADD_LIBRARY(tiff) AC_ADD_LIBRARY(png) AC_ADD_LIBRARY(jpeg) @@ -30,7 +32,7 @@ test -f $withval/include/pdflib.h && PDFLIB_INCLUDE="$withval/include" if test -n "$PDFLIB_INCLUDE" ; then AC_MSG_RESULT(yes) - PHP_EXTENSION(pdf) + PHP_EXTENSION(pdf, $ext_shared) old_withval=$withval if test $HAVE_ZLIB; then @@ -113,12 +115,10 @@ AC_CHECK_LIB(pdf, PDF_show_boxed, [AC_DEFINE(HAVE_PDFLIB,1,[ ]) PDFLIB_LIBS="$PDFLIB_LIBS -L$withval/lib -lpdf"], [AC_MSG_ERROR(pdflib extension requires pdflib 3.x.)]) LIBS=$old_LIBS - AC_ADD_LIBRARY_WITH_PATH(pdf, $withval/lib) + PHP_SUBST(PDFLIB_SHARED_LIBADD) + AC_ADD_LIBRARY_WITH_PATH(pdf, $withval/lib, PDFLIB_SHARED_LIBADD) AC_ADD_INCLUDE($PDFLIB_INCLUDE) else AC_MSG_RESULT(no) fi ;; esac -],[ - AC_MSG_RESULT(no) -]) Index: php4/ext/pdf/pdf.c diff -u php4/ext/pdf/pdf.c:1.69 php4/ext/pdf/pdf.c:1.70 --- php4/ext/pdf/pdf.c:1.69 Wed Jan 31 23:07:09 2001 +++ php4/ext/pdf/pdf.c Mon Feb 12 09:50:38 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdf.c,v 1.69 2001/02/01 07:07:09 steinm Exp $ */ +/* $Id: pdf.c,v 1.70 2001/02/12 17:50:38 rjs Exp $ */ /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */ @@ -29,9 +29,9 @@ #include "ext/standard/head.h" #include "ext/standard/info.h" #include "ext/standard/file.h" -#include "ext/gd/php_gd.h" #if HAVE_LIBGD13 +#include "ext/gd/php_gd.h" #include "gd.h" #endif @@ -193,25 +193,14 @@ ZEND_GET_MODULE(pdf) #endif -static void _free_pdf_image(zend_rsrc_list_entry *rsrc) -{ - int *pdf_image = (int *)rsrc->ptr; - if(pdf_image) efree(pdf_image); -} - static void _free_pdf_doc(zend_rsrc_list_entry *rsrc) { - PDF *pdf = (PDF *)rsrc->ptr; /* RJS: TODO: + PDF *pdf = (PDF *)rsrc->ptr; check whether pdf-Pointer is still valid, before pdf_delete() + remove php-resource */ - PDF_delete(pdf); -} - -static void _free_outline(zend_rsrc_list_entry *rsrc) -{ - int *outline = (int *)rsrc->ptr; - if(outline) efree(outline); + /* PDF_delete(pdf); +*/ } static void custom_errorhandler(PDF *p, int type, const char *shortmsg) @@ -275,7 +264,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "PDF Support", "enabled" ); php_info_print_table_row(2, "PDFlib GmbH Version", tmp ); - php_info_print_table_row(2, "Revision", "$Revision: 1.69 $" ); + php_info_print_table_row(2, "Revision", "$Revision: 1.70 $" ); php_info_print_table_end(); } @@ -401,6 +390,7 @@ } PDF_set_parameter(pdf, "imagewarning", "true"); + PDF_set_parameter(pdf, "binding", "PHP"); ZEND_REGISTER_RESOURCE(return_value, pdf, le_pdf); } @@ -2099,6 +2089,7 @@ pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL); PDF_set_parameter(pdf, "imagewarning", "true"); + PDF_set_parameter(pdf, "binding", "PHP"); ZEND_REGISTER_RESOURCE(return_value, pdf, le_pdf); }

« previous php.cvs (#3991) next »