jni.h 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001
  1. /*
  2. * Copyright (c) 1996, 2023, Oracle and/or its affiliates. All rights reserved.
  3. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4. *
  5. * This code is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License version 2 only, as
  7. * published by the Free Software Foundation. Oracle designates this
  8. * particular file as subject to the "Classpath" exception as provided
  9. * by Oracle in the LICENSE file that accompanied this code.
  10. *
  11. * This code is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  14. * version 2 for more details (a copy is included in the LICENSE file that
  15. * accompanied this code).
  16. *
  17. * You should have received a copy of the GNU General Public License version
  18. * 2 along with this work; if not, write to the Free Software Foundation,
  19. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22. * or visit www.oracle.com if you need additional information or have any
  23. * questions.
  24. */
  25. /*
  26. * We used part of Netscape's Java Runtime Interface (JRI) as the starting
  27. * point of our design and implementation.
  28. */
  29. /******************************************************************************
  30. * Java Runtime Interface
  31. * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
  32. *****************************************************************************/
  33. #ifndef _JAVASOFT_JNI_H_
  34. #define _JAVASOFT_JNI_H_
  35. #include <stdio.h>
  36. #include <stdarg.h>
  37. /* jni_md.h contains the machine-dependent typedefs for jbyte, jint
  38. and jlong */
  39. #include "jni_md.h"
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /*
  44. * JNI Types
  45. */
  46. #ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
  47. typedef unsigned char jboolean;
  48. typedef unsigned short jchar;
  49. typedef short jshort;
  50. typedef float jfloat;
  51. typedef double jdouble;
  52. typedef jint jsize;
  53. #ifdef __cplusplus
  54. class _jobject {};
  55. class _jclass : public _jobject {};
  56. class _jthrowable : public _jobject {};
  57. class _jstring : public _jobject {};
  58. class _jarray : public _jobject {};
  59. class _jbooleanArray : public _jarray {};
  60. class _jbyteArray : public _jarray {};
  61. class _jcharArray : public _jarray {};
  62. class _jshortArray : public _jarray {};
  63. class _jintArray : public _jarray {};
  64. class _jlongArray : public _jarray {};
  65. class _jfloatArray : public _jarray {};
  66. class _jdoubleArray : public _jarray {};
  67. class _jobjectArray : public _jarray {};
  68. typedef _jobject *jobject;
  69. typedef _jclass *jclass;
  70. typedef _jthrowable *jthrowable;
  71. typedef _jstring *jstring;
  72. typedef _jarray *jarray;
  73. typedef _jbooleanArray *jbooleanArray;
  74. typedef _jbyteArray *jbyteArray;
  75. typedef _jcharArray *jcharArray;
  76. typedef _jshortArray *jshortArray;
  77. typedef _jintArray *jintArray;
  78. typedef _jlongArray *jlongArray;
  79. typedef _jfloatArray *jfloatArray;
  80. typedef _jdoubleArray *jdoubleArray;
  81. typedef _jobjectArray *jobjectArray;
  82. #else
  83. struct _jobject;
  84. typedef struct _jobject *jobject;
  85. typedef jobject jclass;
  86. typedef jobject jthrowable;
  87. typedef jobject jstring;
  88. typedef jobject jarray;
  89. typedef jarray jbooleanArray;
  90. typedef jarray jbyteArray;
  91. typedef jarray jcharArray;
  92. typedef jarray jshortArray;
  93. typedef jarray jintArray;
  94. typedef jarray jlongArray;
  95. typedef jarray jfloatArray;
  96. typedef jarray jdoubleArray;
  97. typedef jarray jobjectArray;
  98. #endif
  99. typedef jobject jweak;
  100. typedef union jvalue {
  101. jboolean z;
  102. jbyte b;
  103. jchar c;
  104. jshort s;
  105. jint i;
  106. jlong j;
  107. jfloat f;
  108. jdouble d;
  109. jobject l;
  110. } jvalue;
  111. struct _jfieldID;
  112. typedef struct _jfieldID *jfieldID;
  113. struct _jmethodID;
  114. typedef struct _jmethodID *jmethodID;
  115. /* Return values from jobjectRefType */
  116. typedef enum _jobjectType {
  117. JNIInvalidRefType = 0,
  118. JNILocalRefType = 1,
  119. JNIGlobalRefType = 2,
  120. JNIWeakGlobalRefType = 3
  121. } jobjectRefType;
  122. #endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
  123. /*
  124. * jboolean constants
  125. */
  126. #define JNI_FALSE 0
  127. #define JNI_TRUE 1
  128. /*
  129. * possible return values for JNI functions.
  130. */
  131. #define JNI_OK 0 /* success */
  132. #define JNI_ERR (-1) /* unknown error */
  133. #define JNI_EDETACHED (-2) /* thread detached from the VM */
  134. #define JNI_EVERSION (-3) /* JNI version error */
  135. #define JNI_ENOMEM (-4) /* not enough memory */
  136. #define JNI_EEXIST (-5) /* VM already created */
  137. #define JNI_EINVAL (-6) /* invalid arguments */
  138. /*
  139. * used in ReleaseScalarArrayElements
  140. */
  141. #define JNI_COMMIT 1
  142. #define JNI_ABORT 2
  143. /*
  144. * used in RegisterNatives to describe native method name, signature,
  145. * and function pointer.
  146. */
  147. typedef struct {
  148. char *name;
  149. char *signature;
  150. void *fnPtr;
  151. } JNINativeMethod;
  152. /*
  153. * JNI Native Method Interface.
  154. */
  155. struct JNINativeInterface_;
  156. struct JNIEnv_;
  157. #ifdef __cplusplus
  158. typedef JNIEnv_ JNIEnv;
  159. #else
  160. typedef const struct JNINativeInterface_ *JNIEnv;
  161. #endif
  162. /*
  163. * JNI Invocation Interface.
  164. */
  165. struct JNIInvokeInterface_;
  166. struct JavaVM_;
  167. #ifdef __cplusplus
  168. typedef JavaVM_ JavaVM;
  169. #else
  170. typedef const struct JNIInvokeInterface_ *JavaVM;
  171. #endif
  172. struct JNINativeInterface_ {
  173. void *reserved0;
  174. void *reserved1;
  175. void *reserved2;
  176. void *reserved3;
  177. jint (JNICALL *GetVersion)(JNIEnv *env);
  178. jclass (JNICALL *DefineClass)
  179. (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
  180. jsize len);
  181. jclass (JNICALL *FindClass)
  182. (JNIEnv *env, const char *name);
  183. jmethodID (JNICALL *FromReflectedMethod)
  184. (JNIEnv *env, jobject method);
  185. jfieldID (JNICALL *FromReflectedField)
  186. (JNIEnv *env, jobject field);
  187. jobject (JNICALL *ToReflectedMethod)
  188. (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
  189. jclass (JNICALL *GetSuperclass)
  190. (JNIEnv *env, jclass sub);
  191. jboolean (JNICALL *IsAssignableFrom)
  192. (JNIEnv *env, jclass sub, jclass sup);
  193. jobject (JNICALL *ToReflectedField)
  194. (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
  195. jint (JNICALL *Throw)
  196. (JNIEnv *env, jthrowable obj);
  197. jint (JNICALL *ThrowNew)
  198. (JNIEnv *env, jclass clazz, const char *msg);
  199. jthrowable (JNICALL *ExceptionOccurred)
  200. (JNIEnv *env);
  201. void (JNICALL *ExceptionDescribe)
  202. (JNIEnv *env);
  203. void (JNICALL *ExceptionClear)
  204. (JNIEnv *env);
  205. void (JNICALL *FatalError)
  206. (JNIEnv *env, const char *msg);
  207. jint (JNICALL *PushLocalFrame)
  208. (JNIEnv *env, jint capacity);
  209. jobject (JNICALL *PopLocalFrame)
  210. (JNIEnv *env, jobject result);
  211. jobject (JNICALL *NewGlobalRef)
  212. (JNIEnv *env, jobject lobj);
  213. void (JNICALL *DeleteGlobalRef)
  214. (JNIEnv *env, jobject gref);
  215. void (JNICALL *DeleteLocalRef)
  216. (JNIEnv *env, jobject obj);
  217. jboolean (JNICALL *IsSameObject)
  218. (JNIEnv *env, jobject obj1, jobject obj2);
  219. jobject (JNICALL *NewLocalRef)
  220. (JNIEnv *env, jobject ref);
  221. jint (JNICALL *EnsureLocalCapacity)
  222. (JNIEnv *env, jint capacity);
  223. jobject (JNICALL *AllocObject)
  224. (JNIEnv *env, jclass clazz);
  225. jobject (JNICALL *NewObject)
  226. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  227. jobject (JNICALL *NewObjectV)
  228. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  229. jobject (JNICALL *NewObjectA)
  230. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  231. jclass (JNICALL *GetObjectClass)
  232. (JNIEnv *env, jobject obj);
  233. jboolean (JNICALL *IsInstanceOf)
  234. (JNIEnv *env, jobject obj, jclass clazz);
  235. jmethodID (JNICALL *GetMethodID)
  236. (JNIEnv *env, jclass clazz, const char *name, const char *sig);
  237. jobject (JNICALL *CallObjectMethod)
  238. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  239. jobject (JNICALL *CallObjectMethodV)
  240. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  241. jobject (JNICALL *CallObjectMethodA)
  242. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
  243. jboolean (JNICALL *CallBooleanMethod)
  244. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  245. jboolean (JNICALL *CallBooleanMethodV)
  246. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  247. jboolean (JNICALL *CallBooleanMethodA)
  248. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
  249. jbyte (JNICALL *CallByteMethod)
  250. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  251. jbyte (JNICALL *CallByteMethodV)
  252. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  253. jbyte (JNICALL *CallByteMethodA)
  254. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
  255. jchar (JNICALL *CallCharMethod)
  256. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  257. jchar (JNICALL *CallCharMethodV)
  258. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  259. jchar (JNICALL *CallCharMethodA)
  260. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
  261. jshort (JNICALL *CallShortMethod)
  262. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  263. jshort (JNICALL *CallShortMethodV)
  264. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  265. jshort (JNICALL *CallShortMethodA)
  266. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
  267. jint (JNICALL *CallIntMethod)
  268. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  269. jint (JNICALL *CallIntMethodV)
  270. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  271. jint (JNICALL *CallIntMethodA)
  272. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
  273. jlong (JNICALL *CallLongMethod)
  274. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  275. jlong (JNICALL *CallLongMethodV)
  276. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  277. jlong (JNICALL *CallLongMethodA)
  278. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
  279. jfloat (JNICALL *CallFloatMethod)
  280. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  281. jfloat (JNICALL *CallFloatMethodV)
  282. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  283. jfloat (JNICALL *CallFloatMethodA)
  284. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
  285. jdouble (JNICALL *CallDoubleMethod)
  286. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  287. jdouble (JNICALL *CallDoubleMethodV)
  288. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  289. jdouble (JNICALL *CallDoubleMethodA)
  290. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
  291. void (JNICALL *CallVoidMethod)
  292. (JNIEnv *env, jobject obj, jmethodID methodID, ...);
  293. void (JNICALL *CallVoidMethodV)
  294. (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
  295. void (JNICALL *CallVoidMethodA)
  296. (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
  297. jobject (JNICALL *CallNonvirtualObjectMethod)
  298. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  299. jobject (JNICALL *CallNonvirtualObjectMethodV)
  300. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  301. va_list args);
  302. jobject (JNICALL *CallNonvirtualObjectMethodA)
  303. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  304. const jvalue * args);
  305. jboolean (JNICALL *CallNonvirtualBooleanMethod)
  306. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  307. jboolean (JNICALL *CallNonvirtualBooleanMethodV)
  308. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  309. va_list args);
  310. jboolean (JNICALL *CallNonvirtualBooleanMethodA)
  311. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  312. const jvalue * args);
  313. jbyte (JNICALL *CallNonvirtualByteMethod)
  314. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  315. jbyte (JNICALL *CallNonvirtualByteMethodV)
  316. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  317. va_list args);
  318. jbyte (JNICALL *CallNonvirtualByteMethodA)
  319. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  320. const jvalue *args);
  321. jchar (JNICALL *CallNonvirtualCharMethod)
  322. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  323. jchar (JNICALL *CallNonvirtualCharMethodV)
  324. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  325. va_list args);
  326. jchar (JNICALL *CallNonvirtualCharMethodA)
  327. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  328. const jvalue *args);
  329. jshort (JNICALL *CallNonvirtualShortMethod)
  330. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  331. jshort (JNICALL *CallNonvirtualShortMethodV)
  332. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  333. va_list args);
  334. jshort (JNICALL *CallNonvirtualShortMethodA)
  335. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  336. const jvalue *args);
  337. jint (JNICALL *CallNonvirtualIntMethod)
  338. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  339. jint (JNICALL *CallNonvirtualIntMethodV)
  340. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  341. va_list args);
  342. jint (JNICALL *CallNonvirtualIntMethodA)
  343. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  344. const jvalue *args);
  345. jlong (JNICALL *CallNonvirtualLongMethod)
  346. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  347. jlong (JNICALL *CallNonvirtualLongMethodV)
  348. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  349. va_list args);
  350. jlong (JNICALL *CallNonvirtualLongMethodA)
  351. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  352. const jvalue *args);
  353. jfloat (JNICALL *CallNonvirtualFloatMethod)
  354. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  355. jfloat (JNICALL *CallNonvirtualFloatMethodV)
  356. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  357. va_list args);
  358. jfloat (JNICALL *CallNonvirtualFloatMethodA)
  359. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  360. const jvalue *args);
  361. jdouble (JNICALL *CallNonvirtualDoubleMethod)
  362. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  363. jdouble (JNICALL *CallNonvirtualDoubleMethodV)
  364. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  365. va_list args);
  366. jdouble (JNICALL *CallNonvirtualDoubleMethodA)
  367. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  368. const jvalue *args);
  369. void (JNICALL *CallNonvirtualVoidMethod)
  370. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
  371. void (JNICALL *CallNonvirtualVoidMethodV)
  372. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  373. va_list args);
  374. void (JNICALL *CallNonvirtualVoidMethodA)
  375. (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
  376. const jvalue * args);
  377. jfieldID (JNICALL *GetFieldID)
  378. (JNIEnv *env, jclass clazz, const char *name, const char *sig);
  379. jobject (JNICALL *GetObjectField)
  380. (JNIEnv *env, jobject obj, jfieldID fieldID);
  381. jboolean (JNICALL *GetBooleanField)
  382. (JNIEnv *env, jobject obj, jfieldID fieldID);
  383. jbyte (JNICALL *GetByteField)
  384. (JNIEnv *env, jobject obj, jfieldID fieldID);
  385. jchar (JNICALL *GetCharField)
  386. (JNIEnv *env, jobject obj, jfieldID fieldID);
  387. jshort (JNICALL *GetShortField)
  388. (JNIEnv *env, jobject obj, jfieldID fieldID);
  389. jint (JNICALL *GetIntField)
  390. (JNIEnv *env, jobject obj, jfieldID fieldID);
  391. jlong (JNICALL *GetLongField)
  392. (JNIEnv *env, jobject obj, jfieldID fieldID);
  393. jfloat (JNICALL *GetFloatField)
  394. (JNIEnv *env, jobject obj, jfieldID fieldID);
  395. jdouble (JNICALL *GetDoubleField)
  396. (JNIEnv *env, jobject obj, jfieldID fieldID);
  397. void (JNICALL *SetObjectField)
  398. (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
  399. void (JNICALL *SetBooleanField)
  400. (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
  401. void (JNICALL *SetByteField)
  402. (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
  403. void (JNICALL *SetCharField)
  404. (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
  405. void (JNICALL *SetShortField)
  406. (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
  407. void (JNICALL *SetIntField)
  408. (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
  409. void (JNICALL *SetLongField)
  410. (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
  411. void (JNICALL *SetFloatField)
  412. (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
  413. void (JNICALL *SetDoubleField)
  414. (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
  415. jmethodID (JNICALL *GetStaticMethodID)
  416. (JNIEnv *env, jclass clazz, const char *name, const char *sig);
  417. jobject (JNICALL *CallStaticObjectMethod)
  418. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  419. jobject (JNICALL *CallStaticObjectMethodV)
  420. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  421. jobject (JNICALL *CallStaticObjectMethodA)
  422. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  423. jboolean (JNICALL *CallStaticBooleanMethod)
  424. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  425. jboolean (JNICALL *CallStaticBooleanMethodV)
  426. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  427. jboolean (JNICALL *CallStaticBooleanMethodA)
  428. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  429. jbyte (JNICALL *CallStaticByteMethod)
  430. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  431. jbyte (JNICALL *CallStaticByteMethodV)
  432. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  433. jbyte (JNICALL *CallStaticByteMethodA)
  434. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  435. jchar (JNICALL *CallStaticCharMethod)
  436. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  437. jchar (JNICALL *CallStaticCharMethodV)
  438. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  439. jchar (JNICALL *CallStaticCharMethodA)
  440. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  441. jshort (JNICALL *CallStaticShortMethod)
  442. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  443. jshort (JNICALL *CallStaticShortMethodV)
  444. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  445. jshort (JNICALL *CallStaticShortMethodA)
  446. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  447. jint (JNICALL *CallStaticIntMethod)
  448. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  449. jint (JNICALL *CallStaticIntMethodV)
  450. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  451. jint (JNICALL *CallStaticIntMethodA)
  452. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  453. jlong (JNICALL *CallStaticLongMethod)
  454. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  455. jlong (JNICALL *CallStaticLongMethodV)
  456. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  457. jlong (JNICALL *CallStaticLongMethodA)
  458. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  459. jfloat (JNICALL *CallStaticFloatMethod)
  460. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  461. jfloat (JNICALL *CallStaticFloatMethodV)
  462. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  463. jfloat (JNICALL *CallStaticFloatMethodA)
  464. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  465. jdouble (JNICALL *CallStaticDoubleMethod)
  466. (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
  467. jdouble (JNICALL *CallStaticDoubleMethodV)
  468. (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
  469. jdouble (JNICALL *CallStaticDoubleMethodA)
  470. (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
  471. void (JNICALL *CallStaticVoidMethod)
  472. (JNIEnv *env, jclass cls, jmethodID methodID, ...);
  473. void (JNICALL *CallStaticVoidMethodV)
  474. (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
  475. void (JNICALL *CallStaticVoidMethodA)
  476. (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
  477. jfieldID (JNICALL *GetStaticFieldID)
  478. (JNIEnv *env, jclass clazz, const char *name, const char *sig);
  479. jobject (JNICALL *GetStaticObjectField)
  480. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  481. jboolean (JNICALL *GetStaticBooleanField)
  482. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  483. jbyte (JNICALL *GetStaticByteField)
  484. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  485. jchar (JNICALL *GetStaticCharField)
  486. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  487. jshort (JNICALL *GetStaticShortField)
  488. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  489. jint (JNICALL *GetStaticIntField)
  490. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  491. jlong (JNICALL *GetStaticLongField)
  492. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  493. jfloat (JNICALL *GetStaticFloatField)
  494. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  495. jdouble (JNICALL *GetStaticDoubleField)
  496. (JNIEnv *env, jclass clazz, jfieldID fieldID);
  497. void (JNICALL *SetStaticObjectField)
  498. (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
  499. void (JNICALL *SetStaticBooleanField)
  500. (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
  501. void (JNICALL *SetStaticByteField)
  502. (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
  503. void (JNICALL *SetStaticCharField)
  504. (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
  505. void (JNICALL *SetStaticShortField)
  506. (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
  507. void (JNICALL *SetStaticIntField)
  508. (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
  509. void (JNICALL *SetStaticLongField)
  510. (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
  511. void (JNICALL *SetStaticFloatField)
  512. (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
  513. void (JNICALL *SetStaticDoubleField)
  514. (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
  515. jstring (JNICALL *NewString)
  516. (JNIEnv *env, const jchar *unicode, jsize len);
  517. jsize (JNICALL *GetStringLength)
  518. (JNIEnv *env, jstring str);
  519. const jchar *(JNICALL *GetStringChars)
  520. (JNIEnv *env, jstring str, jboolean *isCopy);
  521. void (JNICALL *ReleaseStringChars)
  522. (JNIEnv *env, jstring str, const jchar *chars);
  523. jstring (JNICALL *NewStringUTF)
  524. (JNIEnv *env, const char *utf);
  525. jsize (JNICALL *GetStringUTFLength)
  526. (JNIEnv *env, jstring str);
  527. const char* (JNICALL *GetStringUTFChars)
  528. (JNIEnv *env, jstring str, jboolean *isCopy);
  529. void (JNICALL *ReleaseStringUTFChars)
  530. (JNIEnv *env, jstring str, const char* chars);
  531. jsize (JNICALL *GetArrayLength)
  532. (JNIEnv *env, jarray array);
  533. jobjectArray (JNICALL *NewObjectArray)
  534. (JNIEnv *env, jsize len, jclass clazz, jobject init);
  535. jobject (JNICALL *GetObjectArrayElement)
  536. (JNIEnv *env, jobjectArray array, jsize index);
  537. void (JNICALL *SetObjectArrayElement)
  538. (JNIEnv *env, jobjectArray array, jsize index, jobject val);
  539. jbooleanArray (JNICALL *NewBooleanArray)
  540. (JNIEnv *env, jsize len);
  541. jbyteArray (JNICALL *NewByteArray)
  542. (JNIEnv *env, jsize len);
  543. jcharArray (JNICALL *NewCharArray)
  544. (JNIEnv *env, jsize len);
  545. jshortArray (JNICALL *NewShortArray)
  546. (JNIEnv *env, jsize len);
  547. jintArray (JNICALL *NewIntArray)
  548. (JNIEnv *env, jsize len);
  549. jlongArray (JNICALL *NewLongArray)
  550. (JNIEnv *env, jsize len);
  551. jfloatArray (JNICALL *NewFloatArray)
  552. (JNIEnv *env, jsize len);
  553. jdoubleArray (JNICALL *NewDoubleArray)
  554. (JNIEnv *env, jsize len);
  555. jboolean * (JNICALL *GetBooleanArrayElements)
  556. (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
  557. jbyte * (JNICALL *GetByteArrayElements)
  558. (JNIEnv *env, jbyteArray array, jboolean *isCopy);
  559. jchar * (JNICALL *GetCharArrayElements)
  560. (JNIEnv *env, jcharArray array, jboolean *isCopy);
  561. jshort * (JNICALL *GetShortArrayElements)
  562. (JNIEnv *env, jshortArray array, jboolean *isCopy);
  563. jint * (JNICALL *GetIntArrayElements)
  564. (JNIEnv *env, jintArray array, jboolean *isCopy);
  565. jlong * (JNICALL *GetLongArrayElements)
  566. (JNIEnv *env, jlongArray array, jboolean *isCopy);
  567. jfloat * (JNICALL *GetFloatArrayElements)
  568. (JNIEnv *env, jfloatArray array, jboolean *isCopy);
  569. jdouble * (JNICALL *GetDoubleArrayElements)
  570. (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
  571. void (JNICALL *ReleaseBooleanArrayElements)
  572. (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
  573. void (JNICALL *ReleaseByteArrayElements)
  574. (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
  575. void (JNICALL *ReleaseCharArrayElements)
  576. (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
  577. void (JNICALL *ReleaseShortArrayElements)
  578. (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
  579. void (JNICALL *ReleaseIntArrayElements)
  580. (JNIEnv *env, jintArray array, jint *elems, jint mode);
  581. void (JNICALL *ReleaseLongArrayElements)
  582. (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
  583. void (JNICALL *ReleaseFloatArrayElements)
  584. (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
  585. void (JNICALL *ReleaseDoubleArrayElements)
  586. (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
  587. void (JNICALL *GetBooleanArrayRegion)
  588. (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
  589. void (JNICALL *GetByteArrayRegion)
  590. (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
  591. void (JNICALL *GetCharArrayRegion)
  592. (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
  593. void (JNICALL *GetShortArrayRegion)
  594. (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
  595. void (JNICALL *GetIntArrayRegion)
  596. (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
  597. void (JNICALL *GetLongArrayRegion)
  598. (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
  599. void (JNICALL *GetFloatArrayRegion)
  600. (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
  601. void (JNICALL *GetDoubleArrayRegion)
  602. (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
  603. void (JNICALL *SetBooleanArrayRegion)
  604. (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
  605. void (JNICALL *SetByteArrayRegion)
  606. (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
  607. void (JNICALL *SetCharArrayRegion)
  608. (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
  609. void (JNICALL *SetShortArrayRegion)
  610. (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
  611. void (JNICALL *SetIntArrayRegion)
  612. (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
  613. void (JNICALL *SetLongArrayRegion)
  614. (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
  615. void (JNICALL *SetFloatArrayRegion)
  616. (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
  617. void (JNICALL *SetDoubleArrayRegion)
  618. (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
  619. jint (JNICALL *RegisterNatives)
  620. (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
  621. jint nMethods);
  622. jint (JNICALL *UnregisterNatives)
  623. (JNIEnv *env, jclass clazz);
  624. jint (JNICALL *MonitorEnter)
  625. (JNIEnv *env, jobject obj);
  626. jint (JNICALL *MonitorExit)
  627. (JNIEnv *env, jobject obj);
  628. jint (JNICALL *GetJavaVM)
  629. (JNIEnv *env, JavaVM **vm);
  630. void (JNICALL *GetStringRegion)
  631. (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
  632. void (JNICALL *GetStringUTFRegion)
  633. (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
  634. void * (JNICALL *GetPrimitiveArrayCritical)
  635. (JNIEnv *env, jarray array, jboolean *isCopy);
  636. void (JNICALL *ReleasePrimitiveArrayCritical)
  637. (JNIEnv *env, jarray array, void *carray, jint mode);
  638. const jchar * (JNICALL *GetStringCritical)
  639. (JNIEnv *env, jstring string, jboolean *isCopy);
  640. void (JNICALL *ReleaseStringCritical)
  641. (JNIEnv *env, jstring string, const jchar *cstring);
  642. jweak (JNICALL *NewWeakGlobalRef)
  643. (JNIEnv *env, jobject obj);
  644. void (JNICALL *DeleteWeakGlobalRef)
  645. (JNIEnv *env, jweak ref);
  646. jboolean (JNICALL *ExceptionCheck)
  647. (JNIEnv *env);
  648. jobject (JNICALL *NewDirectByteBuffer)
  649. (JNIEnv* env, void* address, jlong capacity);
  650. void* (JNICALL *GetDirectBufferAddress)
  651. (JNIEnv* env, jobject buf);
  652. jlong (JNICALL *GetDirectBufferCapacity)
  653. (JNIEnv* env, jobject buf);
  654. /* New JNI 1.6 Features */
  655. jobjectRefType (JNICALL *GetObjectRefType)
  656. (JNIEnv* env, jobject obj);
  657. /* Module Features */
  658. jobject (JNICALL *GetModule)
  659. (JNIEnv* env, jclass clazz);
  660. /* Virtual threads */
  661. jboolean (JNICALL *IsVirtualThread)
  662. (JNIEnv* env, jobject obj);
  663. };
  664. /*
  665. * We use inlined functions for C++ so that programmers can write:
  666. *
  667. * env->FindClass("java/lang/String")
  668. *
  669. * in C++ rather than:
  670. *
  671. * (*env)->FindClass(env, "java/lang/String")
  672. *
  673. * in C.
  674. */
  675. struct JNIEnv_ {
  676. const struct JNINativeInterface_ *functions;
  677. #ifdef __cplusplus
  678. jint GetVersion() {
  679. return functions->GetVersion(this);
  680. }
  681. jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
  682. jsize len) {
  683. return functions->DefineClass(this, name, loader, buf, len);
  684. }
  685. jclass FindClass(const char *name) {
  686. return functions->FindClass(this, name);
  687. }
  688. jmethodID FromReflectedMethod(jobject method) {
  689. return functions->FromReflectedMethod(this,method);
  690. }
  691. jfieldID FromReflectedField(jobject field) {
  692. return functions->FromReflectedField(this,field);
  693. }
  694. jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
  695. return functions->ToReflectedMethod(this, cls, methodID, isStatic);
  696. }
  697. jclass GetSuperclass(jclass sub) {
  698. return functions->GetSuperclass(this, sub);
  699. }
  700. jboolean IsAssignableFrom(jclass sub, jclass sup) {
  701. return functions->IsAssignableFrom(this, sub, sup);
  702. }
  703. jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
  704. return functions->ToReflectedField(this,cls,fieldID,isStatic);
  705. }
  706. jint Throw(jthrowable obj) {
  707. return functions->Throw(this, obj);
  708. }
  709. jint ThrowNew(jclass clazz, const char *msg) {
  710. return functions->ThrowNew(this, clazz, msg);
  711. }
  712. jthrowable ExceptionOccurred() {
  713. return functions->ExceptionOccurred(this);
  714. }
  715. void ExceptionDescribe() {
  716. functions->ExceptionDescribe(this);
  717. }
  718. void ExceptionClear() {
  719. functions->ExceptionClear(this);
  720. }
  721. void FatalError(const char *msg) {
  722. functions->FatalError(this, msg);
  723. }
  724. jint PushLocalFrame(jint capacity) {
  725. return functions->PushLocalFrame(this,capacity);
  726. }
  727. jobject PopLocalFrame(jobject result) {
  728. return functions->PopLocalFrame(this,result);
  729. }
  730. jobject NewGlobalRef(jobject lobj) {
  731. return functions->NewGlobalRef(this,lobj);
  732. }
  733. void DeleteGlobalRef(jobject gref) {
  734. functions->DeleteGlobalRef(this,gref);
  735. }
  736. void DeleteLocalRef(jobject obj) {
  737. functions->DeleteLocalRef(this, obj);
  738. }
  739. jboolean IsSameObject(jobject obj1, jobject obj2) {
  740. return functions->IsSameObject(this,obj1,obj2);
  741. }
  742. jobject NewLocalRef(jobject ref) {
  743. return functions->NewLocalRef(this,ref);
  744. }
  745. jint EnsureLocalCapacity(jint capacity) {
  746. return functions->EnsureLocalCapacity(this,capacity);
  747. }
  748. jobject AllocObject(jclass clazz) {
  749. return functions->AllocObject(this,clazz);
  750. }
  751. jobject NewObject(jclass clazz, jmethodID methodID, ...) {
  752. va_list args;
  753. jobject result;
  754. va_start(args, methodID);
  755. result = functions->NewObjectV(this,clazz,methodID,args);
  756. va_end(args);
  757. return result;
  758. }
  759. jobject NewObjectV(jclass clazz, jmethodID methodID,
  760. va_list args) {
  761. return functions->NewObjectV(this,clazz,methodID,args);
  762. }
  763. jobject NewObjectA(jclass clazz, jmethodID methodID,
  764. const jvalue *args) {
  765. return functions->NewObjectA(this,clazz,methodID,args);
  766. }
  767. jclass GetObjectClass(jobject obj) {
  768. return functions->GetObjectClass(this,obj);
  769. }
  770. jboolean IsInstanceOf(jobject obj, jclass clazz) {
  771. return functions->IsInstanceOf(this,obj,clazz);
  772. }
  773. jmethodID GetMethodID(jclass clazz, const char *name,
  774. const char *sig) {
  775. return functions->GetMethodID(this,clazz,name,sig);
  776. }
  777. jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
  778. va_list args;
  779. jobject result;
  780. va_start(args,methodID);
  781. result = functions->CallObjectMethodV(this,obj,methodID,args);
  782. va_end(args);
  783. return result;
  784. }
  785. jobject CallObjectMethodV(jobject obj, jmethodID methodID,
  786. va_list args) {
  787. return functions->CallObjectMethodV(this,obj,methodID,args);
  788. }
  789. jobject CallObjectMethodA(jobject obj, jmethodID methodID,
  790. const jvalue * args) {
  791. return functions->CallObjectMethodA(this,obj,methodID,args);
  792. }
  793. jboolean CallBooleanMethod(jobject obj,
  794. jmethodID methodID, ...) {
  795. va_list args;
  796. jboolean result;
  797. va_start(args,methodID);
  798. result = functions->CallBooleanMethodV(this,obj,methodID,args);
  799. va_end(args);
  800. return result;
  801. }
  802. jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
  803. va_list args) {
  804. return functions->CallBooleanMethodV(this,obj,methodID,args);
  805. }
  806. jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
  807. const jvalue * args) {
  808. return functions->CallBooleanMethodA(this,obj,methodID, args);
  809. }
  810. jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
  811. va_list args;
  812. jbyte result;
  813. va_start(args,methodID);
  814. result = functions->CallByteMethodV(this,obj,methodID,args);
  815. va_end(args);
  816. return result;
  817. }
  818. jbyte CallByteMethodV(jobject obj, jmethodID methodID,
  819. va_list args) {
  820. return functions->CallByteMethodV(this,obj,methodID,args);
  821. }
  822. jbyte CallByteMethodA(jobject obj, jmethodID methodID,
  823. const jvalue * args) {
  824. return functions->CallByteMethodA(this,obj,methodID,args);
  825. }
  826. jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
  827. va_list args;
  828. jchar result;
  829. va_start(args,methodID);
  830. result = functions->CallCharMethodV(this,obj,methodID,args);
  831. va_end(args);
  832. return result;
  833. }
  834. jchar CallCharMethodV(jobject obj, jmethodID methodID,
  835. va_list args) {
  836. return functions->CallCharMethodV(this,obj,methodID,args);
  837. }
  838. jchar CallCharMethodA(jobject obj, jmethodID methodID,
  839. const jvalue * args) {
  840. return functions->CallCharMethodA(this,obj,methodID,args);
  841. }
  842. jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
  843. va_list args;
  844. jshort result;
  845. va_start(args,methodID);
  846. result = functions->CallShortMethodV(this,obj,methodID,args);
  847. va_end(args);
  848. return result;
  849. }
  850. jshort CallShortMethodV(jobject obj, jmethodID methodID,
  851. va_list args) {
  852. return functions->CallShortMethodV(this,obj,methodID,args);
  853. }
  854. jshort CallShortMethodA(jobject obj, jmethodID methodID,
  855. const jvalue * args) {
  856. return functions->CallShortMethodA(this,obj,methodID,args);
  857. }
  858. jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
  859. va_list args;
  860. jint result;
  861. va_start(args,methodID);
  862. result = functions->CallIntMethodV(this,obj,methodID,args);
  863. va_end(args);
  864. return result;
  865. }
  866. jint CallIntMethodV(jobject obj, jmethodID methodID,
  867. va_list args) {
  868. return functions->CallIntMethodV(this,obj,methodID,args);
  869. }
  870. jint CallIntMethodA(jobject obj, jmethodID methodID,
  871. const jvalue * args) {
  872. return functions->CallIntMethodA(this,obj,methodID,args);
  873. }
  874. jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
  875. va_list args;
  876. jlong result;
  877. va_start(args,methodID);
  878. result = functions->CallLongMethodV(this,obj,methodID,args);
  879. va_end(args);
  880. return result;
  881. }
  882. jlong CallLongMethodV(jobject obj, jmethodID methodID,
  883. va_list args) {
  884. return functions->CallLongMethodV(this,obj,methodID,args);
  885. }
  886. jlong CallLongMethodA(jobject obj, jmethodID methodID,
  887. const jvalue * args) {
  888. return functions->CallLongMethodA(this,obj,methodID,args);
  889. }
  890. jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
  891. va_list args;
  892. jfloat result;
  893. va_start(args,methodID);
  894. result = functions->CallFloatMethodV(this,obj,methodID,args);
  895. va_end(args);
  896. return result;
  897. }
  898. jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
  899. va_list args) {
  900. return functions->CallFloatMethodV(this,obj,methodID,args);
  901. }
  902. jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
  903. const jvalue * args) {
  904. return functions->CallFloatMethodA(this,obj,methodID,args);
  905. }
  906. jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
  907. va_list args;
  908. jdouble result;
  909. va_start(args,methodID);
  910. result = functions->CallDoubleMethodV(this,obj,methodID,args);
  911. va_end(args);
  912. return result;
  913. }
  914. jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
  915. va_list args) {
  916. return functions->CallDoubleMethodV(this,obj,methodID,args);
  917. }
  918. jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
  919. const jvalue * args) {
  920. return functions->CallDoubleMethodA(this,obj,methodID,args);
  921. }
  922. void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
  923. va_list args;
  924. va_start(args,methodID);
  925. functions->CallVoidMethodV(this,obj,methodID,args);
  926. va_end(args);
  927. }
  928. void CallVoidMethodV(jobject obj, jmethodID methodID,
  929. va_list args) {
  930. functions->CallVoidMethodV(this,obj,methodID,args);
  931. }
  932. void CallVoidMethodA(jobject obj, jmethodID methodID,
  933. const jvalue * args) {
  934. functions->CallVoidMethodA(this,obj,methodID,args);
  935. }
  936. jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
  937. jmethodID methodID, ...) {
  938. va_list args;
  939. jobject result;
  940. va_start(args,methodID);
  941. result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
  942. methodID,args);
  943. va_end(args);
  944. return result;
  945. }
  946. jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
  947. jmethodID methodID, va_list args) {
  948. return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
  949. methodID,args);
  950. }
  951. jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
  952. jmethodID methodID, const jvalue * args) {
  953. return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
  954. methodID,args);
  955. }
  956. jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
  957. jmethodID methodID, ...) {
  958. va_list args;
  959. jboolean result;
  960. va_start(args,methodID);
  961. result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
  962. methodID,args);
  963. va_end(args);
  964. return result;
  965. }
  966. jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
  967. jmethodID methodID, va_list args) {
  968. return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
  969. methodID,args);
  970. }
  971. jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
  972. jmethodID methodID, const jvalue * args) {
  973. return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
  974. methodID, args);
  975. }
  976. jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
  977. jmethodID methodID, ...) {
  978. va_list args;
  979. jbyte result;
  980. va_start(args,methodID);
  981. result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
  982. methodID,args);
  983. va_end(args);
  984. return result;
  985. }
  986. jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
  987. jmethodID methodID, va_list args) {
  988. return functions->CallNonvirtualByteMethodV(this,obj,clazz,
  989. methodID,args);
  990. }
  991. jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
  992. jmethodID methodID, const jvalue * args) {
  993. return functions->CallNonvirtualByteMethodA(this,obj,clazz,
  994. methodID,args);
  995. }
  996. jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
  997. jmethodID methodID, ...) {
  998. va_list args;
  999. jchar result;
  1000. va_start(args,methodID);
  1001. result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
  1002. methodID,args);
  1003. va_end(args);
  1004. return result;
  1005. }
  1006. jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
  1007. jmethodID methodID, va_list args) {
  1008. return functions->CallNonvirtualCharMethodV(this,obj,clazz,
  1009. methodID,args);
  1010. }
  1011. jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
  1012. jmethodID methodID, const jvalue * args) {
  1013. return functions->CallNonvirtualCharMethodA(this,obj,clazz,
  1014. methodID,args);
  1015. }
  1016. jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
  1017. jmethodID methodID, ...) {
  1018. va_list args;
  1019. jshort result;
  1020. va_start(args,methodID);
  1021. result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
  1022. methodID,args);
  1023. va_end(args);
  1024. return result;
  1025. }
  1026. jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
  1027. jmethodID methodID, va_list args) {
  1028. return functions->CallNonvirtualShortMethodV(this,obj,clazz,
  1029. methodID,args);
  1030. }
  1031. jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
  1032. jmethodID methodID, const jvalue * args) {
  1033. return functions->CallNonvirtualShortMethodA(this,obj,clazz,
  1034. methodID,args);
  1035. }
  1036. jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
  1037. jmethodID methodID, ...) {
  1038. va_list args;
  1039. jint result;
  1040. va_start(args,methodID);
  1041. result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
  1042. methodID,args);
  1043. va_end(args);
  1044. return result;
  1045. }
  1046. jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
  1047. jmethodID methodID, va_list args) {
  1048. return functions->CallNonvirtualIntMethodV(this,obj,clazz,
  1049. methodID,args);
  1050. }
  1051. jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
  1052. jmethodID methodID, const jvalue * args) {
  1053. return functions->CallNonvirtualIntMethodA(this,obj,clazz,
  1054. methodID,args);
  1055. }
  1056. jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
  1057. jmethodID methodID, ...) {
  1058. va_list args;
  1059. jlong result;
  1060. va_start(args,methodID);
  1061. result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
  1062. methodID,args);
  1063. va_end(args);
  1064. return result;
  1065. }
  1066. jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
  1067. jmethodID methodID, va_list args) {
  1068. return functions->CallNonvirtualLongMethodV(this,obj,clazz,
  1069. methodID,args);
  1070. }
  1071. jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
  1072. jmethodID methodID, const jvalue * args) {
  1073. return functions->CallNonvirtualLongMethodA(this,obj,clazz,
  1074. methodID,args);
  1075. }
  1076. jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
  1077. jmethodID methodID, ...) {
  1078. va_list args;
  1079. jfloat result;
  1080. va_start(args,methodID);
  1081. result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
  1082. methodID,args);
  1083. va_end(args);
  1084. return result;
  1085. }
  1086. jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
  1087. jmethodID methodID,
  1088. va_list args) {
  1089. return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
  1090. methodID,args);
  1091. }
  1092. jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
  1093. jmethodID methodID,
  1094. const jvalue * args) {
  1095. return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
  1096. methodID,args);
  1097. }
  1098. jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
  1099. jmethodID methodID, ...) {
  1100. va_list args;
  1101. jdouble result;
  1102. va_start(args,methodID);
  1103. result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
  1104. methodID,args);
  1105. va_end(args);
  1106. return result;
  1107. }
  1108. jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
  1109. jmethodID methodID,
  1110. va_list args) {
  1111. return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
  1112. methodID,args);
  1113. }
  1114. jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
  1115. jmethodID methodID,
  1116. const jvalue * args) {
  1117. return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
  1118. methodID,args);
  1119. }
  1120. void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
  1121. jmethodID methodID, ...) {
  1122. va_list args;
  1123. va_start(args,methodID);
  1124. functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
  1125. va_end(args);
  1126. }
  1127. void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
  1128. jmethodID methodID,
  1129. va_list args) {
  1130. functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
  1131. }
  1132. void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
  1133. jmethodID methodID,
  1134. const jvalue * args) {
  1135. functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
  1136. }
  1137. jfieldID GetFieldID(jclass clazz, const char *name,
  1138. const char *sig) {
  1139. return functions->GetFieldID(this,clazz,name,sig);
  1140. }
  1141. jobject GetObjectField(jobject obj, jfieldID fieldID) {
  1142. return functions->GetObjectField(this,obj,fieldID);
  1143. }
  1144. jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
  1145. return functions->GetBooleanField(this,obj,fieldID);
  1146. }
  1147. jbyte GetByteField(jobject obj, jfieldID fieldID) {
  1148. return functions->GetByteField(this,obj,fieldID);
  1149. }
  1150. jchar GetCharField(jobject obj, jfieldID fieldID) {
  1151. return functions->GetCharField(this,obj,fieldID);
  1152. }
  1153. jshort GetShortField(jobject obj, jfieldID fieldID) {
  1154. return functions->GetShortField(this,obj,fieldID);
  1155. }
  1156. jint GetIntField(jobject obj, jfieldID fieldID) {
  1157. return functions->GetIntField(this,obj,fieldID);
  1158. }
  1159. jlong GetLongField(jobject obj, jfieldID fieldID) {
  1160. return functions->GetLongField(this,obj,fieldID);
  1161. }
  1162. jfloat GetFloatField(jobject obj, jfieldID fieldID) {
  1163. return functions->GetFloatField(this,obj,fieldID);
  1164. }
  1165. jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
  1166. return functions->GetDoubleField(this,obj,fieldID);
  1167. }
  1168. void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
  1169. functions->SetObjectField(this,obj,fieldID,val);
  1170. }
  1171. void SetBooleanField(jobject obj, jfieldID fieldID,
  1172. jboolean val) {
  1173. functions->SetBooleanField(this,obj,fieldID,val);
  1174. }
  1175. void SetByteField(jobject obj, jfieldID fieldID,
  1176. jbyte val) {
  1177. functions->SetByteField(this,obj,fieldID,val);
  1178. }
  1179. void SetCharField(jobject obj, jfieldID fieldID,
  1180. jchar val) {
  1181. functions->SetCharField(this,obj,fieldID,val);
  1182. }
  1183. void SetShortField(jobject obj, jfieldID fieldID,
  1184. jshort val) {
  1185. functions->SetShortField(this,obj,fieldID,val);
  1186. }
  1187. void SetIntField(jobject obj, jfieldID fieldID,
  1188. jint val) {
  1189. functions->SetIntField(this,obj,fieldID,val);
  1190. }
  1191. void SetLongField(jobject obj, jfieldID fieldID,
  1192. jlong val) {
  1193. functions->SetLongField(this,obj,fieldID,val);
  1194. }
  1195. void SetFloatField(jobject obj, jfieldID fieldID,
  1196. jfloat val) {
  1197. functions->SetFloatField(this,obj,fieldID,val);
  1198. }
  1199. void SetDoubleField(jobject obj, jfieldID fieldID,
  1200. jdouble val) {
  1201. functions->SetDoubleField(this,obj,fieldID,val);
  1202. }
  1203. jmethodID GetStaticMethodID(jclass clazz, const char *name,
  1204. const char *sig) {
  1205. return functions->GetStaticMethodID(this,clazz,name,sig);
  1206. }
  1207. jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
  1208. ...) {
  1209. va_list args;
  1210. jobject result;
  1211. va_start(args,methodID);
  1212. result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
  1213. va_end(args);
  1214. return result;
  1215. }
  1216. jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
  1217. va_list args) {
  1218. return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
  1219. }
  1220. jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
  1221. const jvalue *args) {
  1222. return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
  1223. }
  1224. jboolean CallStaticBooleanMethod(jclass clazz,
  1225. jmethodID methodID, ...) {
  1226. va_list args;
  1227. jboolean result;
  1228. va_start(args,methodID);
  1229. result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
  1230. va_end(args);
  1231. return result;
  1232. }
  1233. jboolean CallStaticBooleanMethodV(jclass clazz,
  1234. jmethodID methodID, va_list args) {
  1235. return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
  1236. }
  1237. jboolean CallStaticBooleanMethodA(jclass clazz,
  1238. jmethodID methodID, const jvalue *args) {
  1239. return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
  1240. }
  1241. jbyte CallStaticByteMethod(jclass clazz,
  1242. jmethodID methodID, ...) {
  1243. va_list args;
  1244. jbyte result;
  1245. va_start(args,methodID);
  1246. result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
  1247. va_end(args);
  1248. return result;
  1249. }
  1250. jbyte CallStaticByteMethodV(jclass clazz,
  1251. jmethodID methodID, va_list args) {
  1252. return functions->CallStaticByteMethodV(this,clazz,methodID,args);
  1253. }
  1254. jbyte CallStaticByteMethodA(jclass clazz,
  1255. jmethodID methodID, const jvalue *args) {
  1256. return functions->CallStaticByteMethodA(this,clazz,methodID,args);
  1257. }
  1258. jchar CallStaticCharMethod(jclass clazz,
  1259. jmethodID methodID, ...) {
  1260. va_list args;
  1261. jchar result;
  1262. va_start(args,methodID);
  1263. result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
  1264. va_end(args);
  1265. return result;
  1266. }
  1267. jchar CallStaticCharMethodV(jclass clazz,
  1268. jmethodID methodID, va_list args) {
  1269. return functions->CallStaticCharMethodV(this,clazz,methodID,args);
  1270. }
  1271. jchar CallStaticCharMethodA(jclass clazz,
  1272. jmethodID methodID, const jvalue *args) {
  1273. return functions->CallStaticCharMethodA(this,clazz,methodID,args);
  1274. }
  1275. jshort CallStaticShortMethod(jclass clazz,
  1276. jmethodID methodID, ...) {
  1277. va_list args;
  1278. jshort result;
  1279. va_start(args,methodID);
  1280. result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
  1281. va_end(args);
  1282. return result;
  1283. }
  1284. jshort CallStaticShortMethodV(jclass clazz,
  1285. jmethodID methodID, va_list args) {
  1286. return functions->CallStaticShortMethodV(this,clazz,methodID,args);
  1287. }
  1288. jshort CallStaticShortMethodA(jclass clazz,
  1289. jmethodID methodID, const jvalue *args) {
  1290. return functions->CallStaticShortMethodA(this,clazz,methodID,args);
  1291. }
  1292. jint CallStaticIntMethod(jclass clazz,
  1293. jmethodID methodID, ...) {
  1294. va_list args;
  1295. jint result;
  1296. va_start(args,methodID);
  1297. result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
  1298. va_end(args);
  1299. return result;
  1300. }
  1301. jint CallStaticIntMethodV(jclass clazz,
  1302. jmethodID methodID, va_list args) {
  1303. return functions->CallStaticIntMethodV(this,clazz,methodID,args);
  1304. }
  1305. jint CallStaticIntMethodA(jclass clazz,
  1306. jmethodID methodID, const jvalue *args) {
  1307. return functions->CallStaticIntMethodA(this,clazz,methodID,args);
  1308. }
  1309. jlong CallStaticLongMethod(jclass clazz,
  1310. jmethodID methodID, ...) {
  1311. va_list args;
  1312. jlong result;
  1313. va_start(args,methodID);
  1314. result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
  1315. va_end(args);
  1316. return result;
  1317. }
  1318. jlong CallStaticLongMethodV(jclass clazz,
  1319. jmethodID methodID, va_list args) {
  1320. return functions->CallStaticLongMethodV(this,clazz,methodID,args);
  1321. }
  1322. jlong CallStaticLongMethodA(jclass clazz,
  1323. jmethodID methodID, const jvalue *args) {
  1324. return functions->CallStaticLongMethodA(this,clazz,methodID,args);
  1325. }
  1326. jfloat CallStaticFloatMethod(jclass clazz,
  1327. jmethodID methodID, ...) {
  1328. va_list args;
  1329. jfloat result;
  1330. va_start(args,methodID);
  1331. result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
  1332. va_end(args);
  1333. return result;
  1334. }
  1335. jfloat CallStaticFloatMethodV(jclass clazz,
  1336. jmethodID methodID, va_list args) {
  1337. return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
  1338. }
  1339. jfloat CallStaticFloatMethodA(jclass clazz,
  1340. jmethodID methodID, const jvalue *args) {
  1341. return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
  1342. }
  1343. jdouble CallStaticDoubleMethod(jclass clazz,
  1344. jmethodID methodID, ...) {
  1345. va_list args;
  1346. jdouble result;
  1347. va_start(args,methodID);
  1348. result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
  1349. va_end(args);
  1350. return result;
  1351. }
  1352. jdouble CallStaticDoubleMethodV(jclass clazz,
  1353. jmethodID methodID, va_list args) {
  1354. return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
  1355. }
  1356. jdouble CallStaticDoubleMethodA(jclass clazz,
  1357. jmethodID methodID, const jvalue *args) {
  1358. return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
  1359. }
  1360. void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
  1361. va_list args;
  1362. va_start(args,methodID);
  1363. functions->CallStaticVoidMethodV(this,cls,methodID,args);
  1364. va_end(args);
  1365. }
  1366. void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
  1367. va_list args) {
  1368. functions->CallStaticVoidMethodV(this,cls,methodID,args);
  1369. }
  1370. void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
  1371. const jvalue * args) {
  1372. functions->CallStaticVoidMethodA(this,cls,methodID,args);
  1373. }
  1374. jfieldID GetStaticFieldID(jclass clazz, const char *name,
  1375. const char *sig) {
  1376. return functions->GetStaticFieldID(this,clazz,name,sig);
  1377. }
  1378. jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
  1379. return functions->GetStaticObjectField(this,clazz,fieldID);
  1380. }
  1381. jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
  1382. return functions->GetStaticBooleanField(this,clazz,fieldID);
  1383. }
  1384. jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
  1385. return functions->GetStaticByteField(this,clazz,fieldID);
  1386. }
  1387. jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
  1388. return functions->GetStaticCharField(this,clazz,fieldID);
  1389. }
  1390. jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
  1391. return functions->GetStaticShortField(this,clazz,fieldID);
  1392. }
  1393. jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
  1394. return functions->GetStaticIntField(this,clazz,fieldID);
  1395. }
  1396. jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
  1397. return functions->GetStaticLongField(this,clazz,fieldID);
  1398. }
  1399. jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
  1400. return functions->GetStaticFloatField(this,clazz,fieldID);
  1401. }
  1402. jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
  1403. return functions->GetStaticDoubleField(this,clazz,fieldID);
  1404. }
  1405. void SetStaticObjectField(jclass clazz, jfieldID fieldID,
  1406. jobject value) {
  1407. functions->SetStaticObjectField(this,clazz,fieldID,value);
  1408. }
  1409. void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
  1410. jboolean value) {
  1411. functions->SetStaticBooleanField(this,clazz,fieldID,value);
  1412. }
  1413. void SetStaticByteField(jclass clazz, jfieldID fieldID,
  1414. jbyte value) {
  1415. functions->SetStaticByteField(this,clazz,fieldID,value);
  1416. }
  1417. void SetStaticCharField(jclass clazz, jfieldID fieldID,
  1418. jchar value) {
  1419. functions->SetStaticCharField(this,clazz,fieldID,value);
  1420. }
  1421. void SetStaticShortField(jclass clazz, jfieldID fieldID,
  1422. jshort value) {
  1423. functions->SetStaticShortField(this,clazz,fieldID,value);
  1424. }
  1425. void SetStaticIntField(jclass clazz, jfieldID fieldID,
  1426. jint value) {
  1427. functions->SetStaticIntField(this,clazz,fieldID,value);
  1428. }
  1429. void SetStaticLongField(jclass clazz, jfieldID fieldID,
  1430. jlong value) {
  1431. functions->SetStaticLongField(this,clazz,fieldID,value);
  1432. }
  1433. void SetStaticFloatField(jclass clazz, jfieldID fieldID,
  1434. jfloat value) {
  1435. functions->SetStaticFloatField(this,clazz,fieldID,value);
  1436. }
  1437. void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
  1438. jdouble value) {
  1439. functions->SetStaticDoubleField(this,clazz,fieldID,value);
  1440. }
  1441. jstring NewString(const jchar *unicode, jsize len) {
  1442. return functions->NewString(this,unicode,len);
  1443. }
  1444. jsize GetStringLength(jstring str) {
  1445. return functions->GetStringLength(this,str);
  1446. }
  1447. const jchar *GetStringChars(jstring str, jboolean *isCopy) {
  1448. return functions->GetStringChars(this,str,isCopy);
  1449. }
  1450. void ReleaseStringChars(jstring str, const jchar *chars) {
  1451. functions->ReleaseStringChars(this,str,chars);
  1452. }
  1453. jstring NewStringUTF(const char *utf) {
  1454. return functions->NewStringUTF(this,utf);
  1455. }
  1456. jsize GetStringUTFLength(jstring str) {
  1457. return functions->GetStringUTFLength(this,str);
  1458. }
  1459. const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
  1460. return functions->GetStringUTFChars(this,str,isCopy);
  1461. }
  1462. void ReleaseStringUTFChars(jstring str, const char* chars) {
  1463. functions->ReleaseStringUTFChars(this,str,chars);
  1464. }
  1465. jsize GetArrayLength(jarray array) {
  1466. return functions->GetArrayLength(this,array);
  1467. }
  1468. jobjectArray NewObjectArray(jsize len, jclass clazz,
  1469. jobject init) {
  1470. return functions->NewObjectArray(this,len,clazz,init);
  1471. }
  1472. jobject GetObjectArrayElement(jobjectArray array, jsize index) {
  1473. return functions->GetObjectArrayElement(this,array,index);
  1474. }
  1475. void SetObjectArrayElement(jobjectArray array, jsize index,
  1476. jobject val) {
  1477. functions->SetObjectArrayElement(this,array,index,val);
  1478. }
  1479. jbooleanArray NewBooleanArray(jsize len) {
  1480. return functions->NewBooleanArray(this,len);
  1481. }
  1482. jbyteArray NewByteArray(jsize len) {
  1483. return functions->NewByteArray(this,len);
  1484. }
  1485. jcharArray NewCharArray(jsize len) {
  1486. return functions->NewCharArray(this,len);
  1487. }
  1488. jshortArray NewShortArray(jsize len) {
  1489. return functions->NewShortArray(this,len);
  1490. }
  1491. jintArray NewIntArray(jsize len) {
  1492. return functions->NewIntArray(this,len);
  1493. }
  1494. jlongArray NewLongArray(jsize len) {
  1495. return functions->NewLongArray(this,len);
  1496. }
  1497. jfloatArray NewFloatArray(jsize len) {
  1498. return functions->NewFloatArray(this,len);
  1499. }
  1500. jdoubleArray NewDoubleArray(jsize len) {
  1501. return functions->NewDoubleArray(this,len);
  1502. }
  1503. jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
  1504. return functions->GetBooleanArrayElements(this,array,isCopy);
  1505. }
  1506. jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
  1507. return functions->GetByteArrayElements(this,array,isCopy);
  1508. }
  1509. jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
  1510. return functions->GetCharArrayElements(this,array,isCopy);
  1511. }
  1512. jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
  1513. return functions->GetShortArrayElements(this,array,isCopy);
  1514. }
  1515. jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
  1516. return functions->GetIntArrayElements(this,array,isCopy);
  1517. }
  1518. jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
  1519. return functions->GetLongArrayElements(this,array,isCopy);
  1520. }
  1521. jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
  1522. return functions->GetFloatArrayElements(this,array,isCopy);
  1523. }
  1524. jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
  1525. return functions->GetDoubleArrayElements(this,array,isCopy);
  1526. }
  1527. void ReleaseBooleanArrayElements(jbooleanArray array,
  1528. jboolean *elems,
  1529. jint mode) {
  1530. functions->ReleaseBooleanArrayElements(this,array,elems,mode);
  1531. }
  1532. void ReleaseByteArrayElements(jbyteArray array,
  1533. jbyte *elems,
  1534. jint mode) {
  1535. functions->ReleaseByteArrayElements(this,array,elems,mode);
  1536. }
  1537. void ReleaseCharArrayElements(jcharArray array,
  1538. jchar *elems,
  1539. jint mode) {
  1540. functions->ReleaseCharArrayElements(this,array,elems,mode);
  1541. }
  1542. void ReleaseShortArrayElements(jshortArray array,
  1543. jshort *elems,
  1544. jint mode) {
  1545. functions->ReleaseShortArrayElements(this,array,elems,mode);
  1546. }
  1547. void ReleaseIntArrayElements(jintArray array,
  1548. jint *elems,
  1549. jint mode) {
  1550. functions->ReleaseIntArrayElements(this,array,elems,mode);
  1551. }
  1552. void ReleaseLongArrayElements(jlongArray array,
  1553. jlong *elems,
  1554. jint mode) {
  1555. functions->ReleaseLongArrayElements(this,array,elems,mode);
  1556. }
  1557. void ReleaseFloatArrayElements(jfloatArray array,
  1558. jfloat *elems,
  1559. jint mode) {
  1560. functions->ReleaseFloatArrayElements(this,array,elems,mode);
  1561. }
  1562. void ReleaseDoubleArrayElements(jdoubleArray array,
  1563. jdouble *elems,
  1564. jint mode) {
  1565. functions->ReleaseDoubleArrayElements(this,array,elems,mode);
  1566. }
  1567. void GetBooleanArrayRegion(jbooleanArray array,
  1568. jsize start, jsize len, jboolean *buf) {
  1569. functions->GetBooleanArrayRegion(this,array,start,len,buf);
  1570. }
  1571. void GetByteArrayRegion(jbyteArray array,
  1572. jsize start, jsize len, jbyte *buf) {
  1573. functions->GetByteArrayRegion(this,array,start,len,buf);
  1574. }
  1575. void GetCharArrayRegion(jcharArray array,
  1576. jsize start, jsize len, jchar *buf) {
  1577. functions->GetCharArrayRegion(this,array,start,len,buf);
  1578. }
  1579. void GetShortArrayRegion(jshortArray array,
  1580. jsize start, jsize len, jshort *buf) {
  1581. functions->GetShortArrayRegion(this,array,start,len,buf);
  1582. }
  1583. void GetIntArrayRegion(jintArray array,
  1584. jsize start, jsize len, jint *buf) {
  1585. functions->GetIntArrayRegion(this,array,start,len,buf);
  1586. }
  1587. void GetLongArrayRegion(jlongArray array,
  1588. jsize start, jsize len, jlong *buf) {
  1589. functions->GetLongArrayRegion(this,array,start,len,buf);
  1590. }
  1591. void GetFloatArrayRegion(jfloatArray array,
  1592. jsize start, jsize len, jfloat *buf) {
  1593. functions->GetFloatArrayRegion(this,array,start,len,buf);
  1594. }
  1595. void GetDoubleArrayRegion(jdoubleArray array,
  1596. jsize start, jsize len, jdouble *buf) {
  1597. functions->GetDoubleArrayRegion(this,array,start,len,buf);
  1598. }
  1599. void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
  1600. const jboolean *buf) {
  1601. functions->SetBooleanArrayRegion(this,array,start,len,buf);
  1602. }
  1603. void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
  1604. const jbyte *buf) {
  1605. functions->SetByteArrayRegion(this,array,start,len,buf);
  1606. }
  1607. void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
  1608. const jchar *buf) {
  1609. functions->SetCharArrayRegion(this,array,start,len,buf);
  1610. }
  1611. void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
  1612. const jshort *buf) {
  1613. functions->SetShortArrayRegion(this,array,start,len,buf);
  1614. }
  1615. void SetIntArrayRegion(jintArray array, jsize start, jsize len,
  1616. const jint *buf) {
  1617. functions->SetIntArrayRegion(this,array,start,len,buf);
  1618. }
  1619. void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
  1620. const jlong *buf) {
  1621. functions->SetLongArrayRegion(this,array,start,len,buf);
  1622. }
  1623. void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
  1624. const jfloat *buf) {
  1625. functions->SetFloatArrayRegion(this,array,start,len,buf);
  1626. }
  1627. void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
  1628. const jdouble *buf) {
  1629. functions->SetDoubleArrayRegion(this,array,start,len,buf);
  1630. }
  1631. jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
  1632. jint nMethods) {
  1633. return functions->RegisterNatives(this,clazz,methods,nMethods);
  1634. }
  1635. jint UnregisterNatives(jclass clazz) {
  1636. return functions->UnregisterNatives(this,clazz);
  1637. }
  1638. jint MonitorEnter(jobject obj) {
  1639. return functions->MonitorEnter(this,obj);
  1640. }
  1641. jint MonitorExit(jobject obj) {
  1642. return functions->MonitorExit(this,obj);
  1643. }
  1644. jint GetJavaVM(JavaVM **vm) {
  1645. return functions->GetJavaVM(this,vm);
  1646. }
  1647. void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
  1648. functions->GetStringRegion(this,str,start,len,buf);
  1649. }
  1650. void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
  1651. functions->GetStringUTFRegion(this,str,start,len,buf);
  1652. }
  1653. void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
  1654. return functions->GetPrimitiveArrayCritical(this,array,isCopy);
  1655. }
  1656. void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
  1657. functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
  1658. }
  1659. const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
  1660. return functions->GetStringCritical(this,string,isCopy);
  1661. }
  1662. void ReleaseStringCritical(jstring string, const jchar *cstring) {
  1663. functions->ReleaseStringCritical(this,string,cstring);
  1664. }
  1665. jweak NewWeakGlobalRef(jobject obj) {
  1666. return functions->NewWeakGlobalRef(this,obj);
  1667. }
  1668. void DeleteWeakGlobalRef(jweak ref) {
  1669. functions->DeleteWeakGlobalRef(this,ref);
  1670. }
  1671. jboolean ExceptionCheck() {
  1672. return functions->ExceptionCheck(this);
  1673. }
  1674. jobject NewDirectByteBuffer(void* address, jlong capacity) {
  1675. return functions->NewDirectByteBuffer(this, address, capacity);
  1676. }
  1677. void* GetDirectBufferAddress(jobject buf) {
  1678. return functions->GetDirectBufferAddress(this, buf);
  1679. }
  1680. jlong GetDirectBufferCapacity(jobject buf) {
  1681. return functions->GetDirectBufferCapacity(this, buf);
  1682. }
  1683. jobjectRefType GetObjectRefType(jobject obj) {
  1684. return functions->GetObjectRefType(this, obj);
  1685. }
  1686. /* Module Features */
  1687. jobject GetModule(jclass clazz) {
  1688. return functions->GetModule(this, clazz);
  1689. }
  1690. /* Virtual threads */
  1691. jboolean IsVirtualThread(jobject obj) {
  1692. return functions->IsVirtualThread(this, obj);
  1693. }
  1694. #endif /* __cplusplus */
  1695. };
  1696. /*
  1697. * optionString may be any option accepted by the JVM, or one of the
  1698. * following:
  1699. *
  1700. * -D<name>=<value> Set a system property.
  1701. * -verbose[:class|gc|jni] Enable verbose output, comma-separated. E.g.
  1702. * "-verbose:class" or "-verbose:gc,class"
  1703. * Standard names include: gc, class, and jni.
  1704. * All nonstandard (VM-specific) names must begin
  1705. * with "X".
  1706. * vfprintf extraInfo is a pointer to the vfprintf hook.
  1707. * exit extraInfo is a pointer to the exit hook.
  1708. * abort extraInfo is a pointer to the abort hook.
  1709. */
  1710. typedef struct JavaVMOption {
  1711. char *optionString;
  1712. void *extraInfo;
  1713. } JavaVMOption;
  1714. typedef struct JavaVMInitArgs {
  1715. jint version;
  1716. jint nOptions;
  1717. JavaVMOption *options;
  1718. jboolean ignoreUnrecognized;
  1719. } JavaVMInitArgs;
  1720. typedef struct JavaVMAttachArgs {
  1721. jint version;
  1722. char *name;
  1723. jobject group;
  1724. } JavaVMAttachArgs;
  1725. /* These will be VM-specific. */
  1726. #define JDK1_2
  1727. #define JDK1_4
  1728. /* End VM-specific. */
  1729. struct JNIInvokeInterface_ {
  1730. void *reserved0;
  1731. void *reserved1;
  1732. void *reserved2;
  1733. jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
  1734. jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
  1735. jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
  1736. jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
  1737. jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
  1738. };
  1739. struct JavaVM_ {
  1740. const struct JNIInvokeInterface_ *functions;
  1741. #ifdef __cplusplus
  1742. jint DestroyJavaVM() {
  1743. return functions->DestroyJavaVM(this);
  1744. }
  1745. jint AttachCurrentThread(void **penv, void *args) {
  1746. return functions->AttachCurrentThread(this, penv, args);
  1747. }
  1748. jint DetachCurrentThread() {
  1749. return functions->DetachCurrentThread(this);
  1750. }
  1751. jint GetEnv(void **penv, jint version) {
  1752. return functions->GetEnv(this, penv, version);
  1753. }
  1754. jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
  1755. return functions->AttachCurrentThreadAsDaemon(this, penv, args);
  1756. }
  1757. #endif
  1758. };
  1759. #ifdef _JNI_IMPLEMENTATION_
  1760. #define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
  1761. #else
  1762. #define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
  1763. #endif
  1764. _JNI_IMPORT_OR_EXPORT_ jint JNICALL
  1765. JNI_GetDefaultJavaVMInitArgs(void *args);
  1766. _JNI_IMPORT_OR_EXPORT_ jint JNICALL
  1767. JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
  1768. _JNI_IMPORT_OR_EXPORT_ jint JNICALL
  1769. JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
  1770. /* Defined by native libraries. */
  1771. JNIEXPORT jint JNICALL
  1772. JNI_OnLoad(JavaVM *vm, void *reserved);
  1773. JNIEXPORT void JNICALL
  1774. JNI_OnUnload(JavaVM *vm, void *reserved);
  1775. #define JNI_VERSION_1_1 0x00010001
  1776. #define JNI_VERSION_1_2 0x00010002
  1777. #define JNI_VERSION_1_4 0x00010004
  1778. #define JNI_VERSION_1_6 0x00010006
  1779. #define JNI_VERSION_1_8 0x00010008
  1780. #define JNI_VERSION_9 0x00090000
  1781. #define JNI_VERSION_10 0x000a0000
  1782. #define JNI_VERSION_19 0x00130000
  1783. #define JNI_VERSION_20 0x00140000
  1784. #define JNI_VERSION_21 0x00150000
  1785. #ifdef __cplusplus
  1786. } /* extern "C" */
  1787. #endif /* __cplusplus */
  1788. #endif /* !_JAVASOFT_JNI_H_ */