SaxonC  11.4
Saxon Processor library for C/C++, PHP and Python
php5_saxon.h
1 // Copyright (c) 2014 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
7 
8 #ifndef PHP_SAXON_H
9 #define PHP_SAXON_H
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15  #include "php.h"
16  //#include "php_ini.h"
17  #include "ext/standard/info.h"
18  #include "Zend/zend_exceptions.h"
19 
20 
21 
22 #ifdef PHP_WIN32
23  #define _ALLOW_KEYWORD_MACROS
24 #endif
25 
26 #ifdef PHP_WIN32
27  #define PHP_SAXON_API __declspec(dllexport)
28  #define PHP_SAXON __declspec(dllimport)
29 //#elif define(__GNUC__) && __GNUC__ >= 4
30 //#define PHP_SAXON __attribute__ ((visibility("default")))
31 //#else
32 //#define PHP_SAXON_API
33 #endif
34 
35 #ifdef ZTS
36 #include "TSRM.h"
37 #endif
38 #ifdef __cplusplus
39 }
40 #endif
41 #include "SaxonProcessor.h"
42 #include "XdmValue.h"
43 #include "XdmItem.h"
44 #include "XdmNode.h"
45 #include "XdmAtomicValue.h"
46 /*class SaxonProcessor;
47 class XQueryProcessor;
48 class XsltProcessor;
49 class XdmValue;*/
50 
51 extern zend_module_entry saxon_module_entry;
52 #define phpext_saxon_ptr &saxon_module_entry;
53 
54 struct zvalArr {
55  zval * _val;
56 };
57 
59  zend_object std;
60  SaxonProcessor * saxonProcessor;
61 };
62 
64  zend_object std;
65  Xslt30Processor *xslt30Processor;
66 };
67 
69  zend_object std;
70  XQueryProcessor *xqueryProcessor;
71 };
72 
74  zend_object std;
75  XPathProcessor *xpathProcessor;
76 };
77 
79  zend_object std;
80  SchemaValidator * schemaValidator;
81 };
82 
84  zend_object std;
85  XdmValue * xdmValue;
86 };
87 
89  zend_object std;
90  XdmItem * xdmItem;
91 };
92 
94  zend_object std;
95  XdmNode * xdmNode;
96 };
97 
99  zend_object std;
100  XdmAtomicValue * xdmAtomicValue;
101 };
102 
103 
104 #define PHP_SAXON_EXTNAME "SaxonC"
105 #define PHP_SAXON_EXTVER "1.2.0"
106 
107 /*
108  * Class: com_saxonica_functions_extfn_PhpCall_PhpFunctionCall
109  * Method: _phpCall
110  * Signature: ([Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/Object;
111  */
112 
113 jobject JNICALL phpNativeCall
114  (JNIEnv *env, jobject object, jstring funcName, jobjectArray arguments, jobjectArray arrayTypes);
115 
116  PHP_MSHUTDOWN_FUNCTION(saxon);
117  PHP_MINFO_FUNCTION(saxon);
118  PHP_MINIT_FUNCTION(saxon);
119 
120  PHP_METHOD(SaxonProcessor, __construct);
121  PHP_METHOD(SaxonProcessor, __destruct);
122 
123  PHP_METHOD(SaxonProcessor, createAtomicValue);
124  PHP_METHOD(SaxonProcessor, parseXmlFromString);
125  PHP_METHOD(SaxonProcessor, parseXmlFromFile);
126  PHP_METHOD(SaxonProcessor, setcwd);
127 // PHP_METHOD(SaxonProcessor, importDocument);
128  PHP_METHOD(SaxonProcessor, setResourcesDirectory);
129  PHP_METHOD(SaxonProcessor, setCatalog);
130  PHP_METHOD(SaxonProcessor, registerPHPFunction);
131  // PHP_METHOD(SaxonProcessor, getXslMessages);
132  PHP_METHOD(SaxonProcessor, setConfigurationProperty);
133  PHP_METHOD(SaxonProcessor, newXsltProcessor);
134  PHP_METHOD(SaxonProcessor, newXslt30Processor);
135  PHP_METHOD(SaxonProcessor, newXQueryProcessor);
136  PHP_METHOD(SaxonProcessor, newXPathProcessor);
137  PHP_METHOD(SaxonProcessor, newSchemaValidator);
138  PHP_METHOD(SaxonProcessor, version);
139  PHP_METHOD(SaxonProcessor, isSchemaAware);
140 
141 
142  //PHP_METHOD(Xslt30Processor, __construct);
143  PHP_METHOD(Xslt30Processor, callFunctionReturningValue);
144  PHP_METHOD(Xslt30Processor, callFunctionReturningString);
145  PHP_METHOD(Xslt30Processor, callFunctionReturningFile);
146  PHP_METHOD(Xslt30Processor, callTemplateReturningValue);
147  PHP_METHOD(Xslt30Processor, callTemplateReturningString);
148  PHP_METHOD(Xslt30Processor, callTemplateReturningFile);
149  PHP_METHOD(Xslt30Processor, applyTemplateReturningValue);
150  PHP_METHOD(Xslt30Processor, applyTemplateReturningString);
151  PHP_METHOD(Xslt30Processor, applyTemplateReturningFile);
152  PHP_METHOD(Xslt30Processor, addPackages);
153  PHP_METHOD(Xslt30Processor,setInitialTemplateParameters);
154  PHP_METHOD(Xslt30Processor, setInitialMatchSelection);
155  PHP_METHOD(Xslt30Processor, setInitialMatchSelectionAsFile);
156  PHP_METHOD(Xslt30Processor, setGlobalContextItem);
157  PHP_METHOD(Xslt30Processor, setGlobalContextFromFile);
158  PHP_METHOD(Xslt30Processor, __destruct);
159  PHP_METHOD(Xslt30Processor, transformFileToFile);
160  PHP_METHOD(Xslt30Processor, transformFileToString);
161  PHP_METHOD(Xslt30Processor, transformFileToValue);
162  PHP_METHOD(Xslt30Processor, transformToString);
163  PHP_METHOD(Xslt30Processor, transformToValue);
164  PHP_METHOD(Xslt30Processor, transformToFile);
165  PHP_METHOD(Xslt30Processor, compileFromFile);
166  PHP_METHOD(Xslt30Processor, compileFromValue);
167  PHP_METHOD(Xslt30Processor, compileFromString);
168  PHP_METHOD(Xslt30Processor, compileFromFileAndSave);
169  PHP_METHOD(Xslt30Processor, compileFromStringAndSave);
170  PHP_METHOD(Xslt30Processor, setOutputFile);
171  PHP_METHOD(Xslt30Processor, setSourceFromFile);
172  PHP_METHOD(Xslt30Processor, setSourceFromXdmValue);
173  PHP_METHOD(Xslt30Processor, setJustInTimeCompilation);
174  PHP_METHOD(Xslt30Processor, setParameter);
175  PHP_METHOD(Xslt30Processor, setProperty);
176  PHP_METHOD(Xslt30Processor, clearParameters);
177  PHP_METHOD(Xslt30Processor, clearProperties);
178  PHP_METHOD(Xslt30Processor, exceptionClear);
179  PHP_METHOD(Xslt30Processor, exceptionOccurred);
180  PHP_METHOD(Xslt30Processor, getErrorCode);
181  PHP_METHOD(Xslt30Processor, getErrorMessage);
182  PHP_METHOD(Xslt30Processor, getExceptionCount);
183  PHP_METHOD(Xslt30Processor, getXslMessages);
184 
185 
186 
187 
188  // PHP_METHOD(XQueryProcesor, __construct);
189  PHP_METHOD(XQueryProcesor, __destruct);
190  PHP_METHOD(XQueryProcessor, setQueryContent);
191  PHP_METHOD(XQueryProcessor, setContextItem);
192  PHP_METHOD(XQueryProcessor, setContextItemFromFile);
193  PHP_METHOD(XQueryProcessor, setParameter);
194  PHP_METHOD(XQueryProcessor, setProperty);
195  PHP_METHOD(XQueryProcessor, clearParameters);
196  PHP_METHOD(XQueryProcessor, clearProperties);
197  // PHP_METHOD(XQueryProcessor, setOutputFile);
198  PHP_METHOD(XQueryProcessor, runQueryToValue);
199  PHP_METHOD(XQueryProcessor, runQueryToString);
200  PHP_METHOD(XQueryProcessor, runQueryToFile);
201  PHP_METHOD(XQueryProcessor, setQueryFile);
202  PHP_METHOD(XQueryProcessor, setQueryBaseURI);
203  PHP_METHOD(XQueryProcessor, declareNamespace);
204  PHP_METHOD(XQueryProcessor, exceptionClear);
205  PHP_METHOD(XQueryProcessor, exceptionOccurred);
206  PHP_METHOD(XQueryProcessor, getErrorCode);
207  PHP_METHOD(XQueryProcessor, getErrorMessage);
208  PHP_METHOD(XQueryProcessor, getExceptionCount);
209 
210  // PHP_METHOD(XPathProcessor, __construct);
211  PHP_METHOD(XPathProcessor, __destruct);
212  PHP_METHOD(XPathProcessor, setContextItem);
213  PHP_METHOD(XPathProcessor, setContextFile);
214  PHP_METHOD(XQueryProcessor, setBaseURI);
215  PHP_METHOD(XPathProcessor, effectiveBooleanValue);
216  PHP_METHOD(XPathProcessor, evaluate);
217  PHP_METHOD(XPathProcessor, evaluateSingle);
218  PHP_METHOD(XPathProcessor, declareNamespace);
219  PHP_METHOD(XPathProcessor, setBackwardsCompatible);
220  PHP_METHOD(XPathProcessor, setCaching);
221  PHP_METHOD(XPathProcessor, importSchemaNamespace);
222  PHP_METHOD(XPathProcessor, setParameter);
223  PHP_METHOD(XPathProcessor, setProperty);
224  PHP_METHOD(XPathProcessor, clearParameters);
225  PHP_METHOD(XPathProcessor, clearProperties);
226  PHP_METHOD(XPathProcessor, exceptionClear);
227  PHP_METHOD(XPathProcessor, exceptionOccurred);
228  PHP_METHOD(XPathProcessor, getErrorCode);
229  PHP_METHOD(XPathProcessor, getErrorMessage);
230  PHP_METHOD(XPathProcessor, getExceptionCount);
231 
232 
233  // PHP_METHOD(SchemaValidator, __construct);
234  PHP_METHOD(SchemaValidator, __destruct);
235  PHP_METHOD(SchemaValidator, setSourceNode);
236  PHP_METHOD(SchemaValidator, setOutputFile);
237  PHP_METHOD(SchemaValidator, registerSchemaFromFile);
238  PHP_METHOD(SchemaValidator, registerSchemaFromString);
239  PHP_METHOD(SchemaValidator, validate);
240  PHP_METHOD(SchemaValidator, validateToNode);
241  PHP_METHOD(SchemaValidator, getValidationReport);
242  PHP_METHOD(SchemaValidator, setParameter);
243  PHP_METHOD(SchemaValidator, setProperty);
244  PHP_METHOD(SchemaValidator, clearParameters);
245  PHP_METHOD(SchemaValidator, clearProperties);
246  PHP_METHOD(SchemaValidator, exceptionClear);
247  PHP_METHOD(SchemaValidator, exceptionOccurred);
248  PHP_METHOD(SchemaValidator, getErrorCode);
249  PHP_METHOD(SchemaValidator, getErrorMessage);
250  PHP_METHOD(SchemaValidator, getExceptionCount);
251 
252 
253 /* ============== PHP Interface of XdmValue =============== */
254 
255  PHP_METHOD(XdmValue, __construct);
256  PHP_METHOD(XdmValue, __destruct);
257  PHP_METHOD(XdmValue, __toString);
258  PHP_METHOD(XdmValue, getHead);
259  PHP_METHOD(XdmValue, itemAt);
260  PHP_METHOD(XdmValue, size);
261  PHP_METHOD(XdmValue, addXdmItem);
262 
263 
264 /* ============== PHP Interface of XdmItem =============== */
265 
266  PHP_METHOD(XdmItem, __construct);
267  PHP_METHOD(XdmItem, __destruct);
268  PHP_METHOD(XdmItem, __toString);
269  PHP_METHOD(XdmItem, getStringValue);
270  PHP_METHOD(XdmItem, isAtomic);
271  PHP_METHOD(XdmItem, isNode);
272  PHP_METHOD(XdmItem, getAtomicValue);
273  PHP_METHOD(XdmItem, getNodeValue);
274 
275 /* ============== PHP Interface of XdmNode =============== */
276 
277  PHP_METHOD(XdmNode, __construct);
278  PHP_METHOD(XdmNode, __destruct);
279  PHP_METHOD(XdmNode, __toString);
280  PHP_METHOD(XdmNode, getStringValue);
281  PHP_METHOD(XdmNode, getNodeKind);
282  PHP_METHOD(XdmNode, getNodeName);
283  PHP_METHOD(XdmNode, isAtomic);
284  PHP_METHOD(XdmNode, getChildCount);
285  PHP_METHOD(XdmNode, getAttributeCount);
286  PHP_METHOD(XdmNode, getChildNode);
287  PHP_METHOD(XdmNode, getParent);
288  PHP_METHOD(XdmNode, getAttributeNode);
289  PHP_METHOD(XdmNode, getAttributeValue);
290  PHP_METHOD(XdmNode, getTypedValue);
291 
292 
293 /* ============== PHP Interface of XdmAtomicValue =============== */
294 
295  PHP_METHOD(XdmAtomicValue, __construct);
296  PHP_METHOD(XdmAtomicValue, __destruct);
297  PHP_METHOD(XdmAtomicValue, __toString);
298  PHP_METHOD(XdmAtomicValue, getStringValue);
299  PHP_METHOD(XdmAtomicValue, getBooleanValue);
300  PHP_METHOD(XdmAtomicValue, getDoubleValue);
301  PHP_METHOD(XdmAtomicValue, getLongValue);
302  PHP_METHOD(XdmAtomicValue, isAtomic);
303 
304 
305 #endif /* PHP_SAXON_H */
306 
307 
308 
309 
310 
311 
312 
313 
314 
315 
316 
317 
318 
319 
320 
321 
322 
The SaxonProcessor class acts as a factory for generating XQuery, XPath, Schema and XSLT compilers.
Definition: SaxonProcessor.h:119
Definition: SchemaValidator.h:24
Definition: XPathProcessor.h:27
Definition: XQueryProcessor.h:26
Definition: XdmAtomicValue.h:26
Definition: XdmItem.h:29
Definition: XdmNode.h:31
Definition: XdmValue.h:50
Definition: Xslt30Processor.h:26
Definition: php5_saxon.h:58
Definition: php5_saxon.h:78
Definition: php5_saxon.h:98
Definition: php5_saxon.h:88
Definition: php5_saxon.h:93
Definition: php5_saxon.h:83
Definition: php5_saxon.h:73
Definition: php5_saxon.h:68
Definition: php5_saxon.h:63
Definition: php5_saxon.h:54