// JNI functions for the Go <=> Java bridge.
//   gobind -lang=java issue12328
//
// File is generated by gobind. Do not edit.

#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "issue12328.h"

jclass proxy_class_issue12328_T;
jmethodID proxy_class_issue12328_T_cons;

JNIEXPORT void JNICALL
Java_go_issue12328_Issue12328_init(JNIEnv *env, jclass _unused) {
    jclass clazz;
    clazz = (*env)->FindClass(env, "go/issue12328/Issue12328$T");
    proxy_class_issue12328_T = (*env)->NewGlobalRef(env, clazz);
    proxy_class_issue12328_T_cons = (*env)->GetMethodID(env, clazz, "<init>", "(Lgo/Seq$Ref;)V");
}

JNIEXPORT void JNICALL
Java_go_issue12328_Issue12328_00024T_setErr(JNIEnv *env, jobject this, jobject v) {
    int32_t o = go_seq_to_refnum(env, this);
    int32_t _v = go_seq_to_refnum(env, v);
    proxyissue12328_T_Err_Set(o, _v);
}

JNIEXPORT jobject JNICALL
Java_go_issue12328_Issue12328_00024T_getErr(JNIEnv *env, jobject this) {
    int32_t o = go_seq_to_refnum(env, this);
    int32_t r0 = proxyissue12328_T_Err_Get(o);
    jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons);
    return _r0;
}

