Project

Profile

Help

Maintenance. Planio will be undergoing a scheduled maintenance this weekend. Between Saturday, July 24 at 9:00 UTC and Sunday, July 25, 22:00 UTC your account might observe occasional downtimes which may last up to several minutes in some cases.

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

he / src / main / c / Saxon.C.API / PHP7-Build / php_saxon.h @ 6af44631

1
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright (c) 2021 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" { //remove comment
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
#include "zend_interfaces.h"
23
#include "zend_ini.h"
24
#include "zend_closures.h"
25
#include "zend_types.h"
26
#include "SAPI.h"
27
#ifdef PHP_WIN32
28
        #define _ALLOW_KEYWORD_MACROS
29
#endif
30

    
31
#ifdef PHP_WIN32
32
        #define PHP_SAXON_API __declspec(dllexport)
33
        #define PHP_SAXON __declspec(dllimport)
34
//#elif define(__GNUC__) && __GNUC__ >= 4
35
//#define PHP_SAXON __attribute__ ((visibility("default")))
36
//#else
37
//#define PHP_SAXON_API
38
#endif
39

    
40
#ifdef ZTS
41
#include "TSRM.h"
42
#endif
43
#ifdef __cplusplus
44
//} //remove comment
45
#endif
46
#include "../SaxonProcessor.h"
47
#include "../XdmValue.h"
48
#include "../XdmItem.h"
49
#include "../XdmNode.h"
50
#include "../XdmAtomicValue.h"
51
/*class SaxonProcessor;
52
class XQueryProcessor;
53
class XsltProcessor;
54
class XdmValue;*/
55

    
56
extern zend_module_entry saxon_module_entry;
57
#define phpext_saxon_ptr &saxon_module_entry;
58

    
59
#ifdef PHP_WIN32
60
#        define PHP_SAXON_API __declspec(dllexport)
61
#elif defined(__GNUC__) && __GNUC__ >= 4
62
#        define PHP_SAXON_API __attribute__ ((visibility("default")))
63
#else
64
#        define PHP_SAXON_API
65
#endif
66

    
67
#define SAXON_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(saxon, v)
68

    
69
#if defined(ZTS) && defined(COMPILE_DL_SAXON)
70
ZEND_TSRMLS_CACHE_EXTERN()
71
#endif
72

    
73
#if PHP_MAJOR_VERSION < 7
74
#define _ZVAL_STRING(str, len) ZVAL_STRING(str, len, 0)
75
#define _RETURN_STRING(str) RETURN_STRING(str, 0)
76
#else
77
#define _ZVAL_STRING(str, len) ZVAL_STRING(str, len)
78
#define _RETURN_STRING(str) RETURN_STRING(str)
79
#endif
80

    
81

    
82

    
83

    
84
struct zvalArr {
85
    zval * _val;
86
};
87

    
88
struct saxonProcessor_object {
89

    
90
    SaxonProcessor * saxonProcessor;
91
    zend_object std;
92
};
93

    
94
struct xsltProcessor_object {
95

    
96
    XsltProcessor *xsltProcessor;
97
    zend_object std;
98
};
99

    
100
struct xsltExecutable_object {
101

    
102
    XsltExecutable *xsltExecutable;
103
    zend_object std;
104
};
105

    
106
struct xqueryProcessor_object {
107
    XQueryProcessor *xqueryProcessor;
108
    zend_object std;
109
};
110

    
111
struct xpathProcessor_object {
112
    
113
    XPathProcessor *xpathProcessor;
114
    zend_object std;
115
};
116

    
117
struct schemaValidator_object {
118

    
119
    SchemaValidator * schemaValidator;
120
    zend_object std;
121
};
122

    
123
struct xdmValue_object {
124

    
125
    XdmValue * xdmValue;
126
    zend_object std;
127
};
128

    
129
struct xdmItem_object {
130

    
131
    XdmItem * xdmItem;
132
    zend_object std;
133
};
134

    
135
struct xdmNode_object {
136

    
137
    XdmNode * xdmNode;
138
    zend_object std;
139
};
140

    
141
struct xdmAtomicValue_object {
142

    
143
    XdmAtomicValue * xdmAtomicValue;
144
    zend_object std;
145
};
146

    
147

    
148
#define PHP_SAXON_EXTNAME  "saxonc"
149
#define PHP_SAXON_EXTVER   "1.3.0"
150

    
151
/*
152
 * Class:     com_saxonica_functions_extfn_PhpCall_PhpFunctionCall
153
 * Method:    _phpCall
154
 * Signature: ([Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/Object;
155
 */
