1 /* 2 +----------------------------------------------------------------------+ 3 | Copyright (c) The PHP Group | 4 +----------------------------------------------------------------------+ 5 | This source file is subject to version 3.01 of the PHP license, | 6 | that is bundled with this package in the file LICENSE, and is | 7 | available through the world-wide-web at the following url: | 8 | https://www.php.net/license/3_01.txt | 9 | If you did not receive a copy of the PHP license and are unable to | 10 | obtain it through the world-wide-web, please send a note to | 11 | license@php.net so we can mail you a copy immediately. | 12 +----------------------------------------------------------------------+ 13 | Author: | 14 +----------------------------------------------------------------------+ 15 */ 16 17 #ifndef PHP_XSL_H 18 #define PHP_XSL_H 19 20 extern zend_module_entry xsl_module_entry; 21 #define phpext_xsl_ptr &xsl_module_entry 22 23 #include "php_version.h" 24 #define PHP_XSL_VERSION PHP_VERSION 25 26 #ifdef ZTS 27 #include "TSRM.h" 28 #endif 29 30 #include <libxslt/xsltconfig.h> 31 #include <libxslt/xsltInternals.h> 32 #include <libxslt/xsltutils.h> 33 #include <libxslt/transform.h> 34 #include <libxslt/security.h> 35 #ifdef HAVE_XSL_EXSLT 36 #include <libexslt/exslt.h> 37 #include <libexslt/exsltconfig.h> 38 #endif 39 40 #include "../dom/xml_common.h" 41 #include "../dom/xpath_callbacks.h" 42 43 #include <libxslt/extensions.h> 44 #include <libxml/xpathInternals.h> 45 46 #define XSL_SECPREF_NONE 0 47 #define XSL_SECPREF_READ_FILE 2 48 #define XSL_SECPREF_WRITE_FILE 4 49 #define XSL_SECPREF_CREATE_DIRECTORY 8 50 #define XSL_SECPREF_READ_NETWORK 16 51 #define XSL_SECPREF_WRITE_NETWORK 32 52 /* Default == disable all write access */ 53 #define XSL_SECPREF_DEFAULT (XSL_SECPREF_WRITE_NETWORK | XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE) 54 55 typedef struct _xsl_object { 56 void *ptr; 57 HashTable *parameter; 58 bool hasKeys; 59 zend_long securityPrefs; 60 php_dom_xpath_callbacks xpath_callbacks; 61 php_libxml_node_object *doc; 62 char *profiling; 63 zend_object std; 64 } xsl_object; 65 php_xsl_fetch_object(zend_object * obj)66static inline xsl_object *php_xsl_fetch_object(zend_object *obj) { 67 return (xsl_object *)((char*)(obj) - XtOffsetOf(xsl_object, std)); 68 } 69 70 #define Z_XSL_P(zv) php_xsl_fetch_object(Z_OBJ_P((zv))) 71 72 void php_xsl_set_object(zval *wrapper, void *obj); 73 void xsl_objects_free_storage(zend_object *object); 74 75 void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs); 76 void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs); 77 78 PHP_MINIT_FUNCTION(xsl); 79 PHP_MSHUTDOWN_FUNCTION(xsl); 80 PHP_RINIT_FUNCTION(xsl); 81 PHP_RSHUTDOWN_FUNCTION(xsl); 82 PHP_MINFO_FUNCTION(xsl); 83 84 #endif /* PHP_XSL_H */ 85