Project

Profile

Help

How to connect?
Download (12.2 KB) Statistics
| Branch: | Revision:

he / src / main / c / Saxon.C.API / php5_saxon.h @ 03fcd3f9

1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2
// 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.
6
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////#ifndef PHP_SAXON_H
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

    
58
struct saxonProcessor_object {
59
    zend_object std;
60
    SaxonProcessor * saxonProcessor;
61
};
62

    
63
struct xsltProcessor_object {
64
    zend_object std;
65
    XsltProcessor *xsltProcessor;
66
};
67

    
68
struct xslt30Processor_object {
69
    zend_object std;
70
    Xslt30Processor *xslt30Processor;
71
};
72

    
73
struct xqueryProcessor_object {
74
    zend_object std;
75
    XQueryProcessor *xqueryProcessor;
76
};
77

    
78
struct xpathProcessor_object {
79
    zend_object std;
80
    XPathProcessor *xpathProcessor;
81
};
82

    
83
struct schemaValidator_object {
84
    zend_object std;
85
    SchemaValidator * schemaValidator;
86
};
87

    
88
struct xdmValue_object {
89
    zend_object std;
90
    XdmValue * xdmValue;
91
};
92

    
93
struct xdmItem_object {
94
    zend_object std;
95
    XdmItem * xdmItem;
96
};
97

    
98
struct xdmNode_object {
99
    zend_object std;
100
    XdmNode * xdmNode;
101
};
102

    
103
struct xdmAtomicValue_object {
104
    zend_object std;
105
    XdmAtomicValue * xdmAtomicValue;
106
};
107

    
108

    
109
#define PHP_SAXON_EXTNAME  "saxonc"
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, setBaseOutputURI);
163
    PHP_METHOD(XsltProcessor,  setOutputFile);
164
    PHP_METHOD(XsltProcessor,  setSourceFromFile);
165
    PHP_METHOD(XsltProcessor,  setSourceFromXdmValue);
166
    PHP_METHOD(XsltProcessor,  setJustInTimeCompilation);
167
    PHP_METHOD(XsltProcessor,  setParameter);
168
    PHP_METHOD(XsltProcessor,  setProperty);
169
    PHP_METHOD(XsltProcessor,  clearParameters);
170
    PHP_METHOD(XsltProcessor,  clearProperties);
171
    PHP_METHOD(XsltProcessor,  exceptionClear);
172
    PHP_METHOD(XsltProcessor,  exceptionOccurred);
173
    PHP_METHOD(XsltProcessor,  getErrorCode);
174
    PHP_METHOD(XsltProcessor,  getErrorMessage);
175
    PHP_METHOD(XsltProcessor,  getExceptionCount);
176
    PHP_METHOD(XsltProcessor,  setupXslMessage);
177

    
178
    //PHP_METHOD(Xslt30Processor,  __construct);
179
    PHP_METHOD(Xslt30Processor, callFunctionReturningValue);
180
    PHP_METHOD(Xslt30Processor, callFunctionReturningString);
181
    PHP_METHOD(Xslt30Processor, callFunctionReturningFile);
182
    PHP_METHOD(Xslt30Processor, callTemplateReturningValue);
183
    PHP_METHOD(Xslt30Processor, callTemplateReturningString);
184
    PHP_METHOD(Xslt30Processor, callTemplateReturningFile);
185
    PHP_METHOD(Xslt30Processor, applyTemplateReturningValue);
186
    PHP_METHOD(Xslt30Processor, applyTemplateReturningString);
187
    PHP_METHOD(Xslt30Processor, applyTemplateReturningFile);
188
    PHP_METHOD(Xslt30Processor, addPackages);
189
    PHP_METHOD(Xslt30Processor,setInitialTemplateParameters);
190
    PHP_METHOD(Xslt30Processor, setInitialMatchSelection);
191
    PHP_METHOD(Xslt30Processor, setInitialMatchSelectionAsFile);
192
    PHP_METHOD(Xslt30Processor, setGlobalContextItem);
193
    PHP_METHOD(Xslt30Processor, setGlobalContextFromFile);
194
    PHP_METHOD(XsltProcessor, setBaseOutputURI);
195
    PHP_METHOD(Xslt30Processor,  __destruct);
196
    PHP_METHOD(Xslt30Processor,  transformFileToFile);
197
    PHP_METHOD(Xslt30Processor,  transformFileToString);
198
    PHP_METHOD(Xslt30Processor,  transformFileToValue);
199
    PHP_METHOD(Xslt30Processor,  transformToString);
200
    PHP_METHOD(Xslt30Processor,  transformToValue);
