Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/runtime/include/exelib_api.h
5986 views
1
/*******************************************************************************
2
* Copyright (c) 1991, 2019 IBM Corp. and others
3
*
4
* This program and the accompanying materials are made available under
5
* the terms of the Eclipse Public License 2.0 which accompanies this
6
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7
* or the Apache License, Version 2.0 which accompanies this distribution and
8
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9
*
10
* This Source Code may also be made available under the following
11
* Secondary Licenses when the conditions for such availability set
12
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13
* General Public License, version 2 with the GNU Classpath
14
* Exception [1] and GNU General Public License, version 2 with the
15
* OpenJDK Assembly Exception [2].
16
*
17
* [1] https://www.gnu.org/software/classpath/license.html
18
* [2] http://openjdk.java.net/legal/assembly-exception.html
19
*
20
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
21
*******************************************************************************/
22
23
#ifndef exelib_api_h
24
#define exelib_api_h
25
26
/**
27
* @file exelib_api.h
28
* @brief Public API for the EXELIB module.
29
*
30
* This file contains public function prototypes and
31
* type definitions for the EXELIB module.
32
*/
33
34
#include "j9cfg.h"
35
#include "j9port.h"
36
#include "j9comp.h"
37
#include "jni.h"
38
#include "libhlp.h"
39
40
#ifdef __cplusplus
41
extern "C" {
42
#endif
43
44
typedef struct J9StringBuffer {
45
UDATA remaining;
46
char data[4];
47
} J9StringBuffer;
48
49
/* ---------------- libargs.c ---------------- */
50
51
/**
52
* @brief
53
* @param **vmOptionsTable
54
* @param *argv0
55
* @return I_32
56
*/
57
I_32
58
vmOptionsTableAddExeName(
59
void **vmOptionsTable,
60
char *argv0
61
);
62
63
64
/**
65
* @brief
66
* @param **vmOptionsTable
67
* @param *optionString
68
* @param *extraInfo
69
* @return I_32
70
*/
71
I_32
72
vmOptionsTableAddOption(
73
void **vmOptionsTable,
74
char *optionString,
75
void *extraInfo
76
);
77
78
79
/**
80
* @brief
81
* @param **vmOptionsTable
82
* @param *optionString
83
* @param *extraInfo
84
* @return I_32
85
*/
86
I_32
87
vmOptionsTableAddOptionWithCopy(
88
void **vmOptionsTable,
89
char *optionString,
90
void *extraInfo
91
);
92
93
94
/**
95
* @brief
96
* @param **vmOptionsTable
97
* @return void
98
*/
99
void
100
vmOptionsTableDestroy(
101
void **vmOptionsTable
102
);
103
104
105
/**
106
* @brief
107
* @param **vmOptionsTable
108
* @return int
109
*/
110
int
111
vmOptionsTableGetCount(
112
void **vmOptionsTable
113
);
114
115
116
/**
117
* @brief
118
* @param **vmOptionsTable
119
* @return JavaVMOption *
120
*/
121
JavaVMOption *
122
vmOptionsTableGetOptions(
123
void **vmOptionsTable
124
);
125
126
127
/**
128
* @brief
129
* @param *portLib
130
* @param **vmOptionsTable
131
* @param initialCount
132
* @return I_32
133
*/
134
I_32
135
vmOptionsTableInit(
136
J9PortLibrary *portLib,
137
void **vmOptionsTable,
138
int initialCount
139
);
140
141
/**
142
* This function scans for -Djava.home=xxx/jre. If found, it uses it to construct a path
143
* to redirector jvm.dll and put it in the passed in char buffer:
144
* --> [java.home]/bin/j9vm/
145
* This function is meant to be used by thrstatetest and shrtest so the test can be invoked
146
* in a sdk shape independent way.
147
*/
148
BOOLEAN
149
cmdline_fetchRedirectorDllDir(struct j9cmdlineOptions *args, char *result);
150
151
/* ---------------- libhlp.c ---------------- */
152
153
/**
154
* @brief
155
* @param *portLib
156
* @param sep
157
* @param **classPath
158
* @param *toAppend
159
* @return I_32
160
*/
161
I_32
162
main_appendToClassPath( J9PortLibrary *portLib, U_16 sep, J9StringBuffer **classPath, char *toAppend);
163
164
/**
165
* @brief
166
* @param portLib
167
* @param **finalBootLibraryPath
168
* @param *argv0
169
* @return IDATA
170
*/
171
IDATA
172
main_initializeBootLibraryPath(J9PortLibrary * portLib, J9StringBuffer **finalBootLibraryPath, char *argv0);
173
174
175
/**
176
* @brief
177
* @param *portLib
178
* @param classPath
179
* @return I_32
180
*/
181
I_32
182
main_initializeClassPath( J9PortLibrary *portLib, J9StringBuffer** classPath);
183
184
185
/**
186
* @brief
187
* @param portLib
188
* @param **finalJavaHome
189
* @param argc
190
* @param **argv
191
* @return IDATA
192
*/
193
IDATA
194
main_initializeJavaHome(J9PortLibrary * portLib, J9StringBuffer **finalJavaHome, int argc, char **argv);
195
196
197
/**
198
* @brief
199
* @param portLib
200
* @param **finalJavaLibraryPath
201
* @param *argv0
202
* @return IDATA
203
*/
204
IDATA
205
main_initializeJavaLibraryPath(J9PortLibrary * portLib, J9StringBuffer **finalJavaLibraryPath, char *argv0);
206
207
208
/**
209
* @brief
210
* @param *portLib
211
* @param sep
212
* @param **classPath
213
* @param *toPrepend
214
* @return I_32
215
*/
216
I_32
217
main_prependToClassPath( J9PortLibrary *portLib, U_16 sep, J9StringBuffer **classPath, char *toPrepend);
218
219
220
/**
221
* @brief
222
* @param env
223
* @param *mainClassName
224
* @param nameIsUTF
225
* @param java_argc
226
* @param **java_argv
227
* @param j9portLibrary
228
* @return int
229
*/
230
int
231
main_runJavaMain(JNIEnv * env, char *mainClassName, int nameIsUTF, int java_argc, char **java_argv, J9PortLibrary * j9portLibrary);
232
233
234
/**
235
* @brief
236
* @param portLib
237
* @param **argv
238
* @return void
239
*/
240
void
241
main_setNLSCatalog(J9PortLibrary * portLib, char **argv);
242
243
/**
244
* @brief
245
* @param *portLib
246
* @param *argv0
247
* @param **optionFileName
248
* @return I_32
249
*/
250
I_32
251
main_findDefaultOptionsFile(J9PortLibrary *portLib, char *argv0, char **optionFileName);
252
253
/**
254
* @brief
255
* @param void
256
* @return char *
257
*/
258
char *
259
main_vmVersionString(void);
260
261
262
/**
263
* @brief
264
* @param *portLib
265
* @param *detailString
266
* @param detailStringLength
267
* @return char *
268
*/
269
char *
270
vmDetailString( J9PortLibrary *portLib, char *detailString, UDATA detailStringLength );
271
272
273
/* ---------------- memcheck.c ---------------- */
274
275
#if (defined(J9VM_OPT_MEMORY_CHECK_SUPPORT)) /* File Level Build Flags */
276
277
/**
278
* @brief
279
* @param portLib
280
* @param *modeStr
281
* @return IDATA
282
*/
283
IDATA
284
memoryCheck_initialize(J9PortLibrary * portLib, char const *modeStr , char **argv);
285
286
287
/**
288
* @brief
289
* @param *portLibrary
290
* @param lastLegalArg
291
* @param **argv
292
* @return UDATA
293
*/
294
IDATA
295
memoryCheck_parseCmdLine( J9PortLibrary *portLibrary, UDATA lastLegalArg , char **argv );
296
297
298
/**
299
* @brief
300
* @param portLib
301
* @return void
302
*/
303
void
304
memoryCheck_print_report(J9PortLibrary * portLib);
305
306
#endif /* J9VM_OPT_MEMORY_CHECK_SUPPORT */ /* End File Level Build Flags */
307
308
/* ---------------- strbuf.c ---------------- */
309
310
struct J9PortLibrary;
311
/**
312
* @brief
313
* @param *portLibrary
314
* @param buffer
315
* @param string
316
* @return J9StringBuffer*
317
*/
318
J9StringBuffer*
319
strBufferCat(struct J9PortLibrary *portLibrary, J9StringBuffer* buffer, const char* string);
320
321
322
/**
323
* @brief
324
* @param buffer
325
* @return char*
326
*/
327
char*
328
strBufferData(J9StringBuffer* buffer);
329
330
331
struct J9PortLibrary;
332
/**
333
* @brief
334
* @param *portLibrary
335
* @param buffer
336
* @param len
337
* @return J9StringBuffer*
338
*/
339
J9StringBuffer*
340
strBufferEnsure(struct J9PortLibrary *portLibrary, J9StringBuffer* buffer, UDATA len);
341
342
343
struct J9PortLibrary;
344
/**
345
* @brief
346
* @param *portLibrary
347
* @param buffer
348
* @param string
349
* @return J9StringBuffer*
350
*/
351
J9StringBuffer*
352
strBufferPrepend(struct J9PortLibrary *portLibrary, J9StringBuffer* buffer, char* string);
353
354
355
#ifdef __cplusplus
356
}
357
#endif
358
359
#endif /* exelib_api_h */
360
361