Project

Profile

Help

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

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

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 xqueryProcessor_object {
101
    XQueryProcessor *xqueryProcessor;
102
    zend_object std;
103
};
104

    
105
struct xpathProcessor_object {
106
    
107
    XPathProcessor *xpathProcessor;
108
    zend_object std;
109
};
110

    
111
struct schemaValidator_object {
112

    
113
    SchemaValidator * schemaValidator;
114
    zend_object std;
115
};
116

    
117
struct xdmValue_object {
118

    
119
    XdmValue * xdmValue;
120
    zend_object std;
121
};
122

    
123
struct xdmItem_object {
124

    
125
    XdmItem * xdmItem;
126
    zend_object std;
127
};
128

    
129
struct xdmNode_object {
130

    
131
    XdmNode * xdmNode;
132
    zend_object std;
133
};
134

    
135
struct xdmAtomicValue_object {
136

    
137
    XdmAtomicValue * xdmAtomicValue;
138
    zend_object std;
139
};
140

    
141

    
142
#define PHP_SAXON_EXTNAME  "saxonc"
143
#define PHP_SAXON_EXTVER   "1.3.0"
144

    
145
/*
146
 * Class:     com_saxonica_functions_extfn_PhpCall_PhpFunctionCall
147
 * Method:    _phpCall
148
 * Signature: ([Ljava/lang/String;[Ljava/lang/String;)Ljava/lang/Object;
149
 */
150

    
151
jobject JNICALL phpNativeCall
152
  (JNIEnv *env, jobject object, jstring funcName, jobjectArray arguments, jobjectArray arrayTypes);
153
        
154
        PHP_MSHUTDOWN_FUNCTION(saxon);
155
        PHP_MINFO_FUNCTION(saxon);
156
        PHP_MINIT_FUNCTION(saxon);
157
PHP_RINIT_FUNCTION(saxon);
158

    
159
    PHP_METHOD(SaxonProcessor,  __construct);
160
    PHP_METHOD(SaxonProcessor,  __destruct);
161

    
162
    PHP_METHOD(SaxonProcessor,  createAtomicValue);
163

    
164
    PHP_METHOD(SaxonProcessor,  createXdmMapValue);
165
    PHP_METHOD(SaxonProcessor,  createXdmArrayValue);
166
    PHP_METHOD(SaxonProcessor,  createQNameValue);
167

    
168
    PHP_METHOD(SaxonProcessor,  parseXmlFromString);
169
    PHP_METHOD(SaxonProcessor,  parseXmlFromFile);
170
    PHP_METHOD(SaxonProcessor,  setcwd);
171

    
172
    PHP_METHOD(SaxonProcessor,  setCatalog);
173
    PHP_METHOD(SaxonProcessor,  registerPHPFunctions);
174
    PHP_METHOD(SaxonProcessor,  getErrorMessage);
175
    PHP_METHOD(SaxonProcessor, setConfigurationProperty);
176
    PHP_METHOD(SaxonProcessor, clearConfigurationProperty);
177
    PHP_METHOD(SaxonProcessor, newXsltProcessor);
178
    PHP_METHOD(SaxonProcessor, newXslt30Processor);
179
    PHP_METHOD(SaxonProcessor, newXQueryProcessor);
180
    PHP_METHOD(SaxonProcessor, newXPathProcessor);
181
    PHP_METHOD(SaxonProcessor, newSchemaValidator);
182
    PHP_METHOD(SaxonProcessor,  version);
183
    PHP_METHOD(SaxonProcessor,  isSchemaAware);
184
    PHP_METHOD(SaxonProcessor,  release);
185

    
186

    
187

    
188

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

    
217

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

    
250
//new
251
    PHP_METHOD(XsltExecutable, setcwd);
252

    
253
    PHP_METHOD(XsltExecutable,  setProperty);
254
    PHP_METHOD(XsltExecutable,  clearParameters);
255
    PHP_METHOD(XsltExecutable,  clearProperties);
256
//new
257
    PHP_METHOD(XsltExecutable,  exportStylesheet);
