]> granicus.if.org Git - php/commitdiff
Generate method entries for ext/xsl
authorMáté Kocsis <kocsismate@woohoolabs.com>
Sat, 11 Apr 2020 23:49:13 +0000 (01:49 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Sun, 12 Apr 2020 08:18:21 +0000 (10:18 +0200)
Closes GH-5372

ext/xsl/php_xsl.c
ext/xsl/php_xsl.h
ext/xsl/php_xsl.stub.php [moved from ext/xsl/xsltprocessor.stub.php with 97% similarity]
ext/xsl/php_xsl_arginfo.h [moved from ext/xsl/xsltprocessor_arginfo.h with 50% similarity]
ext/xsl/xsl_fe.h [deleted file]
ext/xsl/xsltprocessor.c

index da67e9ea6429cba762db1402dd4036d09c54a24b..63974643bcaaed11bf4c9eedf65fb628cd339593 100644 (file)
@@ -22,6 +22,7 @@
 #include "php_ini.h"
 #include "ext/standard/info.h"
 #include "php_xsl.h"
+#include "php_xsl_arginfo.h"
 
 zend_class_entry *xsl_xsltprocessor_class_entry;
 static zend_object_handlers xsl_object_handlers;
@@ -129,7 +130,7 @@ PHP_MINIT_FUNCTION(xsl)
        xsl_object_handlers.clone_obj = NULL;
        xsl_object_handlers.free_obj = xsl_objects_free_storage;
 
-       REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, php_xsl_xsltprocessor_class_functions, xsl_xsltprocessor_class_entry);
+       REGISTER_XSL_CLASS(ce, "XSLTProcessor", NULL, class_XSLTProcessor_methods, xsl_xsltprocessor_class_entry);
 #if HAVE_XSL_EXSLT
        exsltRegisterAll();
 #endif
index 0d105ce2a0c545f5f6a8a2ab41429ad4a9de9291..94d4409b3618b54e856ee1cb461a932edfb347cd 100644 (file)
@@ -38,7 +38,6 @@ extern zend_module_entry xsl_module_entry;
 #endif
 
 #include "../dom/xml_common.h"
-#include "xsl_fe.h"
 
 #include <libxslt/extensions.h>
 #include <libxml/xpathInternals.h>
similarity index 97%
rename from ext/xsl/xsltprocessor.stub.php
rename to ext/xsl/php_xsl.stub.php
index 8b4dcd16976310e983e8950ee129315042c1168e..23f187fbddea769e371326cac1f5cf5884546406 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+/** @generate-function-entries */
+
 class XSLTProcessor
 {
     /** @return bool */
similarity index 50%
rename from ext/xsl/xsltprocessor_arginfo.h
rename to ext/xsl/php_xsl_arginfo.h
index 50ed54c8d0b408f41bb3f0e23f2fd91c3c8b8474..e9cc9009ae09d29c8e31ab054e26f6be8b28744c 100644 (file)
@@ -47,3 +47,34 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_XSLTProcessor_setSecurityPrefs, 0, 0, 1)
 ZEND_END_ARG_INFO()
 
 #define arginfo_class_XSLTProcessor_getSecurityPrefs arginfo_class_XSLTProcessor_hasExsltSupport
