Back to index

lightning-sunbird  0.9+nobinonly
jriext.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 /*******************************************************************************
00039  * Java Runtime Interface -- Extension Interfaces
00040  ******************************************************************************/
00041  
00042 #ifndef JRIEXT_H
00043 #define JRIEXT_H
00044 
00045 #include "jri.h"
00046 #include "minicom.h"
00047 
00048 #ifdef __cplusplus
00049 extern "C" {
00050 #endif
00051 
00052 extern const GUID JRINativePkgID;
00053 
00054 /*******************************************************************************
00055  * Optional Embedding
00056  ******************************************************************************/
00057 
00058 /* Runtime */
00059 extern const GUID JRIRuntimePkgID;
00060 
00061 typedef struct JRIRuntimeInterface        JRIRuntimeInterface;
00062 typedef const JRIRuntimeInterface*        JRIRuntimeInstance;
00063 
00064 typedef void
00065 (JRI_CALLBACK* JRICollectionStartProc)(JRIRuntimeInstance* runtime);
00066 
00067 typedef void
00068 (JRI_CALLBACK* JRICollectionEndProc)(JRIRuntimeInstance* runtime);
00069 
00070 /* Passed in JRIRuntimeInitargs: */
00071 typedef enum JRIVerifyMode {
00072     JRIVerifyNone,
00073     JRIVerifyRemote,
00074     JRIVerifyAll
00075 } JRIVerifyMode;
00076 
00077 typedef struct JRIRuntimeInitargsStruct {
00078     /* Required arguments */
00079     short                                 majorVersion;
00080     short                                 minorVersion;
00081     jsize                                 initialHeapSize;
00082     jsize                                 maxHeapSize;
00083     JRICollectionStartProc  collectionStartProc;
00084     JRICollectionEndProc    collectionEndProc;
00085     JRIVerifyMode                  verifyMode;
00086     int                     insideNavigator;
00087 } JRIRuntimeInitargs;
00088 
00089 /* JRIIOMode control bits. These can be or'd together */
00090 typedef enum JRIIOModeFlags {
00091     JRIIOMode_Unrestricted         = ~0,
00092     JRIIOMode_None                        = 0,
00093     JRIIOMode_AllowStdin           = 0x01,
00094     JRIIOMode_AllowStdout          = 0x02,
00095     JRIIOMode_AllowSocket          = 0x04,
00096     JRIIOMode_AllowFileInput       = 0x08,
00097     JRIIOMode_AllowFileOutput      = 0x10
00098 } JRIIOModeFlags;
00099 
00100 typedef enum JRIFSModeFlags {
00101     JRIFSMode_Unrestricted, /* no C level filesystem checks */
00102     JRIFSMode_None          /* no filesystem access allowed */
00103 } JRIFSModeFlags;
00104 
00105 typedef enum JRIRTModeFlags {
00106     JRIRTMode_Unrestricted, /* no C level runtime checks */
00107     JRIRTMode_None          /* no runtime access allowed */
00108 } JRIRTModeFlags;
00109 
00110 extern JRI_PUBLIC_API(JRIRuntimeInstance*)
00111 JRI_NewRuntime(JRIRuntimeInitargs* initargs);
00112 
00113 typedef void
00114 (*JRI_DisposeRuntime_t)(JRIRuntimeInstance* runtime);
00115 
00116 /*
00117 ** Change the JRI io mode. The JRI io mode is the lowest level security
00118 ** check done by the C implementation of the native i/o methods.
00119 */
00120 typedef void
00121 (*JRI_SetIOMode_t)(JRIRuntimeInstance* runtime, JRIIOModeFlags mode);
00122 
00123 /*
00124 ** Change the JRI fs mode. The JRI fs mode is the lowest level security
00125 ** check done by the C implementation of the native filesystem methods.
00126 */
00127 typedef void
00128 (*JRI_SetFSMode_t)(JRIRuntimeInstance* runtime, JRIFSModeFlags mode);
00129 
00130 /*
00131 ** Change the JRI runtime mode. The JRI runtime mode is the lowest
00132 ** level security check done by the C implementation of the native
00133 ** runtime methods.
00134 */
00135 typedef void
00136 (*JRI_SetRTMode_t)(JRIRuntimeInstance* runtime, JRIRTModeFlags mode);
00137 
00138 /* Environments */
00139 
00140 typedef JRIEnv*
00141 (*JRI_NewEnv_t)(JRIRuntimeInstance* runtime, void* thread);
00142 
00143 typedef void
00144 (*JRI_DisposeEnv_t)(JRIEnv* env);
00145 
00146 typedef JRIRuntimeInstance*
00147 (*JRI_GetRuntime_t)(JRIEnv* env);
00148 
00149 typedef void*
00150 (*JRI_GetThread_t)(JRIEnv* env);
00151 
00152 typedef void
00153 (*JRI_SetClassLoader_t)(JRIEnv* env, jref classLoader);
00154 
00155 struct JRIRuntimeInterface {
00156     MCOM_QueryInterface_t          QueryInterface;
00157     MCOM_AddRef_t                         AddRef;
00158     MCOM_Release_t                        Release;
00159        void*                                     reserved3;
00160        JRI_DisposeRuntime_t        DisposeRuntime;
00161        JRI_SetIOMode_t                           SetIOMode;
00162        JRI_SetFSMode_t                           SetFSMode;
00163        JRI_SetRTMode_t                           SetRTMode;
00164        JRI_NewEnv_t                       NewEnv;
00165        JRI_DisposeEnv_t                   DisposeEnv;
00166        JRI_GetRuntime_t                   GetRuntime;
00167        JRI_GetThread_t                           GetThread;
00168        JRI_SetClassLoader_t        SetClassLoader;
00169 };
00170 
00171 #define JRI_DisposeRuntime(runtime)              \
00172        ((*(runtime))->DisposeRuntime(runtime))
00173 
00174 /*
00175 ** Change the JRI io mode. The JRI io mode is the lowest level security
00176 ** check done by the C implementation of the native i/o methods.
00177 */
00178 #define JRI_SetIOMode(runtime, mode)             \
00179        ((*(runtime))->SetIOMode(runtime, mode))
00180 
00181 /*
00182 ** Change the JRI fs mode. The JRI fs mode is the lowest level security
00183 ** check done by the C implementation of the native filesystem methods.
00184 */
00185 #define JRI_SetFSMode(runtime, mode)             \
00186        ((*(runtime))->SetFSMode(runtime, mode))
00187 
00188 /*
00189 ** Change the JRI runtime mode. The JRI runtime mode is the lowest
00190 ** level security check done by the C implementation of the native
00191 ** runtime methods.
00192 */
00193 #define JRI_SetRTMode(runtime, mode)             \
00194        ((*(runtime))->SetRTMode(runtime, mode))
00195 
00196 /* Environments */
00197 
00198 #define JRI_NewEnv(runtime, thread)       \
00199        ((*(runtime))->NewEnv(runtime, thread))
00200 
00201 #define JRI_DisposeEnv(env) \
00202        ((*(env))->DisposeEnv(env))
00203 
00204 #define JRI_GetRuntime(env) \
00205        ((*(env))->GetRuntime(env))
00206 
00207 #define JRI_GetThread(env)         \
00208        ((*(env))->GetThread(env))
00209 
00210 #define JRI_SetClassLoader(env, classLoader)            \
00211        ((*(env))->SetClassLoader(env, classLoader))
00212 
00213 /*******************************************************************************
00214  * Optional Reflection
00215  ******************************************************************************/
00216 
00217 extern const GUID JRIReflectionPkgID;
00218 
00219 typedef struct JRIReflectionInterface     JRIReflectionInterface;
00220 typedef const JRIReflectionInterface*     JRIReflectionEnv;
00221 
00222 typedef enum JRIAccessFlags {
00223     /* Field and Method Access */
00224     JRIAccessPublic                = 0x0001,
00225     JRIAccessPrivate        = 0x0002,
00226     JRIAccessProtected             = 0x0004,
00227     JRIAccessStatic                = 0x0008,
00228     JRIAccessFinal                 = 0x0010,
00229     JRIAccessSynchronized   = 0x0020,
00230     JRIAccessNative                = 0x0100,
00231     /* Class Access */
00232     JRIAccessInterface             = 0x0200,
00233     JRIAccessAbstract              = 0x0400
00234 } JRIAccessFlags;
00235 
00236 typedef jsize
00237 (*JRI_GetClassCount_t)(JRIReflectionEnv* env);
00238 
00239 typedef jref
00240 (*JRI_GetClass_t)(JRIReflectionEnv* env, jsize index);
00241 
00242 typedef const char*
00243 (*JRI_GetClassName_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz);
00244 
00245 typedef jbool
00246 (*JRI_VerifyClass_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz);
00247 
00248 typedef jref
00249 (*JRI_GetClassSuperclass_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz);
00250 
00251 /* These next two routines can be used to iterate through all the
00252    interfaces of a class: */
00253 
00254 typedef jsize
00255 (*JRI_GetClassInterfaceCount_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz);
00256 
00257 typedef jref
00258 (*JRI_GetClassInterface_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz, jsize index);
00259 
00260 /* These next two routines can be used to iterate through all the
00261    fields of a class, getting info about them: */
00262 
00263 typedef jsize
00264 (*JRI_GetClassFieldCount_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz);
00265 
00266 typedef void
00267 (*JRI_GetClassFieldInfo_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz,
00268                                              jsize fieldIndex, char* *fieldName, char* *fieldSig, 
00269                                              JRIAccessFlags *fieldAccess, jref *fieldClass);
00270 
00271 /* These next two routines can be used to iterate through all the
00272    methods of a class, getting info about them: */
00273 
00274 typedef jsize
00275 (*JRI_GetClassMethodCount_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz);
00276 
00277 typedef void
00278 (*JRI_GetClassMethodInfo_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz,
00279                                                  jsize methodIndex, char* *methodName, char* *methodSig, 
00280                                                  JRIAccessFlags *methodAccess,
00281                                                  jref *methodClass, void* *methodNativeProc);
00282 
00283 typedef JRIAccessFlags
00284 (*JRI_GetClassAccessFlags_t)(JRIReflectionEnv* env, struct java_lang_Class* clazz);
00285 
00286 /******************************************************************************/
00287 
00288 struct JRIReflectionInterface {
00289     MCOM_QueryInterface_t                        QueryInterface;
00290     MCOM_AddRef_t                                       AddRef;
00291     MCOM_Release_t                                      Release;
00292        void*                                                   reserved3;
00293        JRI_GetClassCount_t                              GetClassCount;
00294        JRI_GetClass_t                                          GetClass;
00295        JRI_GetClassName_t                               GetClassName;
00296        JRI_VerifyClass_t                                VerifyClass;
00297        JRI_GetClassSuperclass_t                  GetClassSuperclass;
00298        JRI_GetClassInterfaceCount_t              GetClassInterfaceCount;
00299        JRI_GetClassInterface_t                          GetClassInterface;
00300        JRI_GetClassFieldCount_t                  GetClassFieldCount;
00301        JRI_GetClassFieldInfo_t                          GetClassFieldInfo;
00302        JRI_GetClassMethodCount_t                 GetClassMethodCount;
00303        JRI_GetClassMethodInfo_t                  GetClassMethodInfo;
00304        JRI_GetClassAccessFlags_t                 GetClassAccessFlags;
00305 };
00306 
00307 #define JRI_GetClassCount(env)     \
00308        ((*(env))->GetClassCount(env))
00309 
00310 #define JRI_GetClass(env, index)   \
00311        ((*(env))->GetClass(env, index))
00312 
00313 #define JRI_GetClassName(env, clazz)             \
00314        ((*(env))->GetClassName(env, clazz))
00315 
00316 #define JRI_VerifyClass(env, clazz)              \
00317        ((*(env))->VerifyClass(env, clazz))
00318 
00319 #define JRI_GetClassSuperclass(env, clazz)              \
00320        ((*(env))->GetClassSuperclass(env, clazz))
00321 
00322 /* These next two routines can be used to iterate through all the
00323    interfaces of a class: */
00324 
00325 #define JRI_GetClassInterfaceCount(env, clazz)   \
00326        ((*(env))->GetClassInterfaceCount(env, clazz))
00327 
00328 #define JRI_GetClassInterface(env, clazz, index) \
00329        ((*(env))->GetClassInterface(env, clazz, index))
00330 
00331 /* These next two routines can be used to iterate through all the
00332    fields of a class, getting info about them: */
00333 
00334 #define JRI_GetClassFieldCount(env, clazz)              \
00335        ((*(env))->GetClassFieldCount(env, clazz))
00336 
00337 #define JRI_GetClassFieldInfo(env, clazz, fieldIndex, fieldName, fieldSig, fieldAccess, fieldClass)      \
00338        ((*(env))->GetClassFieldInfo(env, clazz, fieldIndex, fieldName, fieldSig, fieldAccess, fieldClass))
00339 
00340 /* These next two routines can be used to iterate through all the
00341    methods of a class, getting info about them: */
00342 
00343 #define JRI_GetClassMethodCount(env, clazz)             \
00344        ((*(env))->GetClassMethodCount(env, clazz))
00345 
00346 #define JRI_GetClassMethodInfo(env, clazz, methodIndex, methodName, methodSig, methodAccess, methodClass, methodNativeProc)          \
00347        ((*(env))->GetClassMethodInfo(env, clazz, methodIndex, methodName, methodSig, methodAccess, methodClass, methodNativeProc))
00348 
00349 #define JRI_GetClassAccessFlags(env, clazz)             \
00350        ((*(env))->GetClassAccessFlags(env, clazz))
00351 
00352 /*******************************************************************************
00353  * Optional Debugger
00354  ******************************************************************************/
00355 
00356 extern const GUID JRIDebuggerPkgID;
00357 
00358 typedef struct JRIDebuggerInterface       JRIDebuggerInterface;
00359 typedef const JRIDebuggerInterface*       JRIDebuggerEnv;
00360 
00361 /* Manipulating Stacks */
00362 
00363 typedef jsize
00364 (*JRI_GetFrameCount_t)(JRIDebuggerEnv* env);
00365 
00366 typedef jbool
00367 (*JRI_GetFrameInfo_t)(JRIDebuggerEnv* env, jsize frameIndex,
00368                               jref *methodClass, jsize *methodIndex,
00369                               jsize *pc, jsize *varsCount);
00370 
00371 typedef void
00372 (*JRI_GetVarInfo_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex,
00373                                    char* *name, char* *signature,
00374                                    jbool *isArgument, jsize *startScope, jsize *endScope);
00375 
00376 #define JRIVarNotInScope    ((JRIFieldID)-1)
00377 
00378 typedef void
00379 (*JRI_GetSourceInfo_t)(JRIDebuggerEnv* env, jsize frameIndex,
00380                                const char* *filename, jsize *lineNumber);
00381 
00382 /******************************************************************************/
00383 
00384 typedef jref
00385 (*JRI_GetVar_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00386 
00387 typedef jbool
00388 (*JRI_GetVar_boolean_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00389 
00390 typedef jbyte
00391 (*JRI_GetVar_byte_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00392 
00393 typedef jchar
00394 (*JRI_GetVar_char_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00395 
00396 typedef jshort
00397 (*JRI_GetVar_short_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00398 
00399 typedef jint
00400 (*JRI_GetVar_int_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00401 
00402 typedef jlong
00403 (*JRI_GetVar_long_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00404 
00405 typedef jfloat
00406 (*JRI_GetVar_float_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00407 
00408 typedef jdouble
00409 (*JRI_GetVar_double_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex);
00410 
00411 /******************************************************************************/
00412 
00413 typedef void
00414 (*JRI_SetVar_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jref value);
00415 
00416 typedef void
00417 (*JRI_SetVar_boolean_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jbool value);
00418 
00419 typedef void
00420 (*JRI_SetVar_byte_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jbyte value);
00421 
00422 typedef void
00423 (*JRI_SetVar_char_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jchar value);
00424 
00425 typedef void
00426 (*JRI_SetVar_short_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jshort value);
00427 
00428 typedef void
00429 (*JRI_SetVar_int_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jint value);
00430 
00431 typedef void
00432 (*JRI_SetVar_long_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jlong value);
00433 
00434 typedef void
00435 (*JRI_SetVar_float_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jfloat value);
00436 
00437 typedef void
00438 (*JRI_SetVar_double_t)(JRIDebuggerEnv* env, jsize frameIndex, jsize varIndex, jdouble value);
00439 
00440 /******************************************************************************/
00441 
00442 /* Controlling Execution */
00443 
00444 typedef void
00445 (*JRI_StepOver_t)(JRIDebuggerEnv* env);
00446 
00447 typedef void
00448 (*JRI_StepIn_t)(JRIDebuggerEnv* env);
00449 
00450 typedef void
00451 (*JRI_StepOut_t)(JRIDebuggerEnv* env);
00452 
00453 typedef void
00454 (*JRI_Continue_t)(JRIDebuggerEnv* env);
00455 
00456 typedef void
00457 (*JRI_Return_t)(JRIDebuggerEnv* env, jsize frameIndex, JRIValue value);
00458 
00459 /******************************************************************************/
00460 
00461 struct JRIDebuggerInterface {
00462     MCOM_QueryInterface_t          QueryInterface;
00463     MCOM_AddRef_t                         AddRef;
00464     MCOM_Release_t                        Release;
00465        void*                                     reserved3;
00466        JRI_GetFrameCount_t                GetFrameCount;
00467        JRI_GetFrameInfo_t                 GetFrameInfo;
00468        JRI_GetVarInfo_t                   GetVarInfo;
00469        JRI_GetSourceInfo_t                GetSourceInfo;
00470        JRI_GetVar_t                       GetVar;
00471        JRI_GetVar_boolean_t        GetVar_boolean;
00472        JRI_GetVar_byte_t                  GetVar_byte;
00473        JRI_GetVar_char_t                  GetVar_char;
00474        JRI_GetVar_short_t                 GetVar_short;
00475        JRI_GetVar_int_t                   GetVar_int;
00476        JRI_GetVar_long_t                  GetVar_long;
00477        JRI_GetVar_float_t                 GetVar_float;
00478        JRI_GetVar_double_t                GetVar_double;
00479        JRI_SetVar_t                       SetVar;
00480        JRI_SetVar_boolean_t        SetVar_boolean;
00481        JRI_SetVar_byte_t                  SetVar_byte;
00482        JRI_SetVar_char_t                  SetVar_char;
00483        JRI_SetVar_short_t                 SetVar_short;
00484        JRI_SetVar_int_t                   SetVar_int;
00485        JRI_SetVar_long_t                  SetVar_long;
00486        JRI_SetVar_float_t                 SetVar_float;
00487        JRI_SetVar_double_t                SetVar_double;
00488        JRI_StepOver_t                            StepOver;
00489        JRI_StepIn_t                       StepIn;
00490        JRI_StepOut_t                      StepOut;
00491        JRI_Continue_t                            Continue;
00492        JRI_Return_t                       Return;
00493 };
00494 
00495 
00496 #define JRI_GetFrameCount(env)     \
00497        ((*(env))->GetFrameCount(env))
00498 
00499 #define JRI_GetFrameInfo(env, frameIndex, methodClass, methodIndex, pc, varsCount)  \
00500        ((*(env))->GetFrameInfo(env, frameIndex, methodClass, methodIndex, pc, varsCount))
00501 
00502 #define JRI_GetVarInfo(env, frameIndex, varIndex, name, signature, pos, isArgument, startScope, endScope)              \
00503        ((*(env))->GetVarInfo(env, frameIndex, varIndex, name, signature, pos, isArgument, startScope, endScope))
00504 
00505 #define JRI_GetSourceInfo(env, frameIndex, filename, lineNumber)      \
00506        ((*(env))->GetSourceInfo(env, frameIndex, filename, lineNumber))
00507 
00508 /******************************************************************************/
00509 
00510 #define JRI_GetVar(env, frameIndex, varIndex)           \
00511        ((*(env))->GetVar(env, frameIndex, varIndex))
00512 
00513 #define JRI_GetVar_boolean(env, frameIndex, varIndex)          \
00514        ((*(env))->GetVar_boolean(env, frameIndex, varIndex))
00515 
00516 #define JRI_GetVar_byte(env, frameIndex, varIndex)      \
00517        ((*(env))->GetVar_byte(env, frameIndex, varIndex))
00518 
00519 #define JRI_GetVar_char(env, frameIndex, varIndex)      \
00520        ((*(env))->GetVar_char(env, frameIndex, varIndex))
00521 
00522 #define JRI_GetVar_short(env, frameIndex, varIndex)            \
00523        ((*(env))->GetVar_short(env, frameIndex, varIndex))
00524 
00525 #define JRI_GetVar_int(env, frameIndex, varIndex)       \
00526        ((*(env))->GetVar_int(env, frameIndex, varIndex))
00527 
00528 #define JRI_GetVar_long(env, frameIndex, varIndex)      \
00529        ((*(env))->GetVar_long(env, frameIndex, varIndex))
00530 
00531 #define JRI_GetVar_float(env, frameIndex, varIndex)            \
00532        ((*(env))->GetVar_float(env, frameIndex, varIndex))
00533 
00534 #define JRI_GetVar_double(env, frameIndex, varIndex)           \
00535        ((*(env))->GetVar_double(env, frameIndex, varIndex))
00536 
00537 /******************************************************************************/
00538 
00539 #define JRI_SetVar(env, frameIndex, varIndex, value)    \
00540        ((*(env))->SetVar(env, frameIndex, varIndex, value))
00541 
00542 #define JRI_SetVar_boolean(env, frameIndex, varIndex, value)   \
00543        ((*(env))->SetVar_boolean(env, frameIndex, varIndex, value))
00544 
00545 #define JRI_SetVar_byte(env, frameIndex, varIndex, value)      \
00546        ((*(env))->SetVar_byte(env, frameIndex, varIndex, value))
00547 
00548 #define JRI_SetVar_char(env, frameIndex, varIndex, value)      \
00549        ((*(env))->SetVar_char(env, frameIndex, varIndex, value))
00550 
00551 #define JRI_SetVar_short(env, frameIndex, varIndex, value)     \
00552        ((*(env))->SetVar_short(env, frameIndex, varIndex, value))
00553 
00554 #define JRI_SetVar_int(env, frameIndex, varIndex, value)              \
00555        ((*(env))->SetVar_int(env, frameIndex, varIndex, value))
00556 
00557 #define JRI_SetVar_long(env, frameIndex, varIndex, value)      \
00558        ((*(env))->SetVar_long(env, frameIndex, varIndex, value))
00559 
00560 #define JRI_SetVar_float(env, frameIndex, varIndex, value)     \
00561        ((*(env))->SetVar_float(env, frameIndex, varIndex, value))
00562 
00563 #define JRI_SetVar_double(env, frameIndex, varIndex, value)           \
00564        ((*(env))->SetVar_double(env, frameIndex, varIndex, value))
00565 
00566 /******************************************************************************/
00567 
00568 /* Controlling Execution */
00569 
00570 #define JRI_StepOver(env)          \
00571        ((*(env))->StepOver(env))
00572 
00573 #define JRI_StepIn(env)            \
00574        ((*(env))->StepIn(env))
00575 
00576 #define JRI_StepOut(env)           \
00577        ((*(env))->StepOut(env))
00578 
00579 #define JRI_Continue(env)          \
00580        ((*(env))->Continue(env))
00581 
00582 #define JRI_Return(env, frameIndex, value)              \
00583        ((*(env))->Return(env, frameIndex, value))
00584 
00585 /*******************************************************************************
00586  * Optional Compiling
00587  ******************************************************************************/
00588 
00589 extern const GUID JRICompilerPkgID;
00590 
00591 typedef struct JRICompilerInterface       JRICompilerInterface;
00592 typedef const JRICompilerInterface*       JRICompilerEnv;
00593 
00594 typedef void
00595 (*JRI_CompileClass_t)(JRICompilerEnv* env,
00596                                      const char* classSrc, jsize classSrcLen,
00597                                      jbyte* *resultingClassData, jsize *classDataLen);
00598 
00599 struct JRICompilerInterface {
00600     MCOM_QueryInterface_t   QueryInterface;
00601     MCOM_AddRef_t                  AddRef;
00602     MCOM_Release_t                 Release;
00603        void*                              reserved3;
00604        JRI_CompileClass_t          CompileClass;
00605 };
00606 
00607 #define JRI_CompileClass(env, classSrc, classSrcLen, resultingClassData, classDataLen)            \
00608        ((*(env))->CompileClass(env, classSrc, classSrcLen, resultingClassData, classDataLen))
00609 
00610 /*******************************************************************************
00611  * Optional Expression Evaluation
00612  ******************************************************************************/
00613 
00614 extern const GUID JRIExprPkgID;
00615 
00616 typedef struct JRIExprInterface    JRIExprInterface;
00617 typedef const JRIExprInterface*    JRIExprEnv;
00618 
00619 typedef jref
00620 (*JRI_CompileExpr_t)(JRIExprEnv* env,
00621                                     const char* exprSrc, jsize exprSrcLen);
00622 
00623 typedef jref
00624 (*JRI_EvalExpr_t)(JRIExprEnv* env, jref expr);
00625 
00626 struct JRIExprInterface {
00627     MCOM_QueryInterface_t   QueryInterface;
00628     MCOM_AddRef_t                  AddRef;
00629     MCOM_Release_t                 Release;
00630        void*                              reserved3;
00631        JRI_CompileExpr_t           CompileExpr;
00632        JRI_EvalExpr_t                     EvalExpr;
00633 };
00634 
00635 #define JRI_CompileExpr(env, exprSrc, exprSrcLen)              \
00636        ((*(env))->CompileExpr(env, exprSrc, exprSrcLen))
00637 
00638 #define JRI_EvalExpr(env, expr)           \
00639        ((*(env))->EvalExpr(env, expr))
00640 
00641 /******************************************************************************/
00642 #ifdef __cplusplus
00643 }
00644 #endif
00645 #endif /* JRIEXT_H */
00646 /******************************************************************************/