SaxonC 12.5
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
SaxonCGlue.h
Go to the documentation of this file.
1
2// Copyright (c) 2022 - 2023 Saxonica Limited.
3// This Source Code Form is subject to the terms of the Mozilla Public License,
4// v. 2.0. If a copy of the MPL was not distributed with this file, You can
5// obtain one at http://mozilla.org/MPL/2.0/. This Source Code Form is
6// "Incompatible With Secondary Licenses", as defined by the Mozilla Public
7// License, v. 2.0.
9
10#ifndef SAXONCGLUE2_H
11#define SAXONCGLUE2_H
12
13#include <libsaxon-eec-12.5.0.h>
14
15#include <stdint.h>
16#include <stdio.h>
17#if defined __linux__ || defined __APPLE__
18#include <stdlib.h>
19#include <string.h>
20#else
21#include <windows.h>
22#endif
23
24#ifdef __cplusplus
25#define EXTERN_SAXONC extern "C" {
26#define EXTERN_SAXONC_END }
27#else
28#define EXTERN_SAXONC
29#define EXTERN_SAXONC_END
30
31#endif
32
33#ifndef __cplusplus
34#ifndef _BOOL
35#include <stdbool.h>
36/*typedef unsigned char sxn_bool;
37static const sxn_bool sxn_false = 0;
38static const sxn_bool sxn_true = 1;*/
39
40#else
41// typedef bool sxn_bool;
42static const bool false = 0;
43static const bool true = 1;
44#endif
45#endif
46
47#ifndef __cplusplus
48#if defined(LICENSE)
49#define sxn_license 1
50#else
51#define sxn_license 0
52#endif
53#endif
54
55static const int SXN_EXCEPTION = -2;
56static const int SXN_UNSET = -1;
57
63//#define DEBUG
64
65EXTERN_SAXONC
66
67extern char *dllname;
68
69extern char *resources_dir;
70
71// Static variable used to track when jvm has been created. Used to prevent
72// creation more than once.
73extern int jvmCreated; // TODO this might not be required in graalvm - remove
74
75//===============================================================================================//
79typedef struct {
80 graal_isolate_t *isolate;
81 graal_isolatethread_t *thread;
82 graal_isolatethread_t *mainthread;
84
85//===============================================================================================//
86
91typedef struct {
92 char *name;
93 int64_t value;
97
98//===============================================================================================//
99
104typedef struct {
105 char *name;
106 char *value;
109
113typedef struct {
114 int64_t xdmvalue;
115} sxnc_value;
116
120typedef struct {
121 int64_t value;
123
124extern int64_t cpp;
125
126typedef void *(*allocFn)(size_t length);
127
128extern const char *failure;
129
135
141
146
151
159int64_t createSaxonProcessor2(graal_isolatethread_t *thread, int license);
160
167 sxnc_processor *processor, int license);
168
173const char *checkForException(sxnc_environment *environi);
174
178void graal_tear_down(graal_isolatethread_t *thread);
179
183int64_t getParameter(sxnc_parameter *parameters, int parLen, const char *name);
184
188char *getProperty(sxnc_property *properties, int propLen, const char *name);
189
193void setParameter(sxnc_parameter **parameters, int *parLen, int *parCap,
194 const char *name, sxnc_value *value);
195
199void setProperty(sxnc_property **properties, int *propLen, int *propCap,
200 const char *name, const char *value);
201
205void clearSettings(sxnc_parameter **parameters, int *parLen,
206 sxnc_property **properties, int *propLen);
207
208EXTERN_SAXONC_END
209
210#endif // SAXONCGLUE_H
void setParameter(sxnc_parameter **parameters, int *parLen, int *parCap, const char *name, sxnc_value *value)
Definition SaxonCGlue.c:160
char * _getResourceDirectory()
Definition SaxonCGlue.c:26
void setProperty(sxnc_property **properties, int *propLen, int *propCap, const char *name, const char *value)
Definition SaxonCGlue.c:186
void graal_tear_down(graal_isolatethread_t *thread)
Definition SaxonCGlue.c:125
const char * checkForException(sxnc_environment *environi)
Definition SaxonCGlue.c:120
int detach_graalvm_thread(sxnc_environment *env)
Definition SaxonCGlue.c:66
int c_createSaxonProcessor(sxnc_environment *environi, sxnc_processor *processor, int license)
Definition SaxonCGlue.c:103
int64_t createSaxonProcessor2(graal_isolatethread_t *thread, int license)
Definition SaxonCGlue.c:99
void clearSettings(sxnc_parameter **parameters, int *parLen, sxnc_property **properties, int *propLen)
Definition SaxonCGlue.c:215
int attach_graalvm_thread(sxnc_environment *env)
Definition SaxonCGlue.c:46
char * getProperty(sxnc_property *properties, int propLen, const char *name)
Definition SaxonCGlue.c:148
int create_graalvm_isolate(sxnc_environment *env)
Definition SaxonCGlue.c:31
int64_t getParameter(sxnc_parameter *parameters, int parLen, const char *name)
Definition SaxonCGlue.c:136
Definition SaxonCGlue.h:79
graal_isolatethread_t * thread
pointer to the current GraalVM isolate thread
Definition SaxonCGlue.h:81
graal_isolate_t * isolate
Structure representing a GraalVM isolate.
Definition SaxonCGlue.h:80
graal_isolatethread_t * mainthread
pointer to the main GraalVM isolate thread
Definition SaxonCGlue.h:82
Definition SaxonCGlue.h:91
char * name
The parameter name.
Definition SaxonCGlue.h:92
int64_t value
Definition SaxonCGlue.h:93
Definition SaxonCGlue.h:120
int64_t value
The ObjectHandle of the processor object.
Definition SaxonCGlue.h:121
Definition SaxonCGlue.h:104
char * value
Definition SaxonCGlue.h:106
char * name
The property name.
Definition SaxonCGlue.h:105
Definition SaxonCGlue.h:113
int64_t xdmvalue
Definition SaxonCGlue.h:114