| OLD | NEW |
| (Empty) |
| 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | |
| 2 /* ***** BEGIN LICENSE BLOCK ***** | |
| 3 * Version: NPL 1.1/GPL 2.0/LGPL 2.1 | |
| 4 * | |
| 5 * The contents of this file are subject to the Netscape Public License | |
| 6 * Version 1.1 (the "License"); you may not use this file except in | |
| 7 * compliance with the License. You may obtain a copy of the License at | |
| 8 * http://www.mozilla.org/NPL/ | |
| 9 * | |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, | |
| 11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
| 12 * for the specific language governing rights and limitations under the | |
| 13 * License. | |
| 14 * | |
| 15 * The Original Code is mozilla.org code. | |
| 16 * | |
| 17 * The Initial Developer of the Original Code is | |
| 18 * Netscape Communications Corporation. | |
| 19 * Portions created by the Initial Developer are Copyright (C) 1998 | |
| 20 * the Initial Developer. All Rights Reserved. | |
| 21 * | |
| 22 * Contributor(s): | |
| 23 * | |
| 24 * Alternatively, the contents of this file may be used under the terms of | |
| 25 * either the GNU General Public License Version 2 or later (the "GPL"), or | |
| 26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | |
| 27 * in which case the provisions of the GPL or the LGPL are applicable instead | |
| 28 * of those above. If you wish to allow use of your version of this file only | |
| 29 * under the terms of either the GPL or the LGPL, and not to allow others to | |
| 30 * use your version of this file under the terms of the NPL, indicate your | |
| 31 * decision by deleting the provisions above and replace them with the notice | |
| 32 * and other provisions required by the GPL or the LGPL. If you do not delete | |
| 33 * the provisions above, a recipient may use your version of this file under | |
| 34 * the terms of any one of the NPL, the GPL or the LGPL. | |
| 35 * | |
| 36 * ***** END LICENSE BLOCK ***** */ | |
| 37 | |
| 38 /******************************************************************************* | |
| 39 * Java Runtime Interface -- Extension Interfaces | |
| 40 ******************************************************************************/ | |
| 41 | |
| 42 #ifndef JRIEXT_H | |
| 43 #define JRIEXT_H | |
| 44 | |
| 45 #include "jri.h" | |
| 46 #include "minicom.h" | |
| 47 | |
| 48 #ifdef __cplusplus | |
| 49 extern "C" { | |
| 50 #endif | |
| 51 | |
| 52 extern const GUID JRINativePkgID; | |
| 53 | |
| 54 /******************************************************************************* | |
| 55 * Optional Embedding | |
| 56 ******************************************************************************/ | |
| 57 | |
| 58 /* Runtime */ | |
| 59 extern const GUID JRIRuntimePkgID; | |
| 60 | |
| 61 typedef struct JRIRuntimeInterface JRIRuntimeInterface; | |
| 62 typedef const JRIRuntimeInterface* JRIRuntimeInstance; | |
| 63 | |
| 64 typedef void | |
| 65 (JRI_CALLBACK* JRICollectionStartProc)(JRIRuntimeInstance* runtime); | |
| 66 | |
| 67 typedef void | |
| 68 (JRI_CALLBACK* JRICollectionEndProc)(JRIRuntimeInstance* runtime); | |
| 69 | |
| 70 /* Passed in JRIRuntimeInitargs: */ | |
| 71 typedef enum JRIVerifyMode { | |
| 72 JRIVerifyNone, | |
| 73 JRIVerifyRemote, | |
| 74 JRIVerifyAll | |
| 75 } JRIVerifyMode; | |
| 76 | |
| 77 typedef struct JRIRuntimeInitargsStruct { | |
| 78 /* Required arguments */ | |
| 79 short majorVersion; | |
| 80 short minorVersion; | |
| 81 jsize initialHeapSize; | |
| 82 jsize maxHeapSize; | |
| 83 JRICollectionStartProc collectionStartProc; | |
| 84 JRICollectionEndProc collectionEndProc; | |
| 85 JRIVerifyMode verifyMode; | |
| 86 int insideNavigator; | |
| 87 } JRIRuntimeInitargs; | |
| 88 | |
| 89 /* JRIIOMode control bits. These can be or'd together */ | |
| 90 typedef enum JRIIOModeFlags { | |
| 91 JRIIOMode_Unrestricted = ~0, | |
| 92 JRIIOMode_None = 0, | |
| 93 JRIIOMode_AllowStdin = 0x01, | |
| 94 JRIIOMode_AllowStdout = 0x02, | |
| 95 JRIIOMode_AllowSocket = 0x04, | |
| 96 JRIIOMode_AllowFileInput = 0x08, | |
| 97 JRIIOMode_AllowFileOutput = 0x10 | |
| 98 } JRIIOModeFlags; | |
| 99 | |
| 100 typedef enum JRIFSModeFlags { | |
| 101 JRIFSMode_Unrestricted, /* no C level filesystem checks */ | |
| 102 JRIFSMode_None /* no filesystem access allowed */ | |
| 103 } JRIFSModeFlags; | |
| 104 | |
| 105 typedef enum JRIRTModeFlags { | |
| 106 JRIRTMode_Unrestricted, /* no C level runtime checks */ | |
| 107 JRIRTMode_None /* no runtime access allowed */ | |
| 108 } JRIRTModeFlags; | |
| 109 | |
| 110 extern JRI_PUBLIC_API(JRIRuntimeInstance*) | |
| 111 JRI_NewRuntime(JRIRuntimeInitargs* initargs); | |
| 112 | |
| 113 typedef void | |
| 114 (*JRI_DisposeRuntime_t)(JRIRuntimeInstance* runtime); | |
| 115 | |
| 116 /* | |
| 117 ** Change the JRI io mode. The JRI io mode is the lowest level security | |
| 118 ** check done by the C implementation of the native i/o methods. | |
| 119 */ | |
| 120 typedef void | |
| 121 (*JRI_SetIOMode_t)(JRIRuntimeInstance* runtime, JRIIOModeFlags mode); | |
| 122 | |
| 123 /* | |
| 124 ** Change the JRI fs mode. The JRI fs mode is the lowest level security | |
| 125 ** check done by the C implementation of the native filesystem methods. | |
| 126 */ | |
| 127 typedef void | |
| 128 (*JRI_SetFSMode_t)(JRIRuntimeInstance* runtime, JRIFSModeFlags mode); | |
| 129 | |
| 130 /* | |
| 131 ** Change the JRI runtime mode. The JRI runtime mode is the lowest | |
| 132 ** level security check done by the C implementation of the native | |
| 133 ** runtime methods. | |
| 134 */ | |
| 135 typedef void | |
| 136 (*JRI_SetRTMode_t)(JRIRuntimeInstance* runtime, JRIRTModeFlags mode); | |
| 137 | |
| 138 /* Environments */ | |
| 139 | |
| 140 typedef JRIEnv* | |
| 141 (*JRI_NewEnv_t)(JRIRuntimeInstance* runtime, void* thread); | |
| 142 | |
| 143 typedef void | |
| 144 (*JRI_DisposeEnv_t)(JRIEnv* env); | |
| 145 | |
| 146 typedef JRIRuntimeInstance* | |
| 147 (*JRI_GetRuntime_t)(JRIEnv* env); | |
| 148 | |
| 149 typedef void* | |
| 150 (*JRI_GetThread_t)(JRIEnv* env); | |
| 151 | |
| 152 typedef void | |
| 153 (*JRI_SetClassLoader_t)(JRIEnv* env, jref classLoader); | |
| 154 | |
| 155 struct JRIRuntimeInterface { | |
| 156 MCOM_QueryInterface_t QueryInterface; | |
| 157 MCOM_AddRef_t AddRef; | |
| 158 MCOM_Release_t Release; | |
| 159 void* reserved3; | |
| 160 JRI_DisposeRuntime_t DisposeRuntime; | |
| 161 JRI_SetIOMode_t SetIOMode; | |
| 162 JRI_SetFSMode_t SetFSMode; | |
| 163 JRI_SetRTMode_t SetRTMode; | |
| 164 JRI_NewEnv_t NewEnv; | |
| 165 JRI_DisposeEnv_t DisposeEnv; | |
| 166 JRI_GetRuntime_t GetRuntime; | |
| 167 JRI_GetThread_t GetThread; | |
| 168 JRI_SetClassLoader_t SetClassLoader; | |
| 169 }; | |
| 170 | |
| 171 #define JRI_DisposeRuntime(runtime) \ | |
| 172 ((*(runtime))->DisposeRuntime(runtime)) | |
| 173 | |
| 174 /* | |
| 175 ** Change the JRI io mode. The JRI io mode is the lowest level security | |
| 176 ** check done by the C implementation of the native i/o methods. | |
| 177 */ | |
| 178 #define JRI_SetIOMode(runtime, mode) \ | |
| 179 ((*(runtime))->SetIOMode(runtime, mode)) | |
| 180 | |
| 181 /* | |
| 182 ** Change the JRI fs mode. The JRI fs mode is the lowest level security | |
| 183 ** check done by the C implementation of the native filesystem methods. | |
| 184 */ | |
| 185 #define JRI_SetFSMode(runtime, mode) \ | |
| 186 ((*(runtime))->SetFSMode(runtime, mode)) | |
| 187 | |
| 188 /* | |
| 189 ** Change the JRI runtime mode. The JRI runtime mode is the lowest | |
| 190 ** level security check done by the C implementation of the native | |
| 191 ** runtime methods. | |
| 192 */ | |
| 193 #define JRI_SetRTMode(runtime, mode) \ | |
| 194 ((*(runtime))->SetRTMode(runtime, mode)) | |
| 195 | |
| 196 /* Environments */ | |
| 197 | |
| 198 #define JRI_NewEnv(runtime, thread) \ | |
| 199 ((*(runtime))->NewEnv(runtime, thread)) | |
| 200 | |
| 201 #define JRI_DisposeEnv(env) \ | |
| 202 ((*(env))->DisposeEnv(env)) | |
| 203 | |
| 204 #define JRI_GetRuntime(env) \ | |
| 205 ((*(env))->GetRuntime(env)) | |
| 206 | |
| 207 #define JRI_GetThread(env) \ | |
| 208 ((*(env))->GetThread(env)) | |
| 209 | |
| 210 #define JRI_SetClassLoader(env, classLoader) \ | |
| 211 ((*(env))->SetClassLoader(env, classLoader)) | |
| 212 | |
| 213 /******************************************************************************* | |
| 214 * Optional Reflection | |
| 215 ******************************************************************************/ | |
| 216 | |
| 217 extern const GUID JRIReflectionPkgID; | |
| 218 | |
| 219 typedef struct JRIReflectionInterface JRIReflectionInterface; | |
| 220 typedef const JRIReflectionInterface* JRIReflectionEnv; | |
| 221 | |
| 222 typedef enum JRIAccessFlags { | |
| 223 /* Field and Method Access */ | |
| 224 JRIAccessPublic = 0x0001, | |
| 225 JRIAccessPrivate = 0x0002, | |
| 226 JRIAccessProtected = 0x0004, | |
| 227 JRIAccessStatic = 0x0008, | |
| 228 JRIAccessFinal = 0x0010, | |
| 229 JRIAccessSynchronized = 0x0020, | |
| 230 JRIAccessNative = 0x0100, | |
| 231 /* Class Access */ | |
| 232 JRIAccessInterface = 0x0200, | |
| 233 JRIAccessAbstract = 0x0400 | |
| 234 } JRIAccessFlags; | |
| 235 | |
| 236 typedef jsize | |
| 237 (*JRI_GetClassCount_t)(JRIReflectionEnv* env); | |
| 238 | |
| 239 typedef jref | |
| 240 (*JRI_GetClass_t)(JRIReflectionEnv* env, jsize index); | |
| 241 | |
| 242 typedef const char* | |
| 243 (*JRI_GetClassName_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz); | |
| 244 | |
| 245 typedef jbool | |
| 246 (*JRI_VerifyClass_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz); | |
| 247 | |
| 248 typedef jref | |
| 249 (*JRI_GetClassSuperclass_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz
); | |
| 250 | |
| 251 /* These next two routines can be used to iterate through all the | |
| 252 interfaces of a class: */ | |
| 253 | |
| 254 typedef jsize | |
| 255 (*JRI_GetClassInterfaceCount_t)(JRIReflectionEnv* env, struct java_lang_Class* c
lazz); | |
| 256 | |
| 257 typedef jref | |
| 258 (*JRI_GetClassInterface_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz,
jsize index); | |
| 259 | |
| 260 /* These next two routines can be used to iterate through all the | |
| 261 fields of a class, getting info about them: */ | |
| 262 | |
| 263 typedef jsize | |
| 264 (*JRI_GetClassFieldCount_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz
); | |
| 265 | |
| 266 typedef void | |
| 267 (*JRI_GetClassFieldInfo_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz, | |
| 268 jsize fieldIndex, char* *fiel
dName, char* *fieldSig, | |
| 269 JRIAccessFlags *fieldAccess,
jref *fieldClass); | |
| 270 | |
| 271 /* These next two routines can be used to iterate through all the | |
| 272 methods of a class, getting info about them: */ | |
| 273 | |
| 274 typedef jsize | |
| 275 (*JRI_GetClassMethodCount_t)(JRIReflectionEnv* env, struct java_lang_Class* claz
z); | |
| 276 | |
| 277 typedef void | |
| 278 (*JRI_GetClassMethodInfo_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz
, | |
| 279 jsize methodIndex, char*
*methodName, char* *methodSig, | |
| 280 JRIAccessFlags *methodAc
cess, | |
| 281 jref *methodClass, void*
*methodNativeProc); | |
| 282 | |
| 283 typedef JRIAccessFlags | |
| 284 (*JRI_GetClassAccessFlags_t)(JRIReflectionEnv* env, struct java_lang_Class* claz
z); | |
| 285 | |
| 286 /******************************************************************************/ | |
| 287 | |
| 288 struct JRIReflectionInterface { | |
| 289 MCOM_QueryInterface_t QueryInterface; | |
| 290 MCOM_AddRef_t AddRef; | |
| 291 MCOM_Release_t Release; | |
| 292 void* reserved
3; | |
| 293 JRI_GetClassCount_t GetClassCount; | |
| 294 JRI_GetClass_t GetClass; | |
| 295 JRI_GetClassName_t GetClassName; | |
| 296 JRI_VerifyClass_t VerifyClass; | |
| 297 JRI_GetClassSuperclass_t GetClassSuperclass; | |
| 298 JRI_GetClassInterfaceCount_t GetClassInterfaceCount; | |
| 299 JRI_GetClassInterface_t GetClassInterface; | |
| 300 JRI_GetClassFieldCount_t GetClassFieldCount; | |
| 301 JRI_GetClassFieldInfo_t GetClassFieldInfo; | |
| 302 JRI_GetClassMethodCount_t GetClassMethodCount; | |
| 303 JRI_GetClassMethodInfo_t GetClassMethodInfo; | |
| 304 JRI_GetClassAccessFlags_t GetClassAccessFlags; | |
| 305 }; | |
| 306 | |
| 307 #define JRI_GetClassCount(env) \ | |
| 308 ((*(env))->GetClassCount(env)) | |
| 309 | |
| 310 #define JRI_GetClass(env, index) \ | |
| 311 ((*(env))->GetClass(env, index)) | |
| 312 | |
| 313 #define JRI_GetClassName(env, clazz) \ | |
| 314 ((*(env))->GetClassName(env, clazz)) | |
| 315 | |
| 316 #define JRI_VerifyClass(env, clazz) \ | |
| 317 ((*(env))->VerifyClass(env, clazz)) | |
| 318 | |
| 319 #define JRI_GetClassSuperclass(env, clazz) \ | |
| 320 ((*(env))->GetClassSuperclass(env, clazz)) | |
| 321 | |
| 322 /* These next two routines can be used to iterate through all the | |
| 323 interfaces of a class: */ | |
| 324 | |
| 325 #define JRI_GetClassInterfaceCount(env, clazz) \ | |
| 326 ((*(env))->GetClassInterfaceCount(env, clazz)) | |
| 327 | |
| 328 #define JRI_GetClassInterface(env, clazz, index) \ | |
| 329 ((*(env))->GetClassInterface(env, clazz, index)) | |
| 330 | |
| 331 /* These next two routines can be used to iterate through all the | |
| 332 fields of a class, getting info about them: */ | |
| 333 | |
| 334 #define JRI_GetClassFieldCount(env, clazz) \ | |
| 335 ((*(env))->GetClassFieldCount(env, clazz)) | |
| 336 | |
| 337 #define JRI_GetClassFieldInfo(env, clazz, fieldIndex, fieldName, fieldSig, field
Access, fieldClass) \ | |
| 338 ((*(env))->GetClassFieldInfo(env, clazz, fieldIndex, fieldName, fieldSig
, fieldAccess, fieldClass)) | |
| 339 | |
| 340 /* These next two routines can be used to iterate through all the | |
| 341 methods of a class, getting info about them: */ | |
| 342 | |
| 343 #define JRI_GetClassMethodCount(env, clazz) \ | |
| 344 ((*(env))->GetClassMethodCount(env, clazz)) | |
| 345 | |
| 346 #define JRI_GetClassMethodInfo(env, clazz, methodIndex, methodName, methodSig, m
ethodAccess, methodClass, methodNativeProc) \ | |
| 347 ((*(env))->GetClassMethodInfo(env, clazz, methodIndex, methodName, metho
dSig, methodAccess, methodClass, methodNativeProc)) | |
| 348 | |
| 349 #define JRI_GetClassAccessFlags(env, clazz) \ | |
| 350 ((*(env))->GetClassAccessFlags(env, clazz)) | |
| 351 | |
| 352 /******************************************************************************* | |
| 353 * Optional Debugger | |
| 354 ******************************************************************************/ | |
| 355 | |
| 356 extern const GUID JRIDebuggerPkgID; | |
| 357 | |
| 358 typedef struct JRIDebuggerInterface JRIDebuggerInterface; | |
| 359 typedef const JRIDebuggerInterface* JRIDebuggerEnv; | |
| 360 | |
| 361 /* Manipulating Stacks */ | |
| 362 | |
| 363 typedef jsize | |
| 364 (*JRI_GetFrameCount_t)(JRIDebuggerEnv* env); | |
| 365 | |
| 366 typedef jbool | |
| 367 (*JRI_GetFrameInfo_t)(JRIDebuggerEnv* env, jsize frameIndex, | |
| 368 jref *methodClass, jsize *methodIndex, | |
| 369 jsize *pc, jsize *varsCount); | |
| 370 | |
| 371 typedef void | |
| 372 (*JRI_GetVarInfo_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, | |
| 373 char* *name, char* *signature, | |
| 374 jbool *isArgument, jsize *startScope, js
ize *endScope); | |
| 375 | |
| 376 #define JRIVarNotInScope ((JRIFieldID)-1) | |
| 377 | |
| 378 typedef void | |
| 379 (*JRI_GetSourceInfo_t)(JRIDebuggerEnv* env, jsize frameIndex, | |
| 380 const char* *filename, jsize *lineNumber); | |
| 381 | |
| 382 /******************************************************************************/ | |
| 383 | |
| 384 typedef jref | |
| 385 (*JRI_GetVar_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 386 | |
| 387 typedef jbool | |
| 388 (*JRI_GetVar_boolean_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 389 | |
| 390 typedef jbyte | |
| 391 (*JRI_GetVar_byte_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 392 | |
| 393 typedef jchar | |
| 394 (*JRI_GetVar_char_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 395 | |
| 396 typedef jshort | |
| 397 (*JRI_GetVar_short_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 398 | |
| 399 typedef jint | |
| 400 (*JRI_GetVar_int_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 401 | |
| 402 typedef jlong | |
| 403 (*JRI_GetVar_long_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 404 | |
| 405 typedef jfloat | |
| 406 (*JRI_GetVar_float_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 407 | |
| 408 typedef jdouble | |
| 409 (*JRI_GetVar_double_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex); | |
| 410 | |
| 411 /******************************************************************************/ | |
| 412 | |
| 413 typedef void | |
| 414 (*JRI_SetVar_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jref valu
e); | |
| 415 | |
| 416 typedef void | |
| 417 (*JRI_SetVar_boolean_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, j
bool value); | |
| 418 | |
| 419 typedef void | |
| 420 (*JRI_SetVar_byte_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jbyt
e value); | |
| 421 | |
| 422 typedef void | |
| 423 (*JRI_SetVar_char_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jcha
r value); | |
| 424 | |
| 425 typedef void | |
| 426 (*JRI_SetVar_short_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jsh
ort value); | |
| 427 | |
| 428 typedef void | |
| 429 (*JRI_SetVar_int_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jint
value); | |
| 430 | |
| 431 typedef void | |
| 432 (*JRI_SetVar_long_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jlon
g value); | |
| 433 | |
| 434 typedef void | |
| 435 (*JRI_SetVar_float_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jfl
oat value); | |
| 436 | |
| 437 typedef void | |
| 438 (*JRI_SetVar_double_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jd
ouble value); | |
| 439 | |
| 440 /******************************************************************************/ | |
| 441 | |
| 442 /* Controlling Execution */ | |
| 443 | |
| 444 typedef void | |
| 445 (*JRI_StepOver_t)(JRIDebuggerEnv* env); | |
| 446 | |
| 447 typedef void | |
| 448 (*JRI_StepIn_t)(JRIDebuggerEnv* env); | |
| 449 | |
| 450 typedef void | |
| 451 (*JRI_StepOut_t)(JRIDebuggerEnv* env); | |
| 452 | |
| 453 typedef void | |
| 454 (*JRI_Continue_t)(JRIDebuggerEnv* env); | |
| 455 | |
| 456 typedef void | |
| 457 (*JRI_Return_t)(JRIDebuggerEnv* env, jsize frameIndex, JRIValue value); | |
| 458 | |
| 459 /******************************************************************************/ | |
| 460 | |
| 461 struct JRIDebuggerInterface { | |
| 462 MCOM_QueryInterface_t QueryInterface; | |
| 463 MCOM_AddRef_t AddRef; | |
| 464 MCOM_Release_t Release; | |
| 465 void* reserved3; | |
| 466 JRI_GetFrameCount_t GetFrameCount; | |
| 467 JRI_GetFrameInfo_t GetFrameInfo; | |
| 468 JRI_GetVarInfo_t GetVarInfo; | |
| 469 JRI_GetSourceInfo_t GetSourceInfo; | |
| 470 JRI_GetVar_t GetVar; | |
| 471 JRI_GetVar_boolean_t GetVar_boolean; | |
| 472 JRI_GetVar_byte_t GetVar_byte; | |
| 473 JRI_GetVar_char_t GetVar_char; | |
| 474 JRI_GetVar_short_t GetVar_short; | |
| 475 JRI_GetVar_int_t GetVar_int; | |
| 476 JRI_GetVar_long_t GetVar_long; | |
| 477 JRI_GetVar_float_t GetVar_float; | |
| 478 JRI_GetVar_double_t GetVar_double; | |
| 479 JRI_SetVar_t SetVar; | |
| 480 JRI_SetVar_boolean_t SetVar_boolean; | |
| 481 JRI_SetVar_byte_t SetVar_byte; | |
| 482 JRI_SetVar_char_t SetVar_char; | |
| 483 JRI_SetVar_short_t SetVar_short; | |
| 484 JRI_SetVar_int_t SetVar_int; | |
| 485 JRI_SetVar_long_t SetVar_long; | |
| 486 JRI_SetVar_float_t SetVar_float; | |
| 487 JRI_SetVar_double_t SetVar_double; | |
| 488 JRI_StepOver_t StepOver; | |
| 489 JRI_StepIn_t StepIn; | |
| 490 JRI_StepOut_t StepOut; | |
| 491 JRI_Continue_t Continue; | |
| 492 JRI_Return_t Return; | |
| 493 }; | |
| 494 | |
| 495 | |
| 496 #define JRI_GetFrameCount(env) \ | |
| 497 ((*(env))->GetFrameCount(env)) | |
| 498 | |
| 499 #define JRI_GetFrameInfo(env, frameIndex, methodClass, methodIndex, pc, varsCoun
t) \ | |
| 500 ((*(env))->GetFrameInfo(env, frameIndex, methodClass, methodIndex, pc, v
arsCount)) | |
| 501 | |
| 502 #define JRI_GetVarInfo(env, frameIndex, varIndex, name, signature, pos, isArgume
nt, startScope, endScope) \ | |
| 503 ((*(env))->GetVarInfo(env, frameIndex, varIndex, name, signature, pos, i
sArgument, startScope, endScope)) | |
| 504 | |
| 505 #define JRI_GetSourceInfo(env, frameIndex, filename, lineNumber) \ | |
| 506 ((*(env))->GetSourceInfo(env, frameIndex, filename, lineNumber)) | |
| 507 | |
| 508 /******************************************************************************/ | |
| 509 | |
| 510 #define JRI_GetVar(env, frameIndex, varIndex) \ | |
| 511 ((*(env))->GetVar(env, frameIndex, varIndex)) | |
| 512 | |
| 513 #define JRI_GetVar_boolean(env, frameIndex, varIndex) \ | |
| 514 ((*(env))->GetVar_boolean(env, frameIndex, varIndex)) | |
| 515 | |
| 516 #define JRI_GetVar_byte(env, frameIndex, varIndex) \ | |
| 517 ((*(env))->GetVar_byte(env, frameIndex, varIndex)) | |
| 518 | |
| 519 #define JRI_GetVar_char(env, frameIndex, varIndex) \ | |
| 520 ((*(env))->GetVar_char(env, frameIndex, varIndex)) | |
| 521 | |
| 522 #define JRI_GetVar_short(env, frameIndex, varIndex) \ | |
| 523 ((*(env))->GetVar_short(env, frameIndex, varIndex)) | |
| 524 | |
| 525 #define JRI_GetVar_int(env, frameIndex, varIndex) \ | |
| 526 ((*(env))->GetVar_int(env, frameIndex, varIndex)) | |
| 527 | |
| 528 #define JRI_GetVar_long(env, frameIndex, varIndex) \ | |
| 529 ((*(env))->GetVar_long(env, frameIndex, varIndex)) | |
| 530 | |
| 531 #define JRI_GetVar_float(env, frameIndex, varIndex) \ | |
| 532 ((*(env))->GetVar_float(env, frameIndex, varIndex)) | |
| 533 | |
| 534 #define JRI_GetVar_double(env, frameIndex, varIndex) \ | |
| 535 ((*(env))->GetVar_double(env, frameIndex, varIndex)) | |
| 536 | |
| 537 /******************************************************************************/ | |
| 538 | |
| 539 #define JRI_SetVar(env, frameIndex, varIndex, value) \ | |
| 540 ((*(env))->SetVar(env, frameIndex, varIndex, value)) | |
| 541 | |
| 542 #define JRI_SetVar_boolean(env, frameIndex, varIndex, value) \ | |
| 543 ((*(env))->SetVar_boolean(env, frameIndex, varIndex, value)) | |
| 544 | |
| 545 #define JRI_SetVar_byte(env, frameIndex, varIndex, value) \ | |
| 546 ((*(env))->SetVar_byte(env, frameIndex, varIndex, value)) | |
| 547 | |
| 548 #define JRI_SetVar_char(env, frameIndex, varIndex, value) \ | |
| 549 ((*(env))->SetVar_char(env, frameIndex, varIndex, value)) | |
| 550 | |
| 551 #define JRI_SetVar_short(env, frameIndex, varIndex, value) \ | |
| 552 ((*(env))->SetVar_short(env, frameIndex, varIndex, value)) | |
| 553 | |
| 554 #define JRI_SetVar_int(env, frameIndex, varIndex, value) \ | |
| 555 ((*(env))->SetVar_int(env, frameIndex, varIndex, value)) | |
| 556 | |
| 557 #define JRI_SetVar_long(env, frameIndex, varIndex, value) \ | |
| 558 ((*(env))->SetVar_long(env, frameIndex, varIndex, value)) | |
| 559 | |
| 560 #define JRI_SetVar_float(env, frameIndex, varIndex, value) \ | |
| 561 ((*(env))->SetVar_float(env, frameIndex, varIndex, value)) | |
| 562 | |
| 563 #define JRI_SetVar_double(env, frameIndex, varIndex, value) \ | |
| 564 ((*(env))->SetVar_double(env, frameIndex, varIndex, value)) | |
| 565 | |
| 566 /******************************************************************************/ | |
| 567 | |
| 568 /* Controlling Execution */ | |
| 569 | |
| 570 #define JRI_StepOver(env) \ | |
| 571 ((*(env))->StepOver(env)) | |
| 572 | |
| 573 #define JRI_StepIn(env) \ | |
| 574 ((*(env))->StepIn(env)) | |
| 575 | |
| 576 #define JRI_StepOut(env) \ | |
| 577 ((*(env))->StepOut(env)) | |
| 578 | |
| 579 #define JRI_Continue(env) \ | |
| 580 ((*(env))->Continue(env)) | |
| 581 | |
| 582 #define JRI_Return(env, frameIndex, value) \ | |
| 583 ((*(env))->Return(env, frameIndex, value)) | |
| 584 | |
| 585 /******************************************************************************* | |
| 586 * Optional Compiling | |
| 587 ******************************************************************************/ | |
| 588 | |
| 589 extern const GUID JRICompilerPkgID; | |
| 590 | |
| 591 typedef struct JRICompilerInterface JRICompilerInterface; | |
| 592 typedef const JRICompilerInterface* JRICompilerEnv; | |
| 593 | |
| 594 typedef void | |
| 595 (*JRI_CompileClass_t)(JRICompilerEnv* env, | |
| 596 const char* classSrc, jsize classSrcLe
n, | |
| 597 jbyte* *resultingClassData, jsize *cla
ssDataLen); | |
| 598 | |
| 599 struct JRICompilerInterface { | |
| 600 MCOM_QueryInterface_t QueryInterface; | |
| 601 MCOM_AddRef_t AddRef; | |
| 602 MCOM_Release_t Release; | |
| 603 void* reserved3; | |
| 604 JRI_CompileClass_t CompileClass; | |
| 605 }; | |
| 606 | |
| 607 #define JRI_CompileClass(env, classSrc, classSrcLen, resultingClassData, classDa
taLen) \ | |
| 608 ((*(env))->CompileClass(env, classSrc, classSrcLen, resultingClassData,
classDataLen)) | |
| 609 | |
| 610 /******************************************************************************* | |
| 611 * Optional Expression Evaluation | |
| 612 ******************************************************************************/ | |
| 613 | |
| 614 extern const GUID JRIExprPkgID; | |
| 615 | |
| 616 typedef struct JRIExprInterface JRIExprInterface; | |
| 617 typedef const JRIExprInterface* JRIExprEnv; | |
| 618 | |
| 619 typedef jref | |
| 620 (*JRI_CompileExpr_t)(JRIExprEnv* env, | |
| 621 const char* exprSrc, jsize exprSrcLen); | |
| 622 | |
| 623 typedef jref | |
| 624 (*JRI_EvalExpr_t)(JRIExprEnv* env, jref expr); | |
| 625 | |
| 626 struct JRIExprInterface { | |
| 627 MCOM_QueryInterface_t QueryInterface; | |
| 628 MCOM_AddRef_t AddRef; | |
| 629 MCOM_Release_t Release; | |
| 630 void* reserved3; | |
| 631 JRI_CompileExpr_t CompileExpr; | |
| 632 JRI_EvalExpr_t EvalExpr; | |
| 633 }; | |
| 634 | |
| 635 #define JRI_CompileExpr(env, exprSrc, exprSrcLen) \ | |
| 636 ((*(env))->CompileExpr(env, exprSrc, exprSrcLen)) | |
| 637 | |
| 638 #define JRI_EvalExpr(env, expr) \ | |
| 639 ((*(env))->EvalExpr(env, expr)) | |
| 640 | |
| 641 /******************************************************************************/ | |
| 642 #ifdef __cplusplus | |
| 643 } | |
| 644 #endif | |
| 645 #endif /* JRIEXT_H */ | |
| 646 /******************************************************************************/ | |
| OLD | NEW |