Back to index

php5  5.3.10
php_xsl.h
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Author:                                                              |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_xsl.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_XSL_H
00022 #define PHP_XSL_H
00023 
00024 extern zend_module_entry xsl_module_entry;
00025 #define phpext_xsl_ptr &xsl_module_entry
00026 
00027 #ifdef ZTS
00028 #include "TSRM.h"
00029 #endif
00030 
00031 #include <libxslt/xsltconfig.h>
00032 #include <libxslt/xsltInternals.h>
00033 #include <libxslt/xsltutils.h>
00034 #include <libxslt/transform.h>
00035 #include <libxslt/security.h> 
00036 #if HAVE_XSL_EXSLT
00037 #include <libexslt/exslt.h>
00038 #include <libexslt/exsltconfig.h>
00039 #endif
00040 
00041 #include "../dom/xml_common.h"
00042 #include "xsl_fe.h"
00043 
00044 #include <libxslt/extensions.h>
00045 #include <libxml/xpathInternals.h>
00046 
00047 #define XSL_SECPREF_NONE 0
00048 #define XSL_SECPREF_READ_FILE 2
00049 #define XSL_SECPREF_WRITE_FILE 4
00050 #define XSL_SECPREF_CREATE_DIRECTORY 8
00051 #define XSL_SECPREF_READ_NETWORK 16
00052 #define XSL_SECPREF_WRITE_NETWORK 32
00053 /* Default == disable all write access ==  XSL_SECPREF_WRITE_NETWORK | XSL_SECPREF_CREATE_DIRECTORY | XSL_SECPREF_WRITE_FILE */
00054 #define XSL_SECPREF_DEFAULT 44
00055 
00056 typedef struct _xsl_object {
00057        zend_object  std;
00058        void *ptr;
00059        HashTable *prop_handler;
00060        zend_object_handle handle;
00061        HashTable *parameter;
00062        int hasKeys;
00063        int registerPhpFunctions;
00064        HashTable *registered_phpfunctions;
00065        HashTable *node_list;
00066        php_libxml_node_object *doc;
00067        char *profiling;
00068 } xsl_object;
00069 
00070 void php_xsl_set_object(zval *wrapper, void *obj TSRMLS_DC);
00071 void xsl_objects_free_storage(void *object TSRMLS_DC);
00072 zval *php_xsl_create_object(xsltStylesheetPtr obj, int *found, zval *wrapper_in, zval *return_value  TSRMLS_DC);
00073 
00074 void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
00075 void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
00076 
00077 #define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \
00078 INIT_CLASS_ENTRY(ce, name, funcs); \
00079 ce.create_object = xsl_objects_new; \
00080 entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
00081 
00082 #define XSL_DOMOBJ_NEW(zval, obj, ret) \
00083        if (NULL == (zval = php_xsl_create_object(obj, ret, zval, return_value TSRMLS_CC))) { \
00084               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot create required DOM object"); \
00085               RETURN_FALSE; \
00086        }
00087 
00088 
00089 
00090 PHP_MINIT_FUNCTION(xsl);
00091 PHP_MSHUTDOWN_FUNCTION(xsl);
00092 PHP_RINIT_FUNCTION(xsl);
00093 PHP_RSHUTDOWN_FUNCTION(xsl);
00094 PHP_MINFO_FUNCTION(xsl);
00095 
00096 
00097 /* 
00098        Declare any global variables you may need between the BEGIN
00099        and END macros here:     
00100 
00101 ZEND_BEGIN_MODULE_GLOBALS(xsl)
00102        long  global_value;
00103        char *global_string;
00104 ZEND_END_MODULE_GLOBALS(xsl)
00105 */
00106 
00107 /* In every utility function you add that needs to use variables 
00108    in php_xsl_globals, call TSRM_FETCH(); after declaring other 
00109    variables used by that function, or better yet, pass in TSRMLS_CC
00110    after the last function argument and declare your utility function
00111    with TSRMLS_DC after the last declared argument.  Always refer to
00112    the globals in your function as XSL_G(variable).  You are 
00113    encouraged to rename these macros something shorter, see
00114    examples in any other php module directory.
00115 */
00116 
00117 #ifdef ZTS
00118 #define XSL_G(v) TSRMG(xsl_globals_id, zend_xsl_globals *, v)
00119 #else
00120 #define XSL_G(v) (xsl_globals.v)
00121 #endif
00122 
00123 #endif /* PHP_XSL_H */
00124 
00125 
00126 /*
00127  * Local variables:
00128  * tab-width: 4
00129  * c-basic-offset: 4
00130  * End:
00131  * vim600: noet sw=4 ts=4 fdm=marker
00132  * vim<600: noet sw=4 ts=4
00133  */