jri.h 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  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. * Java Runtime Interface
  39. ******************************************************************************/
  40. #ifndef JRI_H
  41. #define JRI_H
  42. #include "jritypes.h"
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif /* __cplusplus */
  46. /*******************************************************************************
  47. * JRIEnv
  48. ******************************************************************************/
  49. /* The type of the JRIEnv interface. */
  50. typedef struct JRIEnvInterface JRIEnvInterface;
  51. /* The type of a JRIEnv instance. */
  52. typedef const JRIEnvInterface* JRIEnv;
  53. /*******************************************************************************
  54. * JRIEnv Operations
  55. ******************************************************************************/
  56. #define JRI_DefineClass(env, classLoader, buf, bufLen) \
  57. (((*(env))->DefineClass)(env, JRI_DefineClass_op, classLoader, buf, bufLen))
  58. #define JRI_FindClass(env, name) \
  59. (((*(env))->FindClass)(env, JRI_FindClass_op, name))
  60. #define JRI_Throw(env, obj) \
  61. (((*(env))->Throw)(env, JRI_Throw_op, obj))
  62. #define JRI_ThrowNew(env, clazz, message) \
  63. (((*(env))->ThrowNew)(env, JRI_ThrowNew_op, clazz, message))
  64. #define JRI_ExceptionOccurred(env) \
  65. (((*(env))->ExceptionOccurred)(env, JRI_ExceptionOccurred_op))
  66. #define JRI_ExceptionDescribe(env) \
  67. (((*(env))->ExceptionDescribe)(env, JRI_ExceptionDescribe_op))
  68. #define JRI_ExceptionClear(env) \
  69. (((*(env))->ExceptionClear)(env, JRI_ExceptionClear_op))
  70. #define JRI_NewGlobalRef(env, ref) \
  71. (((*(env))->NewGlobalRef)(env, JRI_NewGlobalRef_op, ref))
  72. #define JRI_DisposeGlobalRef(env, gref) \
  73. (((*(env))->DisposeGlobalRef)(env, JRI_DisposeGlobalRef_op, gref))
  74. #define JRI_GetGlobalRef(env, gref) \
  75. (((*(env))->GetGlobalRef)(env, JRI_GetGlobalRef_op, gref))
  76. #define JRI_SetGlobalRef(env, gref, ref) \
  77. (((*(env))->SetGlobalRef)(env, JRI_SetGlobalRef_op, gref, ref))
  78. #define JRI_IsSameObject(env, a, b) \
  79. (((*(env))->IsSameObject)(env, JRI_IsSameObject_op, a, b))
  80. #define JRI_NewObject(env) ((*(env))->NewObject)
  81. #define JRI_NewObjectV(env, clazz, methodID, args) \
  82. (((*(env))->NewObjectV)(env, JRI_NewObject_op_va_list, clazz, methodID, args))
  83. #define JRI_NewObjectA(env, clazz, method, args) \
  84. (((*(env))->NewObjectA)(env, JRI_NewObject_op_array, clazz, methodID, args))
  85. #define JRI_GetObjectClass(env, obj) \
  86. (((*(env))->GetObjectClass)(env, JRI_GetObjectClass_op, obj))
  87. #define JRI_IsInstanceOf(env, obj, clazz) \
  88. (((*(env))->IsInstanceOf)(env, JRI_IsInstanceOf_op, obj, clazz))
  89. #define JRI_GetMethodID(env, clazz, name, sig) \
  90. (((*(env))->GetMethodID)(env, JRI_GetMethodID_op, clazz, name, sig))
  91. #define JRI_CallMethod(env) ((*(env))->CallMethod)
  92. #define JRI_CallMethodV(env, obj, methodID, args) \
  93. (((*(env))->CallMethodV)(env, JRI_CallMethod_op_va_list, obj, methodID, args))
  94. #define JRI_CallMethodA(env, obj, methodID, args) \
  95. (((*(env))->CallMethodA)(env, JRI_CallMethod_op_array, obj, methodID, args))
  96. #define JRI_CallMethodBoolean(env) ((*(env))->CallMethodBoolean)
  97. #define JRI_CallMethodBooleanV(env, obj, methodID, args) \
  98. (((*(env))->CallMethodBooleanV)(env, JRI_CallMethodBoolean_op_va_list, obj, methodID, args))
  99. #define JRI_CallMethodBooleanA(env, obj, methodID, args) \
  100. (((*(env))->CallMethodBooleanA)(env, JRI_CallMethodBoolean_op_array, obj, methodID, args))
  101. #define JRI_CallMethodByte(env) ((*(env))->CallMethodByte)
  102. #define JRI_CallMethodByteV(env, obj, methodID, args) \
  103. (((*(env))->CallMethodByteV)(env, JRI_CallMethodByte_op_va_list, obj, methodID, args))
  104. #define JRI_CallMethodByteA(env, obj, methodID, args) \
  105. (((*(env))->CallMethodByteA)(env, JRI_CallMethodByte_op_array, obj, methodID, args))
  106. #define JRI_CallMethodChar(env) ((*(env))->CallMethodChar)
  107. #define JRI_CallMethodCharV(env, obj, methodID, args) \
  108. (((*(env))->CallMethodCharV)(env, JRI_CallMethodChar_op_va_list, obj, methodID, args))
  109. #define JRI_CallMethodCharA(env, obj, methodID, args) \
  110. (((*(env))->CallMethodCharA)(env, JRI_CallMethodChar_op_array, obj, methodID, args))
  111. #define JRI_CallMethodShort(env) ((*(env))->CallMethodShort)
  112. #define JRI_CallMethodShortV(env, obj, methodID, args) \
  113. (((*(env))->CallMethodShortV)(env, JRI_CallMethodShort_op_va_list, obj, methodID, args))
  114. #define JRI_CallMethodShortA(env, obj, methodID, args) \
  115. (((*(env))->CallMethodShortA)(env, JRI_CallMethodShort_op_array, obj, methodID, args))
  116. #define JRI_CallMethodInt(env) ((*(env))->CallMethodInt)
  117. #define JRI_CallMethodIntV(env, obj, methodID, args) \
  118. (((*(env))->CallMethodIntV)(env, JRI_CallMethodInt_op_va_list, obj, methodID, args))
  119. #define JRI_CallMethodIntA(env, obj, methodID, args) \
  120. (((*(env))->CallMethodIntA)(env, JRI_CallMethodInt_op_array, obj, methodID, args))
  121. #define JRI_CallMethodLong(env) ((*(env))->CallMethodLong)
  122. #define JRI_CallMethodLongV(env, obj, methodID, args) \
  123. (((*(env))->CallMethodLongV)(env, JRI_CallMethodLong_op_va_list, obj, methodID, args))
  124. #define JRI_CallMethodLongA(env, obj, methodID, args) \
  125. (((*(env))->CallMethodLongA)(env, JRI_CallMethodLong_op_array, obj, methodID, args))
  126. #define JRI_CallMethodFloat(env) ((*(env))->CallMethodFloat)
  127. #define JRI_CallMethodFloatV(env, obj, methodID, args) \
  128. (((*(env))->CallMethodFloatV)(env, JRI_CallMethodFloat_op_va_list, obj, methodID, args))
  129. #define JRI_CallMethodFloatA(env, obj, methodID, args) \
  130. (((*(env))->CallMethodFloatA)(env, JRI_CallMethodFloat_op_array, obj, methodID, args))
  131. #define JRI_CallMethodDouble(env) ((*(env))->CallMethodDouble)
  132. #define JRI_CallMethodDoubleV(env, obj, methodID, args) \
  133. (((*(env))->CallMethodDoubleV)(env, JRI_CallMethodDouble_op_va_list, obj, methodID, args))
  134. #define JRI_CallMethodDoubleA(env, obj, methodID, args) \
  135. (((*(env))->CallMethodDoubleA)(env, JRI_CallMethodDouble_op_array, obj, methodID, args))
  136. #define JRI_GetFieldID(env, clazz, name, sig) \
  137. (((*(env))->GetFieldID)(env, JRI_GetFieldID_op, clazz, name, sig))
  138. #define JRI_GetField(env, obj, fieldID) \
  139. (((*(env))->GetField)(env, JRI_GetField_op, obj, fieldID))
  140. #define JRI_GetFieldBoolean(env, obj, fieldID) \
  141. (((*(env))->GetFieldBoolean)(env, JRI_GetFieldBoolean_op, obj, fieldID))
  142. #define JRI_GetFieldByte(env, obj, fieldID) \
  143. (((*(env))->GetFieldByte)(env, JRI_GetFieldByte_op, obj, fieldID))
  144. #define JRI_GetFieldChar(env, obj, fieldID) \
  145. (((*(env))->GetFieldChar)(env, JRI_GetFieldChar_op, obj, fieldID))
  146. #define JRI_GetFieldShort(env, obj, fieldID) \
  147. (((*(env))->GetFieldShort)(env, JRI_GetFieldShort_op, obj, fieldID))
  148. #define JRI_GetFieldInt(env, obj, fieldID) \
  149. (((*(env))->GetFieldInt)(env, JRI_GetFieldInt_op, obj, fieldID))
  150. #define JRI_GetFieldLong(env, obj, fieldID) \
  151. (((*(env))->GetFieldLong)(env, JRI_GetFieldLong_op, obj, fieldID))
  152. #define JRI_GetFieldFloat(env, obj, fieldID) \
  153. (((*(env))->GetFieldFloat)(env, JRI_GetFieldFloat_op, obj, fieldID))
  154. #define JRI_GetFieldDouble(env, obj, fieldID) \
  155. (((*(env))->GetFieldDouble)(env, JRI_GetFieldDouble_op, obj, fieldID))
  156. #define JRI_SetField(env, obj, fieldID, value) \
  157. (((*(env))->SetField)(env, JRI_SetField_op, obj, fieldID, value))
  158. #define JRI_SetFieldBoolean(env, obj, fieldID, value) \
  159. (((*(env))->SetFieldBoolean)(env, JRI_SetFieldBoolean_op, obj, fieldID, value))
  160. #define JRI_SetFieldByte(env, obj, fieldID, value) \
  161. (((*(env))->SetFieldByte)(env, JRI_SetFieldByte_op, obj, fieldID, value))
  162. #define JRI_SetFieldChar(env, obj, fieldID, value) \
  163. (((*(env))->SetFieldChar)(env, JRI_SetFieldChar_op, obj, fieldID, value))
  164. #define JRI_SetFieldShort(env, obj, fieldID, value) \
  165. (((*(env))->SetFieldShort)(env, JRI_SetFieldShort_op, obj, fieldID, value))
  166. #define JRI_SetFieldInt(env, obj, fieldID, value) \
  167. (((*(env))->SetFieldInt)(env, JRI_SetFieldInt_op, obj, fieldID, value))
  168. #define JRI_SetFieldLong(env, obj, fieldID, value) \
  169. (((*(env))->SetFieldLong)(env, JRI_SetFieldLong_op, obj, fieldID, value))
  170. #define JRI_SetFieldFloat(env, obj, fieldID, value) \
  171. (((*(env))->SetFieldFloat)(env, JRI_SetFieldFloat_op, obj, fieldID, value))
  172. #define JRI_SetFieldDouble(env, obj, fieldID, value) \
  173. (((*(env))->SetFieldDouble)(env, JRI_SetFieldDouble_op, obj, fieldID, value))
  174. #define JRI_IsSubclassOf(env, a, b) \
  175. (((*(env))->IsSubclassOf)(env, JRI_IsSubclassOf_op, a, b))
  176. #define JRI_GetStaticMethodID(env, clazz, name, sig) \
  177. (((*(env))->GetStaticMethodID)(env, JRI_GetStaticMethodID_op, clazz, name, sig))
  178. #define JRI_CallStaticMethod(env) ((*(env))->CallStaticMethod)
  179. #define JRI_CallStaticMethodV(env, clazz, methodID, args) \
  180. (((*(env))->CallStaticMethodV)(env, JRI_CallStaticMethod_op_va_list, clazz, methodID, args))
  181. #define JRI_CallStaticMethodA(env, clazz, methodID, args) \
  182. (((*(env))->CallStaticMethodA)(env, JRI_CallStaticMethod_op_array, clazz, methodID, args))
  183. #define JRI_CallStaticMethodBoolean(env) ((*(env))->CallStaticMethodBoolean)
  184. #define JRI_CallStaticMethodBooleanV(env, clazz, methodID, args) \
  185. (((*(env))->CallStaticMethodBooleanV)(env, JRI_CallStaticMethodBoolean_op_va_list, clazz, methodID, args))
  186. #define JRI_CallStaticMethodBooleanA(env, clazz, methodID, args) \
  187. (((*(env))->CallStaticMethodBooleanA)(env, JRI_CallStaticMethodBoolean_op_array, clazz, methodID, args))
  188. #define JRI_CallStaticMethodByte(env) ((*(env))->CallStaticMethodByte)
  189. #define JRI_CallStaticMethodByteV(env, clazz, methodID, args) \
  190. (((*(env))->CallStaticMethodByteV)(env, JRI_CallStaticMethodByte_op_va_list, clazz, methodID, args))
  191. #define JRI_CallStaticMethodByteA(env, clazz, methodID, args) \
  192. (((*(env))->CallStaticMethodByteA)(env, JRI_CallStaticMethodByte_op_array, clazz, methodID, args))
  193. #define JRI_CallStaticMethodChar(env) ((*(env))->CallStaticMethodChar)
  194. #define JRI_CallStaticMethodCharV(env, clazz, methodID, args) \
  195. (((*(env))->CallStaticMethodCharV)(env, JRI_CallStaticMethodChar_op_va_list, clazz, methodID, args))
  196. #define JRI_CallStaticMethodCharA(env, clazz, methodID, args) \
  197. (((*(env))->CallStaticMethodCharA)(env, JRI_CallStaticMethodChar_op_array, clazz, methodID, args))
  198. #define JRI_CallStaticMethodShort(env) ((*(env))->CallStaticMethodShort)
  199. #define JRI_CallStaticMethodShortV(env, clazz, methodID, args) \
  200. (((*(env))->CallStaticMethodShortV)(env, JRI_CallStaticMethodShort_op_va_list, clazz, methodID, args))
  201. #define JRI_CallStaticMethodShortA(env, clazz, methodID, args) \
  202. (((*(env))->CallStaticMethodShortA)(env, JRI_CallStaticMethodShort_op_array, clazz, methodID, args))
  203. #define JRI_CallStaticMethodInt(env) ((*(env))->CallStaticMethodInt)
  204. #define JRI_CallStaticMethodIntV(env, clazz, methodID, args) \
  205. (((*(env))->CallStaticMethodIntV)(env, JRI_CallStaticMethodInt_op_va_list, clazz, methodID, args))
  206. #define JRI_CallStaticMethodIntA(env, clazz, methodID, args) \
  207. (((*(env))->CallStaticMethodIntA)(env, JRI_CallStaticMethodInt_op_array, clazz, methodID, args))
  208. #define JRI_CallStaticMethodLong(env) ((*(env))->CallStaticMethodLong)
  209. #define JRI_CallStaticMethodLongV(env, clazz, methodID, args) \
  210. (((*(env))->CallStaticMethodLongV)(env, JRI_CallStaticMethodLong_op_va_list, clazz, methodID, args))
  211. #define JRI_CallStaticMethodLongA(env, clazz, methodID, args) \
  212. (((*(env))->CallStaticMethodLongA)(env, JRI_CallStaticMethodLong_op_array, clazz, methodID, args))
  213. #define JRI_CallStaticMethodFloat(env) ((*(env))->CallStaticMethodFloat)
  214. #define JRI_CallStaticMethodFloatV(env, clazz, methodID, args) \
  215. (((*(env))->CallStaticMethodFloatV)(env, JRI_CallStaticMethodFloat_op_va_list, clazz, methodID, args))
  216. #define JRI_CallStaticMethodFloatA(env, clazz, methodID, args) \
  217. (((*(env))->CallStaticMethodFloatA)(env, JRI_CallStaticMethodFloat_op_array, clazz, methodID, args))
  218. #define JRI_CallStaticMethodDouble(env) ((*(env))->CallStaticMethodDouble)
  219. #define JRI_CallStaticMethodDoubleV(env, clazz, methodID, args) \
  220. (((*(env))->CallStaticMethodDoubleV)(env, JRI_CallStaticMethodDouble_op_va_list, clazz, methodID, args))
  221. #define JRI_CallStaticMethodDoubleA(env, clazz, methodID, args) \
  222. (((*(env))->CallStaticMethodDoubleA)(env, JRI_CallStaticMethodDouble_op_array, clazz, methodID, args))
  223. #define JRI_GetStaticFieldID(env, clazz, name, sig) \
  224. (((*(env))->GetStaticFieldID)(env, JRI_GetStaticFieldID_op, clazz, name, sig))
  225. #define JRI_GetStaticField(env, clazz, fieldID) \
  226. (((*(env))->GetStaticField)(env, JRI_GetStaticField_op, clazz, fieldID))
  227. #define JRI_GetStaticFieldBoolean(env, clazz, fieldID) \
  228. (((*(env))->GetStaticFieldBoolean)(env, JRI_GetStaticFieldBoolean_op, clazz, fieldID))
  229. #define JRI_GetStaticFieldByte(env, clazz, fieldID) \
  230. (((*(env))->GetStaticFieldByte)(env, JRI_GetStaticFieldByte_op, clazz, fieldID))
  231. #define JRI_GetStaticFieldChar(env, clazz, fieldID) \
  232. (((*(env))->GetStaticFieldChar)(env, JRI_GetStaticFieldChar_op, clazz, fieldID))
  233. #define JRI_GetStaticFieldShort(env, clazz, fieldID) \
  234. (((*(env))->GetStaticFieldShort)(env, JRI_GetStaticFieldShort_op, clazz, fieldID))
  235. #define JRI_GetStaticFieldInt(env, clazz, fieldID) \
  236. (((*(env))->GetStaticFieldInt)(env, JRI_GetStaticFieldInt_op, clazz, fieldID))
  237. #define JRI_GetStaticFieldLong(env, clazz, fieldID) \
  238. (((*(env))->GetStaticFieldLong)(env, JRI_GetStaticFieldLong_op, clazz, fieldID))
  239. #define JRI_GetStaticFieldFloat(env, clazz, fieldID) \
  240. (((*(env))->GetStaticFieldFloat)(env, JRI_GetStaticFieldFloat_op, clazz, fieldID))
  241. #define JRI_GetStaticFieldDouble(env, clazz, fieldID) \
  242. (((*(env))->GetStaticFieldDouble)(env, JRI_GetStaticFieldDouble_op, clazz, fieldID))
  243. #define JRI_SetStaticField(env, clazz, fieldID, value) \
  244. (((*(env))->SetStaticField)(env, JRI_SetStaticField_op, clazz, fieldID, value))
  245. #define JRI_SetStaticFieldBoolean(env, clazz, fieldID, value) \
  246. (((*(env))->SetStaticFieldBoolean)(env, JRI_SetStaticFieldBoolean_op, clazz, fieldID, value))
  247. #define JRI_SetStaticFieldByte(env, clazz, fieldID, value) \
  248. (((*(env))->SetStaticFieldByte)(env, JRI_SetStaticFieldByte_op, clazz, fieldID, value))
  249. #define JRI_SetStaticFieldChar(env, clazz, fieldID, value) \
  250. (((*(env))->SetStaticFieldChar)(env, JRI_SetStaticFieldChar_op, clazz, fieldID, value))
  251. #define JRI_SetStaticFieldShort(env, clazz, fieldID, value) \
  252. (((*(env))->SetStaticFieldShort)(env, JRI_SetStaticFieldShort_op, clazz, fieldID, value))
  253. #define JRI_SetStaticFieldInt(env, clazz, fieldID, value) \
  254. (((*(env))->SetStaticFieldInt)(env, JRI_SetStaticFieldInt_op, clazz, fieldID, value))
  255. #define JRI_SetStaticFieldLong(env, clazz, fieldID, value) \
  256. (((*(env))->SetStaticFieldLong)(env, JRI_SetStaticFieldLong_op, clazz, fieldID, value))
  257. #define JRI_SetStaticFieldFloat(env, clazz, fieldID, value) \
  258. (((*(env))->SetStaticFieldFloat)(env, JRI_SetStaticFieldFloat_op, clazz, fieldID, value))
  259. #define JRI_SetStaticFieldDouble(env, clazz, fieldID, value) \
  260. (((*(env))->SetStaticFieldDouble)(env, JRI_SetStaticFieldDouble_op, clazz, fieldID, value))
  261. #define JRI_NewString(env, unicode, len) \
  262. (((*(env))->NewString)(env, JRI_NewString_op, unicode, len))
  263. #define JRI_GetStringLength(env, string) \
  264. (((*(env))->GetStringLength)(env, JRI_GetStringLength_op, string))
  265. #define JRI_GetStringChars(env, string) \
  266. (((*(env))->GetStringChars)(env, JRI_GetStringChars_op, string))
  267. #define JRI_NewStringUTF(env, utf, len) \
  268. (((*(env))->NewStringUTF)(env, JRI_NewStringUTF_op, utf, len))
  269. #define JRI_GetStringUTFLength(env, string) \
  270. (((*(env))->GetStringUTFLength)(env, JRI_GetStringUTFLength_op, string))
  271. #define JRI_GetStringUTFChars(env, string) \
  272. (((*(env))->GetStringUTFChars)(env, JRI_GetStringUTFChars_op, string))
  273. #define JRI_NewScalarArray(env, length, elementSig, initialElements) \
  274. (((*(env))->NewScalarArray)(env, JRI_NewScalarArray_op, length, elementSig, initialElements))
  275. #define JRI_GetScalarArrayLength(env, array) \
  276. (((*(env))->GetScalarArrayLength)(env, JRI_GetScalarArrayLength_op, array))
  277. #define JRI_GetScalarArrayElements(env, array) \
  278. (((*(env))->GetScalarArrayElements)(env, JRI_GetScalarArrayElements_op, array))
  279. #define JRI_NewObjectArray(env, length, elementClass, initialElement) \
  280. (((*(env))->NewObjectArray)(env, JRI_NewObjectArray_op, length, elementClass, initialElement))
  281. #define JRI_GetObjectArrayLength(env, array) \
  282. (((*(env))->GetObjectArrayLength)(env, JRI_GetObjectArrayLength_op, array))
  283. #define JRI_GetObjectArrayElement(env, array, index) \
  284. (((*(env))->GetObjectArrayElement)(env, JRI_GetObjectArrayElement_op, array, index))
  285. #define JRI_SetObjectArrayElement(env, array, index, value) \
  286. (((*(env))->SetObjectArrayElement)(env, JRI_SetObjectArrayElement_op, array, index, value))
  287. #define JRI_RegisterNatives(env, clazz, nameAndSigArray, nativeProcArray) \
  288. (((*(env))->RegisterNatives)(env, JRI_RegisterNatives_op, clazz, nameAndSigArray, nativeProcArray))
  289. #define JRI_UnregisterNatives(env, clazz) \
  290. (((*(env))->UnregisterNatives)(env, JRI_UnregisterNatives_op, clazz))
  291. #define JRI_NewStringPlatform(env, string, len, encoding, encodingLength) \
  292. (((*(env))->NewStringPlatform)(env, JRI_NewStringPlatform_op, string, len, encoding, encodingLength))
  293. #define JRI_GetStringPlatformChars(env, string, encoding, encodingLength) \
  294. (((*(env))->GetStringPlatformChars)(env, JRI_GetStringPlatformChars_op, string, encoding, encodingLength))
  295. /*******************************************************************************
  296. * JRIEnv Interface
  297. ******************************************************************************/
  298. struct java_lang_ClassLoader;
  299. struct java_lang_Class;
  300. struct java_lang_Throwable;
  301. struct java_lang_Object;
  302. struct java_lang_String;
  303. struct JRIEnvInterface {
  304. void* reserved0;
  305. void* reserved1;
  306. void* reserved2;
  307. void* reserved3;
  308. struct java_lang_Class* (*FindClass)(JRIEnv* env, jint op, const char* a);
  309. void (*Throw)(JRIEnv* env, jint op, struct java_lang_Throwable* a);
  310. void (*ThrowNew)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b);
  311. struct java_lang_Throwable* (*ExceptionOccurred)(JRIEnv* env, jint op);
  312. void (*ExceptionDescribe)(JRIEnv* env, jint op);
  313. void (*ExceptionClear)(JRIEnv* env, jint op);
  314. jglobal (*NewGlobalRef)(JRIEnv* env, jint op, void* a);
  315. void (*DisposeGlobalRef)(JRIEnv* env, jint op, jglobal a);
  316. void* (*GetGlobalRef)(JRIEnv* env, jint op, jglobal a);
  317. void (*SetGlobalRef)(JRIEnv* env, jint op, jglobal a, void* b);
  318. jbool (*IsSameObject)(JRIEnv* env, jint op, void* a, void* b);
  319. void* (*NewObject)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  320. void* (*NewObjectV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  321. void* (*NewObjectA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  322. struct java_lang_Class* (*GetObjectClass)(JRIEnv* env, jint op, void* a);
  323. jbool (*IsInstanceOf)(JRIEnv* env, jint op, void* a, struct java_lang_Class* b);
  324. jint (*GetMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
  325. void* (*CallMethod)(JRIEnv* env, jint op, void* a, jint b, ...);
  326. void* (*CallMethodV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  327. void* (*CallMethodA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  328. jbool (*CallMethodBoolean)(JRIEnv* env, jint op, void* a, jint b, ...);
  329. jbool (*CallMethodBooleanV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  330. jbool (*CallMethodBooleanA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  331. jbyte (*CallMethodByte)(JRIEnv* env, jint op, void* a, jint b, ...);
  332. jbyte (*CallMethodByteV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  333. jbyte (*CallMethodByteA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  334. jchar (*CallMethodChar)(JRIEnv* env, jint op, void* a, jint b, ...);
  335. jchar (*CallMethodCharV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  336. jchar (*CallMethodCharA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  337. jshort (*CallMethodShort)(JRIEnv* env, jint op, void* a, jint b, ...);
  338. jshort (*CallMethodShortV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  339. jshort (*CallMethodShortA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  340. jint (*CallMethodInt)(JRIEnv* env, jint op, void* a, jint b, ...);
  341. jint (*CallMethodIntV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  342. jint (*CallMethodIntA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  343. jlong (*CallMethodLong)(JRIEnv* env, jint op, void* a, jint b, ...);
  344. jlong (*CallMethodLongV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  345. jlong (*CallMethodLongA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  346. jfloat (*CallMethodFloat)(JRIEnv* env, jint op, void* a, jint b, ...);
  347. jfloat (*CallMethodFloatV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  348. jfloat (*CallMethodFloatA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  349. jdouble (*CallMethodDouble)(JRIEnv* env, jint op, void* a, jint b, ...);
  350. jdouble (*CallMethodDoubleV)(JRIEnv* env, jint op, void* a, jint b, va_list c);
  351. jdouble (*CallMethodDoubleA)(JRIEnv* env, jint op, void* a, jint b, JRIValue* c);
  352. jint (*GetFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
  353. void* (*GetField)(JRIEnv* env, jint op, void* a, jint b);
  354. jbool (*GetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b);
  355. jbyte (*GetFieldByte)(JRIEnv* env, jint op, void* a, jint b);
  356. jchar (*GetFieldChar)(JRIEnv* env, jint op, void* a, jint b);
  357. jshort (*GetFieldShort)(JRIEnv* env, jint op, void* a, jint b);
  358. jint (*GetFieldInt)(JRIEnv* env, jint op, void* a, jint b);
  359. jlong (*GetFieldLong)(JRIEnv* env, jint op, void* a, jint b);
  360. jfloat (*GetFieldFloat)(JRIEnv* env, jint op, void* a, jint b);
  361. jdouble (*GetFieldDouble)(JRIEnv* env, jint op, void* a, jint b);
  362. void (*SetField)(JRIEnv* env, jint op, void* a, jint b, void* c);
  363. void (*SetFieldBoolean)(JRIEnv* env, jint op, void* a, jint b, jbool c);
  364. void (*SetFieldByte)(JRIEnv* env, jint op, void* a, jint b, jbyte c);
  365. void (*SetFieldChar)(JRIEnv* env, jint op, void* a, jint b, jchar c);
  366. void (*SetFieldShort)(JRIEnv* env, jint op, void* a, jint b, jshort c);
  367. void (*SetFieldInt)(JRIEnv* env, jint op, void* a, jint b, jint c);
  368. void (*SetFieldLong)(JRIEnv* env, jint op, void* a, jint b, jlong c);
  369. void (*SetFieldFloat)(JRIEnv* env, jint op, void* a, jint b, jfloat c);
  370. void (*SetFieldDouble)(JRIEnv* env, jint op, void* a, jint b, jdouble c);
  371. jbool (*IsSubclassOf)(JRIEnv* env, jint op, struct java_lang_Class* a, struct java_lang_Class* b);
  372. jint (*GetStaticMethodID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
  373. void* (*CallStaticMethod)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  374. void* (*CallStaticMethodV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  375. void* (*CallStaticMethodA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  376. jbool (*CallStaticMethodBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  377. jbool (*CallStaticMethodBooleanV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  378. jbool (*CallStaticMethodBooleanA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  379. jbyte (*CallStaticMethodByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  380. jbyte (*CallStaticMethodByteV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  381. jbyte (*CallStaticMethodByteA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  382. jchar (*CallStaticMethodChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  383. jchar (*CallStaticMethodCharV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  384. jchar (*CallStaticMethodCharA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  385. jshort (*CallStaticMethodShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  386. jshort (*CallStaticMethodShortV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  387. jshort (*CallStaticMethodShortA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  388. jint (*CallStaticMethodInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  389. jint (*CallStaticMethodIntV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  390. jint (*CallStaticMethodIntA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  391. jlong (*CallStaticMethodLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  392. jlong (*CallStaticMethodLongV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  393. jlong (*CallStaticMethodLongA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  394. jfloat (*CallStaticMethodFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  395. jfloat (*CallStaticMethodFloatV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  396. jfloat (*CallStaticMethodFloatA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  397. jdouble (*CallStaticMethodDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, ...);
  398. jdouble (*CallStaticMethodDoubleV)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, va_list c);
  399. jdouble (*CallStaticMethodDoubleA)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, JRIValue* c);
  400. jint (*GetStaticFieldID)(JRIEnv* env, jint op, struct java_lang_Class* a, const char* b, const char* c);
  401. void* (*GetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  402. jbool (*GetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  403. jbyte (*GetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  404. jchar (*GetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  405. jshort (*GetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  406. jint (*GetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  407. jlong (*GetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  408. jfloat (*GetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  409. jdouble (*GetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b);
  410. void (*SetStaticField)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, void* c);
  411. void (*SetStaticFieldBoolean)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbool c);
  412. void (*SetStaticFieldByte)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jbyte c);
  413. void (*SetStaticFieldChar)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jchar c);
  414. void (*SetStaticFieldShort)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jshort c);
  415. void (*SetStaticFieldInt)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jint c);
  416. void (*SetStaticFieldLong)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jlong c);
  417. void (*SetStaticFieldFloat)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jfloat c);
  418. void (*SetStaticFieldDouble)(JRIEnv* env, jint op, struct java_lang_Class* a, jint b, jdouble c);
  419. struct java_lang_String* (*NewString)(JRIEnv* env, jint op, const jchar* a, jint b);
  420. jint (*GetStringLength)(JRIEnv* env, jint op, struct java_lang_String* a);
  421. const jchar* (*GetStringChars)(JRIEnv* env, jint op, struct java_lang_String* a);
  422. struct java_lang_String* (*NewStringUTF)(JRIEnv* env, jint op, const jbyte* a, jint b);
  423. jint (*GetStringUTFLength)(JRIEnv* env, jint op, struct java_lang_String* a);
  424. const jbyte* (*GetStringUTFChars)(JRIEnv* env, jint op, struct java_lang_String* a);
  425. void* (*NewScalarArray)(JRIEnv* env, jint op, jint a, const char* b, const jbyte* c);
  426. jint (*GetScalarArrayLength)(JRIEnv* env, jint op, void* a);
  427. jbyte* (*GetScalarArrayElements)(JRIEnv* env, jint op, void* a);
  428. void* (*NewObjectArray)(JRIEnv* env, jint op, jint a, struct java_lang_Class* b, void* c);
  429. jint (*GetObjectArrayLength)(JRIEnv* env, jint op, void* a);
  430. void* (*GetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b);
  431. void (*SetObjectArrayElement)(JRIEnv* env, jint op, void* a, jint b, void* c);
  432. void (*RegisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a, char** b, void** c);
  433. void (*UnregisterNatives)(JRIEnv* env, jint op, struct java_lang_Class* a);
  434. struct java_lang_Class* (*DefineClass)(JRIEnv* env, jint op, struct java_lang_ClassLoader* a, jbyte* b, jsize bLen);
  435. struct java_lang_String* (*NewStringPlatform)(JRIEnv* env, jint op, const jbyte* a, jint b, const jbyte* c, jint d);
  436. const jbyte* (*GetStringPlatformChars)(JRIEnv* env, jint op, struct java_lang_String* a, const jbyte* b, jint c);
  437. };
  438. /*
  439. ** ****************************************************************************
  440. ** JRIEnv Operation IDs
  441. ** ***************************************************************************
  442. */
  443. typedef enum JRIEnvOperations {
  444. JRI_Reserved0_op,
  445. JRI_Reserved1_op,
  446. JRI_Reserved2_op,
  447. JRI_Reserved3_op,
  448. JRI_FindClass_op,
  449. JRI_Throw_op,
  450. JRI_ThrowNew_op,
  451. JRI_ExceptionOccurred_op,
  452. JRI_ExceptionDescribe_op,
  453. JRI_ExceptionClear_op,
  454. JRI_NewGlobalRef_op,
  455. JRI_DisposeGlobalRef_op,
  456. JRI_GetGlobalRef_op,
  457. JRI_SetGlobalRef_op,
  458. JRI_IsSameObject_op,
  459. JRI_NewObject_op,
  460. JRI_NewObject_op_va_list,
  461. JRI_NewObject_op_array,
  462. JRI_GetObjectClass_op,
  463. JRI_IsInstanceOf_op,
  464. JRI_GetMethodID_op,
  465. JRI_CallMethod_op,
  466. JRI_CallMethod_op_va_list,
  467. JRI_CallMethod_op_array,
  468. JRI_CallMethodBoolean_op,
  469. JRI_CallMethodBoolean_op_va_list,
  470. JRI_CallMethodBoolean_op_array,
  471. JRI_CallMethodByte_op,
  472. JRI_CallMethodByte_op_va_list,
  473. JRI_CallMethodByte_op_array,
  474. JRI_CallMethodChar_op,
  475. JRI_CallMethodChar_op_va_list,
  476. JRI_CallMethodChar_op_array,
  477. JRI_CallMethodShort_op,
  478. JRI_CallMethodShort_op_va_list,
  479. JRI_CallMethodShort_op_array,
  480. JRI_CallMethodInt_op,
  481. JRI_CallMethodInt_op_va_list,
  482. JRI_CallMethodInt_op_array,
  483. JRI_CallMethodLong_op,
  484. JRI_CallMethodLong_op_va_list,
  485. JRI_CallMethodLong_op_array,
  486. JRI_CallMethodFloat_op,
  487. JRI_CallMethodFloat_op_va_list,
  488. JRI_CallMethodFloat_op_array,
  489. JRI_CallMethodDouble_op,
  490. JRI_CallMethodDouble_op_va_list,
  491. JRI_CallMethodDouble_op_array,
  492. JRI_GetFieldID_op,
  493. JRI_GetField_op,
  494. JRI_GetFieldBoolean_op,
  495. JRI_GetFieldByte_op,
  496. JRI_GetFieldChar_op,
  497. JRI_GetFieldShort_op,
  498. JRI_GetFieldInt_op,
  499. JRI_GetFieldLong_op,
  500. JRI_GetFieldFloat_op,
  501. JRI_GetFieldDouble_op,
  502. JRI_SetField_op,
  503. JRI_SetFieldBoolean_op,
  504. JRI_SetFieldByte_op,
  505. JRI_SetFieldChar_op,
  506. JRI_SetFieldShort_op,
  507. JRI_SetFieldInt_op,
  508. JRI_SetFieldLong_op,
  509. JRI_SetFieldFloat_op,
  510. JRI_SetFieldDouble_op,
  511. JRI_IsSubclassOf_op,
  512. JRI_GetStaticMethodID_op,
  513. JRI_CallStaticMethod_op,
  514. JRI_CallStaticMethod_op_va_list,
  515. JRI_CallStaticMethod_op_array,
  516. JRI_CallStaticMethodBoolean_op,
  517. JRI_CallStaticMethodBoolean_op_va_list,
  518. JRI_CallStaticMethodBoolean_op_array,
  519. JRI_CallStaticMethodByte_op,
  520. JRI_CallStaticMethodByte_op_va_list,
  521. JRI_CallStaticMethodByte_op_array,
  522. JRI_CallStaticMethodChar_op,
  523. JRI_CallStaticMethodChar_op_va_list,
  524. JRI_CallStaticMethodChar_op_array,
  525. JRI_CallStaticMethodShort_op,
  526. JRI_CallStaticMethodShort_op_va_list,
  527. JRI_CallStaticMethodShort_op_array,
  528. JRI_CallStaticMethodInt_op,
  529. JRI_CallStaticMethodInt_op_va_list,
  530. JRI_CallStaticMethodInt_op_array,
  531. JRI_CallStaticMethodLong_op,
  532. JRI_CallStaticMethodLong_op_va_list,
  533. JRI_CallStaticMethodLong_op_array,
  534. JRI_CallStaticMethodFloat_op,
  535. JRI_CallStaticMethodFloat_op_va_list,
  536. JRI_CallStaticMethodFloat_op_array,
  537. JRI_CallStaticMethodDouble_op,
  538. JRI_CallStaticMethodDouble_op_va_list,
  539. JRI_CallStaticMethodDouble_op_array,
  540. JRI_GetStaticFieldID_op,
  541. JRI_GetStaticField_op,
  542. JRI_GetStaticFieldBoolean_op,
  543. JRI_GetStaticFieldByte_op,
  544. JRI_GetStaticFieldChar_op,
  545. JRI_GetStaticFieldShort_op,
  546. JRI_GetStaticFieldInt_op,
  547. JRI_GetStaticFieldLong_op,
  548. JRI_GetStaticFieldFloat_op,
  549. JRI_GetStaticFieldDouble_op,
  550. JRI_SetStaticField_op,
  551. JRI_SetStaticFieldBoolean_op,
  552. JRI_SetStaticFieldByte_op,
  553. JRI_SetStaticFieldChar_op,
  554. JRI_SetStaticFieldShort_op,
  555. JRI_SetStaticFieldInt_op,
  556. JRI_SetStaticFieldLong_op,
  557. JRI_SetStaticFieldFloat_op,
  558. JRI_SetStaticFieldDouble_op,
  559. JRI_NewString_op,
  560. JRI_GetStringLength_op,
  561. JRI_GetStringChars_op,
  562. JRI_NewStringUTF_op,
  563. JRI_GetStringUTFLength_op,
  564. JRI_GetStringUTFChars_op,
  565. JRI_NewScalarArray_op,
  566. JRI_GetScalarArrayLength_op,
  567. JRI_GetScalarArrayElements_op,
  568. JRI_NewObjectArray_op,
  569. JRI_GetObjectArrayLength_op,
  570. JRI_GetObjectArrayElement_op,
  571. JRI_SetObjectArrayElement_op,
  572. JRI_RegisterNatives_op,
  573. JRI_UnregisterNatives_op,
  574. JRI_DefineClass_op,
  575. JRI_NewStringPlatform_op,
  576. JRI_GetStringPlatformChars_op
  577. } JRIEnvOperations;
  578. #ifdef __cplusplus
  579. } /* extern "C" */
  580. #endif /* __cplusplus */
  581. #endif /* JRI_H */
  582. /******************************************************************************/