From: Ulf Wendel Date: Tue, 21 Aug 2001 13:33:16 +0000 (+0000) Subject: Added two new functions: X-Git-Tag: PRE_SUBST_Z_MACROS~406 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ffed2e53f525884c050e0a68a639a37d948fe98;p=php 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. --- 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);