-
Notifications
You must be signed in to change notification settings - Fork 45
/
cwrapper.go
1292 lines (977 loc) · 53.8 KB
/
cwrapper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2016 Tim O'Brien. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package jnigi
/*
#include<jni.h>
#include<stdlib.h>
// Android is missing the JNI_VERSION_1_8, JNI_VERSION_9, JNI_VERSION_10 constant
#ifndef JNI_VERSION_1_8
#define JNI_VERSION_1_8 0x00010008
#endif
#ifndef JNI_VERSION_9
#define JNI_VERSION_9 0x00090000
#endif
#ifndef JNI_VERSION_10
#define JNI_VERSION_10 0x000a0000
#endif
jclass FindClass(JNIEnv* env, char* name) {
return (*env)->FindClass (env, name);
}
jint Throw(JNIEnv* env, jthrowable obj) {
return (*env)->Throw (env, obj);
}
jint ThrowNew(JNIEnv* env, jclass clazz, char* msg) {
return (*env)->ThrowNew (env, clazz, msg);
}
jthrowable ExceptionOccurred(JNIEnv* env) {
return (*env)->ExceptionOccurred (env);
}
void ExceptionDescribe(JNIEnv* env) {
(*env)->ExceptionDescribe (env);
}
void ExceptionClear(JNIEnv* env) {
(*env)->ExceptionClear (env);
}
void FatalError(JNIEnv* env, char* msg) {
(*env)->FatalError (env, msg);
}
jboolean ExceptionCheck(JNIEnv* env) {
return (*env)->ExceptionCheck (env);
}
jint PushLocalFrame(JNIEnv* env, jint capacity) {
return (*env)->PushLocalFrame (env, capacity);
}
jobject PopLocalFrame(JNIEnv* env, jobject result) {
return (*env)->PopLocalFrame (env, result);
}
jobject NewGlobalRef(JNIEnv* env, jobject lobj) {
return (*env)->NewGlobalRef (env, lobj);
}
void DeleteGlobalRef(JNIEnv* env, jobject gref) {
(*env)->DeleteGlobalRef (env, gref);
}
void DeleteLocalRef(JNIEnv* env, jobject obj) {
(*env)->DeleteLocalRef (env, obj);
}
jboolean IsSameObject(JNIEnv* env, jobject obj1, jobject obj2) {
return (*env)->IsSameObject (env, obj1, obj2);
}
jobject NewLocalRef(JNIEnv* env, jobject ref) {
return (*env)->NewLocalRef (env, ref);
}
jint EnsureLocalCapacity(JNIEnv* env, jint capacity) {
return (*env)->EnsureLocalCapacity (env, capacity);
}
jobject AllocObject(JNIEnv* env, jclass clazz) {
return (*env)->AllocObject (env, clazz);
}
jobject NewObjectA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->NewObjectA (env, clazz, methodID, args);
}
jclass GetObjectClass(JNIEnv* env, jobject obj) {
return (*env)->GetObjectClass (env, obj);
}
jboolean IsInstanceOf(JNIEnv* env, jobject obj, jclass clazz) {
return (*env)->IsInstanceOf (env, obj, clazz);
}
jmethodID GetMethodID(JNIEnv* env, jclass clazz, char* name, char* sig) {
return (*env)->GetMethodID (env, clazz, name, sig);
}
jobject CallObjectMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallObjectMethodA (env, obj, methodID, args);
}
jboolean CallBooleanMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallBooleanMethodA (env, obj, methodID, args);
}
jbyte CallByteMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallByteMethodA (env, obj, methodID, args);
}
jchar CallCharMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallCharMethodA (env, obj, methodID, args);
}
jshort CallShortMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallShortMethodA (env, obj, methodID, args);
}
jint CallIntMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallIntMethodA (env, obj, methodID, args);
}
jlong CallLongMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallLongMethodA (env, obj, methodID, args);
}
jfloat CallFloatMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallFloatMethodA (env, obj, methodID, args);
}
jdouble CallDoubleMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
return (*env)->CallDoubleMethodA (env, obj, methodID, args);
}
void CallVoidMethodA(JNIEnv* env, jobject obj, jmethodID methodID, jvalue* args) {
(*env)->CallVoidMethodA (env, obj, methodID, args);
}
jfieldID GetFieldID(JNIEnv* env, jclass clazz, char* name, char* sig) {
return (*env)->GetFieldID (env, clazz, name, sig);
}
jobject GetObjectField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetObjectField (env, obj, fieldID);
}
jboolean GetBooleanField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetBooleanField (env, obj, fieldID);
}
jbyte GetByteField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetByteField (env, obj, fieldID);
}
jchar GetCharField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetCharField (env, obj, fieldID);
}
jshort GetShortField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetShortField (env, obj, fieldID);
}
jint GetIntField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetIntField (env, obj, fieldID);
}
jlong GetLongField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetLongField (env, obj, fieldID);
}
jfloat GetFloatField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetFloatField (env, obj, fieldID);
}
jdouble GetDoubleField(JNIEnv* env, jobject obj, jfieldID fieldID) {
return (*env)->GetDoubleField (env, obj, fieldID);
}
void SetObjectField(JNIEnv* env, jobject obj, jfieldID fieldID, jobject val) {
(*env)->SetObjectField (env, obj, fieldID, val);
}
void SetBooleanField(JNIEnv* env, jobject obj, jfieldID fieldID, jboolean val) {
(*env)->SetBooleanField (env, obj, fieldID, val);
}
void SetByteField(JNIEnv* env, jobject obj, jfieldID fieldID, jbyte val) {
(*env)->SetByteField (env, obj, fieldID, val);
}
void SetCharField(JNIEnv* env, jobject obj, jfieldID fieldID, jchar val) {
(*env)->SetCharField (env, obj, fieldID, val);
}
void SetShortField(JNIEnv* env, jobject obj, jfieldID fieldID, jshort val) {
(*env)->SetShortField (env, obj, fieldID, val);
}
void SetIntField(JNIEnv* env, jobject obj, jfieldID fieldID, jint val) {
(*env)->SetIntField (env, obj, fieldID, val);
}
void SetLongField(JNIEnv* env, jobject obj, jfieldID fieldID, jlong val) {
(*env)->SetLongField (env, obj, fieldID, val);
}
void SetFloatField(JNIEnv* env, jobject obj, jfieldID fieldID, jfloat val) {
(*env)->SetFloatField (env, obj, fieldID, val);
}
void SetDoubleField(JNIEnv* env, jobject obj, jfieldID fieldID, jdouble val) {
(*env)->SetDoubleField (env, obj, fieldID, val);
}
jmethodID GetStaticMethodID(JNIEnv* env, jclass clazz, char* name, char* sig) {
return (*env)->GetStaticMethodID (env, clazz, name, sig);
}
jobject CallStaticObjectMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticObjectMethodA (env, clazz, methodID, args);
}
jboolean CallStaticBooleanMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticBooleanMethodA (env, clazz, methodID, args);
}
jbyte CallStaticByteMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticByteMethodA (env, clazz, methodID, args);
}
jchar CallStaticCharMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticCharMethodA (env, clazz, methodID, args);
}
jshort CallStaticShortMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticShortMethodA (env, clazz, methodID, args);
}
jint CallStaticIntMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticIntMethodA (env, clazz, methodID, args);
}
jlong CallStaticLongMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticLongMethodA (env, clazz, methodID, args);
}
jfloat CallStaticFloatMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticFloatMethodA (env, clazz, methodID, args);
}
jdouble CallStaticDoubleMethodA(JNIEnv* env, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallStaticDoubleMethodA (env, clazz, methodID, args);
}
void CallStaticVoidMethodA(JNIEnv* env, jclass cls, jmethodID methodID, jvalue* args) {
(*env)->CallStaticVoidMethodA (env, cls, methodID, args);
}
jfieldID GetStaticFieldID(JNIEnv* env, jclass clazz, char* name, char* sig) {
return (*env)->GetStaticFieldID (env, clazz, name, sig);
}
jobject GetStaticObjectField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticObjectField (env, clazz, fieldID);
}
jboolean GetStaticBooleanField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticBooleanField (env, clazz, fieldID);
}
jbyte GetStaticByteField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticByteField (env, clazz, fieldID);
}
jchar GetStaticCharField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticCharField (env, clazz, fieldID);
}
jshort GetStaticShortField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticShortField (env, clazz, fieldID);
}
jint GetStaticIntField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticIntField (env, clazz, fieldID);
}
jlong GetStaticLongField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticLongField (env, clazz, fieldID);
}
jfloat GetStaticFloatField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticFloatField (env, clazz, fieldID);
}
jdouble GetStaticDoubleField(JNIEnv* env, jclass clazz, jfieldID fieldID) {
return (*env)->GetStaticDoubleField (env, clazz, fieldID);
}
void SetStaticObjectField(JNIEnv* env, jclass clazz, jfieldID fieldID, jobject value) {
(*env)->SetStaticObjectField (env, clazz, fieldID, value);
}
void SetStaticBooleanField(JNIEnv* env, jclass clazz, jfieldID fieldID, jboolean value) {
(*env)->SetStaticBooleanField (env, clazz, fieldID, value);
}
void SetStaticByteField(JNIEnv* env, jclass clazz, jfieldID fieldID, jbyte value) {
(*env)->SetStaticByteField (env, clazz, fieldID, value);
}
void SetStaticCharField(JNIEnv* env, jclass clazz, jfieldID fieldID, jchar value) {
(*env)->SetStaticCharField (env, clazz, fieldID, value);
}
void SetStaticShortField(JNIEnv* env, jclass clazz, jfieldID fieldID, jshort value) {
(*env)->SetStaticShortField (env, clazz, fieldID, value);
}
void SetStaticIntField(JNIEnv* env, jclass clazz, jfieldID fieldID, jint value) {
(*env)->SetStaticIntField (env, clazz, fieldID, value);
}
void SetStaticLongField(JNIEnv* env, jclass clazz, jfieldID fieldID, jlong value) {
(*env)->SetStaticLongField (env, clazz, fieldID, value);
}
void SetStaticFloatField(JNIEnv* env, jclass clazz, jfieldID fieldID, jfloat value) {
(*env)->SetStaticFloatField (env, clazz, fieldID, value);
}
void SetStaticDoubleField(JNIEnv* env, jclass clazz, jfieldID fieldID, jdouble value) {
(*env)->SetStaticDoubleField (env, clazz, fieldID, value);
}
jstring NewString(JNIEnv* env, jchar* unicode, jsize len) {
return (*env)->NewString (env, unicode, len);
}
jsize GetStringLength(JNIEnv* env, jstring str) {
return (*env)->GetStringLength (env, str);
}
const jchar* GetStringChars(JNIEnv* env, jstring str, jboolean* isCopy) {
return (*env)->GetStringChars (env, str, isCopy);
}
void ReleaseStringChars(JNIEnv* env, jstring str, jchar* chars) {
(*env)->ReleaseStringChars (env, str, chars);
}
jstring NewStringUTF(JNIEnv* env, char* utf) {
return (*env)->NewStringUTF (env, utf);
}
jsize GetStringUTFLength(JNIEnv* env, jstring str) {
return (*env)->GetStringUTFLength (env, str);
}
const char* GetStringUTFChars(JNIEnv* env, jstring str, jboolean* isCopy) {
return (*env)->GetStringUTFChars (env, str, isCopy);
}
void ReleaseStringUTFChars(JNIEnv* env, jstring str, char* chars) {
(*env)->ReleaseStringUTFChars (env, str, chars);
}
jsize GetArrayLength(JNIEnv* env, jarray array) {
return (*env)->GetArrayLength (env, array);
}
jobjectArray NewObjectArray(JNIEnv* env, jsize len, jclass clazz, jobject init) {
return (*env)->NewObjectArray (env, len, clazz, init);
}
jobject GetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index) {
return (*env)->GetObjectArrayElement (env, array, index);
}
void SetObjectArrayElement(JNIEnv* env, jobjectArray array, jsize index, jobject val) {
(*env)->SetObjectArrayElement (env, array, index, val);
}
jbooleanArray NewBooleanArray(JNIEnv* env, jsize len) {
return (*env)->NewBooleanArray (env, len);
}
jbyteArray NewByteArray(JNIEnv* env, jsize len) {
return (*env)->NewByteArray (env, len);
}
jcharArray NewCharArray(JNIEnv* env, jsize len) {
return (*env)->NewCharArray (env, len);
}
jshortArray NewShortArray(JNIEnv* env, jsize len) {
return (*env)->NewShortArray (env, len);
}
jintArray NewIntArray(JNIEnv* env, jsize len) {
return (*env)->NewIntArray (env, len);
}
jlongArray NewLongArray(JNIEnv* env, jsize len) {
return (*env)->NewLongArray (env, len);
}
jfloatArray NewFloatArray(JNIEnv* env, jsize len) {
return (*env)->NewFloatArray (env, len);
}
jdoubleArray NewDoubleArray(JNIEnv* env, jsize len) {
return (*env)->NewDoubleArray (env, len);
}
jboolean* GetBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* isCopy) {
return (*env)->GetBooleanArrayElements (env, array, isCopy);
}
jbyte* GetByteArrayElements(JNIEnv* env, jbyteArray array, jboolean* isCopy) {
return (*env)->GetByteArrayElements (env, array, isCopy);
}
jchar* GetCharArrayElements(JNIEnv* env, jcharArray array, jboolean* isCopy) {
return (*env)->GetCharArrayElements (env, array, isCopy);
}
jshort* GetShortArrayElements(JNIEnv* env, jshortArray array, jboolean* isCopy) {
return (*env)->GetShortArrayElements (env, array, isCopy);
}
jint* GetIntArrayElements(JNIEnv* env, jintArray array, jboolean* isCopy) {
return (*env)->GetIntArrayElements (env, array, isCopy);
}
jlong* GetLongArrayElements(JNIEnv* env, jlongArray array, jboolean* isCopy) {
return (*env)->GetLongArrayElements (env, array, isCopy);
}
jfloat* GetFloatArrayElements(JNIEnv* env, jfloatArray array, jboolean* isCopy) {
return (*env)->GetFloatArrayElements (env, array, isCopy);
}
jdouble* GetDoubleArrayElements(JNIEnv* env, jdoubleArray array, jboolean* isCopy) {
return (*env)->GetDoubleArrayElements (env, array, isCopy);
}
void ReleaseBooleanArrayElements(JNIEnv* env, jbooleanArray array, jboolean* elems, jint mode) {
(*env)->ReleaseBooleanArrayElements (env, array, elems, mode);
}
void ReleaseByteArrayElements(JNIEnv* env, jbyteArray array, jbyte* elems, jint mode) {
(*env)->ReleaseByteArrayElements (env, array, elems, mode);
}
void ReleaseCharArrayElements(JNIEnv* env, jcharArray array, jchar* elems, jint mode) {
(*env)->ReleaseCharArrayElements (env, array, elems, mode);
}
void ReleaseShortArrayElements(JNIEnv* env, jshortArray array, jshort* elems, jint mode) {
(*env)->ReleaseShortArrayElements (env, array, elems, mode);
}
void ReleaseIntArrayElements(JNIEnv* env, jintArray array, jint* elems, jint mode) {
(*env)->ReleaseIntArrayElements (env, array, elems, mode);
}
void ReleaseLongArrayElements(JNIEnv* env, jlongArray array, jlong* elems, jint mode) {
(*env)->ReleaseLongArrayElements (env, array, elems, mode);
}
void ReleaseFloatArrayElements(JNIEnv* env, jfloatArray array, jfloat* elems, jint mode) {
(*env)->ReleaseFloatArrayElements (env, array, elems, mode);
}
void ReleaseDoubleArrayElements(JNIEnv* env, jdoubleArray array, jdouble* elems, jint mode) {
(*env)->ReleaseDoubleArrayElements (env, array, elems, mode);
}
void GetBooleanArrayRegion(JNIEnv* env, jbooleanArray array, jsize start, jsize l, jboolean* buf) {
(*env)->GetBooleanArrayRegion (env, array, start, l, buf);
}
void GetByteArrayRegion(JNIEnv* env, jbyteArray array, jsize start, jsize len, jbyte* buf) {
(*env)->GetByteArrayRegion (env, array, start, len, buf);
}
void GetCharArrayRegion(JNIEnv* env, jcharArray array, jsize start, jsize len, jchar* buf) {
(*env)->GetCharArrayRegion (env, array, start, len, buf);
}
void GetShortArrayRegion(JNIEnv* env, jshortArray array, jsize start, jsize len, jshort* buf) {
(*env)->GetShortArrayRegion (env, array, start, len, buf);
}
void GetIntArrayRegion(JNIEnv* env, jintArray array, jsize start, jsize len, jint* buf) {
(*env)->GetIntArrayRegion (env, array, start, len, buf);
}
void GetLongArrayRegion(JNIEnv* env, jlongArray array, jsize start, jsize len, jlong* buf) {
(*env)->GetLongArrayRegion (env, array, start, len, buf);
}
void GetFloatArrayRegion(JNIEnv* env, jfloatArray array, jsize start, jsize len, jfloat* buf) {
(*env)->GetFloatArrayRegion (env, array, start, len, buf);
}
void GetDoubleArrayRegion(JNIEnv* env, jdoubleArray array, jsize start, jsize len, jdouble* buf) {
(*env)->GetDoubleArrayRegion (env, array, start, len, buf);
}
void SetBooleanArrayRegion(JNIEnv* env, jbooleanArray array, jsize start, jsize l, jboolean* buf) {
(*env)->SetBooleanArrayRegion (env, array, start, l, buf);
}
void SetByteArrayRegion(JNIEnv* env, jbyteArray array, jsize start, jsize len, jbyte* buf) {
(*env)->SetByteArrayRegion (env, array, start, len, buf);
}
void SetCharArrayRegion(JNIEnv* env, jcharArray array, jsize start, jsize len, jchar* buf) {
(*env)->SetCharArrayRegion (env, array, start, len, buf);
}
void SetShortArrayRegion(JNIEnv* env, jshortArray array, jsize start, jsize len, jshort* buf) {
(*env)->SetShortArrayRegion (env, array, start, len, buf);
}
void SetIntArrayRegion(JNIEnv* env, jintArray array, jsize start, jsize len, jint* buf) {
(*env)->SetIntArrayRegion (env, array, start, len, buf);
}
void SetLongArrayRegion(JNIEnv* env, jlongArray array, jsize start, jsize len, jlong* buf) {
(*env)->SetLongArrayRegion (env, array, start, len, buf);
}
void SetFloatArrayRegion(JNIEnv* env, jfloatArray array, jsize start, jsize len, jfloat* buf) {
(*env)->SetFloatArrayRegion (env, array, start, len, buf);
}
void SetDoubleArrayRegion(JNIEnv* env, jdoubleArray array, jsize start, jsize len, jdouble* buf) {
(*env)->SetDoubleArrayRegion (env, array, start, len, buf);
}
jint RegisterNatives(JNIEnv* env, jclass clazz, JNINativeMethod* methods, jint nMethods) {
return (*env)->RegisterNatives (env, clazz, methods, nMethods);
}
void GetStringRegion(JNIEnv* env, jstring str, jsize start, jsize len, jchar* buf) {
(*env)->GetStringRegion (env, str, start, len, buf);
}
void GetStringUTFRegion(JNIEnv* env, jstring str, jsize start, jsize len, char* buf) {
(*env)->GetStringUTFRegion (env, str, start, len, buf);
}
void* GetPrimitiveArrayCritical(JNIEnv* env, jarray array, jboolean* isCopy) {
return (*env)->GetPrimitiveArrayCritical (env, array, isCopy);
}
void ReleasePrimitiveArrayCritical(JNIEnv* env, jarray array, void* carray, jint mode) {
(*env)->ReleasePrimitiveArrayCritical (env, array, carray, mode);
}
const jchar* GetStringCritical(JNIEnv* env, jstring string, jboolean* isCopy) {
return (*env)->GetStringCritical (env, string, isCopy);
}
void ReleaseStringCritical(JNIEnv* env, jstring string, jchar* cstring) {
(*env)->ReleaseStringCritical (env, string, cstring);
}
jint AttachCurrentThread(JavaVM* vm, void** penv, void* args) {
#ifdef ANDROID_JNI
return (*vm)->AttachCurrentThread (vm, (JNIEnv**)penv, args);
#else
return (*vm)->AttachCurrentThread (vm, penv, args);
#endif
}
jint DetachCurrentThread(JavaVM* vm) {
return (*vm)->DetachCurrentThread (vm);
}
jint DestroyJavaVM(JavaVM* vm) {
return (*vm)->DestroyJavaVM (vm);
}
jint GetJavaVM(JNIEnv* env, JavaVM** vm) {
return (*env)->GetJavaVM (env, vm);
}
jobject CallNonvirtualObjectMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualObjectMethodA (env, obj, clazz, methodID, args);
}
jboolean CallNonvirtualBooleanMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualBooleanMethodA (env, obj, clazz, methodID, args);
}
jbyte CallNonvirtualByteMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualByteMethodA (env, obj, clazz, methodID, args);
}
jchar CallNonvirtualCharMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualCharMethodA (env, obj, clazz, methodID, args);
}
jshort CallNonvirtualShortMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualShortMethodA (env, obj, clazz, methodID, args);
}
jint CallNonvirtualIntMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualIntMethodA (env, obj, clazz, methodID, args);
}
jlong CallNonvirtualLongMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualLongMethodA (env, obj, clazz, methodID, args);
}
jfloat CallNonvirtualFloatMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualFloatMethodA (env, obj, clazz, methodID, args);
}
jdouble CallNonvirtualDoubleMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
return (*env)->CallNonvirtualDoubleMethodA (env, obj, clazz, methodID, args);
}
void CallNonvirtualVoidMethodA(JNIEnv* env, jobject obj, jclass clazz, jmethodID methodID, jvalue* args) {
(*env)->CallNonvirtualVoidMethodA (env, obj, clazz, methodID, args);
}
*/
import "C"
import "unsafe"
const (
JNI_VERSION_1_2 = C.JNI_VERSION_1_2
JNI_VERSION_1_4 = C.JNI_VERSION_1_4
JNI_VERSION_1_6 = C.JNI_VERSION_1_6
JNI_VERSION_1_8 = C.JNI_VERSION_1_8
JNI_VERSION_9 = C.JNI_VERSION_9
JNI_VERSION_10 = C.JNI_VERSION_10
DEFAULT_VERSION = JNI_VERSION_1_6
)
type (
jfieldID uintptr
jbooleanArray uintptr
jshortArray uintptr
jmethodID uintptr
jboolean C.jboolean
jdouble C.jdouble
jarray uintptr
jbyteArray uintptr
jclass uintptr
jthrowable uintptr
jobjectArray uintptr
jcharArray uintptr
jlongArray uintptr
jvalue C.jvalue
jshort C.jshort
jintArray uintptr
jlong C.jlong
jfloat C.jfloat
jstring uintptr
jchar C.jchar
jobject uintptr
jbyte C.jbyte
jsize C.jsize
jfloatArray uintptr
jdoubleArray uintptr
jint C.jint
)
func throw(env unsafe.Pointer, obj jthrowable) jint {
return jint(C.Throw((*C.JNIEnv)(env), C.jthrowable(unsafe.Pointer(obj))))
}
func throwNew(env unsafe.Pointer, clazz jclass, msg unsafe.Pointer) jint {
return jint(C.ThrowNew((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), (*C.char)(msg)))
}
func exceptionOccurred(env unsafe.Pointer) jthrowable {
return jthrowable(unsafe.Pointer(C.ExceptionOccurred((*C.JNIEnv)(env))))
}
func exceptionDescribe(env unsafe.Pointer) {
C.ExceptionDescribe((*C.JNIEnv)(env))
}
func exceptionClear(env unsafe.Pointer) {
C.ExceptionClear((*C.JNIEnv)(env))
}
func fatalError(env unsafe.Pointer, msg unsafe.Pointer) {
C.FatalError((*C.JNIEnv)(env), (*C.char)(msg))
}
func exceptionCheck(env unsafe.Pointer) jboolean {
return jboolean(C.ExceptionCheck((*C.JNIEnv)(env)))
}
func pushLocalFrame(env unsafe.Pointer, capacity jint) jint {
return jint(C.PushLocalFrame((*C.JNIEnv)(env), C.jint(capacity)))
}
func popLocalFrame(env unsafe.Pointer, result jobject) jobject {
return jobject(unsafe.Pointer(C.PopLocalFrame((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(result)))))
}
func newGlobalRef(env unsafe.Pointer, lobj jobject) jobject {
return jobject(unsafe.Pointer(C.NewGlobalRef((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(lobj)))))
}
func deleteGlobalRef(env unsafe.Pointer, gref jobject) {
C.DeleteGlobalRef((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(gref)))
}
func deleteLocalRef(env unsafe.Pointer, obj jobject) {
C.DeleteLocalRef((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)))
}
func isSameObject(env unsafe.Pointer, obj1 jobject, obj2 jobject) jboolean {
return jboolean(C.IsSameObject((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj1)), C.jobject(unsafe.Pointer(obj2))))
}
func newLocalRef(env unsafe.Pointer, ref jobject) jobject {
return jobject(unsafe.Pointer(C.NewLocalRef((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(ref)))))
}
func ensureLocalCapacity(env unsafe.Pointer, capacity jint) jint {
return jint(C.EnsureLocalCapacity((*C.JNIEnv)(env), C.jint(capacity)))
}
func allocObject(env unsafe.Pointer, clazz jclass) jobject {
return jobject(unsafe.Pointer(C.AllocObject((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)))))
}
func newObjectA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jobject {
return jobject(unsafe.Pointer(C.NewObjectA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args))))
}
func getObjectClass(env unsafe.Pointer, obj jobject) jclass {
return jclass(unsafe.Pointer(C.GetObjectClass((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)))))
}
func isInstanceOf(env unsafe.Pointer, obj jobject, clazz jclass) jboolean {
return jboolean(C.IsInstanceOf((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jclass(unsafe.Pointer(clazz))))
}
func getMethodID(env unsafe.Pointer, clazz jclass, name unsafe.Pointer, sig unsafe.Pointer) jmethodID {
return jmethodID(unsafe.Pointer(C.GetMethodID((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), (*C.char)(name), (*C.char)(sig))))
}
func callObjectMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jobject {
return jobject(unsafe.Pointer(C.CallObjectMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args))))
}
func callBooleanMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jboolean {
return jboolean(C.CallBooleanMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callByteMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jbyte {
return jbyte(C.CallByteMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callCharMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jchar {
return jchar(C.CallCharMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callShortMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jshort {
return jshort(C.CallShortMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callIntMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jint {
return jint(C.CallIntMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callLongMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jlong {
return jlong(C.CallLongMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callFloatMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jfloat {
return jfloat(C.CallFloatMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callDoubleMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) jdouble {
return jdouble(C.CallDoubleMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callVoidMethodA(env unsafe.Pointer, obj jobject, methodID jmethodID, args unsafe.Pointer) {
C.CallVoidMethodA((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args))
}
func getFieldID(env unsafe.Pointer, clazz jclass, name unsafe.Pointer, sig unsafe.Pointer) jfieldID {
return jfieldID(unsafe.Pointer(C.GetFieldID((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), (*C.char)(name), (*C.char)(sig))))
}
func getObjectField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jobject {
return jobject(unsafe.Pointer(C.GetObjectField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)))))
}
func getBooleanField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jboolean {
return jboolean(C.GetBooleanField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getByteField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jbyte {
return jbyte(C.GetByteField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getCharField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jchar {
return jchar(C.GetCharField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getShortField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jshort {
return jshort(C.GetShortField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getIntField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jint {
return jint(C.GetIntField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getLongField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jlong {
return jlong(C.GetLongField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getFloatField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jfloat {
return jfloat(C.GetFloatField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getDoubleField(env unsafe.Pointer, obj jobject, fieldID jfieldID) jdouble {
return jdouble(C.GetDoubleField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func setObjectField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jobject) {
C.SetObjectField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jobject(unsafe.Pointer(val)))
}
func setBooleanField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jboolean) {
C.SetBooleanField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jboolean(val))
}
func setByteField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jbyte) {
C.SetByteField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jbyte(val))
}
func setCharField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jchar) {
C.SetCharField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jchar(val))
}
func setShortField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jshort) {
C.SetShortField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jshort(val))
}
func setIntField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jint) {
C.SetIntField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jint(val))
}
func setLongField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jlong) {
C.SetLongField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jlong(val))
}
func setFloatField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jfloat) {
C.SetFloatField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jfloat(val))
}
func setDoubleField(env unsafe.Pointer, obj jobject, fieldID jfieldID, val jdouble) {
C.SetDoubleField((*C.JNIEnv)(env), C.jobject(unsafe.Pointer(obj)), C.jfieldID(unsafe.Pointer(fieldID)), C.jdouble(val))
}
func getStaticMethodID(env unsafe.Pointer, clazz jclass, name unsafe.Pointer, sig unsafe.Pointer) jmethodID {
return jmethodID(unsafe.Pointer(C.GetStaticMethodID((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), (*C.char)(name), (*C.char)(sig))))
}
func callStaticObjectMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jobject {
return jobject(unsafe.Pointer(C.CallStaticObjectMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args))))
}
func callStaticBooleanMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jboolean {
return jboolean(C.CallStaticBooleanMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticByteMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jbyte {
return jbyte(C.CallStaticByteMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticCharMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jchar {
return jchar(C.CallStaticCharMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticShortMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jshort {
return jshort(C.CallStaticShortMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticIntMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jint {
return jint(C.CallStaticIntMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticLongMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jlong {
return jlong(C.CallStaticLongMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticFloatMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jfloat {
return jfloat(C.CallStaticFloatMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticDoubleMethodA(env unsafe.Pointer, clazz jclass, methodID jmethodID, args unsafe.Pointer) jdouble {
return jdouble(C.CallStaticDoubleMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args)))
}
func callStaticVoidMethodA(env unsafe.Pointer, cls jclass, methodID jmethodID, args unsafe.Pointer) {
C.CallStaticVoidMethodA((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(cls)), C.jmethodID(unsafe.Pointer(methodID)), (*C.jvalue)(args))
}
func getStaticFieldID(env unsafe.Pointer, clazz jclass, name unsafe.Pointer, sig unsafe.Pointer) jfieldID {
return jfieldID(unsafe.Pointer(C.GetStaticFieldID((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), (*C.char)(name), (*C.char)(sig))))
}
func getStaticObjectField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jobject {
return jobject(unsafe.Pointer(C.GetStaticObjectField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)))))
}
func getStaticBooleanField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jboolean {
return jboolean(C.GetStaticBooleanField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getStaticByteField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jbyte {
return jbyte(C.GetStaticByteField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getStaticCharField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jchar {
return jchar(C.GetStaticCharField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getStaticShortField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jshort {
return jshort(C.GetStaticShortField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getStaticIntField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jint {
return jint(C.GetStaticIntField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getStaticLongField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jlong {
return jlong(C.GetStaticLongField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getStaticFloatField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jfloat {
return jfloat(C.GetStaticFloatField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func getStaticDoubleField(env unsafe.Pointer, clazz jclass, fieldID jfieldID) jdouble {
return jdouble(C.GetStaticDoubleField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID))))
}
func setStaticObjectField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jobject) {
C.SetStaticObjectField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jobject(unsafe.Pointer(value)))
}
func setStaticBooleanField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jboolean) {
C.SetStaticBooleanField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jboolean(value))
}
func setStaticByteField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jbyte) {
C.SetStaticByteField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jbyte(value))
}
func setStaticCharField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jchar) {
C.SetStaticCharField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jchar(value))
}
func setStaticShortField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jshort) {
C.SetStaticShortField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jshort(value))
}
func setStaticIntField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jint) {
C.SetStaticIntField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jint(value))
}
func setStaticLongField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jlong) {
C.SetStaticLongField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jlong(value))
}
func setStaticFloatField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jfloat) {
C.SetStaticFloatField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jfloat(value))
}
func setStaticDoubleField(env unsafe.Pointer, clazz jclass, fieldID jfieldID, value jdouble) {
C.SetStaticDoubleField((*C.JNIEnv)(env), C.jclass(unsafe.Pointer(clazz)), C.jfieldID(unsafe.Pointer(fieldID)), C.jdouble(value))
}
func newString(env unsafe.Pointer, unicode unsafe.Pointer, len jsize) jstring {