+
+
+ZEND_METHOD(XSLTProcessor, importStylesheet);
+ZEND_METHOD(XSLTProcessor, transformToDoc);
+ZEND_METHOD(XSLTProcessor, transformToUri);
+ZEND_METHOD(XSLTProcessor, transformToXml);
+ZEND_METHOD(XSLTProcessor, setParameter);
+ZEND_METHOD(XSLTProcessor, getParameter);
+ZEND_METHOD(XSLTProcessor, removeParameter);
+ZEND_METHOD(XSLTProcessor, hasExsltSupport);
+ZEND_METHOD(XSLTProcessor, registerPHPFunctions);
+ZEND_METHOD(XSLTProcessor, setProfiling);
+ZEND_METHOD(XSLTProcessor, setSecurityPrefs);
+ZEND_METHOD(XSLTProcessor, getSecurityPrefs);
+
+
+static const zend_function_entry class_XSLTProcessor_methods[] = {
+       ZEND_ME(XSLTProcessor, importStylesheet, arginfo_class_XSLTProcessor_importStylesheet, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, transformToDoc, arginfo_class_XSLTProcessor_transformToDoc, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, transformToUri, arginfo_class_XSLTProcessor_transformToUri, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, transformToXml, arginfo_class_XSLTProcessor_transformToXml, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, setParameter, arginfo_class_XSLTProcessor_setParameter, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, getParameter, arginfo_class_XSLTProcessor_getParameter, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, removeParameter, arginfo_class_XSLTProcessor_removeParameter, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, hasExsltSupport, arginfo_class_XSLTProcessor_hasExsltSupport, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, registerPHPFunctions, arginfo_class_XSLTProcessor_registerPHPFunctions, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, setProfiling, arginfo_class_XSLTProcessor_setProfiling, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, setSecurityPrefs, arginfo_class_XSLTProcessor_setSecurityPrefs, ZEND_ACC_PUBLIC)
+       ZEND_ME(XSLTProcessor, getSecurityPrefs, arginfo_class_XSLTProcessor_getSecurityPrefs, ZEND_ACC_PUBLIC)
+       ZEND_FE_END
+};
diff --git a/ext/xsl/xsl_fe.h b/ext/xsl/xsl_fe.h
deleted file mode 100644 (file)
index dd81681..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-  +----------------------------------------------------------------------+
-  | Copyright (c) The PHP Group                                          |
-  +----------------------------------------------------------------------+
-  | This source file is subject to version 3.01 of the PHP license,      |
-  | that is bundled with this package in the file LICENSE, and is        |
-  | available through the world-wide-web at the following url:           |
-  | http://www.php.net/license/3_01.txt                                  |
-  | If you did not receive a copy of the PHP license and are unable to   |
-  | obtain it through the world-wide-web, please send a note to          |
-  | license@php.net so we can mail you a copy immediately.               |
-  +----------------------------------------------------------------------+
-  | Author: Christian Stocker <chregu@php.net>                           |
-  +----------------------------------------------------------------------+
-*/
-
-#ifndef XSL_FE_H
-#define XSL_FE_H
-
-extern const zend_function_entry php_xsl_xsltprocessor_class_functions[];
-extern zend_class_entry *xsl_xsltprocessor_class_entry;
-
-PHP_METHOD(XSLTProcessor, importStylesheet);
-PHP_METHOD(XSLTProcessor, transformToDoc);
-PHP_METHOD(XSLTProcessor, transformToUri);
-PHP_METHOD(XSLTProcessor, transformToXml);
-PHP_METHOD(XSLTProcessor, setParameter);
-PHP_METHOD(XSLTProcessor, getParameter);
-PHP_METHOD(XSLTProcessor, removeParameter);
-PHP_METHOD(XSLTProcessor, hasExsltSupport);
-PHP_METHOD(XSLTProcessor, registerPHPFunctions);
-PHP_METHOD(XSLTProcessor, setProfiling);
-PHP_METHOD(XSLTProcessor, setSecurityPrefs);
-PHP_METHOD(XSLTProcessor, getSecurityPrefs);
-
-#endif
index 539fe39e617d3d80164d6fb960d22b2676fb6b51..1ced2b7b74049c0674b31ee33cf27420ef9b0fde 100644 (file)
 
 #include "php.h"
 #include "php_xsl.h"
-#include "xsltprocessor_arginfo.h"
 #include "ext/libxml/php_libxml.h"
 
-/*
-* class xsl_xsltprocessor
-*
-* URL: https://www.w3.org/TR/2003/WD-DOM-Level-3-Core-20030226/DOM3-Core.html#
-* Since:
-*/
-
-const zend_function_entry php_xsl_xsltprocessor_class_functions[] = {
-       PHP_ME(XSLTProcessor, importStylesheet,         arginfo_class_XSLTProcessor_importStylesheet,   ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, transformToDoc,           arginfo_class_XSLTProcessor_transformToDoc,             ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, transformToUri,           arginfo_class_XSLTProcessor_transformToUri,             ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, transformToXml,           arginfo_class_XSLTProcessor_transformToXml,             ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, setParameter,                     arginfo_class_XSLTProcessor_setParameter,               ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, getParameter,                     arginfo_class_XSLTProcessor_getParameter,               ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, removeParameter,          arginfo_class_XSLTProcessor_removeParameter,    ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, hasExsltSupport,          arginfo_class_XSLTProcessor_hasExsltSupport,    ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, registerPHPFunctions,     arginfo_class_XSLTProcessor_registerPHPFunctions, ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, setProfiling,                     arginfo_class_XSLTProcessor_setProfiling,               ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, setSecurityPrefs,         arginfo_class_XSLTProcessor_setSecurityPrefs,   ZEND_ACC_PUBLIC)
-       PHP_ME(XSLTProcessor, getSecurityPrefs,         arginfo_class_XSLTProcessor_getSecurityPrefs,   ZEND_ACC_PUBLIC)
-       PHP_FE_END
-};
-
 /* {{{ php_xsl_xslt_string_to_xpathexpr()
    Translates a string to a XPath Expression */
 static char *php_xsl_xslt_string_to_xpathexpr(const char *str)