]> granicus.if.org Git - php/commitdiff
Added two new functions:
authorUlf Wendel <uw@php.net>
Tue, 21 Aug 2001 13:33:16 +0000 (13:33 +0000)
committerUlf Wendel <uw@php.net>
Tue, 21 Aug 2001 13:33:16 +0000 (13:33 +0000)
  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.

ext/pdf/pdf.c
ext/pdf/php_pdf.h

index 62b63d183fc5fba694f1f608b1f2152132fa13f5..c2584a062d43147b447b0b3c893f828ed17e83e5 100644 (file)
@@ -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)
index a40226800ebc7fa1e5b711f431088fa5c9a9ae68..bf55817368d2d1a3c7e63292dc016de399b2663f 100644 (file)
@@ -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);