156

    
157
jobject JNICALL phpNativeCall
158
  (JNIEnv *env, jobject object, jstring funcName, jobjectArray arguments, jobjectArray arrayTypes);
159
        
160
        PHP_MSHUTDOWN_FUNCTION(saxon);
161
        PHP_MINFO_FUNCTION(saxon);
162
        PHP_MINIT_FUNCTION(saxon);
163
PHP_RINIT_FUNCTION(saxon);
164

    
165
    PHP_METHOD(SaxonProcessor,  __construct);
166
    PHP_METHOD(SaxonProcessor,  __destruct);
167

    
168
    PHP_METHOD(SaxonProcessor,  createAtomicValue);
169

    
170
    PHP_METHOD(SaxonProcessor,  createXdmMapValue);
171
    PHP_METHOD(SaxonProcessor,  createXdmArrayValue);
172
    PHP_METHOD(SaxonProcessor,  createQNameValue);
173

    
174
    PHP_METHOD(SaxonProcessor,  parseXmlFromString);
175
    PHP_METHOD(SaxonProcessor,  parseXmlFromFile);
176
    PHP_METHOD(SaxonProcessor,  setcwd);
177

    
178
    PHP_METHOD(SaxonProcessor,  setCatalog);
179
    PHP_METHOD(SaxonProcessor,  registerPHPFunctions);
180
    PHP_METHOD(SaxonProcessor,  getErrorMessage);
181
    PHP_METHOD(SaxonProcessor, setConfigurationProperty);
182
    PHP_METHOD(SaxonProcessor, clearConfigurationProperty);
183
    PHP_METHOD(SaxonProcessor, newXsltProcessor);
184
    PHP_METHOD(SaxonProcessor, newXslt30Processor);
185
    PHP_METHOD(SaxonProcessor, newXQueryProcessor);
186
    PHP_METHOD(SaxonProcessor, newXPathProcessor);
187
    PHP_METHOD(SaxonProcessor, newSchemaValidator);
188
    PHP_METHOD(SaxonProcessor,  version);
189
    PHP_METHOD(SaxonProcessor,  isSchemaAware);
190
    PHP_METHOD(SaxonProcessor,  release);
191

    
192

    
193

    
194

    
195
    //PHP_METHOD(XsltProcessor,  __construct);
196
    PHP_METHOD(XsltProcessor,  __destruct);
197
    PHP_METHOD(XsltProcessor,  transformFileToFile);
198
    PHP_METHOD(XsltProcessor,  transformFileToString);
199
    PHP_METHOD(XsltProcessor,  transformFileToValue);
200
    PHP_METHOD(XsltProcessor,  transformToString);
201
    PHP_METHOD(XsltProcessor,  transformToValue);
202
    PHP_METHOD(XsltProcessor,  transformToFile);
203
    PHP_METHOD(XsltProcessor, compileFromFile);
204
    PHP_METHOD(XsltProcessor, compileFromValue);
205
    PHP_METHOD(XsltProcessor, compileFromString);
206
    PHP_METHOD(XsltProcessor, compileFromStringAndSave);
207
    PHP_METHOD(XsltProcessor, compileFromFileAndSave);
208
    PHP_METHOD(XsltProcessor,  setOutputFile);