201
    PHP_METHOD(Xslt30Processor,  transformToFile);
202
    PHP_METHOD(Xslt30Processor, compileFromFile);
203
    PHP_METHOD(Xslt30Processor, compileFromValue);
204
    PHP_METHOD(Xslt30Processor, compileFromString);
205
    PHP_METHOD(Xslt30Processor, compileFromFileAndSave);
206
    PHP_METHOD(Xslt30Processor, compileFromStringAndSave);
207
    PHP_METHOD(Xslt30Processor,  setOutputFile);
208
    PHP_METHOD(Xslt30Processor,  setSourceFromFile);
209
    PHP_METHOD(Xslt30Processor,  setSourceFromXdmValue);
210
    PHP_METHOD(Xslt30Processor,  setJustInTimeCompilation);
211
    PHP_METHOD(Xslt30Processor,  setParameter);
212
    PHP_METHOD(Xslt30Processor,  setProperty);
213
    PHP_METHOD(Xslt30Processor,  clearParameters);
214
    PHP_METHOD(Xslt30Processor,  clearProperties);
215
    PHP_METHOD(Xslt30Processor,  exceptionClear);
216
    PHP_METHOD(Xslt30Processor,  exceptionOccurred);
217
    PHP_METHOD(Xslt30Processor,  getErrorCode);
218
    PHP_METHOD(Xslt30Processor,  getErrorMessage);
219
    PHP_METHOD(Xslt30Processor,  getExceptionCount);
220
    PHP_METHOD(Xslt30Processor,  setupXslMessage);
221

    
222

    
223

    
224

    
225
   // PHP_METHOD(XQueryProcesor,  __construct);
226
    PHP_METHOD(XQueryProcesor,  __destruct);
227
    PHP_METHOD(XQueryProcessor,  setQueryContent);
228
    PHP_METHOD(XQueryProcessor,  setContextItem);
229
    PHP_METHOD(XQueryProcessor,  setContextItemFromFile);
230
    PHP_METHOD(XQueryProcessor,  setParameter);
231
    PHP_METHOD(XQueryProcessor,  setProperty);
232
    PHP_METHOD(XQueryProcessor,  clearParameters);
233
    PHP_METHOD(XQueryProcessor,  clearProperties);
234
   // PHP_METHOD(XQueryProcessor, setOutputFile);
235
    PHP_METHOD(XQueryProcessor, runQueryToValue);
236
    PHP_METHOD(XQueryProcessor, runQueryToString);
237
    PHP_METHOD(XQueryProcessor, runQueryToFile);
238
    PHP_METHOD(XQueryProcessor, setQueryFile);
239
    PHP_METHOD(XQueryProcessor, setQueryBaseURI);
240
    PHP_METHOD(XQueryProcessor, declareNamespace);
241
    PHP_METHOD(XQueryProcessor,  exceptionClear);
242
    PHP_METHOD(XQueryProcessor,  exceptionOccurred);
243
    PHP_METHOD(XQueryProcessor,  getErrorCode);
244
    PHP_METHOD(XQueryProcessor,  getErrorMessage);
245
    PHP_METHOD(XQueryProcessor,  getExceptionCount);
246

    
247
   // PHP_METHOD(XPathProcessor,  __construct);
248
    PHP_METHOD(XPathProcessor,  __destruct);
249
    PHP_METHOD(XPathProcessor,  setContextItem);
250
    PHP_METHOD(XPathProcessor,  setContextFile);
251
    PHP_METHOD(XQueryProcessor, setBaseURI);
252
    PHP_METHOD(XPathProcessor,  effectiveBooleanValue);
253
    PHP_METHOD(XPathProcessor,  evaluate);
254
    PHP_METHOD(XPathProcessor,  evaluateSingle);
255
    PHP_METHOD(XPathProcessor, declareNamespace);
256
    PHP_METHOD(XPathProcessor, setBackwardsCompatible);
257
    PHP_METHOD(XPathProcessor, setCaching);
258
    PHP_METHOD(XPathProcessor, importSchemaNamespace);
259
    PHP_METHOD(XPathProcessor,  setParameter);
260
    PHP_METHOD(XPathProcessor,  setProperty);
261
    PHP_METHOD(XPathProcessor,  clearParameters);
262
    PHP_METHOD(XPathProcessor,  clearProperties);
263
    PHP_METHOD(XPathProcessor,  exceptionClear);
264
    PHP_METHOD(XPathProcessor,  exceptionOccurred);
265
    PHP_METHOD(XPathProcessor,  getErrorCode);
266
    PHP_METHOD(XPathProcessor,  getErrorMessage);
