cvs: php4 /ext/pdf pdf.c php_pdf.h
| From: | Ulf Wendel | Date: | Tue, 21 Aug 2001 13:33:16 +0000 |
| Subject: | cvs: php4 /ext/pdf pdf.c php_pdf.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-6995@lists.php.net to get a copy of this message | ||
uw Tue Aug 21 09:33:16 2001 EDT
Modified files:
/php4/ext/pdf pdf.c php_pdf.h
Log:
Added two new functions:
int pdf_get_minorversion()
int pdf_get_majorversion()
Both functions are taken from the C-Library. You should be able to determine
the API version of the extension/library using pdf_get_value() or
pdf_get_parameter() but these functions need a pdf object to work on. This
means that you have to create an pdf object before you can find out the
API version. Using pdf_get_minorversion() and pdf_get_majorversion() there's
no need for this.
Index: php4/ext/pdf/pdf.c
diff -u php4/ext/pdf/pdf.c:1.94 php4/ext/pdf/pdf.c:1.95
--- php4/ext/pdf/pdf.c:1.94 Tue Aug 7 13:26:30 2001
+++ php4/ext/pdf/pdf.c Tue Aug 21 09:33:15 2001
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pdf.c,v 1.94 2001/08/07 17:26:30 phanto Exp $ */
+/* $Id: pdf.c,v 1.95 2001/08/21 13:33:15 uw Exp $ */
/* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */
@@ -81,6 +81,8 @@
PHP_FE(pdf_close, NULL)
PHP_FE(pdf_begin_page, NULL)
PHP_FE(pdf_end_page, NULL)
+ PHP_FE(pdf_get_majorversion, NULL)
+ PHP_FE(pdf_get_minorversion, NULL)
PHP_FE(pdf_get_value, NULL)
PHP_FE(pdf_set_value, NULL)
PHP_FE(pdf_get_parameter, NULL)
@@ -347,7 +349,7 @@
#else
php_info_print_table_row(2, "PDFlib GmbH Version", tmp );
#endif
- php_info_print_table_row(2, "Revision", "$Revision: 1.94 $" );
+ php_info_print_table_row(2, "Revision", "$Revision: 1.95 $" );
php_info_print_table_end();
}
@@ -2245,6 +2247,29 @@
/* }}} */
+/* {{{ proto int pdf_get_majorversion()
+ Returns the major version number of the PDFlib */
+PHP_FUNCTION(pdf_get_majorversion)
+{
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+
+ RETURN_LONG(PDF_get_majorversion());
+}
+
+/* {{{ proto int pdf_get_minorversion()
+ Returns the minor version number of the PDFlib */
+PHP_FUNCTION(pdf_get_minorversion)
+{
+ if (ZEND_NUM_ARGS() != 0) {
+ WRONG_PARAM_COUNT;
+ }
+
+ RETURN_LONG(PDF_get_minorversion());
+}
+
+/* }}} */
/* {{{ proto void pdf_delete(int pdfdoc)
Deletes the PDF object */
PHP_FUNCTION(pdf_delete)
Index: php4/ext/pdf/php_pdf.h
diff -u php4/ext/pdf/php_pdf.h:1.19 php4/ext/pdf/php_pdf.h:1.20
--- php4/ext/pdf/php_pdf.h:1.19 Tue Aug 7 13:26:32 2001
+++ php4/ext/pdf/php_pdf.h Tue Aug 21 09:33:15 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_pdf.h,v 1.19 2001/08/07 17:26:32 phanto Exp $ */
+/* $Id: php_pdf.h,v 1.20 2001/08/21 13:33:15 uw Exp $ */
#ifndef PHP_PDF_H
#define PHP_PDF_H
@@ -42,6 +42,8 @@
PHP_FUNCTION(pdf_close);
PHP_FUNCTION(pdf_begin_page);
PHP_FUNCTION(pdf_end_page);
+PHP_FUNCTION(pdf_get_majorversion);
+PHP_FUNCTION(pdf_get_minorversion);
PHP_FUNCTION(pdf_get_value);
PHP_FUNCTION(pdf_set_value);
PHP_FUNCTION(pdf_get_parameter);