209
    PHP_METHOD(XsltProcessor, setBaseOutputURI);
210
    PHP_METHOD(XsltProcessor,  setSourceFromFile);
211
    PHP_METHOD(XsltProcessor,  setSourceFromXdmValue);
212
    PHP_METHOD(XsltProcessor,  setJustInTimeCompilation);
213
    PHP_METHOD(XsltProcessor,  setParameter);
214
    PHP_METHOD(XsltProcessor,  setProperty);
215
    PHP_METHOD(XsltProcessor,  clearParameters);
216
    PHP_METHOD(XsltProcessor,  clearProperties);
217
    PHP_METHOD(XsltProcessor,  exceptionClear);
218
    PHP_METHOD(XsltProcessor,  exceptionOccurred);
219
    PHP_METHOD(XsltProcessor,  getErrorCode);
220
    PHP_METHOD(XsltProcessor,  getErrorMessage);
221
    PHP_METHOD(XsltProcessor,  setupXslMessage);
222

    
223

    
224
    PHP_METHOD(XsltExecutable,  __destruct);
225
    PHP_METHOD(XsltExecutable, callFunctionReturningValue);
226
    PHP_METHOD(XsltExecutable, callFunctionReturningString);
227
    PHP_METHOD(XsltExecutable, callFunctionReturningFile);
228
    PHP_METHOD(XsltExecutable, callTemplateReturningValue);
229
    PHP_METHOD(XsltExecutable, callTemplateReturningString);
230
    PHP_METHOD(XsltExecutable, callTemplateReturningFile);
231
    PHP_METHOD(XsltExecutable, applyTemplatesReturningValue);
232
    PHP_METHOD(XsltExecutable, applyTemplatesReturningString);
233
    PHP_METHOD(XsltExecutable, applyTemplatesReturningFile);
234
    PHP_METHOD(XsltExecutable,  transformFileToFile);
235
    PHP_METHOD(XsltExecutable,  transformFileToString);
236
    PHP_METHOD(XsltExecutable,  transformFileToValue);
237
    PHP_METHOD(XsltExecutable,  transformToString);
238
    PHP_METHOD(XsltExecutable,  transformToValue);
239
    PHP_METHOD(XsltExecutable,  transformToFile);
240
    PHP_METHOD(XsltExecutable, compileFromFile);
241
    PHP_METHOD(XsltExecutable, compileFromValue);
242
    PHP_METHOD(XsltExecutable, compileFromString);
243
    PHP_METHOD(XsltExecutable, compileFromStringAndSave);
244
    PHP_METHOD(XsltExecutable, compileFromFileAndSave);
245
    PHP_METHOD(XsltExecutable, compileFromAssociatedFile);
246
    PHP_METHOD(XsltExecutable,  setOutputFile);
247
    PHP_METHOD(XsltExecutable,  setResultAsRawValue);
248
    PHP_METHOD(XsltExecutable,  setParameter);
249
    PHP_METHOD(XsltExecutable, setBaseOutputURI);
250
    PHP_METHOD(XsltExecutable, setInitialTemplateParameters);
251
    PHP_METHOD(XsltExecutable, setInitialMatchSelection);
252
    PHP_METHOD(XsltExecutable, setInitialMatchSelectionAsFile);
253
    PHP_METHOD(XsltExecutable, setGlobalContextItem);
254
    PHP_METHOD(XsltExecutable, setGlobalContextFromFile);
255

    
256
//new
257
    PHP_METHOD(XsltExecutable, setcwd);
258

    
259
    PHP_METHOD(XsltExecutable,  setProperty);
260
    PHP_METHOD(XsltExecutable,  clearParameters);
261
    PHP_METHOD(XsltExecutable,  clearProperties);
262
//new
263
    PHP_METHOD(XsltExecutable,  exportStylesheet);
264
    PHP_METHOD(XsltExecutable,  exceptionClear);
265
    PHP_METHOD(XsltExecutable,  exceptionOccurred);