258
    PHP_METHOD(XsltExecutable,  exceptionClear);
259
    PHP_METHOD(XsltExecutable,  exceptionOccurred);
260
    PHP_METHOD(XsltExecutable,  getErrorCode);
261
    PHP_METHOD(XsltExecutable,  getErrorMessage);
262
//new
263
    PHP_METHOD(XsltExecutable,  setupXslMessage);
264
//new
265
    PHP_METHOD(XsltExecutable,  getXslMessages);
266

    
267

    
268

    
269

    
270

    
271
   // PHP_METHOD(XQueryProcesor,  __construct);
272
    PHP_METHOD(XQueryProcesor,  __destruct);
273
    PHP_METHOD(XQueryProcessor,  setQueryContent);
274
    PHP_METHOD(XQueryProcessor,  setContextItem);
275
    PHP_METHOD(XQueryProcessor,  setContextItemFromFile);
276
    PHP_METHOD(XQueryProcessor,  setParameter);
277
    PHP_METHOD(XQueryProcessor,  setProperty);
278
    PHP_METHOD(XQueryProcessor,  clearParameters);
279
    PHP_METHOD(XQueryProcessor,  clearProperties);
280
   // PHP_METHOD(XQueryProcessor, setOutputFile);
281
    PHP_METHOD(XQueryProcessor, runQueryToValue);
282
    PHP_METHOD(XQueryProcessor, runQueryToString);
283
    PHP_METHOD(XQueryProcessor, runQueryToFile);
284
    PHP_METHOD(XQueryProcessor, setQueryFile);
285
    PHP_METHOD(XQueryProcessor, setQueryBaseURI);
286
    PHP_METHOD(XQueryProcessor, declareNamespace);
287
    PHP_METHOD(XQueryProcessor,  exceptionClear);
288
    PHP_METHOD(XQueryProcessor,  exceptionOccurred);
289
    PHP_METHOD(XQueryProcessor,  getErrorCode);
290
    PHP_METHOD(XQueryProcessor,  getErrorMessage);
291

    
292
   // PHP_METHOD(XPathProcessor,  __construct);
293
    PHP_METHOD(XPathProcessor,  __destruct);
294
    PHP_METHOD(XPathProcessor,  setContextItem);
295
    PHP_METHOD(XPathProcessor,  setContextFile);
296
    PHP_METHOD(XQueryProcessor, setBaseURI);
297
    PHP_METHOD(XPathProcessor,  effectiveBooleanValue);
298
    PHP_METHOD(XPathProcessor,  evaluate);
299
    PHP_METHOD(XPathProcessor,  evaluateSingle);
300
    PHP_METHOD(XPathProcessor, declareNamespace);
301
    PHP_METHOD(XPathProcessor, setBackwardsCompatible);
302
    PHP_METHOD(XPathProcessor, setCaching);
303
    PHP_METHOD(XPathProcessor, importSchemaNamespace);
304
    PHP_METHOD(XPathProcessor,  setParameter);
305
    PHP_METHOD(XPathProcessor,  setProperty);
306
    PHP_METHOD(XPathProcessor,  clearParameters);
307
    PHP_METHOD(XPathProcessor,  clearProperties);
308
    PHP_METHOD(XPathProcessor,  exceptionClear);
309
    PHP_METHOD(XPathProcessor,  exceptionOccurred);
310
    PHP_METHOD(XPathProcessor,  getErrorCode);
311
    PHP_METHOD(XPathProcessor,  getErrorMessage);
312

    
313

    
314
   // PHP_METHOD(SchemaValidator,  __construct);
315
    PHP_METHOD(SchemaValidator,  __destruct);
316
    PHP_METHOD(SchemaValidator,  setSourceNode);
317
    PHP_METHOD(SchemaValidator,  setOutputFile);
318
    PHP_METHOD(SchemaValidator,  exportSchema);
319
    PHP_METHOD(SchemaValidator, registerSchemaFromFile);
320
    PHP_METHOD(SchemaValidator, registerSchemaFromString);