267
    PHP_METHOD(XPathProcessor,  getExceptionCount);
268

    
269

    
270
   // PHP_METHOD(SchemaValidator,  __construct);
271
    PHP_METHOD(SchemaValidator,  __destruct);
272
    PHP_METHOD(SchemaValidator,  setSourceNode);
273
    PHP_METHOD(SchemaValidator,  setOutputFile);
274
    PHP_METHOD(SchemaValidator,  exportSchema);
275
    PHP_METHOD(SchemaValidator, registerSchemaFromFile);
276
    PHP_METHOD(SchemaValidator, registerSchemaFromString);
277
    PHP_METHOD(SchemaValidator, validate); 
278
    PHP_METHOD(SchemaValidator, validateToNode);
279
    PHP_METHOD(SchemaValidator, getValidationReport);
280
    PHP_METHOD(SchemaValidator,  setParameter);
281
    PHP_METHOD(SchemaValidator,  setProperty);
282
    PHP_METHOD(SchemaValidator,  clearParameters);
283
    PHP_METHOD(SchemaValidator,  clearProperties);
284
    PHP_METHOD(SchemaValidator,  exceptionClear);
285
    PHP_METHOD(SchemaValidator,  exceptionOccurred);
286
    PHP_METHOD(SchemaValidator,  getErrorCode);
287
    PHP_METHOD(SchemaValidator,  getErrorMessage);
288
    PHP_METHOD(SchemaValidator,  getExceptionCount); 
289
        
290

    
291
/*     ============== PHP Interface of   XdmValue =============== */
292

    
293
    PHP_METHOD(XdmValue,  __construct);
294
    PHP_METHOD(XdmValue,  __destruct);
295
    PHP_METHOD(XdmValue,  __toString);
296
    PHP_METHOD(XdmValue,  getHead);
297
    PHP_METHOD(XdmValue,  itemAt);
298
    PHP_METHOD(XdmValue,  size);
299
    PHP_METHOD(XdmValue, addXdmItem);
300

    
301

    
302
/*     ============== PHP Interface of   XdmItem =============== */
303

    
304
    PHP_METHOD(XdmItem,  __construct);
305
    PHP_METHOD(XdmItem,  __destruct);
306
    PHP_METHOD(XdmItem,  __toString);
307
    PHP_METHOD(XdmItem,  getStringValue);
308
    PHP_METHOD(XdmItem,  isAtomic);
309
    PHP_METHOD(XdmItem,  isNode);
310
    PHP_METHOD(XdmItem,  getAtomicValue);
311
    PHP_METHOD(XdmItem,  getNodeValue);        
312

    
313
/*     ============== PHP Interface of   XdmNode =============== */
314

    
315
    PHP_METHOD(XdmNode,  __construct);
316
    PHP_METHOD(XdmNode,  __destruct);
317
    PHP_METHOD(XdmNode,  __toString);
318
    PHP_METHOD(XdmNode,  getStringValue);
319
    PHP_METHOD(XdmNode, getNodeKind);
320
    PHP_METHOD(XdmNode, getNodeName);
321
    PHP_METHOD(XdmNode,  isAtomic);
322
    PHP_METHOD(XdmNode,  getChildCount);   
323
    PHP_METHOD(XdmNode,  getAttributeCount); 
324
    PHP_METHOD(XdmNode,  getChildNode);
325
    PHP_METHOD(XdmNode,  getParent);
326
    PHP_METHOD(XdmNode,  getAttributeNode);
327
    PHP_METHOD(XdmNode,  getAttributeValue);
328
    PHP_METHOD(XdmNode,  getTypedValue);
329
    
330

    
331
/*     ============== PHP Interface of   XdmAtomicValue =============== */
332

    
333
    PHP_METHOD(XdmAtomicValue,  __construct);
334
    PHP_METHOD(XdmAtomicValue,  __destruct);
335
    PHP_METHOD(XdmAtomicValue,  __toString);
336
    PHP_METHOD(XdmAtomicValue,  getStringValue);
337
    PHP_METHOD(XdmAtomicValue,  getBooleanValue);
338
    PHP_METHOD(XdmAtomicValue,  getDoubleValue);
339
    PHP_METHOD(XdmAtomicValue,  getLongValue);
340
    PHP_METHOD(XdmAtomicValue,  isAtomic);
341

    
342

    
343
#endif /* PHP_SAXON_H */
344

    
345

    
346

    
347

    
348

    
349

    
350

    
351

    
352

    
353

    
354

    
355

    
356

    
357

    
358

    
359

    
360

    
(49-49/55)