Saxon/C  1.2.1
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  XsltProcessor *xsltProcessor;
66 };
67 
69  zend_object std;
70  Xslt30Processor *xslt30Processor;
71 };
72 
74  zend_object std;
75  XQueryProcessor *xqueryProcessor;
76 };
77 
79  zend_object std;
80  XPathProcessor *xpathProcessor;
81 };
82 
84  zend_object std;
85  SchemaValidator * schemaValidator;
86 };
87 
89  zend_object std;
90  XdmValue * xdmValue;
91 };
92 
94  zend_object std;
95  XdmItem * xdmItem;
96 };
97 
99  zend_object std;
100  XdmNode * xdmNode;
101 };
102 
104  zend_object std;
105  XdmAtomicValue * xdmAtomicValue;
106 };
107 
108 
109 #define PHP_SAXON_EXTNAME "Saxon/C"
110 #define PHP_SAXON_EXTVER "1.2.0"
111 
112 /*
113  * Class: com_saxonica_functions_extfn_PhpCall_PhpFunctionCall
114  * Method: _phpCall
115  * Signature: ([Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/Object;
116  */
117 
118 jobject JNICALL phpNativeCall
119  (JNIEnv *env, jobject object, jstring funcName, jobjectArray arguments, jobjectArray arrayTypes);
120 
121  PHP_MSHUTDOWN_FUNCTION(saxon);
122  PHP_MINFO_FUNCTION(saxon);
123  PHP_MINIT_FUNCTION(saxon);
124 
125  PHP_METHOD(SaxonProcessor, __construct);
126  PHP_METHOD(SaxonProcessor, __destruct);
127 
128  PHP_METHOD(SaxonProcessor, createAtomicValue);
129  PHP_METHOD(SaxonProcessor, parseXmlFromString);
130  PHP_METHOD(SaxonProcessor, parseXmlFromFile);
131  PHP_METHOD(SaxonProcessor, setcwd);
132 // PHP_METHOD(SaxonProcessor, importDocument);
133  PHP_METHOD(SaxonProcessor, setResourcesDirectory);
134  PHP_METHOD(SaxonProcessor, setCatalog);
135  PHP_METHOD(SaxonProcessor, registerPHPFunction);
136  // PHP_METHOD(SaxonProcessor, getXslMessages);
137  PHP_METHOD(SaxonProcessor, setConfigurationProperty);
138  PHP_METHOD(SaxonProcessor, newXsltProcessor);
139  PHP_METHOD(SaxonProcessor, newXslt30Processor);
140  PHP_METHOD(SaxonProcessor, newXQueryProcessor);
141  PHP_METHOD(SaxonProcessor, newXPathProcessor);
142  PHP_METHOD(SaxonProcessor, newSchemaValidator);
143  PHP_METHOD(SaxonProcessor, version);
144  PHP_METHOD(SaxonProcessor, isSchemaAware);
145 
146 
147 
148 
149  //PHP_METHOD(XsltProcessor, __construct);
150  PHP_METHOD(XsltProcessor, __destruct);
151  PHP_METHOD(XsltProcessor, transformFileToFile);
152  PHP_METHOD(XsltProcessor, transformFileToString);
153  PHP_METHOD(XsltProcessor, transformFileToValue);
154  PHP_METHOD(XsltProcessor, transformToString);
155  PHP_METHOD(XsltProcessor, transformToValue);
156  PHP_METHOD(XsltProcessor, transformToFile);
157  PHP_METHOD(XsltProcessor, compileFromFile);
158  PHP_METHOD(XsltProcessor, compileFromValue);
159  PHP_METHOD(XsltProcessor, compileFromString);
160  PHP_METHOD(XsltProcessor, compileFromFileAndSave);
161  PHP_METHOD(XsltProcessor, compileFromStringAndSave);
162  PHP_METHOD(XsltProcessor, setOutputFile);
163  PHP_METHOD(XsltProcessor, setSourceFromFile);
164  PHP_METHOD(XsltProcessor, setSourceFromXdmValue);
165  PHP_METHOD(XsltProcessor, setJustInTimeCompilation);
166  PHP_METHOD(XsltProcessor, setParameter);
167  PHP_METHOD(XsltProcessor, setProperty);
168  PHP_METHOD(XsltProcessor, clearParameters);
169  PHP_METHOD(XsltProcessor, clearProperties);
170  PHP_METHOD(XsltProcessor, exceptionClear);
171  PHP_METHOD(XsltProcessor, exceptionOccurred);
172  PHP_METHOD(XsltProcessor, getErrorCode);
173  PHP_METHOD(XsltProcessor, getErrorMessage);
174  PHP_METHOD(XsltProcessor, getExceptionCount);
175  PHP_METHOD(XsltProcessor, getXslMessages);
176 
177  //PHP_METHOD(Xslt30Processor, __construct);
178  PHP_METHOD(Xslt30Processor, callFunctionReturningValue);
179  PHP_METHOD(Xslt30Processor, callFunctionReturningString);
180  PHP_METHOD(Xslt30Processor, callFunctionReturningFile);
181  PHP_METHOD(Xslt30Processor, callTemplateReturningValue);
182  PHP_METHOD(Xslt30Processor, callTemplateReturningString);
183  PHP_METHOD(Xslt30Processor, callTemplateReturningFile);
184  PHP_METHOD(Xslt30Processor, applyTemplateReturningValue);
185  PHP_METHOD(Xslt30Processor, applyTemplateReturningString);
186  PHP_METHOD(Xslt30Processor, applyTemplateReturningFile);
187  PHP_METHOD(Xslt30Processor, addPackages);
188  PHP_METHOD(Xslt30Processor,setInitialTemplateParameters);
189  PHP_METHOD(Xslt30Processor, setInitialMatchSelection);
190  PHP_METHOD(Xslt30Processor, setInitialMatchSelectionAsFile);
191  PHP_METHOD(Xslt30Processor, setGlobalContextItem);
192  PHP_METHOD(Xslt30Processor, setGlobalContextFromFile);
193  PHP_METHOD(Xslt30Processor, __destruct);
194  PHP_METHOD(Xslt30Processor, transformFileToFile);
195  PHP_METHOD(Xslt30Processor, transformFileToString);
196  PHP_METHOD(Xslt30Processor, transformFileToValue);
197  PHP_METHOD(Xslt30Processor, transformToString);
198  PHP_METHOD(Xslt30Processor, transformToValue);
199  PHP_METHOD(Xslt30Processor, transformToFile);
200  PHP_METHOD(Xslt30Processor, compileFromFile);
201  PHP_METHOD(Xslt30Processor, compileFromValue);
202  PHP_METHOD(Xslt30Processor, compileFromString);
203  PHP_METHOD(Xslt30Processor, compileFromFileAndSave);
204  PHP_METHOD(Xslt30Processor, compileFromStringAndSave);
205  PHP_METHOD(Xslt30Processor, setOutputFile);
206  PHP_METHOD(Xslt30Processor, setSourceFromFile);
207  PHP_METHOD(Xslt30Processor, setSourceFromXdmValue);
208  PHP_METHOD(Xslt30Processor, setJustInTimeCompilation);
209  PHP_METHOD(Xslt30Processor, setParameter);
210  PHP_METHOD(Xslt30Processor, setProperty);
211  PHP_METHOD(Xslt30Processor, clearParameters);
212  PHP_METHOD(Xslt30Processor, clearProperties);
213  PHP_METHOD(Xslt30Processor, exceptionClear);
214  PHP_METHOD(Xslt30Processor, exceptionOccurred);
215  PHP_METHOD(Xslt30Processor, getErrorCode);
216  PHP_METHOD(Xslt30Processor, getErrorMessage);
217  PHP_METHOD(Xslt30Processor, getExceptionCount);
218  PHP_METHOD(Xslt30Processor, getXslMessages);
219 
220 
221 
222 
223  // PHP_METHOD(XQueryProcesor, __construct);
224  PHP_METHOD(XQueryProcesor, __destruct);
225  PHP_METHOD(XQueryProcessor, setQueryContent);
226  PHP_METHOD(XQueryProcessor, setContextItem);
227  PHP_METHOD(XQueryProcessor, setContextItemFromFile);
228  PHP_METHOD(XQueryProcessor, setParameter);
229  PHP_METHOD(XQueryProcessor, setProperty);
230  PHP_METHOD(XQueryProcessor, clearParameters);
231  PHP_METHOD(XQueryProcessor, clearProperties);
232  // PHP_METHOD(XQueryProcessor, setOutputFile);
233  PHP_METHOD(XQueryProcessor, runQueryToValue);
234  PHP_METHOD(XQueryProcessor, runQueryToString);
235  PHP_METHOD(XQueryProcessor, runQueryToFile);
236  PHP_METHOD(XQueryProcessor, setQueryFile);
237  PHP_METHOD(XQueryProcessor, setQueryBaseURI);
238  PHP_METHOD(XQueryProcessor, declareNamespace);
239  PHP_METHOD(XQueryProcessor, exceptionClear);
240  PHP_METHOD(XQueryProcessor, exceptionOccurred);
241  PHP_METHOD(XQueryProcessor, getErrorCode);
242  PHP_METHOD(XQueryProcessor, getErrorMessage);
243  PHP_METHOD(XQueryProcessor, getExceptionCount);
244 
245  // PHP_METHOD(XPathProcessor, __construct);
246  PHP_METHOD(XPathProcessor, __destruct);
247  PHP_METHOD(XPathProcessor, setContextItem);
248  PHP_METHOD(XPathProcessor, setContextFile);
249  PHP_METHOD(XQueryProcessor, setBaseURI);
250  PHP_METHOD(XPathProcessor, effectiveBooleanValue);
251  PHP_METHOD(XPathProcessor, evaluate);
252  PHP_METHOD(XPathProcessor, evaluateSingle);
253  PHP_METHOD(XPathProcessor, declareNamespace);
254  PHP_METHOD(XPathProcessor, setBackwardsCompatible);
255  PHP_METHOD(XPathProcessor, setCaching);
256  PHP_METHOD(XPathProcessor, importSchemaNamespace);
257  PHP_METHOD(XPathProcessor, setParameter);
258  PHP_METHOD(XPathProcessor, setProperty);
259  PHP_METHOD(XPathProcessor, clearParameters);
260  PHP_METHOD(XPathProcessor, clearProperties);
261  PHP_METHOD(XPathProcessor, exceptionClear);
262  PHP_METHOD(XPathProcessor, exceptionOccurred);
263  PHP_METHOD(XPathProcessor, getErrorCode);
264  PHP_METHOD(XPathProcessor, getErrorMessage);
265  PHP_METHOD(XPathProcessor, getExceptionCount);
266 
267 
268  // PHP_METHOD(SchemaValidator, __construct);
269  PHP_METHOD(SchemaValidator, __destruct);
270  PHP_METHOD(SchemaValidator, setSourceNode);
271  PHP_METHOD(SchemaValidator, setOutputFile);
272  PHP_METHOD(SchemaValidator, registerSchemaFromFile);
273  PHP_METHOD(SchemaValidator, registerSchemaFromString);
274  PHP_METHOD(SchemaValidator, validate);
275  PHP_METHOD(SchemaValidator, validateToNode);
276  PHP_METHOD(SchemaValidator, getValidationReport);
277  PHP_METHOD(SchemaValidator, setParameter);
278  PHP_METHOD(SchemaValidator, setProperty);
279  PHP_METHOD(SchemaValidator, clearParameters);
280  PHP_METHOD(SchemaValidator, clearProperties);
281  PHP_METHOD(SchemaValidator, exceptionClear);
282  PHP_METHOD(SchemaValidator, exceptionOccurred);
283  PHP_METHOD(SchemaValidator, getErrorCode);
284  PHP_METHOD(SchemaValidator, getErrorMessage);
285  PHP_METHOD(SchemaValidator, getExceptionCount);
286 
287 
288 /* ============== PHP Interface of XdmValue =============== */
289 
290  PHP_METHOD(XdmValue, __construct);
291  PHP_METHOD(XdmValue, __destruct);
292  PHP_METHOD(XdmValue, __toString);
293  PHP_METHOD(XdmValue, getHead);
294  PHP_METHOD(XdmValue, itemAt);
295  PHP_METHOD(XdmValue, size);
296  PHP_METHOD(XdmValue, addXdmItem);
297 
298 
299 /* ============== PHP Interface of XdmItem =============== */
300 
301  PHP_METHOD(XdmItem, __construct);
302  PHP_METHOD(XdmItem, __destruct);
303  PHP_METHOD(XdmItem, __toString);
304  PHP_METHOD(XdmItem, getStringValue);
305  PHP_METHOD(XdmItem, isAtomic);
306  PHP_METHOD(XdmItem, isNode);
307  PHP_METHOD(XdmItem, getAtomicValue);
308  PHP_METHOD(XdmItem, getNodeValue);
309 
310 /* ============== PHP Interface of XdmNode =============== */
311 
312  PHP_METHOD(XdmNode, __construct);
313  PHP_METHOD(XdmNode, __destruct);
314  PHP_METHOD(XdmNode, __toString);
315  PHP_METHOD(XdmNode, getStringValue);
316  PHP_METHOD(XdmNode, getNodeKind);
317  PHP_METHOD(XdmNode, getNodeName);
318  PHP_METHOD(XdmNode, isAtomic);
319  PHP_METHOD(XdmNode, getChildCount);
320  PHP_METHOD(XdmNode, getAttributeCount);
321  PHP_METHOD(XdmNode, getChildNode);
322  PHP_METHOD(XdmNode, getParent);
323  PHP_METHOD(XdmNode, getAttributeNode);
324  PHP_METHOD(XdmNode, getAttributeValue);
325  PHP_METHOD(XdmNode, getTypedValue);
326 
327 
328 /* ============== PHP Interface of XdmAtomicValue =============== */
329 
330  PHP_METHOD(XdmAtomicValue, __construct);
331  PHP_METHOD(XdmAtomicValue, __destruct);
332  PHP_METHOD(XdmAtomicValue, __toString);
333  PHP_METHOD(XdmAtomicValue, getStringValue);
334  PHP_METHOD(XdmAtomicValue, getBooleanValue);
335  PHP_METHOD(XdmAtomicValue, getDoubleValue);
336  PHP_METHOD(XdmAtomicValue, getLongValue);
337  PHP_METHOD(XdmAtomicValue, isAtomic);
338 
339 
340 #endif /* PHP_SAXON_H */
341 
342 
343 
344 
345 
346 
347 
348 
349 
350 
351 
352 
353 
354 
355 
356 
357 
Definition: php5_saxon.h:78
Definition: XQueryProcessor.h:26
Definition: php5_saxon.h:98
Definition: XdmAtomicValue.h:20
Definition: php5_saxon.h:58
Definition: Xslt30Processor.h:24
Definition: XdmNode.h:21
Definition: php5_saxon.h:73
Definition: SchemaValidator.h:26
Definition: XdmValue.h:46
Definition: XsltProcessor.h:24
Definition: php5_saxon.h:54
Definition: SaxonProcessor.h:296
Definition: XdmItem.h:15
Definition: php5_saxon.h:93
Definition: php5_saxon.h:68
Definition: php5_saxon.h:83
Definition: XPathProcessor.h:26
Definition: php5_saxon.h:63
Definition: php5_saxon.h:88
Definition: php5_saxon.h:103