This source file includes following definitions.
- php_xsl_fetch_object
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #ifndef PHP_XSL_H
22 #define PHP_XSL_H
23
24 extern zend_module_entry xsl_module_entry;
25 #define phpext_xsl_ptr &xsl_module_entry
26
27 #include "php_version.h"
28 #define PHP_XSL_VERSION PHP_VERSION
29
30 #ifdef ZTS
31 #include "TSRM.h"
32 #endif
33
34 #include <libxslt/xsltconfig.h>
35 #include <libxslt/xsltInternals.h>
36 #include <libxslt/xsltutils.h>
37 #include <libxslt/transform.h>
38 #include <libxslt/security.h>
39 #if HAVE_XSL_EXSLT
40 #include <libexslt/exslt.h>
41 #include <libexslt/exsltconfig.h>
42 #endif
43
44 #include "../dom/xml_common.h"
45 #include "xsl_fe.h"
46
47 #include <libxslt/extensions.h>
48 #include <libxml/xpathInternals.h>
49
50 #define XSL_SECPREF_NONE 0
51 #define XSL_SECPREF_READ_FILE 2
52 #define XSL_SECPREF_WRITE_FILE 4
53 #define XSL_SECPREF_CREATE_DIRECTORY 8
54 #define XSL_SECPREF_READ_NETWORK 16
55 #define XSL_SECPREF_WRITE_NETWORK 32
56
57 #define XSL_SECPREF_DEFAULT 44
58
59 typedef struct _xsl_object {
60 void *ptr;
61 HashTable *prop_handler;
62 zval handle;
63 HashTable *parameter;
64 int hasKeys;
65 int registerPhpFunctions;
66 HashTable *registered_phpfunctions;
67 HashTable *node_list;
68 php_libxml_node_object *doc;
69 char *profiling;
70 zend_long securityPrefs;
71 int securityPrefsSet;
72 zend_object std;
73 } xsl_object;
74
75 static inline xsl_object *php_xsl_fetch_object(zend_object *obj) {
76 return (xsl_object *)((char*)(obj) - XtOffsetOf(xsl_object, std));
77 }
78
79 #define Z_XSL_P(zv) php_xsl_fetch_object(Z_OBJ_P((zv)))
80
81 void php_xsl_set_object(zval *wrapper, void *obj);
82 void xsl_objects_free_storage(zend_object *object);
83 void php_xsl_create_object(xsltStylesheetPtr obj, zval *wrapper_in, zval *return_value );
84
85 void xsl_ext_function_string_php(xmlXPathParserContextPtr ctxt, int nargs);
86 void xsl_ext_function_object_php(xmlXPathParserContextPtr ctxt, int nargs);
87
88 #define REGISTER_XSL_CLASS(ce, name, parent_ce, funcs, entry) \
89 INIT_CLASS_ENTRY(ce, name, funcs); \
90 ce.create_object = xsl_objects_new; \
91 entry = zend_register_internal_class_ex(&ce, parent_ce);
92
93 #define XSL_DOMOBJ_NEW(zval, obj, ret) \
94 zval = php_xsl_create_object(obj, ret, zval, return_value); \
95 if (ZVAL_IS_NULL(zval)) { \
96 php_error_docref(NULL, E_WARNING, "Cannot create required DOM object"); \
97 RETURN_FALSE; \
98 }
99
100
101 PHP_MINIT_FUNCTION(xsl);
102 PHP_MSHUTDOWN_FUNCTION(xsl);
103 PHP_RINIT_FUNCTION(xsl);
104 PHP_RSHUTDOWN_FUNCTION(xsl);
105 PHP_MINFO_FUNCTION(xsl);
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128 #ifdef ZTS
129 #define XSL_G(v) TSRMG(xsl_globals_id, zend_xsl_globals *, v)
130 #else
131 #define XSL_G(v) (xsl_globals.v)
132 #endif
133
134 #endif
135
136
137
138
139
140
141
142
143
144