Project

Profile

Help

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

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

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, clearConfigurationProperties);
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

    
219

    
220
   // PHP_METHOD(XQueryProcesor,  __construct);
221
    PHP_METHOD(XQueryProcesor,  __destruct);
222
    PHP_METHOD(XQueryProcessor,  setQueryContent);
223
    PHP_METHOD(XQueryProcessor,  setContextItem);
224
    PHP_METHOD(XQueryProcessor,  setContextItemFromFile);
225
    PHP_METHOD(XQueryProcessor,  setParameter);
226
    PHP_METHOD(XQueryProcessor,  setProperty);
227
    PHP_METHOD(XQueryProcessor,  clearParameters);
228
    PHP_METHOD(XQueryProcessor,  clearProperties);
229
   // PHP_METHOD(XQueryProcessor, setOutputFile);
230
    PHP_METHOD(XQueryProcessor, runQueryToValue);
231
    PHP_METHOD(XQueryProcessor, runQueryToString);
232
    PHP_METHOD(XQueryProcessor, runQueryToFile);
233
    PHP_METHOD(XQueryProcessor, setQueryFile);
234
    PHP_METHOD(XQueryProcessor, setQueryBaseURI);
235
    PHP_METHOD(XQueryProcessor, declareNamespace);
236
    PHP_METHOD(XQueryProcessor,  exceptionClear);
237
    PHP_METHOD(XQueryProcessor,  exceptionOccurred);
238
    PHP_METHOD(XQueryProcessor,  getErrorCode);
239
    PHP_METHOD(XQueryProcessor,  getErrorMessage);
240

    
241
   // PHP_METHOD(XPathProcessor,  __construct);
242
    PHP_METHOD(XPathProcessor,  __destruct);
243
    PHP_METHOD(XPathProcessor,  setContextItem);
244
    PHP_METHOD(XPathProcessor,  setContextFile);
245
    PHP_METHOD(XQueryProcessor, setBaseURI);
246
    PHP_METHOD(XPathProcessor,  effectiveBooleanValue);
247
    PHP_METHOD(XPathProcessor,  evaluate);
248
    PHP_METHOD(XPathProcessor,  evaluateSingle);
249
    PHP_METHOD(XPathProcessor, declareNamespace);
250
    PHP_METHOD(XPathProcessor, setBackwardsCompatible);
251
    PHP_METHOD(XPathProcessor, setCaching);
252
    PHP_METHOD(XPathProcessor, importSchemaNamespace);
253
    PHP_METHOD(XPathProcessor,  setParameter);
254
    PHP_METHOD(XPathProcessor,  setProperty);
255
    PHP_METHOD(XPathProcessor,  clearParameters);
256
    PHP_METHOD(XPathProcessor,  clearProperties);
257
    PHP_METHOD(XPathProcessor,  exceptionClear);
258
    PHP_METHOD(XPathProcessor,  exceptionOccurred);
259
    PHP_METHOD(XPathProcessor,  getErrorCode);
260
    PHP_METHOD(XPathProcessor,  getErrorMessage);
261

    
262

    
263
   // PHP_METHOD(SchemaValidator,  __construct);
264
    PHP_METHOD(SchemaValidator,  __destruct);
265
    PHP_METHOD(SchemaValidator,  setSourceNode);
266
    PHP_METHOD(SchemaValidator,  setOutputFile);
267
    PHP_METHOD(SchemaValidator,  exportSchema);
268
    PHP_METHOD(SchemaValidator, registerSchemaFromFile);
269
    PHP_METHOD(SchemaValidator, registerSchemaFromString);
270
    PHP_METHOD(SchemaValidator, validate); 
271
    PHP_METHOD(SchemaValidator, validateToNode);
272
    PHP_METHOD(SchemaValidator, getValidationReport);
273
    PHP_METHOD(SchemaValidator,  setParameter);
274
    PHP_METHOD(SchemaValidator,  setProperty);
275
    PHP_METHOD(SchemaValidator,  clearParameters);
276
    PHP_METHOD(SchemaValidator,  clearProperties);
277
    PHP_METHOD(SchemaValidator,  exceptionClear);
278
    PHP_METHOD(SchemaValidator,  exceptionOccurred);
279
    PHP_METHOD(SchemaValidator,  getErrorCode);
280
    PHP_METHOD(SchemaValidator,  getErrorMessage);
281
        
282

    
283
/*     ============== PHP Interface of   XdmValue =============== */
284

    
285
    PHP_METHOD(XdmValue,  __construct);
286
    PHP_METHOD(XdmValue,  __destruct);
287
    PHP_METHOD(XdmValue,  __toString);
288
    PHP_METHOD(XdmValue,  getHead);
289
    PHP_METHOD(XdmValue,  itemAt);
290
    PHP_METHOD(XdmValue,  size);
291
    PHP_METHOD(XdmValue, addXdmItem);
292

    
293

    
294
/*     ============== PHP Interface of   XdmItem =============== */
295

    
296
    PHP_METHOD(XdmItem,  __construct);
297
    PHP_METHOD(XdmItem,  __destruct);
298
    PHP_METHOD(XdmItem,  __toString);
299
    PHP_METHOD(XdmItem,  getStringValue);
300
    PHP_METHOD(XdmItem,  isAtomic);
301
    PHP_METHOD(XdmItem,  isNode);
302
    PHP_METHOD(XdmItem,  getAtomicValue);
303
    PHP_METHOD(XdmItem,  getNodeValue);        
304

    
305
/*     ============== PHP Interface of   XdmNode =============== */
306

    
307
    PHP_METHOD(XdmNode,  __construct);
308
    PHP_METHOD(XdmNode,  __destruct);
309
    PHP_METHOD(XdmNode,  __toString);
310
    PHP_METHOD(XdmNode,  getStringValue);
311
    PHP_METHOD(XdmNode, getNodeKind);
312
    PHP_METHOD(XdmNode, getNodeName);
313
    PHP_METHOD(XdmNode,  isAtomic);
314
    PHP_METHOD(XdmNode,  getChildCount);   
315
    PHP_METHOD(XdmNode,  getAttributeCount); 
316
    PHP_METHOD(XdmNode,  getChildNode);
317
    PHP_METHOD(XdmNode,  getParent);
318
    PHP_METHOD(XdmNode,  getAttributeNode);
319
    PHP_METHOD(XdmNode,  getAttributeValue);
320
    PHP_METHOD(XdmNode,  getTypedValue);
321
    
322

    
323
/*     ============== PHP Interface of   XdmAtomicValue =============== */
324

    
325
    PHP_METHOD(XdmAtomicValue,  __construct);
326
    PHP_METHOD(XdmAtomicValue,  __destruct);
327
    PHP_METHOD(XdmAtomicValue,  __toString);
328
    PHP_METHOD(XdmAtomicValue,  getStringValue);
329
    PHP_METHOD(XdmAtomicValue,  getBooleanValue);
330
    PHP_METHOD(XdmAtomicValue,  getDoubleValue);
331
    PHP_METHOD(XdmAtomicValue,  getLongValue);
332
    PHP_METHOD(XdmAtomicValue,  getPrimitiveTypeName);
333
    PHP_METHOD(XdmAtomicValue,  isAtomic);
334

    
335

    
336
#endif /* PHP_SAXON_H */
337

    
338

    
339

    
340

    
341

    
342

    
343

    
344

    
345

    
346

    
347

    
348

    
349

    
350

    
351

    
352

    
353

    
(8-8/8)