github.com/F4RD1N/gomobile@v1.0.1/bind/testdata/basictypes.java.c.golden (about) 1 // Code generated by gobind. DO NOT EDIT. 2 3 // JNI functions for the Go <=> Java bridge. 4 // 5 // autogenerated by gobind -lang=java basictypes 6 7 #include <android/log.h> 8 #include <stdint.h> 9 #include "seq.h" 10 #include "_cgo_export.h" 11 #include "basictypes.h" 12 13 14 JNIEXPORT void JNICALL 15 Java_basictypes_Basictypes__1init(JNIEnv *env, jclass _unused) { 16 jclass clazz; 17 } 18 19 JNIEXPORT jboolean JNICALL 20 Java_basictypes_Basictypes_bool(JNIEnv* env, jclass _clazz, jboolean p0) { 21 char _p0 = (char)p0; 22 char r0 = proxybasictypes__Bool(_p0); 23 jboolean _r0 = r0 ? JNI_TRUE : JNI_FALSE; 24 return _r0; 25 } 26 27 JNIEXPORT jbyteArray JNICALL 28 Java_basictypes_Basictypes_byteArrays(JNIEnv* env, jclass _clazz, jbyteArray x) { 29 nbyteslice _x = go_seq_from_java_bytearray(env, x, 0); 30 nbyteslice r0 = proxybasictypes__ByteArrays(_x); 31 go_seq_release_byte_array(env, x, _x.ptr); 32 jbyteArray _r0 = go_seq_to_java_bytearray(env, r0, 1); 33 return _r0; 34 } 35 36 JNIEXPORT void JNICALL 37 Java_basictypes_Basictypes_error(JNIEnv* env, jclass _clazz) { 38 int32_t r0 = proxybasictypes__Error(); 39 jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons); 40 go_seq_maybe_throw_exception(env, _r0); 41 } 42 43 JNIEXPORT jlong JNICALL 44 Java_basictypes_Basictypes_errorPair(JNIEnv* env, jclass _clazz) { 45 struct proxybasictypes__ErrorPair_return res = proxybasictypes__ErrorPair(); 46 jlong _r0 = (jlong)res.r0; 47 jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons); 48 go_seq_maybe_throw_exception(env, _r1); 49 return _r0; 50 } 51 52 JNIEXPORT void JNICALL 53 Java_basictypes_Basictypes_ints(JNIEnv* env, jclass _clazz, jbyte x, jshort y, jint z, jlong t, jlong u) { 54 int8_t _x = (int8_t)x; 55 int16_t _y = (int16_t)y; 56 int32_t _z = (int32_t)z; 57 int64_t _t = (int64_t)t; 58 nint _u = (nint)u; 59 proxybasictypes__Ints(_x, _y, _z, _t, _u); 60 } 61