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