SaxonC 12.4
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.4.2.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
142int attach_graalvm_thread(sxnc_environment *env);
143
148
149int64_t createSaxonProcessor2(graal_isolatethread_t *thread, int license);
150
157 sxnc_processor *processor, int license);
158
163const char *checkForException(sxnc_environment *environi);
164
168void graal_tear_down(graal_isolatethread_t *thread);
169
173int64_t getParameter(sxnc_parameter *parameters, int parLen, const char *name);
174
178char *getProperty(sxnc_property *properties, int propLen, const char *name);
179
183void setParameter(sxnc_parameter **parameters, int *parLen, int *parCap,
184 const char *name, sxnc_value *value);
185
189void setProperty(sxnc_property **properties, int *propLen, int *propCap,
190 const char *name, const char *value);
191
195void clearSettings(sxnc_parameter **parameters, int *parLen,
196 sxnc_property **properties, int *propLen);
197
198EXTERN_SAXONC_END
199
200#endif // SAXONCGLUE_H
void setParameter(sxnc_parameter **parameters, int *parLen, int *parCap, const char *name, sxnc_value *value)
Definition SaxonCGlue.c:157
char * _getResourceDirectory()
Definition SaxonCGlue.c:26
void setProperty(sxnc_property **properties, int *propLen, int *propCap, const char *name, const char *value)
Definition SaxonCGlue.c:183
void graal_tear_down(graal_isolatethread_t *thread)
Definition SaxonCGlue.c:122
const char * checkForException(sxnc_environment *environi)
Definition SaxonCGlue.c:117
int detach_graalvm_thread(sxnc_environment *env)
Definition SaxonCGlue.c:63
int c_createSaxonProcessor(sxnc_environment *environi, sxnc_processor *processor, int license)
Definition SaxonCGlue.c:100
void clearSettings(sxnc_parameter **parameters, int *parLen, sxnc_property **properties, int *propLen)
Definition SaxonCGlue.c:212
char * getProperty(sxnc_property *properties, int propLen, const char *name)
Definition SaxonCGlue.c:145
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:133
Definition SaxonCGlue.h:79
Definition SaxonCGlue.h:91
int64_t value
Definition SaxonCGlue.h:93
Definition SaxonCGlue.h:120
Definition SaxonCGlue.h:104
char * value
Definition SaxonCGlue.h:106
Definition SaxonCGlue.h:113
int64_t xdmvalue
Definition SaxonCGlue.h:114