Back to index

lightning-sunbird  0.9+nobinonly
jri.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
00040  ******************************************************************************/
00041 
00042 #ifndef JRI_H
00043 #define JRI_H
00044 
00045 #include "jritypes.h"
00046 
00047 #ifdef __cplusplus
00048 extern "C" {
00049 #endif /* __cplusplus */
00050 
00051 /*******************************************************************************
00052  * JRIEnv
00053  ******************************************************************************/
00054 
00055 /* The type of the JRIEnv interface. */
00056 typedef struct JRIEnvInterface     JRIEnvInterface;
00057 
00058 /* The type of a JRIEnv instance. */
00059 typedef const JRIEnvInterface*     JRIEnv;
00060 
00061 /*******************************************************************************
00062  * JRIEnv Operations
00063  ******************************************************************************/
00064 
00065 #define JRI_DefineClass(env, classLoader, buf, bufLen)  \
00066        (((*(env))->DefineClass)(env, JRI_DefineClass_op, classLoader, buf, bufLen))
00067 
00068 #define JRI_FindClass(env, name)   \
00069        (((*(env))->FindClass)(env, JRI_FindClass_op, name))
00070 
00071 #define JRI_Throw(env, obj) \
00072        (((*(env))->Throw)(env, JRI_Throw_op, obj))
00073 
00074 #define JRI_ThrowNew(env, clazz, message) \
00075        (((*(env))->ThrowNew)(env, JRI_ThrowNew_op, clazz, message))
00076 
00077 #define JRI_ExceptionOccurred(env) \
00078        (((*(env))->ExceptionOccurred)(env, JRI_ExceptionOccurred_op))
00079 
00080 #define JRI_ExceptionDescribe(env) \
00081        (((*(env))->ExceptionDescribe)(env, JRI_ExceptionDescribe_op))
00082 
00083 #define JRI_ExceptionClear(env)    \
00084        (((*(env))->ExceptionClear)(env, JRI_ExceptionClear_op))
00085 
00086 #define JRI_NewGlobalRef(env, ref) \
00087        (((*(env))->NewGlobalRef)(env, JRI_NewGlobalRef_op, ref))
00088 
00089 #define JRI_DisposeGlobalRef(env, gref)   \
00090        (((*(env))->DisposeGlobalRef)(env, JRI_DisposeGlobalRef_op, gref))
00091 
00092 #define JRI_GetGlobalRef(env, gref)       \
00093        (((*(env))->GetGlobalRef)(env, JRI_GetGlobalRef_op, gref))
00094 
00095 #define JRI_SetGlobalRef(env, gref, ref)  \
00096        (((*(env))->SetGlobalRef)(env, JRI_SetGlobalRef_op, gref, ref))
00097 
00098 #define JRI_IsSameObject(env, a, b)       \
00099        (((*(env))->IsSameObject)(env, JRI_IsSameObject_op, a, b))
00100 
00101 #define JRI_NewObject(env)  ((*(env))->NewObject)
00102 #define JRI_NewObjectV(env, clazz, methodID, args)      \
00103        (((*(env))->NewObjectV)(env, JRI_NewObject_op_va_list, clazz, methodID, args))
00104 #define JRI_NewObjectA(env, clazz, method, args) \
00105        (((*(env))->NewObjectA)(env, JRI_NewObject_op_array, clazz, methodID, args))
00106 
00107 #define JRI_GetObjectClass(env, obj)      \
00108        (((*(env))->GetObjectClass)(env, JRI_GetObjectClass_op, obj))
00109 
00110 #define JRI_IsInstanceOf(env, obj, clazz) \
00111        (((*(env))->IsInstanceOf)(env, JRI_IsInstanceOf_op, obj, clazz))
00112 
00113 #define JRI_GetMethodID(env, clazz, name, sig)   \
00114        (((*(env))->GetMethodID)(env, JRI_GetMethodID_op, clazz, name, sig))
00115 
00116 #define JRI_CallMethod(env) ((*(env))->CallMethod)
00117 #define JRI_CallMethodV(env, obj, methodID, args)       \
00118        (((*(env))->CallMethodV)(env, JRI_CallMethod_op_va_list, obj, methodID, args))
00119 #define JRI_CallMethodA(env, obj, methodID, args)       \
00120        (((*(env))->CallMethodA)(env, JRI_CallMethod_op_array, obj, methodID, args))
00121 
00122 #define JRI_CallMethodBoolean(env) ((*(env))->CallMethodBoolean)
00123 #define JRI_CallMethodBooleanV(env, obj, methodID, args)       \
00124        (((*(env))->CallMethodBooleanV)(env, JRI_CallMethodBoolean_op_va_list, obj, methodID, args))
00125 #define JRI_CallMethodBooleanA(env, obj, methodID, args)       \
00126        (((*(env))->CallMethodBooleanA)(env, JRI_CallMethodBoolean_op_array, obj, methodID, args))
00127 
00128 #define JRI_CallMethodByte(env)    ((*(env))->CallMethodByte)
00129 #define JRI_CallMethodByteV(env, obj, methodID, args)   \
00130        (((*(env))->CallMethodByteV)(env, JRI_CallMethodByte_op_va_list, obj, methodID, args))
00131 #define JRI_CallMethodByteA(env, obj, methodID, args)   \
00132        (((*(env))->CallMethodByteA)(env, JRI_CallMethodByte_op_array, obj, methodID, args))
00133 
00134 #define JRI_CallMethodChar(env)    ((*(env))->CallMethodChar)
00135 #define JRI_CallMethodCharV(env, obj, methodID, args)   \
00136        (((*(env))->CallMethodCharV)(env, JRI_CallMethodChar_op_va_list, obj, methodID, args))
00137 #define JRI_CallMethodCharA(env, obj, methodID, args)   \
00138        (((*(env))->CallMethodCharA)(env, JRI_CallMethodChar_op_array, obj, methodID, args))
00139 
00140 #define JRI_CallMethodShort(env)   ((*(env))->CallMethodShort)
00141 #define JRI_CallMethodShortV(env, obj, methodID, args)  \
00142        (((*(env))->CallMethodShortV)(env, JRI_CallMethodShort_op_va_list, obj, methodID, args))
00143 #define JRI_CallMethodShortA(env, obj, methodID, args)  \
00144        (((*(env))->CallMethodShortA)(env, JRI_CallMethodShort_op_array, obj, methodID, args))
00145 
00146 #define JRI_CallMethodInt(env)     ((*(env))->CallMethodInt)
00147 #define JRI_CallMethodIntV(env, obj, methodID, args)    \
00148        (((*(env))->CallMethodIntV)(env, JRI_CallMethodInt_op_va_list, obj, methodID, args))
00149 #define JRI_CallMethodIntA(env, obj, methodID, args)    \
00150        (((*(env))->CallMethodIntA)(env, JRI_CallMethodInt_op_array, obj, methodID, args))
00151 
00152 #define JRI_CallMethodLong(env)    ((*(env))->CallMethodLong)
00153 #define JRI_CallMethodLongV(env, obj, methodID, args)   \
00154        (((*(env))->CallMethodLongV)(env, JRI_CallMethodLong_op_va_list, obj, methodID, args))
00155 #define JRI_CallMethodLongA(env, obj, methodID, args)   \
00156        (((*(env))->CallMethodLongA)(env, JRI_CallMethodLong_op_array, obj, methodID, args))
00157 
00158 #define JRI_CallMethodFloat(env)   ((*(env))->CallMethodFloat)
00159 #define JRI_CallMethodFloatV(env, obj, methodID, args)  \
00160        (((*(env))->CallMethodFloatV)(env, JRI_CallMethodFloat_op_va_list, obj, methodID, args))
00161 #define JRI_CallMethodFloatA(env, obj, methodID, args)  \
00162        (((*(env))->CallMethodFloatA)(env, JRI_CallMethodFloat_op_array, obj, methodID, args))
00163 
00164 #define JRI_CallMethodDouble(env)  ((*(env))->CallMethodDouble)
00165 #define JRI_CallMethodDoubleV(env, obj, methodID, args) \
00166        (((*(env))->CallMethodDoubleV)(env, JRI_CallMethodDouble_op_va_list, obj, methodID, args))
00167 #define JRI_CallMethodDoubleA(env, obj, methodID, args) \
00168        (((*(env))->CallMethodDoubleA)(env, JRI_CallMethodDouble_op_array, obj, methodID, args))
00169 
00170 #define JRI_GetFieldID(env, clazz, name, sig)    \
00171        (((*(env))->GetFieldID)(env, JRI_GetFieldID_op, clazz, name, sig))
00172 
00173 #define JRI_GetField(env, obj, fieldID)   \
00174        (((*(env))->GetField)(env, JRI_GetField_op, obj, fieldID))
00175 
00176 #define JRI_GetFieldBoolean(env, obj, fieldID)   \
00177        (((*(env))->GetFieldBoolean)(env, JRI_GetFieldBoolean_op, obj, fieldID))
00178 
00179 #define JRI_GetFieldByte(env, obj, fieldID)      \
00180        (((*(env))->GetFieldByte)(env, JRI_GetFieldByte_op, obj, fieldID))
00181 
00182 #define JRI_GetFieldChar(env, obj, fieldID)      \
00183        (((*(env))->GetFieldChar)(env, JRI_GetFieldChar_op, obj, fieldID))
00184 
00185 #define JRI_GetFieldShort(env, obj, fieldID)     \
00186        (((*(env))->GetFieldShort)(env, JRI_GetFieldShort_op, obj, fieldID))
00187 
00188 #define JRI_GetFieldInt(env, obj, fieldID)       \
00189        (((*(env))->GetFieldInt)(env, JRI_GetFieldInt_op, obj, fieldID))
00190 
00191 #define JRI_GetFieldLong(env, obj, fieldID)      \
00192        (((*(env))->GetFieldLong)(env, JRI_GetFieldLong_op, obj, fieldID))
00193 
00194 #define JRI_GetFieldFloat(env, obj, fieldID)     \
00195        (((*(env))->GetFieldFloat)(env, JRI_GetFieldFloat_op, obj, fieldID))
00196 
00197 #define JRI_GetFieldDouble(env, obj, fieldID)    \
00198        (((*(env))->GetFieldDouble)(env, JRI_GetFieldDouble_op, obj, fieldID))
00199 
00200 #define JRI_SetField(env, obj, fieldID, value)   \
00201        (((*(env))->SetField)(env, JRI_SetField_op, obj, fieldID, value))
00202 
00203 #define JRI_SetFieldBoolean(env, obj, fieldID, value)   \
00204        (((*(env))->SetFieldBoolean)(env, JRI_SetFieldBoolean_op, obj, fieldID, value))
00205 
00206 #define JRI_SetFieldByte(env, obj, fieldID, value)      \
00207        (((*(env))->SetFieldByte)(env, JRI_SetFieldByte_op, obj, fieldID, value))
00208 
00209 #define JRI_SetFieldChar(env, obj, fieldID, value)      \
00210        (((*(env))->SetFieldChar)(env, JRI_SetFieldChar_op, obj, fieldID, value))
00211 
00212 #define JRI_SetFieldShort(env, obj, fieldID, value)     \
00213        (((*(env))->SetFieldShort)(env, JRI_SetFieldShort_op, obj, fieldID, value))
00214 
00215 #define JRI_SetFieldInt(env, obj, fieldID, value)       \
00216        (((*(env))->SetFieldInt)(env, JRI_SetFieldInt_op, obj, fieldID, value))
00217 
00218 #define JRI_SetFieldLong(env, obj, fieldID, value)      \
00219        (((*(env))->SetFieldLong)(env, JRI_SetFieldLong_op, obj, fieldID, value))
00220 
00221 #define JRI_SetFieldFloat(env, obj, fieldID, value)     \
00222        (((*(env))->SetFieldFloat)(env, JRI_SetFieldFloat_op, obj, fieldID, value))
00223 
00224 #define JRI_SetFieldDouble(env, obj, fieldID, value)    \
00225        (((*(env))->SetFieldDouble)(env, JRI_SetFieldDouble_op, obj, fieldID, value))
00226 
00227 #define JRI_IsSubclassOf(env, a, b)       \
00228        (((*(env))->IsSubclassOf)(env, JRI_IsSubclassOf_op, a, b))
00229 
00230 #define JRI_GetStaticMethodID(env, clazz, name, sig)    \
00231        (((*(env))->GetStaticMethodID)(env, JRI_GetStaticMethodID_op, clazz, name, sig))
00232 
00233 #define JRI_CallStaticMethod(env)  ((*(env))->CallStaticMethod)
00234 #define JRI_CallStaticMethodV(env, clazz, methodID, args)      \
00235        (((*(env))->CallStaticMethodV)(env, JRI_CallStaticMethod_op_va_list, clazz, methodID, args))
00236 #define JRI_CallStaticMethodA(env, clazz, methodID, args)      \
00237        (((*(env))->CallStaticMethodA)(env, JRI_CallStaticMethod_op_array, clazz, methodID, args))
00238 
00239 #define JRI_CallStaticMethodBoolean(env)  ((*(env))->CallStaticMethodBoolean)
00240 #define JRI_CallStaticMethodBooleanV(env, clazz, methodID, args)      \
00241        (((*(env))->CallStaticMethodBooleanV)(env, JRI_CallStaticMethodBoolean_op_va_list, clazz, methodID, args))
00242 #define JRI_CallStaticMethodBooleanA(env, clazz, methodID, args)      \
00243        (((*(env))->CallStaticMethodBooleanA)(env, JRI_CallStaticMethodBoolean_op_array, clazz, methodID, args))
00244 
00245 #define JRI_CallStaticMethodByte(env)     ((*(env))->CallStaticMethodByte)
00246 #define JRI_CallStaticMethodByteV(env, clazz, methodID, args)  \
00247        (((*(env))->CallStaticMethodByteV)(env, JRI_CallStaticMethodByte_op_va_list, clazz, methodID, args))
00248 #define JRI_CallStaticMethodByteA(env, clazz, methodID, args)  \
00249        (((*(env))->CallStaticMethodByteA)(env, JRI_CallStaticMethodByte_op_array, clazz, methodID, args))
00250 
00251 #define JRI_CallStaticMethodChar(env)     ((*(env))->CallStaticMethodChar)
00252 #define JRI_CallStaticMethodCharV(env, clazz, methodID, args)  \
00253        (((*(env))->CallStaticMethodCharV)(env, JRI_CallStaticMethodChar_op_va_list, clazz, methodID, args))
00254 #define JRI_CallStaticMethodCharA(env, clazz, methodID, args)  \
00255        (((*(env))->CallStaticMethodCharA)(env, JRI_CallStaticMethodChar_op_array, clazz, methodID, args))
00256 
00257 #define JRI_CallStaticMethodShort(env)    ((*(env))->CallStaticMethodShort)
00258 #define JRI_CallStaticMethodShortV(env, clazz, methodID, args) \
00259        (((*(env))->CallStaticMethodShortV)(env, JRI_CallStaticMethodShort_op_va_list, clazz, methodID, args))
00260 #define JRI_CallStaticMethodShortA(env, clazz, methodID, args) \
00261        (((*(env))->CallStaticMethodShortA)(env, JRI_CallStaticMethodShort_op_array, clazz, methodID, args))
00262 
00263 #define JRI_CallStaticMethodInt(env)      ((*(env))->CallStaticMethodInt)
00264 #define JRI_CallStaticMethodIntV(env, clazz, methodID, args)   \
00265        (((*(env))->CallStaticMethodIntV)(env, JRI_CallStaticMethodInt_op_va_list, clazz, methodID, args))
00266 #define JRI_CallStaticMethodIntA(env, clazz, methodID, args)   \
00267        (((*(env))->CallStaticMethodIntA)(env, JRI_CallStaticMethodInt_op_array, clazz, methodID, args))
00268 
00269 #define JRI_CallStaticMethodLong(env)     ((*(env))->CallStaticMethodLong)
00270 #define JRI_CallStaticMethodLongV(env, clazz, methodID, args)  \
00271        (((*(env))->CallStaticMethodLongV)(env, JRI_CallStaticMethodLong_op_va_list, clazz, methodID, args))
00272 #define JRI_CallStaticMethodLongA(env, clazz, methodID, args)  \
00273        (((*(env))->CallStaticMethodLongA)(env, JRI_CallStaticMethodLong_op_array, clazz, methodID, args))
00274 
00275 #define JRI_CallStaticMethodFloat(env)    ((*(env))->CallStaticMethodFloat)
00276 #define JRI_CallStaticMethodFloatV(env, clazz, methodID, args) \
00277        (((*(env))->CallStaticMethodFloatV)(env, JRI_CallStaticMethodFloat_op_va_list, clazz, methodID, args))
00278 #define JRI_CallStaticMethodFloatA(env, clazz, methodID, args) \
00279        (((*(env))->CallStaticMethodFloatA)(env, JRI_CallStaticMethodFloat_op_array, clazz, methodID, args))
00280 
00281 #define JRI_CallStaticMethodDouble(env)   ((*(env))->CallStaticMethodDouble)
00282 #define JRI_CallStaticMethodDoubleV(env, clazz, methodID, args)       \
00283        (((*(env))->CallStaticMethodDoubleV)(env, JRI_CallStaticMethodDouble_op_va_list, clazz, methodID, args))
00284 #define JRI_CallStaticMethodDoubleA(env, clazz, methodID, args)       \
00285        (((*(env))->CallStaticMethodDoubleA)(env, JRI_CallStaticMethodDouble_op_array, clazz, methodID, args))
00286 
00287 #define JRI_GetStaticFieldID(env, clazz, name, sig)     \
00288        (((*(env))->GetStaticFieldID)(env, JRI_GetStaticFieldID_op, clazz, name, sig))
00289 
00290 #define JRI_GetStaticField(env, clazz, fieldID)  \
00291        (((*(env))->GetStaticField)(env, JRI_GetStaticField_op, clazz, fieldID))
00292 
00293 #define JRI_GetStaticFieldBoolean(env, clazz, fieldID)  \
00294        (((*(env))->GetStaticFieldBoolean)(env, JRI_GetStaticFieldBoolean_op, clazz, fieldID))
00295 
00296 #define JRI_GetStaticFieldByte(env, clazz, fieldID)     \
00297        (((*(env))->GetStaticFieldByte)(env, JRI_GetStaticFieldByte_op, clazz, fieldID))
00298 
00299 #define JRI_GetStaticFieldChar(env, clazz, fieldID)     \
00300        (((*(env))->GetStaticFieldChar)(env, JRI_GetStaticFieldChar_op, clazz, fieldID))
00301 
00302 #define JRI_GetStaticFieldShort(env, clazz, fieldID)    \
00303        (((*(env))->GetStaticFieldShort)(env, JRI_GetStaticFieldShort_op, clazz, fieldID))
00304 
00305 #define JRI_GetStaticFieldInt(env, clazz, fieldID)      \
00306        (((*(env))->GetStaticFieldInt)(env, JRI_GetStaticFieldInt_op, clazz, fieldID))
00307 
00308 #define JRI_GetStaticFieldLong(env, clazz, fieldID)     \
00309        (((*(env))->GetStaticFieldLong)(env, JRI_GetStaticFieldLong_op, clazz, fieldID))
00310 
00311 #define JRI_GetStaticFieldFloat(env, clazz, fieldID)    \
00312        (((*(env))->GetStaticFieldFloat)(env, JRI_GetStaticFieldFloat_op, clazz, fieldID))
00313 
00314 #define JRI_GetStaticFieldDouble(env, clazz, fieldID)   \
00315        (((*(env))->GetStaticFieldDouble)(env, JRI_GetStaticFieldDouble_op, clazz, fieldID))
00316 
00317 #define JRI_SetStaticField(env, clazz, fieldID, value)  \
00318        (((*(env))->SetStaticField)(env, JRI_SetStaticField_op, clazz, fieldID, value))
00319 
00320 #define JRI_SetStaticFieldBoolean(env, clazz, fieldID, value)  \
00321        (((*(env))->SetStaticFieldBoolean)(env, JRI_SetStaticFieldBoolean_op, clazz, fieldID, value))
00322 
00323 #define JRI_SetStaticFieldByte(env, clazz, fieldID, value)     \
00324        (((*(env))->SetStaticFieldByte)(env, JRI_SetStaticFieldByte_op, clazz, fieldID, value))
00325 
00326 #define JRI_SetStaticFieldChar(env, clazz, fieldID, value)     \
00327        (((*(env))->SetStaticFieldChar)(env, JRI_SetStaticFieldChar_op, clazz, fieldID, value))
00328 
00329 #define JRI_SetStaticFieldShort(env, clazz, fieldID, value)    \
00330        (((*(env))->SetStaticFieldShort)(env, JRI_SetStaticFieldShort_op, clazz, fieldID, value))
00331 
00332 #define JRI_SetStaticFieldInt(env, clazz, fieldID, value)      \
00333        (((*(env))->SetStaticFieldInt)(env, JRI_SetStaticFieldInt_op, clazz, fieldID, value))
00334 
00335 #define JRI_SetStaticFieldLong(env, clazz, fieldID, value)     \
00336        (((*(env))->SetStaticFieldLong)(env, JRI_SetStaticFieldLong_op, clazz, fieldID, value))
00337 
00338 #define JRI_SetStaticFieldFloat(env, clazz, fieldID, value)    \
00339        (((*(env))->SetStaticFieldFloat)(env, JRI_SetStaticFieldFloat_op, clazz, fieldID, value))
00340 
00341 #define JRI_SetStaticFieldDouble(env, clazz, fieldID, value)   \
00342        (((*(env))->SetStaticFieldDouble)(env, JRI_SetStaticFieldDouble_op, clazz, fieldID, value))
00343 
00344 #define JRI_NewString(env, unicode, len)  \
00345        (((*(env))->NewString)(env, JRI_NewString_op, unicode, len))
00346 
00347 #define JRI_GetStringLength(env, string)  \
00348        (((*(env))->GetStringLength)(env, JRI_GetStringLength_op, string))
00349 
00350 #define JRI_GetStringChars(env, string)   \
00351        (((*(env))->GetStringChars)(env, JRI_GetStringChars_op, string))
00352 
00353 #define JRI_NewStringUTF(env, utf, len)   \
00354        (((*(env))->NewStringUTF)(env, JRI_NewStringUTF_op, utf, len))
00355 
00356 #define JRI_GetStringUTFLength(env, string)      \
00357        (((*(env))->GetStringUTFLength)(env, JRI_GetStringUTFLength_op, string))
00358 
00359 #define JRI_GetStringUTFChars(env, string)       \
00360        (((*(env))->GetStringUTFChars)(env, JRI_GetStringUTFChars_op, string))
00361 
00362 #define JRI_NewScalarArray(env, length, elementSig, initialElements)  \
00363        (((*(env))->NewScalarArray)(env, JRI_NewScalarArray_op, length, elementSig, initialElements))
00364 
00365 #define JRI_GetScalarArrayLength(env, array)     \
00366        (((*(env))->GetScalarArrayLength)(env, JRI_GetScalarArrayLength_op, array))
00367 
00368 #define JRI_GetScalarArrayElements(env, array)   \
00369        (((*(env))->GetScalarArrayElements)(env, JRI_GetScalarArrayElements_op, array))
00370 
00371 #define JRI_NewObjectArray(env, length, elementClass, initialElement) \
00372        (((*(env))->NewObjectArray)(env, JRI_NewObjectArray_op, length, elementClass, initialElement))
00373 
00374 #define JRI_GetObjectArrayLength(env, array)     \
00375        (((*(env))->GetObjectArrayLength)(env, JRI_GetObjectArrayLength_op, array))
00376 
00377 #define JRI_GetObjectArrayElement(env, array, index)    \
00378        (((*(env))->GetObjectArrayElement)(env, JRI_GetObjectArrayElement_op, array, index))
00379 
00380 #define JRI_SetObjectArrayElement(env, array, index, value)    \
00381        (((*(env))->SetObjectArrayElement)(env, JRI_SetObjectArrayElement_op, array, index, value))
00382 
00383 #define JRI_RegisterNatives(env, clazz, nameAndSigArray, nativeProcArray)    \
00384        (((*(env))->RegisterNatives)(env, JRI_RegisterNatives_op, clazz, nameAndSigArray, nativeProcArray))
00385 
00386 #define JRI_UnregisterNatives(env, clazz) \
00387        (((*(env))->UnregisterNatives)(env, JRI_UnregisterNatives_op, clazz))
00388 
00389 #define JRI_NewStringPlatform(env, string, len, encoding, encodingLength)    \
00390        (((*(env))->NewStringPlatform)(env, JRI_NewStringPlatform_op, string, len, encoding, encodingLength))
00391 
00392 #define JRI_GetStringPlatformChars(env, string, encoding, encodingLength)    \
00393        (((*(env))->GetStringPlatformChars)(env, JRI_GetStringPlatformChars_op, string, encoding, encodingLength))
00394 
00395 
00396 /*******************************************************************************
00397  * JRIEnv Interface
00398  ******************************************************************************/
00399 
00400 struct java_lang_ClassLoader;
00401 struct java_lang_Class;
00402 struct java_lang_Throwable;
00403 struct java_lang_Object;
00404 struct java_lang_String;
00405 
00406 struct JRIEnvInterface {
00407        void*  reserved0;
00408        void*  reserved1;
00409        void*  reserved2;
00410        void*  reserved3;
00411        struct java_lang_Class*     (*FindClass)(JRIEnv* env, jint op, const char* a);
00412        void   (*Throw)(JRIEnv* env, jint op, struct java_lang_Throwable* a);
00413        void   (*ThrowNew)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b);
00414        struct java_lang_Throwable* (*ExceptionOccurred)(JRIEnv* env, jint op);
00415        void   (*ExceptionDescribe)(JRIEnv* env, jint op);
00416        void   (*ExceptionClear)(JRIEnv* env, jint op);
00417        jglobal       (*NewGlobalRef)(JRIEnv* env, jint op, void* a);
00418        void   (*DisposeGlobalRef)(JRIEnv* env, jint op, jglobal a);
00419        void*  (*GetGlobalRef)(JRIEnv* env, jint op, jglobal a);
00420        void   (*SetGlobalRef)(JRIEnv* env, jint op, jglobal a, void* b);
00421        jbool  (*IsSameObject)(JRIEnv* env, jint op, void* a, void* b);
00422        void*  (*NewObject)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00423        void*  (*NewObjectV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00424        void*  (*NewObjectA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00425        struct java_lang_Class*     (*GetObjectClass)(JRIEnv* env, jint op, void* a);
00426        jbool  (*IsInstanceOf)(JRIEnv* env, jint op, void* a, struct java_lang_Class* b);
00427        jint   (*GetMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
00428        void*  (*CallMethod)(JRIEnv* env, jint op, void* a, jint b, ...);
00429        void*  (*CallMethodV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00430        void*  (*CallMethodA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00431        jbool  (*CallMethodBoolean)(JRIEnv* env, jint op, void* a, jint b, ...);
00432        jbool  (*CallMethodBooleanV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00433        jbool  (*CallMethodBooleanA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00434        jbyte  (*CallMethodByte)(JRIEnv* env, jint op, void* a, jint b, ...);
00435        jbyte  (*CallMethodByteV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00436        jbyte  (*CallMethodByteA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00437        jchar  (*CallMethodChar)(JRIEnv* env, jint op, void* a, jint b, ...);
00438        jchar  (*CallMethodCharV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00439        jchar  (*CallMethodCharA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00440        jshort (*CallMethodShort)(JRIEnv* env, jint op, void* a, jint b, ...);
00441        jshort (*CallMethodShortV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00442        jshort (*CallMethodShortA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00443        jint   (*CallMethodInt)(JRIEnv* env, jint op, void* a, jint b, ...);
00444        jint   (*CallMethodIntV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00445        jint   (*CallMethodIntA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00446        jlong  (*CallMethodLong)(JRIEnv* env, jint op, void* a, jint b, ...);
00447        jlong  (*CallMethodLongV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00448        jlong  (*CallMethodLongA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00449        jfloat (*CallMethodFloat)(JRIEnv* env, jint op, void* a, jint b, ...);
00450        jfloat (*CallMethodFloatV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00451        jfloat (*CallMethodFloatA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00452        jdouble       (*CallMethodDouble)(JRIEnv* env, jint op, void* a, jint b, ...);
00453        jdouble       (*CallMethodDoubleV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
00454        jdouble       (*CallMethodDoubleA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
00455        jint   (*GetFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
00456        void*  (*GetField)(JRIEnv* env, jint op, void* a, jint b);
00457        jbool  (*GetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b);
00458        jbyte  (*GetFieldByte)(JRIEnv* env, jint op, void* a, jint b);
00459        jchar  (*GetFieldChar)(JRIEnv* env, jint op, void* a, jint b);
00460        jshort (*GetFieldShort)(JRIEnv* env, jint op, void* a, jint b);
00461        jint   (*GetFieldInt)(JRIEnv* env, jint op, void* a, jint b);
00462        jlong  (*GetFieldLong)(JRIEnv* env, jint op, void* a, jint b);
00463        jfloat (*GetFieldFloat)(JRIEnv* env, jint op, void* a, jint b);
00464        jdouble       (*GetFieldDouble)(JRIEnv* env, jint op, void* a, jint b);
00465        void   (*SetField)(JRIEnv* env, jint op, void* a, jint b, void* c);
00466        void   (*SetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b, jbool c);
00467        void   (*SetFieldByte)(JRIEnv* env, jint op, void* a, jint b, jbyte c);
00468        void   (*SetFieldChar)(JRIEnv* env, jint op, void* a, jint b, jchar c);
00469        void   (*SetFieldShort)(JRIEnv* env, jint op, void* a, jint b, jshort c);
00470        void   (*SetFieldInt)(JRIEnv* env, jint op, void* a, jint b, jint c);
00471        void   (*SetFieldLong)(JRIEnv* env, jint op, void* a, jint b, jlong c);
00472        void   (*SetFieldFloat)(JRIEnv* env, jint op, void* a, jint b, jfloat c);
00473        void   (*SetFieldDouble)(JRIEnv* env, jint op, void* a, jint b, jdouble c);
00474        jbool  (*IsSubclassOf)(JRIEnv* env, jint op, struct java_lang_Class* a, struct java_lang_Class* b);
00475        jint   (*GetStaticMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
00476        void*  (*CallStaticMethod)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00477        void*  (*CallStaticMethodV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00478        void*  (*CallStaticMethodA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00479        jbool  (*CallStaticMethodBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00480        jbool  (*CallStaticMethodBooleanV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00481        jbool  (*CallStaticMethodBooleanA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00482        jbyte  (*CallStaticMethodByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00483        jbyte  (*CallStaticMethodByteV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00484        jbyte  (*CallStaticMethodByteA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00485        jchar  (*CallStaticMethodChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00486        jchar  (*CallStaticMethodCharV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00487        jchar  (*CallStaticMethodCharA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00488        jshort (*CallStaticMethodShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00489        jshort (*CallStaticMethodShortV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00490        jshort (*CallStaticMethodShortA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00491        jint   (*CallStaticMethodInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00492        jint   (*CallStaticMethodIntV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00493        jint   (*CallStaticMethodIntA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00494        jlong  (*CallStaticMethodLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00495        jlong  (*CallStaticMethodLongV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00496        jlong  (*CallStaticMethodLongA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00497        jfloat (*CallStaticMethodFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00498        jfloat (*CallStaticMethodFloatV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00499        jfloat (*CallStaticMethodFloatA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00500        jdouble       (*CallStaticMethodDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
00501        jdouble       (*CallStaticMethodDoubleV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
00502        jdouble       (*CallStaticMethodDoubleA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
00503        jint   (*GetStaticFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
00504        void*  (*GetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00505        jbool  (*GetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00506        jbyte  (*GetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00507        jchar  (*GetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00508        jshort (*GetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00509        jint   (*GetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00510        jlong  (*GetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00511        jfloat (*GetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00512        jdouble       (*GetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
00513        void   (*SetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, void* c);
00514        void   (*SetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbool c);
00515        void   (*SetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbyte c);
00516        void   (*SetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jchar c);
00517        void   (*SetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jshort c);
00518        void   (*SetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jint c);
00519        void   (*SetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jlong c);
00520        void   (*SetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jfloat c);
00521        void   (*SetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jdouble c);
00522        struct java_lang_String*    (*NewString)(JRIEnv* env, jint op, const jchar* a, jint b);
00523        jint   (*GetStringLength)(JRIEnv* env, jint op, struct java_lang_String* a);
00524        const jchar*  (*GetStringChars)(JRIEnv* env, jint op, struct java_lang_String* a);
00525        struct java_lang_String*    (*NewStringUTF)(JRIEnv* env, jint op, const jbyte* a, jint b);
00526        jint   (*GetStringUTFLength)(JRIEnv* env, jint op, struct java_lang_String* a);
00527        const jbyte*  (*GetStringUTFChars)(JRIEnv* env, jint op, struct java_lang_String* a);
00528        void*  (*NewScalarArray)(JRIEnv* env, jint op, jint a, const char* b, const jbyte* c);
00529        jint   (*GetScalarArrayLength)(JRIEnv* env, jint op, void* a);
00530        jbyte* (*GetScalarArrayElements)(JRIEnv* env, jint op, void* a);
00531        void*  (*NewObjectArray)(JRIEnv* env, jint op, jint a, struct java_lang_Class* b, void* c);
00532        jint   (*GetObjectArrayLength)(JRIEnv* env, jint op, void* a);
00533        void*  (*GetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b);
00534        void   (*SetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b, void* c);
00535        void   (*RegisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a, char** b, void** c);
00536        void   (*UnregisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a);
00537        struct java_lang_Class*     (*DefineClass)(JRIEnv* env, jint op, struct java_lang_ClassLoader* a, jbyte* b, jsize bLen);
00538        struct java_lang_String*    (*NewStringPlatform)(JRIEnv* env, jint op, const jbyte* a, jint b, const jbyte* c, jint d);
00539        const jbyte*  (*GetStringPlatformChars)(JRIEnv* env, jint op, struct java_lang_String* a, const jbyte* b, jint c);
00540 };
00541 
00542 /*
00543 ** ****************************************************************************
00544 ** JRIEnv Operation IDs
00545 ** ***************************************************************************
00546 */
00547 
00548 typedef enum JRIEnvOperations {
00549        JRI_Reserved0_op,
00550        JRI_Reserved1_op,
00551        JRI_Reserved2_op,
00552        JRI_Reserved3_op,
00553        JRI_FindClass_op,
00554        JRI_Throw_op,
00555        JRI_ThrowNew_op,
00556        JRI_ExceptionOccurred_op,
00557        JRI_ExceptionDescribe_op,
00558        JRI_ExceptionClear_op,
00559        JRI_NewGlobalRef_op,
00560        JRI_DisposeGlobalRef_op,
00561        JRI_GetGlobalRef_op,
00562        JRI_SetGlobalRef_op,
00563        JRI_IsSameObject_op,
00564        JRI_NewObject_op,
00565        JRI_NewObject_op_va_list,
00566        JRI_NewObject_op_array,
00567        JRI_GetObjectClass_op,
00568        JRI_IsInstanceOf_op,
00569        JRI_GetMethodID_op,
00570        JRI_CallMethod_op,
00571        JRI_CallMethod_op_va_list,
00572        JRI_CallMethod_op_array,
00573        JRI_CallMethodBoolean_op,
00574        JRI_CallMethodBoolean_op_va_list,
00575        JRI_CallMethodBoolean_op_array,
00576        JRI_CallMethodByte_op,
00577        JRI_CallMethodByte_op_va_list,
00578        JRI_CallMethodByte_op_array,
00579        JRI_CallMethodChar_op,
00580        JRI_CallMethodChar_op_va_list,
00581        JRI_CallMethodChar_op_array,
00582        JRI_CallMethodShort_op,
00583        JRI_CallMethodShort_op_va_list,
00584        JRI_CallMethodShort_op_array,
00585        JRI_CallMethodInt_op,
00586        JRI_CallMethodInt_op_va_list,
00587        JRI_CallMethodInt_op_array,
00588        JRI_CallMethodLong_op,
00589        JRI_CallMethodLong_op_va_list,
00590        JRI_CallMethodLong_op_array,
00591        JRI_CallMethodFloat_op,
00592        JRI_CallMethodFloat_op_va_list,
00593        JRI_CallMethodFloat_op_array,
00594        JRI_CallMethodDouble_op,
00595        JRI_CallMethodDouble_op_va_list,
00596        JRI_CallMethodDouble_op_array,
00597        JRI_GetFieldID_op,
00598        JRI_GetField_op,
00599        JRI_GetFieldBoolean_op,
00600        JRI_GetFieldByte_op,
00601        JRI_GetFieldChar_op,
00602        JRI_GetFieldShort_op,
00603        JRI_GetFieldInt_op,
00604        JRI_GetFieldLong_op,
00605        JRI_GetFieldFloat_op,
00606        JRI_GetFieldDouble_op,
00607        JRI_SetField_op,
00608        JRI_SetFieldBoolean_op,
00609        JRI_SetFieldByte_op,
00610        JRI_SetFieldChar_op,
00611        JRI_SetFieldShort_op,
00612        JRI_SetFieldInt_op,
00613        JRI_SetFieldLong_op,
00614        JRI_SetFieldFloat_op,
00615        JRI_SetFieldDouble_op,
00616        JRI_IsSubclassOf_op,
00617        JRI_GetStaticMethodID_op,
00618        JRI_CallStaticMethod_op,
00619        JRI_CallStaticMethod_op_va_list,
00620        JRI_CallStaticMethod_op_array,
00621        JRI_CallStaticMethodBoolean_op,
00622        JRI_CallStaticMethodBoolean_op_va_list,
00623        JRI_CallStaticMethodBoolean_op_array,
00624        JRI_CallStaticMethodByte_op,
00625        JRI_CallStaticMethodByte_op_va_list,
00626        JRI_CallStaticMethodByte_op_array,
00627        JRI_CallStaticMethodChar_op,
00628        JRI_CallStaticMethodChar_op_va_list,
00629        JRI_CallStaticMethodChar_op_array,
00630        JRI_CallStaticMethodShort_op,
00631        JRI_CallStaticMethodShort_op_va_list,
00632        JRI_CallStaticMethodShort_op_array,
00633        JRI_CallStaticMethodInt_op,
00634        JRI_CallStaticMethodInt_op_va_list,
00635        JRI_CallStaticMethodInt_op_array,
00636        JRI_CallStaticMethodLong_op,
00637        JRI_CallStaticMethodLong_op_va_list,
00638        JRI_CallStaticMethodLong_op_array,
00639        JRI_CallStaticMethodFloat_op,
00640        JRI_CallStaticMethodFloat_op_va_list,
00641        JRI_CallStaticMethodFloat_op_array,
00642        JRI_CallStaticMethodDouble_op,
00643        JRI_CallStaticMethodDouble_op_va_list,
00644        JRI_CallStaticMethodDouble_op_array,
00645        JRI_GetStaticFieldID_op,
00646        JRI_GetStaticField_op,
00647        JRI_GetStaticFieldBoolean_op,
00648        JRI_GetStaticFieldByte_op,
00649        JRI_GetStaticFieldChar_op,
00650        JRI_GetStaticFieldShort_op,
00651        JRI_GetStaticFieldInt_op,
00652        JRI_GetStaticFieldLong_op,
00653        JRI_GetStaticFieldFloat_op,
00654        JRI_GetStaticFieldDouble_op,
00655        JRI_SetStaticField_op,
00656        JRI_SetStaticFieldBoolean_op,
00657        JRI_SetStaticFieldByte_op,
00658        JRI_SetStaticFieldChar_op,
00659        JRI_SetStaticFieldShort_op,
00660        JRI_SetStaticFieldInt_op,
00661        JRI_SetStaticFieldLong_op,
00662        JRI_SetStaticFieldFloat_op,
00663        JRI_SetStaticFieldDouble_op,
00664        JRI_NewString_op,
00665        JRI_GetStringLength_op,
00666        JRI_GetStringChars_op,
00667        JRI_NewStringUTF_op,
00668        JRI_GetStringUTFLength_op,
00669        JRI_GetStringUTFChars_op,
00670        JRI_NewScalarArray_op,
00671        JRI_GetScalarArrayLength_op,
00672        JRI_GetScalarArrayElements_op,
00673        JRI_NewObjectArray_op,
00674        JRI_GetObjectArrayLength_op,
00675        JRI_GetObjectArrayElement_op,
00676        JRI_SetObjectArrayElement_op,
00677        JRI_RegisterNatives_op,
00678        JRI_UnregisterNatives_op,
00679        JRI_DefineClass_op,
00680        JRI_NewStringPlatform_op,
00681        JRI_GetStringPlatformChars_op
00682 } JRIEnvOperations;
00683 
00684 #ifdef __cplusplus
00685 } /* extern "C" */
00686 #endif /* __cplusplus */
00687 
00688 #endif /* JRI_H */
00689 /******************************************************************************/