1  #![doc(html_root_url="https://docs.rs/jni-sys/0.3.0")]
2  #![allow(non_snake_case, non_camel_case_types)]
3  
4  use std::os::raw::c_void;
5  use std::os::raw::c_char;
6  
7  // FIXME is this sufficiently correct?
8  pub type va_list = *mut c_void;
9  
10  pub type jint = i32;
11  pub type jlong = i64;
12  pub type jbyte = i8;
13  pub type jboolean = u8;
14  pub type jchar = u16;
15  pub type jshort = i16;
16  pub type jfloat = f32;
17  pub type jdouble = f64;
18  pub type jsize = jint;
19  
20  pub enum _jobject {}
21  pub type jobject = *mut _jobject;
22  pub type jclass = jobject;
23  pub type jthrowable = jobject;
24  pub type jstring = jobject;
25  pub type jarray = jobject;
26  pub type jbooleanArray = jarray;
27  pub type jbyteArray = jarray;
28  pub type jcharArray = jarray;
29  pub type jshortArray = jarray;
30  pub type jintArray = jarray;
31  pub type jlongArray = jarray;
32  pub type jfloatArray = jarray;
33  pub type jdoubleArray = jarray;
34  pub type jobjectArray = jarray;
35  pub type jweak = jobject;
36  
37  #[repr(C)]
38  #[derive(Copy)]
39  pub union jvalue {
40      pub z: jboolean,
41      pub b: jbyte,
42      pub c: jchar,
43      pub s: jshort,
44      pub i: jint,
45      pub j: jlong,
46      pub f: jfloat,
47      pub d: jdouble,
48      pub l: jobject,
49  }
50  
51  impl Clone for jvalue {
clone(&self) -> Self52      fn clone(&self) -> Self {
53          *self
54      }
55  }
56  
57  pub enum _jfieldID {}
58  pub type jfieldID = *mut _jfieldID;
59  pub enum _jmethodID {}
60  pub type jmethodID = *mut _jmethodID;
61  
62  #[derive(Clone, Copy)]
63  #[repr(C)]
64  pub enum jobjectRefType {
65      JNIInvalidRefType = 0,
66      JNILocalRefType = 1,
67      JNIGlobalRefType = 2,
68      JNIWeakGlobalRefType = 3,
69  }
70  
71  pub const JNI_FALSE: jboolean = 0;
72  pub const JNI_TRUE: jboolean = 1;
73  
74  pub const JNI_OK: jint = 0;
75  pub const JNI_ERR: jint = -1;
76  pub const JNI_EDETACHED: jint = -2;
77  pub const JNI_EVERSION: jint = -3;
78  pub const JNI_ENOMEM: jint = -4;
79  pub const JNI_EEXIST: jint = -5;
80  pub const JNI_EINVAL: jint = -6;
81  
82  pub const JNI_COMMIT: jint = 1;
83  pub const JNI_ABORT: jint = 2;
84  
85  pub const JNI_VERSION_1_1: jint = 0x00010001;
86  pub const JNI_VERSION_1_2: jint = 0x00010002;
87  pub const JNI_VERSION_1_4: jint = 0x00010004;
88  pub const JNI_VERSION_1_6: jint = 0x00010006;
89  pub const JNI_VERSION_1_8: jint = 0x00010008;
90  
91  #[repr(C)]
92  #[derive(Copy)]
93  pub struct JNINativeMethod {
94      pub name: *mut c_char,
95      pub signature: *mut c_char,
96      pub fnPtr: *mut c_void,
97  }
98  
99  impl Clone for JNINativeMethod {
clone(&self) -> Self100      fn clone(&self) -> Self {
101          *self
102      }
103  }
104  
105  pub type JNIEnv = *const JNINativeInterface_;
106  pub type JavaVM = *const JNIInvokeInterface_;
107  
108  #[repr(C)]
109  #[derive(Copy)]
110  pub struct JNINativeInterface_ {
111      pub reserved0: *mut c_void,
112      pub reserved1: *mut c_void,
113      pub reserved2: *mut c_void,
114      pub reserved3: *mut c_void,
115      pub GetVersion: Option<unsafe extern "system" fn(env: *mut JNIEnv) -> jint>,
116      pub DefineClass: Option<
117          unsafe extern "system" fn(env: *mut JNIEnv,
118                                    name: *const c_char,
119                                    loader: jobject,
120                                    buf: *const jbyte,
121                                    len: jsize)
122                                    -> jclass,
123      >,
124      pub FindClass:
125          Option<unsafe extern "system" fn(env: *mut JNIEnv, name: *const c_char) -> jclass>,
126      pub FromReflectedMethod:
127          Option<unsafe extern "system" fn(env: *mut JNIEnv, method: jobject) -> jmethodID>,
128      pub FromReflectedField:
129          Option<unsafe extern "system" fn(env: *mut JNIEnv, field: jobject) -> jfieldID>,
130      pub ToReflectedMethod: Option<
131          unsafe extern "system" fn(env: *mut JNIEnv,
132                                    cls: jclass,
133                                    methodID: jmethodID,
134                                    isStatic: jboolean)
135                                    -> jobject,
136      >,
137      pub GetSuperclass: Option<unsafe extern "system" fn(env: *mut JNIEnv, sub: jclass) -> jclass>,
138      pub IsAssignableFrom:
139          Option<unsafe extern "system" fn(env: *mut JNIEnv, sub: jclass, sup: jclass) -> jboolean>,
140      pub ToReflectedField: Option<
141          unsafe extern "system" fn(env: *mut JNIEnv,
142                                    cls: jclass,
143                                    fieldID: jfieldID,
144                                    isStatic: jboolean)
145                                    -> jobject,
146      >,
147      pub Throw: Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jthrowable) -> jint>,
148      pub ThrowNew: Option<
149          unsafe extern "system" fn(env: *mut JNIEnv,
150                                    clazz: jclass,
151                                    msg: *const c_char)
152                                    -> jint,
153      >,
154      pub ExceptionOccurred: Option<unsafe extern "system" fn(env: *mut JNIEnv) -> jthrowable>,
155      pub ExceptionDescribe: Option<unsafe extern "system" fn(env: *mut JNIEnv)>,
156      pub ExceptionClear: Option<unsafe extern "system" fn(env: *mut JNIEnv)>,
157      pub FatalError: Option<unsafe extern "system" fn(env: *mut JNIEnv, msg: *const c_char) -> !>,
158      pub PushLocalFrame: Option<unsafe extern "system" fn(env: *mut JNIEnv, capacity: jint) -> jint>,
159      pub PopLocalFrame:
160          Option<unsafe extern "system" fn(env: *mut JNIEnv, result: jobject) -> jobject>,
161      pub NewGlobalRef: Option<unsafe extern "system" fn(env: *mut JNIEnv, lobj: jobject) -> jobject>,
162      pub DeleteGlobalRef: Option<unsafe extern "system" fn(env: *mut JNIEnv, gref: jobject)>,
163      pub DeleteLocalRef: Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject)>,
164      pub IsSameObject: Option<
165          unsafe extern "system" fn(env: *mut JNIEnv,
166                                    obj1: jobject,
167                                    obj2: jobject)
168                                    -> jboolean,
169      >,
170      pub NewLocalRef: Option<unsafe extern "system" fn(env: *mut JNIEnv, ref_: jobject) -> jobject>,
171      pub EnsureLocalCapacity:
172          Option<unsafe extern "system" fn(env: *mut JNIEnv, capacity: jint) -> jint>,
173      pub AllocObject: Option<unsafe extern "system" fn(env: *mut JNIEnv, clazz: jclass) -> jobject>,
174      pub NewObject: Option<
175          unsafe extern "C" fn(env: *mut JNIEnv,
176                               clazz: jclass,
177                               methodID: jmethodID,
178                               ...)
179                               -> jobject,
180      >,
181      pub NewObjectV: Option<
182          unsafe extern "system" fn(env: *mut JNIEnv,
183                                    clazz: jclass,
184                                    methodID: jmethodID,
185                                    args: va_list)
186                                    -> jobject,
187      >,
188      pub NewObjectA: Option<
189          unsafe extern "system" fn(env: *mut JNIEnv,
190                                    clazz: jclass,
191                                    methodID: jmethodID,
192                                    args: *const jvalue)
193                                    -> jobject,
194      >,
195      pub GetObjectClass: Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject) -> jclass>,
196      pub IsInstanceOf:
197          Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject, clazz: jclass) -> jboolean>,
198      pub GetMethodID: Option<
199          unsafe extern "system" fn(env: *mut JNIEnv,
200                                    clazz: jclass,
201                                    name: *const c_char,
202                                    sig: *const c_char)
203                                    -> jmethodID,
204      >,
205      pub CallObjectMethod: Option<
206          unsafe extern "C" fn(env: *mut JNIEnv,
207                               obj: jobject,
208                               methodID: jmethodID,
209                               ...)
210                               -> jobject,
211      >,
212      pub CallObjectMethodV: Option<
213          unsafe extern "system" fn(env: *mut JNIEnv,
214                                    obj: jobject,
215                                    methodID: jmethodID,
216                                    args: va_list)
217                                    -> jobject,
218      >,
219      pub CallObjectMethodA: Option<
220          unsafe extern "system" fn(env: *mut JNIEnv,
221                                    obj: jobject,
222                                    methodID: jmethodID,
223                                    args: *const jvalue)
224                                    -> jobject,
225      >,
226      pub CallBooleanMethod: Option<
227          unsafe extern "C" fn(env: *mut JNIEnv,
228                               obj: jobject,
229                               methodID: jmethodID,
230                               ...)
231                               -> jboolean,
232      >,
233      pub CallBooleanMethodV: Option<
234          unsafe extern "system" fn(env: *mut JNIEnv,
235                                    obj: jobject,
236                                    methodID: jmethodID,
237                                    args: va_list)
238                                    -> jboolean,
239      >,
240      pub CallBooleanMethodA: Option<
241          unsafe extern "system" fn(env: *mut JNIEnv,
242                                    obj: jobject,
243                                    methodID: jmethodID,
244                                    args: *const jvalue)
245                                    -> jboolean,
246      >,
247      pub CallByteMethod: Option<
248          unsafe extern "C" fn(env: *mut JNIEnv,
249                               obj: jobject,
250                               methodID: jmethodID,
251                               ...)
252                               -> jbyte,
253      >,
254      pub CallByteMethodV: Option<
255          unsafe extern "system" fn(env: *mut JNIEnv,
256                                    obj: jobject,
257                                    methodID: jmethodID,
258                                    args: va_list)
259                                    -> jbyte,
260      >,
261      pub CallByteMethodA: Option<
262          unsafe extern "system" fn(env: *mut JNIEnv,
263                                    obj: jobject,
264                                    methodID: jmethodID,
265                                    args: *const jvalue)
266                                    -> jbyte,
267      >,
268      pub CallCharMethod: Option<
269          unsafe extern "C" fn(env: *mut JNIEnv,
270                               obj: jobject,
271                               methodID: jmethodID,
272                               ...)
273                               -> jchar,
274      >,
275      pub CallCharMethodV: Option<
276          unsafe extern "system" fn(env: *mut JNIEnv,
277                                    obj: jobject,
278                                    methodID: jmethodID,
279                                    args: va_list)
280                                    -> jchar,
281      >,
282      pub CallCharMethodA: Option<
283          unsafe extern "system" fn(env: *mut JNIEnv,
284                                    obj: jobject,
285                                    methodID: jmethodID,
286                                    args: *const jvalue)
287                                    -> jchar,
288      >,
289      pub CallShortMethod: Option<
290          unsafe extern "C" fn(env: *mut JNIEnv,
291                               obj: jobject,
292                               methodID: jmethodID,
293                               ...)
294                               -> jshort,
295      >,
296      pub CallShortMethodV: Option<
297          unsafe extern "system" fn(env: *mut JNIEnv,
298                                    obj: jobject,
299                                    methodID: jmethodID,
300                                    args: va_list)
301                                    -> jshort,
302      >,
303      pub CallShortMethodA: Option<
304          unsafe extern "system" fn(env: *mut JNIEnv,
305                                    obj: jobject,
306                                    methodID: jmethodID,
307                                    args: *const jvalue)
308                                    -> jshort,
309      >,
310      pub CallIntMethod: Option<
311          unsafe extern "C" fn(env: *mut JNIEnv,
312                               obj: jobject,
313                               methodID: jmethodID,
314                               ...)
315                               -> jint,
316      >,
317      pub CallIntMethodV: Option<
318          unsafe extern "system" fn(env: *mut JNIEnv,
319                                    obj: jobject,
320                                    methodID: jmethodID,
321                                    args: va_list)
322                                    -> jint,
323      >,
324      pub CallIntMethodA: Option<
325          unsafe extern "system" fn(env: *mut JNIEnv,
326                                    obj: jobject,
327                                    methodID: jmethodID,
328                                    args: *const jvalue)
329                                    -> jint,
330      >,
331      pub CallLongMethod: Option<
332          unsafe extern "C" fn(env: *mut JNIEnv,
333                               obj: jobject,
334                               methodID: jmethodID,
335                               ...)
336                               -> jlong,
337      >,
338      pub CallLongMethodV: Option<
339          unsafe extern "system" fn(env: *mut JNIEnv,
340                                    obj: jobject,
341                                    methodID: jmethodID,
342                                    args: va_list)
343                                    -> jlong,
344      >,
345      pub CallLongMethodA: Option<
346          unsafe extern "system" fn(env: *mut JNIEnv,
347                                    obj: jobject,
348                                    methodID: jmethodID,
349                                    args: *const jvalue)
350                                    -> jlong,
351      >,
352      pub CallFloatMethod: Option<
353          unsafe extern "C" fn(env: *mut JNIEnv,
354                               obj: jobject,
355                               methodID: jmethodID,
356                               ...)
357                               -> jfloat,
358      >,
359      pub CallFloatMethodV: Option<
360          unsafe extern "system" fn(env: *mut JNIEnv,
361                                    obj: jobject,
362                                    methodID: jmethodID,
363                                    args: va_list)
364                                    -> jfloat,
365      >,
366      pub CallFloatMethodA: Option<
367          unsafe extern "system" fn(env: *mut JNIEnv,
368                                    obj: jobject,
369                                    methodID: jmethodID,
370                                    args: *const jvalue)
371                                    -> jfloat,
372      >,
373      pub CallDoubleMethod: Option<
374          unsafe extern "C" fn(env: *mut JNIEnv,
375                               obj: jobject,
376                               methodID: jmethodID,
377                               ...)
378                               -> jdouble,
379      >,
380      pub CallDoubleMethodV: Option<
381          unsafe extern "system" fn(env: *mut JNIEnv,
382                                    obj: jobject,
383                                    methodID: jmethodID,
384                                    args: va_list)
385                                    -> jdouble,
386      >,
387      pub CallDoubleMethodA: Option<
388          unsafe extern "system" fn(env: *mut JNIEnv,
389                                    obj: jobject,
390                                    methodID: jmethodID,
391                                    args: *const jvalue)
392                                    -> jdouble,
393      >,
394      pub CallVoidMethod:
395          Option<unsafe extern "C" fn(env: *mut JNIEnv, obj: jobject, methodID: jmethodID, ...)>,
396      pub CallVoidMethodV: Option<
397          unsafe extern "system" fn(env: *mut JNIEnv,
398                                    obj: jobject,
399                                    methodID: jmethodID,
400                                    args: va_list),
401      >,
402      pub CallVoidMethodA: Option<
403          unsafe extern "system" fn(env: *mut JNIEnv,
404                                    obj: jobject,
405                                    methodID: jmethodID,
406                                    args: *const jvalue),
407      >,
408      pub CallNonvirtualObjectMethod: Option<
409          unsafe extern "C" fn(env: *mut JNIEnv,
410                               obj: jobject,
411                               clazz: jclass,
412                               methodID: jmethodID,
413                               ...)
414                               -> jobject,
415      >,
416      pub CallNonvirtualObjectMethodV: Option<
417          unsafe extern "system" fn(env: *mut JNIEnv,
418                                    obj: jobject,
419                                    clazz: jclass,
420                                    methodID: jmethodID,
421                                    args: va_list)
422                                    -> jobject,
423      >,
424      pub CallNonvirtualObjectMethodA: Option<
425          unsafe extern "system" fn(env: *mut JNIEnv,
426                                    obj: jobject,
427                                    clazz: jclass,
428                                    methodID: jmethodID,
429                                    args: *const jvalue)
430                                    -> jobject,
431      >,
432      pub CallNonvirtualBooleanMethod: Option<
433          unsafe extern "C" fn(env: *mut JNIEnv,
434                               obj: jobject,
435                               clazz: jclass,
436                               methodID: jmethodID,
437                               ...)
438                               -> jboolean,
439      >,
440      pub CallNonvirtualBooleanMethodV: Option<
441          unsafe extern "system" fn(env: *mut JNIEnv,
442                                    obj: jobject,
443                                    clazz: jclass,
444                                    methodID: jmethodID,
445                                    args: va_list)
446                                    -> jboolean,
447      >,
448      pub CallNonvirtualBooleanMethodA: Option<
449          unsafe extern "system" fn(env: *mut JNIEnv,
450                                    obj: jobject,
451                                    clazz: jclass,
452                                    methodID: jmethodID,
453                                    args: *const jvalue)
454                                    -> jboolean,
455      >,
456      pub CallNonvirtualByteMethod: Option<
457          unsafe extern "C" fn(env: *mut JNIEnv,
458                               obj: jobject,
459                               clazz: jclass,
460                               methodID: jmethodID,
461                               ...)
462                               -> jbyte,
463      >,
464      pub CallNonvirtualByteMethodV: Option<
465          unsafe extern "system" fn(env: *mut JNIEnv,
466                                    obj: jobject,
467                                    clazz: jclass,
468                                    methodID: jmethodID,
469                                    args: va_list)
470                                    -> jbyte,
471      >,
472      pub CallNonvirtualByteMethodA: Option<
473          unsafe extern "system" fn(env: *mut JNIEnv,
474                                    obj: jobject,
475                                    clazz: jclass,
476                                    methodID: jmethodID,
477                                    args: *const jvalue)
478                                    -> jbyte,
479      >,
480      pub CallNonvirtualCharMethod: Option<
481          unsafe extern "C" fn(env: *mut JNIEnv,
482                               obj: jobject,
483                               clazz: jclass,
484                               methodID: jmethodID,
485                               ...)
486                               -> jchar,
487      >,
488      pub CallNonvirtualCharMethodV: Option<
489          unsafe extern "system" fn(env: *mut JNIEnv,
490                                    obj: jobject,
491                                    clazz: jclass,
492                                    methodID: jmethodID,
493                                    args: va_list)
494                                    -> jchar,
495      >,
496      pub CallNonvirtualCharMethodA: Option<
497          unsafe extern "system" fn(env: *mut JNIEnv,
498                                    obj: jobject,
499                                    clazz: jclass,
500                                    methodID: jmethodID,
501                                    args: *const jvalue)
502                                    -> jchar,
503      >,
504      pub CallNonvirtualShortMethod: Option<
505          unsafe extern "C" fn(env: *mut JNIEnv,
506                               obj: jobject,
507                               clazz: jclass,
508                               methodID: jmethodID,
509                               ...)
510                               -> jshort,
511      >,
512      pub CallNonvirtualShortMethodV: Option<
513          unsafe extern "system" fn(env: *mut JNIEnv,
514                                    obj: jobject,
515                                    clazz: jclass,
516                                    methodID: jmethodID,
517                                    args: va_list)
518                                    -> jshort,
519      >,
520      pub CallNonvirtualShortMethodA: Option<
521          unsafe extern "system" fn(env: *mut JNIEnv,
522                                    obj: jobject,
523                                    clazz: jclass,
524                                    methodID: jmethodID,
525                                    args: *const jvalue)
526                                    -> jshort,
527      >,
528      pub CallNonvirtualIntMethod: Option<
529          unsafe extern "C" fn(env: *mut JNIEnv,
530                               obj: jobject,
531                               clazz: jclass,
532                               methodID: jmethodID,
533                               ...)
534                               -> jint,
535      >,
536      pub CallNonvirtualIntMethodV: Option<
537          unsafe extern "system" fn(env: *mut JNIEnv,
538                                    obj: jobject,
539                                    clazz: jclass,
540                                    methodID: jmethodID,
541                                    args: va_list)
542                                    -> jint,
543      >,
544      pub CallNonvirtualIntMethodA: Option<
545          unsafe extern "system" fn(env: *mut JNIEnv,
546                                    obj: jobject,
547                                    clazz: jclass,
548                                    methodID: jmethodID,
549                                    args: *const jvalue)
550                                    -> jint,
551      >,
552      pub CallNonvirtualLongMethod: Option<
553          unsafe extern "C" fn(env: *mut JNIEnv,
554                               obj: jobject,
555                               clazz: jclass,
556                               methodID: jmethodID,
557                               ...)
558                               -> jlong,
559      >,
560      pub CallNonvirtualLongMethodV: Option<
561          unsafe extern "system" fn(env: *mut JNIEnv,
562                                    obj: jobject,
563                                    clazz: jclass,
564                                    methodID: jmethodID,
565                                    args: va_list)
566                                    -> jlong,
567      >,
568      pub CallNonvirtualLongMethodA: Option<
569          unsafe extern "system" fn(env: *mut JNIEnv,
570                                    obj: jobject,
571                                    clazz: jclass,
572                                    methodID: jmethodID,
573                                    args: *const jvalue)
574                                    -> jlong,
575      >,
576      pub CallNonvirtualFloatMethod: Option<
577          unsafe extern "C" fn(env: *mut JNIEnv,
578                               obj: jobject,
579                               clazz: jclass,
580                               methodID: jmethodID,
581                               ...)
582                               -> jfloat,
583      >,
584      pub CallNonvirtualFloatMethodV: Option<
585          unsafe extern "system" fn(env: *mut JNIEnv,
586                                    obj: jobject,
587                                    clazz: jclass,
588                                    methodID: jmethodID,
589                                    args: va_list)
590                                    -> jfloat,
591      >,
592      pub CallNonvirtualFloatMethodA: Option<
593          unsafe extern "system" fn(env: *mut JNIEnv,
594                                    obj: jobject,
595                                    clazz: jclass,
596                                    methodID: jmethodID,
597                                    args: *const jvalue)
598                                    -> jfloat,
599      >,
600      pub CallNonvirtualDoubleMethod: Option<
601          unsafe extern "C" fn(env: *mut JNIEnv,
602                               obj: jobject,
603                               clazz: jclass,
604                               methodID: jmethodID,
605                               ...)
606                               -> jdouble,
607      >,
608      pub CallNonvirtualDoubleMethodV: Option<
609          unsafe extern "system" fn(env: *mut JNIEnv,
610                                    obj: jobject,
611                                    clazz: jclass,
612                                    methodID: jmethodID,
613                                    args: va_list)
614                                    -> jdouble,
615      >,
616      pub CallNonvirtualDoubleMethodA: Option<
617          unsafe extern "system" fn(env: *mut JNIEnv,
618                                    obj: jobject,
619                                    clazz: jclass,
620                                    methodID: jmethodID,
621                                    args: *const jvalue)
622                                    -> jdouble,
623      >,
624      pub CallNonvirtualVoidMethod: Option<
625          unsafe extern "C" fn(env: *mut JNIEnv,
626                               obj: jobject,
627                               clazz: jclass,
628                               methodID: jmethodID,
629                               ...),
630      >,
631      pub CallNonvirtualVoidMethodV: Option<
632          unsafe extern "system" fn(env: *mut JNIEnv,
633                                    obj: jobject,
634                                    clazz: jclass,
635                                    methodID: jmethodID,
636                                    args: va_list),
637      >,
638      pub CallNonvirtualVoidMethodA: Option<
639          unsafe extern "system" fn(env: *mut JNIEnv,
640                                    obj: jobject,
641                                    clazz: jclass,
642                                    methodID: jmethodID,
643                                    args: *const jvalue),
644      >,
645      pub GetFieldID: Option<
646          unsafe extern "system" fn(env: *mut JNIEnv,
647                                    clazz: jclass,
648                                    name: *const c_char,
649                                    sig: *const c_char)
650                                    -> jfieldID,
651      >,
652      pub GetObjectField: Option<
653          unsafe extern "system" fn(env: *mut JNIEnv,
654                                    obj: jobject,
655                                    fieldID: jfieldID)
656                                    -> jobject,
657      >,
658      pub GetBooleanField: Option<
659          unsafe extern "system" fn(env: *mut JNIEnv,
660                                    obj: jobject,
661                                    fieldID: jfieldID)
662                                    -> jboolean,
663      >,
664      pub GetByteField: Option<
665          unsafe extern "system" fn(env: *mut JNIEnv,
666                                    obj: jobject,
667                                    fieldID: jfieldID)
668                                    -> jbyte,
669      >,
670      pub GetCharField: Option<
671          unsafe extern "system" fn(env: *mut JNIEnv,
672                                    obj: jobject,
673                                    fieldID: jfieldID)
674                                    -> jchar,
675      >,
676      pub GetShortField: Option<
677          unsafe extern "system" fn(env: *mut JNIEnv,
678                                    obj: jobject,
679                                    fieldID: jfieldID)
680                                    -> jshort,
681      >,
682      pub GetIntField:
683          Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject, fieldID: jfieldID) -> jint>,
684      pub GetLongField: Option<
685          unsafe extern "system" fn(env: *mut JNIEnv,
686                                    obj: jobject,
687                                    fieldID: jfieldID)
688                                    -> jlong,
689      >,
690      pub GetFloatField: Option<
691          unsafe extern "system" fn(env: *mut JNIEnv,
692                                    obj: jobject,
693                                    fieldID: jfieldID)
694                                    -> jfloat,
695      >,
696      pub GetDoubleField: Option<
697          unsafe extern "system" fn(env: *mut JNIEnv,
698                                    obj: jobject,
699                                    fieldID: jfieldID)
700                                    -> jdouble,
701      >,
702      pub SetObjectField: Option<
703          unsafe extern "system" fn(env: *mut JNIEnv,
704                                    obj: jobject,
705                                    fieldID: jfieldID,
706                                    val: jobject),
707      >,
708      pub SetBooleanField: Option<
709          unsafe extern "system" fn(env: *mut JNIEnv,
710                                    obj: jobject,
711                                    fieldID: jfieldID,
712                                    val: jboolean),
713      >,
714      pub SetByteField: Option<
715          unsafe extern "system" fn(env: *mut JNIEnv,
716                                    obj: jobject,
717                                    fieldID: jfieldID,
718                                    val: jbyte),
719      >,
720      pub SetCharField: Option<
721          unsafe extern "system" fn(env: *mut JNIEnv,
722                                    obj: jobject,
723                                    fieldID: jfieldID,
724                                    val: jchar),
725      >,
726      pub SetShortField: Option<
727          unsafe extern "system" fn(env: *mut JNIEnv,
728                                    obj: jobject,
729                                    fieldID: jfieldID,
730                                    val: jshort),
731      >,
732      pub SetIntField: Option<
733          unsafe extern "system" fn(env: *mut JNIEnv,
734                                    obj: jobject,
735                                    fieldID: jfieldID,
736                                    val: jint),
737      >,
738      pub SetLongField: Option<
739          unsafe extern "system" fn(env: *mut JNIEnv,
740                                    obj: jobject,
741                                    fieldID: jfieldID,
742                                    val: jlong),
743      >,
744      pub SetFloatField: Option<
745          unsafe extern "system" fn(env: *mut JNIEnv,
746                                    obj: jobject,
747                                    fieldID: jfieldID,
748                                    val: jfloat),
749      >,
750      pub SetDoubleField: Option<
751          unsafe extern "system" fn(env: *mut JNIEnv,
752                                    obj: jobject,
753                                    fieldID: jfieldID,
754                                    val: jdouble),
755      >,
756      pub GetStaticMethodID: Option<
757          unsafe extern "system" fn(env: *mut JNIEnv,
758                                    clazz: jclass,
759                                    name: *const c_char,
760                                    sig: *const c_char)
761                                    -> jmethodID,
762      >,
763      pub CallStaticObjectMethod: Option<
764          unsafe extern "C" fn(env: *mut JNIEnv,
765                               clazz: jclass,
766                               methodID: jmethodID,
767                               ...)
768                               -> jobject,
769      >,
770      pub CallStaticObjectMethodV: Option<
771          unsafe extern "system" fn(env: *mut JNIEnv,
772                                    clazz: jclass,
773                                    methodID: jmethodID,
774                                    args: va_list)
775                                    -> jobject,
776      >,
777      pub CallStaticObjectMethodA: Option<
778          unsafe extern "system" fn(env: *mut JNIEnv,
779                                    clazz: jclass,
780                                    methodID: jmethodID,
781                                    args: *const jvalue)
782                                    -> jobject,
783      >,
784      pub CallStaticBooleanMethod: Option<
785          unsafe extern "C" fn(env: *mut JNIEnv,
786                               clazz: jclass,
787                               methodID: jmethodID,
788                               ...)
789                               -> jboolean,
790      >,
791      pub CallStaticBooleanMethodV: Option<
792          unsafe extern "system" fn(env: *mut JNIEnv,
793                                    clazz: jclass,
794                                    methodID: jmethodID,
795                                    args: va_list)
796                                    -> jboolean,
797      >,
798      pub CallStaticBooleanMethodA: Option<
799          unsafe extern "system" fn(env: *mut JNIEnv,
800                                    clazz: jclass,
801                                    methodID: jmethodID,
802                                    args: *const jvalue)
803                                    -> jboolean,
804      >,
805      pub CallStaticByteMethod: Option<
806          unsafe extern "C" fn(env: *mut JNIEnv,
807                               clazz: jclass,
808                               methodID: jmethodID,
809                               ...)
810                               -> jbyte,
811      >,
812      pub CallStaticByteMethodV: Option<
813          unsafe extern "system" fn(env: *mut JNIEnv,
814                                    clazz: jclass,
815                                    methodID: jmethodID,
816                                    args: va_list)
817                                    -> jbyte,
818      >,
819      pub CallStaticByteMethodA: Option<
820          unsafe extern "system" fn(env: *mut JNIEnv,
821                                    clazz: jclass,
822                                    methodID: jmethodID,
823                                    args: *const jvalue)
824                                    -> jbyte,
825      >,
826      pub CallStaticCharMethod: Option<
827          unsafe extern "C" fn(env: *mut JNIEnv,
828                               clazz: jclass,
829                               methodID: jmethodID,
830                               ...)
831                               -> jchar,
832      >,
833      pub CallStaticCharMethodV: Option<
834          unsafe extern "system" fn(env: *mut JNIEnv,
835                                    clazz: jclass,
836                                    methodID: jmethodID,
837                                    args: va_list)
838                                    -> jchar,
839      >,
840      pub CallStaticCharMethodA: Option<
841          unsafe extern "system" fn(env: *mut JNIEnv,
842                                    clazz: jclass,
843                                    methodID: jmethodID,
844                                    args: *const jvalue)
845                                    -> jchar,
846      >,
847      pub CallStaticShortMethod: Option<
848          unsafe extern "C" fn(env: *mut JNIEnv,
849                               clazz: jclass,
850                               methodID: jmethodID,
851                               ...)
852                               -> jshort,
853      >,
854      pub CallStaticShortMethodV: Option<
855          unsafe extern "system" fn(env: *mut JNIEnv,
856                                    clazz: jclass,
857                                    methodID: jmethodID,
858                                    args: va_list)
859                                    -> jshort,
860      >,
861      pub CallStaticShortMethodA: Option<
862          unsafe extern "system" fn(env: *mut JNIEnv,
863                                    clazz: jclass,
864                                    methodID: jmethodID,
865                                    args: *const jvalue)
866                                    -> jshort,
867      >,
868      pub CallStaticIntMethod: Option<
869          unsafe extern "C" fn(env: *mut JNIEnv,
870                               clazz: jclass,
871                               methodID: jmethodID,
872                               ...)
873                               -> jint,
874      >,
875      pub CallStaticIntMethodV: Option<
876          unsafe extern "system" fn(env: *mut JNIEnv,
877                                    clazz: jclass,
878                                    methodID: jmethodID,
879                                    args: va_list)
880                                    -> jint,
881      >,
882      pub CallStaticIntMethodA: Option<
883          unsafe extern "system" fn(env: *mut JNIEnv,
884                                    clazz: jclass,
885                                    methodID: jmethodID,
886                                    args: *const jvalue)
887                                    -> jint,
888      >,
889      pub CallStaticLongMethod: Option<
890          unsafe extern "C" fn(env: *mut JNIEnv,
891                               clazz: jclass,
892                               methodID: jmethodID,
893                               ...)
894                               -> jlong,
895      >,
896      pub CallStaticLongMethodV: Option<
897          unsafe extern "system" fn(env: *mut JNIEnv,
898                                    clazz: jclass,
899                                    methodID: jmethodID,
900                                    args: va_list)
901                                    -> jlong,
902      >,
903      pub CallStaticLongMethodA: Option<
904          unsafe extern "system" fn(env: *mut JNIEnv,
905                                    clazz: jclass,
906                                    methodID: jmethodID,
907                                    args: *const jvalue)
908                                    -> jlong,
909      >,
910      pub CallStaticFloatMethod: Option<
911          unsafe extern "C" fn(env: *mut JNIEnv,
912                               clazz: jclass,
913                               methodID: jmethodID,
914                               ...)
915                               -> jfloat,
916      >,
917      pub CallStaticFloatMethodV: Option<
918          unsafe extern "system" fn(env: *mut JNIEnv,
919                                    clazz: jclass,
920                                    methodID: jmethodID,
921                                    args: va_list)
922                                    -> jfloat,
923      >,
924      pub CallStaticFloatMethodA: Option<
925          unsafe extern "system" fn(env: *mut JNIEnv,
926                                    clazz: jclass,
927                                    methodID: jmethodID,
928                                    args: *const jvalue)
929                                    -> jfloat,
930      >,
931      pub CallStaticDoubleMethod: Option<
932          unsafe extern "C" fn(env: *mut JNIEnv,
933                               clazz: jclass,
934                               methodID: jmethodID,
935                               ...)
936                               -> jdouble,
937      >,
938      pub CallStaticDoubleMethodV: Option<
939          unsafe extern "system" fn(env: *mut JNIEnv,
940                                    clazz: jclass,
941                                    methodID: jmethodID,
942                                    args: va_list)
943                                    -> jdouble,
944      >,
945      pub CallStaticDoubleMethodA: Option<
946          unsafe extern "system" fn(env: *mut JNIEnv,
947                                    clazz: jclass,
948                                    methodID: jmethodID,
949                                    args: *const jvalue)
950                                    -> jdouble,
951      >,
952      pub CallStaticVoidMethod:
953          Option<unsafe extern "C" fn(env: *mut JNIEnv, cls: jclass, methodID: jmethodID, ...)>,
954      pub CallStaticVoidMethodV: Option<
955          unsafe extern "system" fn(env: *mut JNIEnv,
956                                    cls: jclass,
957                                    methodID: jmethodID,
958                                    args: va_list),
959      >,
960      pub CallStaticVoidMethodA: Option<
961          unsafe extern "system" fn(env: *mut JNIEnv,
962                                    cls: jclass,
963                                    methodID: jmethodID,
964                                    args: *const jvalue),
965      >,
966      pub GetStaticFieldID: Option<
967          unsafe extern "system" fn(env: *mut JNIEnv,
968                                    clazz: jclass,
969                                    name: *const c_char,
970                                    sig: *const c_char)
971                                    -> jfieldID,
972      >,
973      pub GetStaticObjectField: Option<
974          unsafe extern "system" fn(env: *mut JNIEnv,
975                                    clazz: jclass,
976                                    fieldID: jfieldID)
977                                    -> jobject,
978      >,
979      pub GetStaticBooleanField: Option<
980          unsafe extern "system" fn(env: *mut JNIEnv,
981                                    clazz: jclass,
982                                    fieldID: jfieldID)
983                                    -> jboolean,
984      >,
985      pub GetStaticByteField: Option<
986          unsafe extern "system" fn(env: *mut JNIEnv,
987                                    clazz: jclass,
988                                    fieldID: jfieldID)
989                                    -> jbyte,
990      >,
991      pub GetStaticCharField: Option<
992          unsafe extern "system" fn(env: *mut JNIEnv,
993                                    clazz: jclass,
994                                    fieldID: jfieldID)
995                                    -> jchar,
996      >,
997      pub GetStaticShortField: Option<
998          unsafe extern "system" fn(env: *mut JNIEnv,
999                                    clazz: jclass,
1000                                    fieldID: jfieldID)
1001                                    -> jshort,
1002      >,
1003      pub GetStaticIntField: Option<
1004          unsafe extern "system" fn(env: *mut JNIEnv,
1005                                    clazz: jclass,
1006                                    fieldID: jfieldID)
1007                                    -> jint,
1008      >,
1009      pub GetStaticLongField: Option<
1010          unsafe extern "system" fn(env: *mut JNIEnv,
1011                                    clazz: jclass,
1012                                    fieldID: jfieldID)
1013                                    -> jlong,
1014      >,
1015      pub GetStaticFloatField: Option<
1016          unsafe extern "system" fn(env: *mut JNIEnv,
1017                                    clazz: jclass,
1018                                    fieldID: jfieldID)
1019                                    -> jfloat,
1020      >,
1021      pub GetStaticDoubleField: Option<
1022          unsafe extern "system" fn(env: *mut JNIEnv,
1023                                    clazz: jclass,
1024                                    fieldID: jfieldID)
1025                                    -> jdouble,
1026      >,
1027      pub SetStaticObjectField: Option<
1028          unsafe extern "system" fn(env: *mut JNIEnv,
1029                                    clazz: jclass,
1030                                    fieldID: jfieldID,
1031                                    value: jobject),
1032      >,
1033      pub SetStaticBooleanField: Option<
1034          unsafe extern "system" fn(env: *mut JNIEnv,
1035                                    clazz: jclass,
1036                                    fieldID: jfieldID,
1037                                    value: jboolean),
1038      >,
1039      pub SetStaticByteField: Option<
1040          unsafe extern "system" fn(env: *mut JNIEnv,
1041                                    clazz: jclass,
1042                                    fieldID: jfieldID,
1043                                    value: jbyte),
1044      >,
1045      pub SetStaticCharField: Option<
1046          unsafe extern "system" fn(env: *mut JNIEnv,
1047                                    clazz: jclass,
1048                                    fieldID: jfieldID,
1049                                    value: jchar),
1050      >,
1051      pub SetStaticShortField: Option<
1052          unsafe extern "system" fn(env: *mut JNIEnv,
1053                                    clazz: jclass,
1054                                    fieldID: jfieldID,
1055                                    value: jshort),
1056      >,
1057      pub SetStaticIntField: Option<
1058          unsafe extern "system" fn(env: *mut JNIEnv,
1059                                    clazz: jclass,
1060                                    fieldID: jfieldID,
1061                                    value: jint),
1062      >,
1063      pub SetStaticLongField: Option<
1064          unsafe extern "system" fn(env: *mut JNIEnv,
1065                                    clazz: jclass,
1066                                    fieldID: jfieldID,
1067                                    value: jlong),
1068      >,
1069      pub SetStaticFloatField: Option<
1070          unsafe extern "system" fn(env: *mut JNIEnv,
1071                                    clazz: jclass,
1072                                    fieldID: jfieldID,
1073                                    value: jfloat),
1074      >,
1075      pub SetStaticDoubleField: Option<
1076          unsafe extern "system" fn(env: *mut JNIEnv,
1077                                    clazz: jclass,
1078                                    fieldID: jfieldID,
1079                                    value: jdouble),
1080      >,
1081      pub NewString: Option<
1082          unsafe extern "system" fn(env: *mut JNIEnv,
1083                                    unicode: *const jchar,
1084                                    len: jsize)
1085                                    -> jstring,
1086      >,
1087      pub GetStringLength: Option<unsafe extern "system" fn(env: *mut JNIEnv, str: jstring) -> jsize>,
1088      pub GetStringChars: Option<
1089          unsafe extern "system" fn(env: *mut JNIEnv,
1090                                    str: jstring,
1091                                    isCopy: *mut jboolean)
1092                                    -> *const jchar,
1093      >,
1094      pub ReleaseStringChars:
1095          Option<unsafe extern "system" fn(env: *mut JNIEnv, str: jstring, chars: *const jchar)>,
1096      pub NewStringUTF:
1097          Option<unsafe extern "system" fn(env: *mut JNIEnv, utf: *const c_char) -> jstring>,
1098      pub GetStringUTFLength:
1099          Option<unsafe extern "system" fn(env: *mut JNIEnv, str: jstring) -> jsize>,
1100      pub GetStringUTFChars: Option<
1101          unsafe extern "system" fn(env: *mut JNIEnv,
1102                                    str: jstring,
1103                                    isCopy: *mut jboolean)
1104                                    -> *const c_char,
1105      >,
1106      pub ReleaseStringUTFChars:
1107          Option<unsafe extern "system" fn(env: *mut JNIEnv, str: jstring, chars: *const c_char)>,
1108      pub GetArrayLength: Option<unsafe extern "system" fn(env: *mut JNIEnv, array: jarray) -> jsize>,
1109      pub NewObjectArray: Option<
1110          unsafe extern "system" fn(env: *mut JNIEnv,
1111                                    len: jsize,
1112                                    clazz: jclass,
1113                                    init: jobject)
1114                                    -> jobjectArray,
1115      >,
1116      pub GetObjectArrayElement: Option<
1117          unsafe extern "system" fn(env: *mut JNIEnv,
1118                                    array: jobjectArray,
1119                                    index: jsize)
1120                                    -> jobject,
1121      >,
1122      pub SetObjectArrayElement: Option<
1123          unsafe extern "system" fn(env: *mut JNIEnv,
1124                                    array: jobjectArray,
1125                                    index: jsize,
1126                                    val: jobject),
1127      >,
1128      pub NewBooleanArray:
1129          Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jbooleanArray>,
1130      pub NewByteArray: Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jbyteArray>,
1131      pub NewCharArray: Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jcharArray>,
1132      pub NewShortArray:
1133          Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jshortArray>,
1134      pub NewIntArray: Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jintArray>,
1135      pub NewLongArray: Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jlongArray>,
1136      pub NewFloatArray:
1137          Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jfloatArray>,
1138      pub NewDoubleArray:
1139          Option<unsafe extern "system" fn(env: *mut JNIEnv, len: jsize) -> jdoubleArray>,
1140      pub GetBooleanArrayElements: Option<
1141          unsafe extern "system" fn(env: *mut JNIEnv,
1142                                    array: jbooleanArray,
1143                                    isCopy: *mut jboolean)
1144                                    -> *mut jboolean,
1145      >,
1146      pub GetByteArrayElements: Option<
1147          unsafe extern "system" fn(env: *mut JNIEnv,
1148                                    array: jbyteArray,
1149                                    isCopy: *mut jboolean)
1150                                    -> *mut jbyte,
1151      >,
1152      pub GetCharArrayElements: Option<
1153          unsafe extern "system" fn(env: *mut JNIEnv,
1154                                    array: jcharArray,
1155                                    isCopy: *mut jboolean)
1156                                    -> *mut jchar,
1157      >,
1158      pub GetShortArrayElements: Option<
1159          unsafe extern "system" fn(env: *mut JNIEnv,
1160                                    array: jshortArray,
1161                                    isCopy: *mut jboolean)
1162                                    -> *mut jshort,
1163      >,
1164      pub GetIntArrayElements: Option<
1165          unsafe extern "system" fn(env: *mut JNIEnv,
1166                                    array: jintArray,
1167                                    isCopy: *mut jboolean)
1168                                    -> *mut jint,
1169      >,
1170      pub GetLongArrayElements: Option<
1171          unsafe extern "system" fn(env: *mut JNIEnv,
1172                                    array: jlongArray,
1173                                    isCopy: *mut jboolean)
1174                                    -> *mut jlong,
1175      >,
1176      pub GetFloatArrayElements: Option<
1177          unsafe extern "system" fn(env: *mut JNIEnv,
1178                                    array: jfloatArray,
1179                                    isCopy: *mut jboolean)
1180                                    -> *mut jfloat,
1181      >,
1182      pub GetDoubleArrayElements: Option<
1183          unsafe extern "system" fn(env: *mut JNIEnv,
1184                                    array: jdoubleArray,
1185                                    isCopy: *mut jboolean)
1186                                    -> *mut jdouble,
1187      >,
1188      pub ReleaseBooleanArrayElements: Option<
1189          unsafe extern "system" fn(env: *mut JNIEnv,
1190                                    array: jbooleanArray,
1191                                    elems: *mut jboolean,
1192                                    mode: jint),
1193      >,
1194      pub ReleaseByteArrayElements: Option<
1195          unsafe extern "system" fn(env: *mut JNIEnv,
1196                                    array: jbyteArray,
1197                                    elems: *mut jbyte,
1198                                    mode: jint),
1199      >,
1200      pub ReleaseCharArrayElements: Option<
1201          unsafe extern "system" fn(env: *mut JNIEnv,
1202                                    array: jcharArray,
1203                                    elems: *mut jchar,
1204                                    mode: jint),
1205      >,
1206      pub ReleaseShortArrayElements: Option<
1207          unsafe extern "system" fn(env: *mut JNIEnv,
1208                                    array: jshortArray,
1209                                    elems: *mut jshort,
1210                                    mode: jint),
1211      >,
1212      pub ReleaseIntArrayElements: Option<
1213          unsafe extern "system" fn(env: *mut JNIEnv,
1214                                    array: jintArray,
1215                                    elems: *mut jint,
1216                                    mode: jint),
1217      >,
1218      pub ReleaseLongArrayElements: Option<
1219          unsafe extern "system" fn(env: *mut JNIEnv,
1220                                    array: jlongArray,
1221                                    elems: *mut jlong,
1222                                    mode: jint),
1223      >,
1224      pub ReleaseFloatArrayElements: Option<
1225          unsafe extern "system" fn(env: *mut JNIEnv,
1226                                    array: jfloatArray,
1227                                    elems: *mut jfloat,
1228                                    mode: jint),
1229      >,
1230      pub ReleaseDoubleArrayElements: Option<
1231          unsafe extern "system" fn(env: *mut JNIEnv,
1232                                    array: jdoubleArray,
1233                                    elems: *mut jdouble,
1234                                    mode: jint),
1235      >,
1236      pub GetBooleanArrayRegion: Option<
1237          unsafe extern "system" fn(env: *mut JNIEnv,
1238                                    array: jbooleanArray,
1239                                    start: jsize,
1240                                    l: jsize,
1241                                    buf: *mut jboolean),
1242      >,
1243      pub GetByteArrayRegion: Option<
1244          unsafe extern "system" fn(env: *mut JNIEnv,
1245                                    array: jbyteArray,
1246                                    start: jsize,
1247                                    len: jsize,
1248                                    buf: *mut jbyte),
1249      >,
1250      pub GetCharArrayRegion: Option<
1251          unsafe extern "system" fn(env: *mut JNIEnv,
1252                                    array: jcharArray,
1253                                    start: jsize,
1254                                    len: jsize,
1255                                    buf: *mut jchar),
1256      >,
1257      pub GetShortArrayRegion: Option<
1258          unsafe extern "system" fn(env: *mut JNIEnv,
1259                                    array: jshortArray,
1260                                    start: jsize,
1261                                    len: jsize,
1262                                    buf: *mut jshort),
1263      >,
1264      pub GetIntArrayRegion: Option<
1265          unsafe extern "system" fn(env: *mut JNIEnv,
1266                                    array: jintArray,
1267                                    start: jsize,
1268                                    len: jsize,
1269                                    buf: *mut jint),
1270      >,
1271      pub GetLongArrayRegion: Option<
1272          unsafe extern "system" fn(env: *mut JNIEnv,
1273                                    array: jlongArray,
1274                                    start: jsize,
1275                                    len: jsize,
1276                                    buf: *mut jlong),
1277      >,
1278      pub GetFloatArrayRegion: Option<
1279          unsafe extern "system" fn(env: *mut JNIEnv,
1280                                    array: jfloatArray,
1281                                    start: jsize,
1282                                    len: jsize,
1283                                    buf: *mut jfloat),
1284      >,
1285      pub GetDoubleArrayRegion: Option<
1286          unsafe extern "system" fn(env: *mut JNIEnv,
1287                                    array: jdoubleArray,
1288                                    start: jsize,
1289                                    len: jsize,
1290                                    buf: *mut jdouble),
1291      >,
1292      pub SetBooleanArrayRegion: Option<
1293          unsafe extern "system" fn(env: *mut JNIEnv,
1294                                    array: jbooleanArray,
1295                                    start: jsize,
1296                                    l: jsize,
1297                                    buf: *const jboolean),
1298      >,
1299      pub SetByteArrayRegion: Option<
1300          unsafe extern "system" fn(env: *mut JNIEnv,
1301                                    array: jbyteArray,
1302                                    start: jsize,
1303                                    len: jsize,
1304                                    buf: *const jbyte),
1305      >,
1306      pub SetCharArrayRegion: Option<
1307          unsafe extern "system" fn(env: *mut JNIEnv,
1308                                    array: jcharArray,
1309                                    start: jsize,
1310                                    len: jsize,
1311                                    buf: *const jchar),
1312      >,
1313      pub SetShortArrayRegion: Option<
1314          unsafe extern "system" fn(env: *mut JNIEnv,
1315                                    array: jshortArray,
1316                                    start: jsize,
1317                                    len: jsize,
1318                                    buf: *const jshort),
1319      >,
1320      pub SetIntArrayRegion: Option<
1321          unsafe extern "system" fn(env: *mut JNIEnv,
1322                                    array: jintArray,
1323                                    start: jsize,
1324                                    len: jsize,
1325                                    buf: *const jint),
1326      >,
1327      pub SetLongArrayRegion: Option<
1328          unsafe extern "system" fn(env: *mut JNIEnv,
1329                                    array: jlongArray,
1330                                    start: jsize,
1331                                    len: jsize,
1332                                    buf: *const jlong),
1333      >,
1334      pub SetFloatArrayRegion: Option<
1335          unsafe extern "system" fn(env: *mut JNIEnv,
1336                                    array: jfloatArray,
1337                                    start: jsize,
1338                                    len: jsize,
1339                                    buf: *const jfloat),
1340      >,
1341      pub SetDoubleArrayRegion: Option<
1342          unsafe extern "system" fn(env: *mut JNIEnv,
1343                                    array: jdoubleArray,
1344                                    start: jsize,
1345                                    len: jsize,
1346                                    buf: *const jdouble),
1347      >,
1348      pub RegisterNatives: Option<
1349          unsafe extern "system" fn(env: *mut JNIEnv,
1350                                    clazz: jclass,
1351                                    methods: *const JNINativeMethod,
1352                                    nMethods: jint)
1353                                    -> jint,
1354      >,
1355      pub UnregisterNatives:
1356          Option<unsafe extern "system" fn(env: *mut JNIEnv, clazz: jclass) -> jint>,
1357      pub MonitorEnter: Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject) -> jint>,
1358      pub MonitorExit: Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject) -> jint>,
1359      pub GetJavaVM:
1360          Option<unsafe extern "system" fn(env: *mut JNIEnv, vm: *mut *mut JavaVM) -> jint>,
1361      pub GetStringRegion: Option<
1362          unsafe extern "system" fn(env: *mut JNIEnv,
1363                                    str: jstring,
1364                                    start: jsize,
1365                                    len: jsize,
1366                                    buf: *mut jchar),
1367      >,
1368      pub GetStringUTFRegion: Option<
1369          unsafe extern "system" fn(env: *mut JNIEnv,
1370                                    str: jstring,
1371                                    start: jsize,
1372                                    len: jsize,
1373                                    buf: *mut c_char),
1374      >,
1375      pub GetPrimitiveArrayCritical: Option<
1376          unsafe extern "system" fn(env: *mut JNIEnv,
1377                                    array: jarray,
1378                                    isCopy: *mut jboolean)
1379                                    -> *mut c_void,
1380      >,
1381      pub ReleasePrimitiveArrayCritical: Option<
1382          unsafe extern "system" fn(env: *mut JNIEnv,
1383                                    array: jarray,
1384                                    carray: *mut c_void,
1385                                    mode: jint),
1386      >,
1387      pub GetStringCritical: Option<
1388          unsafe extern "system" fn(env: *mut JNIEnv,
1389                                    string: jstring,
1390                                    isCopy: *mut jboolean)
1391                                    -> *const jchar,
1392      >,
1393      pub ReleaseStringCritical:
1394          Option<unsafe extern "system" fn(env: *mut JNIEnv, string: jstring, cstring: *const jchar)>,
1395      pub NewWeakGlobalRef:
1396          Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject) -> jweak>,
1397      pub DeleteWeakGlobalRef: Option<unsafe extern "system" fn(env: *mut JNIEnv, ref_: jweak)>,
1398      pub ExceptionCheck: Option<unsafe extern "system" fn(env: *mut JNIEnv) -> jboolean>,
1399      pub NewDirectByteBuffer: Option<
1400          unsafe extern "system" fn(env: *mut JNIEnv,
1401                                    address: *mut c_void,
1402                                    capacity: jlong)
1403                                    -> jobject,
1404      >,
1405      pub GetDirectBufferAddress:
1406          Option<unsafe extern "system" fn(env: *mut JNIEnv, buf: jobject) -> *mut c_void>,
1407      pub GetDirectBufferCapacity:
1408          Option<unsafe extern "system" fn(env: *mut JNIEnv, buf: jobject) -> jlong>,
1409      pub GetObjectRefType:
1410          Option<unsafe extern "system" fn(env: *mut JNIEnv, obj: jobject) -> jobjectRefType>,
1411  }
1412  
1413  impl Clone for JNINativeInterface_ {
clone(&self) -> Self1414      fn clone(&self) -> Self {
1415          *self
1416      }
1417  }
1418  
1419  #[repr(C)]
1420  #[derive(Copy)]
1421  pub struct JNIEnv_ {
1422      pub functions: *const JNINativeInterface_,
1423  }
1424  
1425  impl Clone for JNIEnv_ {
clone(&self) -> Self1426      fn clone(&self) -> Self {
1427          *self
1428      }
1429  }
1430  
1431  #[repr(C)]
1432  #[derive(Copy)]
1433  pub struct JavaVMOption {
1434      pub optionString: *mut c_char,
1435      pub extraInfo: *mut c_void,
1436  }
1437  
1438  impl Clone for JavaVMOption {
clone(&self) -> Self1439      fn clone(&self) -> Self {
1440          *self
1441      }
1442  }
1443  
1444  #[repr(C)]
1445  #[derive(Copy)]
1446  pub struct JavaVMInitArgs {
1447      pub version: jint,
1448      pub nOptions: jint,
1449      pub options: *mut JavaVMOption,
1450      pub ignoreUnrecognized: jboolean,
1451  }
1452  
1453  impl Clone for JavaVMInitArgs {
clone(&self) -> Self1454      fn clone(&self) -> Self {
1455          *self
1456      }
1457  }
1458  
1459  #[repr(C)]
1460  #[derive(Copy)]
1461  pub struct JavaVMAttachArgs {
1462      pub version: jint,
1463      pub name: *mut c_char,
1464      pub group: jobject,
1465  }
1466  
1467  impl Clone for JavaVMAttachArgs {
clone(&self) -> Self1468      fn clone(&self) -> Self {
1469          *self
1470      }
1471  }
1472  
1473  #[repr(C)]
1474  #[derive(Copy)]
1475  pub struct JNIInvokeInterface_ {
1476      pub reserved0: *mut c_void,
1477      pub reserved1: *mut c_void,
1478      pub reserved2: *mut c_void,
1479      pub DestroyJavaVM: Option<unsafe extern "system" fn(vm: *mut JavaVM) -> jint>,
1480      pub AttachCurrentThread: Option<
1481          unsafe extern "system" fn(vm: *mut JavaVM,
1482                                    penv: *mut *mut c_void,
1483                                    args: *mut c_void)
1484                                    -> jint,
1485      >,
1486      pub DetachCurrentThread: Option<unsafe extern "system" fn(vm: *mut JavaVM) -> jint>,
1487      pub GetEnv: Option<
1488          unsafe extern "system" fn(vm: *mut JavaVM,
1489                                    penv: *mut *mut c_void,
1490                                    version: jint)
1491                                    -> jint,
1492      >,
1493      pub AttachCurrentThreadAsDaemon: Option<
1494          unsafe extern "system" fn(vm: *mut JavaVM,
1495                                    penv: *mut *mut c_void,
1496                                    args: *mut c_void)
1497                                    -> jint,
1498      >,
1499  }
1500  
1501  impl Clone for JNIInvokeInterface_ {
clone(&self) -> Self1502      fn clone(&self) -> Self {
1503          *self
1504      }
1505  }
1506  
1507  extern "system" {
JNI_GetDefaultJavaVMInitArgs(args: *mut c_void) -> jint1508      pub fn JNI_GetDefaultJavaVMInitArgs(args: *mut c_void) -> jint;
JNI_CreateJavaVM( pvm: *mut *mut JavaVM, penv: *mut *mut c_void, args: *mut c_void, ) -> jint1509      pub fn JNI_CreateJavaVM(
1510          pvm: *mut *mut JavaVM,
1511          penv: *mut *mut c_void,
1512          args: *mut c_void,
1513      ) -> jint;
JNI_GetCreatedJavaVMs(vmBuf: *mut *mut JavaVM, bufLen: jsize, nVMs: *mut jsize) -> jint1514      pub fn JNI_GetCreatedJavaVMs(vmBuf: *mut *mut JavaVM, bufLen: jsize, nVMs: *mut jsize) -> jint;
1515  }
1516