summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Wendel <uw@php.net>2001-08-21 13:33:16 +0000
committerUlf Wendel <uw@php.net>2001-08-21 13:33:16 +0000
commit1ffed2e53f525884c050e0a68a639a37d948fe98 (patch)
treeafdbe6a41195f47bca4c99bb0c4326a8c494915a
parente140b35b0420d7ea1e2d80b78c5161d166067c06 (diff)
downloadphp-git-1ffed2e53f525884c050e0a68a639a37d948fe98.tar.gz
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.
-rw-r--r--ext/pdf/pdf.c25
-rw-r--r--ext/pdf/php_pdf.h2
2 files changed, 27 insertions, 0 deletions
diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c
index 62b63d183f..c2584a062d 100644
--- a/ext/pdf/pdf.c
+++ b/ext/pdf/pdf.c
@@ -81,6 +81,8 @@ function_entry pdf_functions[] = {
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)
@@ -2245,6 +2247,29 @@ PHP_FUNCTION(pdf_new)
/* }}} */
+/* {{{ 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)
diff --git a/ext/pdf/php_pdf.h b/ext/pdf/php_pdf.h
index a40226800e..bf55817368 100644
--- a/ext/pdf/php_pdf.h
+++ b/ext/pdf/php_pdf.h
@@ -42,6 +42,8 @@ PHP_FUNCTION(pdf_get_buffer); /* new function */
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);