321
    PHP_METHOD(SchemaValidator, validate); 
322
    PHP_METHOD(SchemaValidator, validateToNode);
323
    PHP_METHOD(SchemaValidator, getValidationReport);
324
    PHP_METHOD(SchemaValidator,  setParameter);
325
    PHP_METHOD(SchemaValidator,  setProperty);
326
    PHP_METHOD(SchemaValidator,  clearParameters);
327
    PHP_METHOD(SchemaValidator,  clearProperties);
328
    PHP_METHOD(SchemaValidator,  exceptionClear);
329
    PHP_METHOD(SchemaValidator,  exceptionOccurred);
330
    PHP_METHOD(SchemaValidator,  getErrorCode);
331
    PHP_METHOD(SchemaValidator,  getErrorMessage);
332
        
333

    
334
/*     ============== PHP Interface of   XdmValue =============== */
335

    
336
    PHP_METHOD(XdmValue,  __construct);
337
    PHP_METHOD(XdmValue,  __destruct);
338
    PHP_METHOD(XdmValue,  __toString);
339
    PHP_METHOD(XdmValue,  getHead);
340
    PHP_METHOD(XdmValue,  itemAt);
341
    PHP_METHOD(XdmValue,  size);
342
    PHP_METHOD(XdmValue, addXdmItem);
343

    
344

    
345
/*     ============== PHP Interface of   XdmItem =============== */
346

    
347
    PHP_METHOD(XdmItem,  __construct);
348
    PHP_METHOD(XdmItem,  __destruct);
349
    PHP_METHOD(XdmItem,  __toString);
350
    PHP_METHOD(XdmItem,  getStringValue);
351
    PHP_METHOD(XdmItem,  isAtomic);
352
    PHP_METHOD(XdmItem,  isNode);
353
    PHP_METHOD(XdmItem,  getAtomicValue);
354
    PHP_METHOD(XdmItem,  getNodeValue);        
355

    
356
/*     ============== PHP Interface of   XdmNode =============== */
357

    
358
    PHP_METHOD(XdmNode,  __construct);
359
    PHP_METHOD(XdmNode,  __destruct);
360
    PHP_METHOD(XdmNode,  __toString);
361
    PHP_METHOD(XdmNode,  getStringValue);
362
    PHP_METHOD(XdmNode, getNodeKind);
363
    PHP_METHOD(XdmNode, getNodeName);
364
    PHP_METHOD(XdmNode,  isAtomic);
365
    PHP_METHOD(XdmNode,  getChildCount);   
366
    PHP_METHOD(XdmNode,  getAttributeCount); 
367
    PHP_METHOD(XdmNode,  getChildNode);
368
    PHP_METHOD(XdmNode,  getParent);
369
    PHP_METHOD(XdmNode,  getAttributeNode);
370
    PHP_METHOD(XdmNode,  getAttributeValue);
371
    PHP_METHOD(XdmNode,  getTypedValue);
372
    
373

    
374
/*     ============== PHP Interface of   XdmAtomicValue =============== */
375

    
376
    PHP_METHOD(XdmAtomicValue,  __construct);
377
    PHP_METHOD(XdmAtomicValue,  __destruct);
378
    PHP_METHOD(XdmAtomicValue,  __toString);
379
    PHP_METHOD(XdmAtomicValue,  getStringValue);
380
    PHP_METHOD(XdmAtomicValue,  getBooleanValue);
381
    PHP_METHOD(XdmAtomicValue,  getDoubleValue);
382
    PHP_METHOD(XdmAtomicValue,  getLongValue);
383
    PHP_METHOD(XdmAtomicValue,  getPrimitiveTypeName);
384
    PHP_METHOD(XdmAtomicValue,  isAtomic);
385

    
386

    
387
#endif /* PHP_SAXON_H */
388

    
389

    
390

    
391

    
392

    
393

    
394

    
395

    
396

    
397

    
398

    
399

    
400

    
401

    
402

    
403

    
404

    
(8-8/8)