266
    PHP_METHOD(XsltExecutable,  getErrorCode);
267
    PHP_METHOD(XsltExecutable,  getErrorMessage);
268
//new
269
    PHP_METHOD(XsltExecutable,  setupXslMessage);
270
//new
271
    PHP_METHOD(XsltExecutable,  getXslMessages);
272

    
273

    
274

    
275

    
276

    
277
   // PHP_METHOD(XQueryProcesor,  __construct);
278
    PHP_METHOD(XQueryProcesor,  __destruct);
279
    PHP_METHOD(XQueryProcessor,  setQueryContent);
280
    PHP_METHOD(XQueryProcessor,  setContextItem);
281
    PHP_METHOD(XQueryProcessor,  setContextItemFromFile);
282
    PHP_METHOD(XQueryProcessor,  setParameter);
283
    PHP_METHOD(XQueryProcessor,  setProperty);
284
    PHP_METHOD(XQueryProcessor,  clearParameters);
285
    PHP_METHOD(XQueryProcessor,  clearProperties);
286
   // PHP_METHOD(XQueryProcessor, setOutputFile);
287
    PHP_METHOD(XQueryProcessor, runQueryToValue);
288
    PHP_METHOD(XQueryProcessor, runQueryToString);
289
    PHP_METHOD(XQueryProcessor, runQueryToFile);
290
    PHP_METHOD(XQueryProcessor, setQueryFile);
291
    PHP_METHOD(XQueryProcessor, setQueryBaseURI);
292
    PHP_METHOD(XQueryProcessor, declareNamespace);
293
    PHP_METHOD(XQueryProcessor,  exceptionClear);
294
    PHP_METHOD(XQueryProcessor,  exceptionOccurred);
295
    PHP_METHOD(XQueryProcessor,  getErrorCode);
296
    PHP_METHOD(XQueryProcessor,  getErrorMessage);
297

    
298
   // PHP_METHOD(XPathProcessor,  __construct);
299
    PHP_METHOD(XPathProcessor,  __destruct);
300
    PHP_METHOD(XPathProcessor,  setContextItem);
301
    PHP_METHOD(XPathProcessor,  setContextFile);
302
    PHP_METHOD(XQueryProcessor, setBaseURI);
303
    PHP_METHOD(XPathProcessor,  effectiveBooleanValue);
304
    PHP_METHOD(XPathProcessor,  evaluate);
305
    PHP_METHOD(XPathProcessor,  evaluateSingle);
306
    PHP_METHOD(XPathProcessor, declareNamespace);
307
    PHP_METHOD(XPathProcessor, setBackwardsCompatible);
308
    PHP_METHOD(XPathProcessor, setCaching);
309
    PHP_METHOD(XPathProcessor, importSchemaNamespace);
310
    PHP_METHOD(XPathProcessor,  setParameter);
311
    PHP_METHOD(XPathProcessor,  setProperty);
312
    PHP_METHOD(XPathProcessor,  clearParameters);
313
    PHP_METHOD(XPathProcessor,  clearProperties);
314
    PHP_METHOD(XPathProcessor,  exceptionClear);
315
    PHP_METHOD(XPathProcessor,  exceptionOccurred);
316
    PHP_METHOD(XPathProcessor,  getErrorCode);
317
    PHP_METHOD(XPathProcessor,  getErrorMessage);
318

    
319

    
320
   // PHP_METHOD(SchemaValidator,  __construct);
321
    PHP_METHOD(SchemaValidator,  __destruct);
322
    PHP_METHOD(SchemaValidator,  setSourceNode);
323
    PHP_METHOD(SchemaValidator,  setOutputFile);
324
    PHP_METHOD(SchemaValidator,  exportSchema);
325
    PHP_METHOD(SchemaValidator, registerSchemaFromFile);
326
    PHP_METHOD(SchemaValidator, registerSchemaFromString);
327
    PHP_METHOD(SchemaValidator, validate); 
