github.com/adwpc/xmobile@v0.0.0-20231212131043-3f9720cf0e99/bind/testdata/structs.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 structs
     6  
     7  #include <android/log.h>
     8  #include <stdint.h>
     9  #include "seq.h"
    10  #include "_cgo_export.h"
    11  #include "structs.h"
    12  
    13  jclass proxy_class_structs_I;
    14  jmethodID proxy_class_structs_I_cons;
    15  static jmethodID mid_I_M;
    16  jclass proxy_class_structs_S;
    17  jmethodID proxy_class_structs_S_cons;
    18  jclass proxy_class_structs_S2;
    19  jmethodID proxy_class_structs_S2_cons;
    20  jclass proxy_class_structs_Structs;
    21  jmethodID proxy_class_structs_Structs_cons;
    22  
    23  JNIEXPORT void JNICALL
    24  Java_structs_Structs__1init(JNIEnv *env, jclass _unused) {
    25      jclass clazz;
    26      clazz = (*env)->FindClass(env, "structs/S");
    27      proxy_class_structs_S = (*env)->NewGlobalRef(env, clazz);
    28      proxy_class_structs_S_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
    29      clazz = (*env)->FindClass(env, "structs/S2");
    30      proxy_class_structs_S2 = (*env)->NewGlobalRef(env, clazz);
    31      proxy_class_structs_S2_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
    32      clazz = (*env)->FindClass(env, "structs/Structs_");
    33      proxy_class_structs_Structs = (*env)->NewGlobalRef(env, clazz);
    34      proxy_class_structs_Structs_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
    35      clazz = (*env)->FindClass(env, "structs/Structs$proxyI");
    36      proxy_class_structs_I = (*env)->NewGlobalRef(env, clazz);
    37      proxy_class_structs_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
    38      clazz = (*env)->FindClass(env, "structs/I");
    39      mid_I_M = (*env)->GetMethodID(env, clazz, "m", "()V");
    40      
    41  }
    42  
    43  JNIEXPORT jobject JNICALL
    44  Java_structs_Structs_identity(JNIEnv* env, jclass _clazz, jobject s) {
    45      int32_t _s = go_seq_to_refnum(env, s);
    46      int32_t r0 = proxystructs__Identity(_s);
    47      jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_structs_S, proxy_class_structs_S_cons);
    48      return _r0;
    49  }
    50  
    51  JNIEXPORT jobject JNICALL
    52  Java_structs_Structs_identityWithError(JNIEnv* env, jclass _clazz, jobject s) {
    53      int32_t _s = go_seq_to_refnum(env, s);
    54      struct proxystructs__IdentityWithError_return res = proxystructs__IdentityWithError(_s);
    55      jobject _r0 = go_seq_from_refnum(env, res.r0, proxy_class_structs_S, proxy_class_structs_S_cons);
    56      jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons);
    57      go_seq_maybe_throw_exception(env, _r1);
    58      return _r0;
    59  }
    60  
    61  JNIEXPORT jint JNICALL
    62  Java_structs_S__1_1New(JNIEnv *env, jclass clazz) {
    63      return new_structs_S();
    64  }
    65  
    66  JNIEXPORT jobject JNICALL
    67  Java_structs_S_identity(JNIEnv* env, jobject __this__) {
    68      int32_t o = go_seq_to_refnum_go(env, __this__);
    69      struct proxystructs_S_Identity_return res = proxystructs_S_Identity(o);
    70      jobject _r0 = go_seq_from_refnum(env, res.r0, proxy_class_structs_S, proxy_class_structs_S_cons);
    71      jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons);
    72      go_seq_maybe_throw_exception(env, _r1);
    73      return _r0;
    74  }
    75  
    76  JNIEXPORT jdouble JNICALL
    77  Java_structs_S_sum(JNIEnv* env, jobject __this__) {
    78      int32_t o = go_seq_to_refnum_go(env, __this__);
    79      double r0 = proxystructs_S_Sum(o);
    80      jdouble _r0 = (jdouble)r0;
    81      return _r0;
    82  }
    83  
    84  JNIEXPORT void JNICALL
    85  Java_structs_S_setX(JNIEnv *env, jobject this, jdouble v) {
    86      int32_t o = go_seq_to_refnum_go(env, this);
    87      double _v = (double)v;
    88      proxystructs_S_X_Set(o, _v);
    89  }
    90  
    91  JNIEXPORT jdouble JNICALL
    92  Java_structs_S_getX(JNIEnv *env, jobject this) {
    93      int32_t o = go_seq_to_refnum_go(env, this);
    94      double r0 = proxystructs_S_X_Get(o);
    95      jdouble _r0 = (jdouble)r0;
    96      return _r0;
    97  }
    98  
    99  JNIEXPORT void JNICALL
   100  Java_structs_S_setY(JNIEnv *env, jobject this, jdouble v) {
   101      int32_t o = go_seq_to_refnum_go(env, this);
   102      double _v = (double)v;
   103      proxystructs_S_Y_Set(o, _v);
   104  }
   105  
   106  JNIEXPORT jdouble JNICALL
   107  Java_structs_S_getY(JNIEnv *env, jobject this) {
   108      int32_t o = go_seq_to_refnum_go(env, this);
   109      double r0 = proxystructs_S_Y_Get(o);
   110      jdouble _r0 = (jdouble)r0;
   111      return _r0;
   112  }
   113  
   114  JNIEXPORT jint JNICALL
   115  Java_structs_S2__1_1New(JNIEnv *env, jclass clazz) {
   116      return new_structs_S2();
   117  }
   118  
   119  JNIEXPORT void JNICALL
   120  Java_structs_S2_m(JNIEnv* env, jobject __this__) {
   121      int32_t o = go_seq_to_refnum_go(env, __this__);
   122      proxystructs_S2_M(o);
   123  }
   124  
   125  JNIEXPORT jstring JNICALL
   126  Java_structs_S2_string(JNIEnv* env, jobject __this__) {
   127      int32_t o = go_seq_to_refnum_go(env, __this__);
   128      nstring r0 = proxystructs_S2_String(o);
   129      jstring _r0 = go_seq_to_java_string(env, r0);
   130      return _r0;
   131  }
   132  
   133  JNIEXPORT jint JNICALL
   134  Java_structs_Structs_1__1_1New(JNIEnv *env, jclass clazz) {
   135      return new_structs_Structs();
   136  }
   137  
   138  JNIEXPORT void JNICALL
   139  Java_structs_Structs_1_m(JNIEnv* env, jobject __this__) {
   140      int32_t o = go_seq_to_refnum_go(env, __this__);
   141      proxystructs_Structs_M(o);
   142  }
   143  
   144  JNIEXPORT void JNICALL
   145  Java_structs_Structs_00024proxyI_m(JNIEnv* env, jobject __this__) {
   146      int32_t o = go_seq_to_refnum_go(env, __this__);
   147      proxystructs_I_M(o);
   148  }
   149  
   150  void cproxystructs_I_M(int32_t refnum) {
   151      JNIEnv *env = go_seq_push_local_frame(0);
   152      jobject o = go_seq_from_refnum(env, refnum, proxy_class_structs_I, proxy_class_structs_I_cons);
   153      (*env)->CallVoidMethod(env, o, mid_I_M);
   154      go_seq_pop_local_frame(env);
   155  }
   156