328
    PHP_METHOD(SchemaValidator, validateToNode);
329
    PHP_METHOD(SchemaValidator, getValidationReport);
330
    PHP_METHOD(SchemaValidator,  setParameter);
331
    PHP_METHOD(SchemaValidator,  setProperty);
332
    PHP_METHOD(SchemaValidator,  clearParameters);
333
    PHP_METHOD(SchemaValidator,  clearProperties);
334
    PHP_METHOD(SchemaValidator,  exceptionClear);
335
    PHP_METHOD(SchemaValidator,  exceptionOccurred);
336
    PHP_METHOD(SchemaValidator,  getErrorCode);
337
    PHP_METHOD(SchemaValidator,  getErrorMessage);
338
        
339

    
340
/*     ============== PHP Interface of   XdmValue =============== */
341

    
342
    PHP_METHOD(XdmValue,  __construct);
343
    PHP_METHOD(XdmValue,  __destruct);
344
    PHP_METHOD(XdmValue,  __toString);
345
    PHP_METHOD(XdmValue,  getHead);
346
    PHP_METHOD(XdmValue,  itemAt);
347
    PHP_METHOD(XdmValue,  size);
348
    PHP_METHOD(XdmValue, addXdmItem);
349

    
350

    
351
/*     ============== PHP Interface of   XdmItem =============== */
352

    
353
    PHP_METHOD(XdmItem,  __construct);
354
    PHP_METHOD(XdmItem,  __destruct);
355
    PHP_METHOD(XdmItem,  __toString);
356
    PHP_METHOD(XdmItem,  getStringValue);
357
    PHP_METHOD(XdmItem,  isAtomic);
358
    PHP_METHOD(XdmItem,  isNode);
359
    PHP_METHOD(XdmItem,  getAtomicValue);
360
    PHP_METHOD(XdmItem,  getNodeValue);        
361

    
362
/*     ============== PHP Interface of   XdmNode =============== */
363

    
364
    PHP_METHOD(XdmNode,  __construct);
365
    PHP_METHOD(XdmNode,  __destruct);
366
    PHP_METHOD(XdmNode,  __toString);
367
    PHP_METHOD(XdmNode,  getStringValue);
368
    PHP_METHOD(XdmNode, getNodeKind);
369
    PHP_METHOD(XdmNode, getNodeName);
370
    PHP_METHOD(XdmNode,  isAtomic);
371
    PHP_METHOD(XdmNode,  getChildCount);   
372
    PHP_METHOD(XdmNode,  getAttributeCount); 
373
    PHP_METHOD(XdmNode,  getChildNode);
374
    PHP_METHOD(XdmNode,  getParent);
375
    PHP_METHOD(XdmNode,  getAttributeNode);
376
    PHP_METHOD(XdmNode,  getAttributeValue);
377
    PHP_METHOD(XdmNode,  getTypedValue);
378
    
379

    
380
/*     ============== PHP Interface of   XdmAtomicValue =============== */
381

    
382
    PHP_METHOD(XdmAtomicValue,  __construct);
383
    PHP_METHOD(XdmAtomicValue,  __destruct);
384
    PHP_METHOD(XdmAtomicValue,  __toString);
385
    PHP_METHOD(XdmAtomicValue,  getStringValue);
386
    PHP_METHOD(XdmAtomicValue,  getBooleanValue);
387
    PHP_METHOD(XdmAtomicValue,  getDoubleValue);
388
    PHP_METHOD(XdmAtomicValue,  getLongValue);
389
    PHP_METHOD(XdmAtomicValue,  getPrimitiveTypeName);
390
    PHP_METHOD(XdmAtomicValue,  isAtomic);
391

    
392

    
393
#endif /* PHP_SAXON_H */
394

    
395

    
396

    
397

    
398

    
399

    
400

    
401

    
402

    
403

    
404

    
405

    
406

    
407

    
408

    
409

    
410

    
(8-8/8)