1
0
Fork 0

Adding upstream version 0.0~git20250520.a1d9079+dfsg.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-24 19:46:29 +02:00
parent 590ac7ff5f
commit 20149b7f3a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
456 changed files with 70406 additions and 0 deletions

25
bind/testdata/basictypes.go vendored Normal file
View file

@ -0,0 +1,25 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package basictypes
const (
AString = "a string"
AnInt = 7
AnInt2 = 1<<63 - 1
AFloat = 0.2015
ARune = rune(32)
ABool = true
ALongString = "LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString"
)
func Ints(x int8, y int16, z int32, t int64, u int) {}
func Error() error { return nil }
func ErrorPair() (int, error) { return 0, nil }
func ByteArrays(x []byte) []byte { return nil }
func Bool(bool) bool { return true }

73
bind/testdata/basictypes.go.golden vendored Normal file
View file

@ -0,0 +1,73 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package basictypes.
//
// autogenerated by gobind -lang=go basictypes
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "basictypes.h"
*/
import "C"
import (
"basictypes"
_seq "golang.org/x/mobile/bind/seq"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxybasictypes__Bool
func proxybasictypes__Bool(param_p0 C.char) C.char {
_param_p0 := param_p0 != 0
res_0 := basictypes.Bool(_param_p0)
var _res_0 C.char = 0
if res_0 {
_res_0 = 1
}
return _res_0
}
//export proxybasictypes__ByteArrays
func proxybasictypes__ByteArrays(param_x C.nbyteslice) C.nbyteslice {
_param_x := toSlice(param_x, false)
res_0 := basictypes.ByteArrays(_param_x)
_res_0 := fromSlice(res_0, true)
return _res_0
}
//export proxybasictypes__Error
func proxybasictypes__Error() C.int32_t {
res_0 := basictypes.Error()
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}
//export proxybasictypes__ErrorPair
func proxybasictypes__ErrorPair() (C.nint, C.int32_t) {
res_0, res_1 := basictypes.ErrorPair()
_res_0 := C.nint(res_0)
var _res_1 C.int32_t = _seq.NullRefNum
if res_1 != nil {
_res_1 = C.int32_t(_seq.ToRefNum(res_1))
}
return _res_0, _res_1
}
//export proxybasictypes__Ints
func proxybasictypes__Ints(param_x C.int8_t, param_y C.int16_t, param_z C.int32_t, param_t C.int64_t, param_u C.nint) {
_param_x := int8(param_x)
_param_y := int16(param_y)
_param_z := int32(param_z)
_param_t := int64(param_t)
_param_u := int(param_u)
basictypes.Ints(_param_x, _param_y, _param_z, _param_t, _param_u)
}

61
bind/testdata/basictypes.java.c.golden vendored Normal file
View file

@ -0,0 +1,61 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java basictypes
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "basictypes.h"
JNIEXPORT void JNICALL
Java_basictypes_Basictypes__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
}
JNIEXPORT jboolean JNICALL
Java_basictypes_Basictypes_bool(JNIEnv* env, jclass _clazz, jboolean p0) {
char _p0 = (char)p0;
char r0 = proxybasictypes__Bool(_p0);
jboolean _r0 = r0 ? JNI_TRUE : JNI_FALSE;
return _r0;
}
JNIEXPORT jbyteArray JNICALL
Java_basictypes_Basictypes_byteArrays(JNIEnv* env, jclass _clazz, jbyteArray x) {
nbyteslice _x = go_seq_from_java_bytearray(env, x, 0);
nbyteslice r0 = proxybasictypes__ByteArrays(_x);
go_seq_release_byte_array(env, x, _x.ptr);
jbyteArray _r0 = go_seq_to_java_bytearray(env, r0, 1);
return _r0;
}
JNIEXPORT void JNICALL
Java_basictypes_Basictypes_error(JNIEnv* env, jclass _clazz) {
int32_t r0 = proxybasictypes__Error();
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r0);
}
JNIEXPORT jlong JNICALL
Java_basictypes_Basictypes_errorPair(JNIEnv* env, jclass _clazz) {
struct proxybasictypes__ErrorPair_return res = proxybasictypes__ErrorPair();
jlong _r0 = (jlong)res.r0;
jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r1);
return _r0;
}
JNIEXPORT void JNICALL
Java_basictypes_Basictypes_ints(JNIEnv* env, jclass _clazz, jbyte x, jshort y, jint z, jlong t, jlong u) {
int8_t _x = (int8_t)x;
int16_t _y = (int16_t)y;
int32_t _z = (int32_t)z;
int64_t _t = (int64_t)t;
nint _u = (nint)u;
proxybasictypes__Ints(_x, _y, _z, _t, _u);
}

37
bind/testdata/basictypes.java.golden vendored Normal file
View file

@ -0,0 +1,37 @@
// Code generated by gobind. DO NOT EDIT.
// Java class basictypes.Basictypes is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java basictypes
package basictypes;
import go.Seq;
public abstract class Basictypes {
static {
Seq.touch(); // for loading the native library
_init();
}
private Basictypes() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
public static final boolean ABool = true;
public static final double AFloat = 0.2015;
public static final String ALongString = "LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString";
public static final int ARune = 32;
public static final String AString = "a string";
public static final long AnInt = 7L;
public static final long AnInt2 = 9223372036854775807L;
public static native boolean bool(boolean p0);
public static native byte[] byteArrays(byte[] x);
public static native void error() throws Exception;
public static native long errorPair() throws Exception;
public static native void ints(byte x, short y, int z, long t, long u);
}

12
bind/testdata/basictypes.java.h.golden vendored Normal file
View file

@ -0,0 +1,12 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java basictypes
#ifndef __Basictypes_H__
#define __Basictypes_H__
#include <jni.h>
#endif

View file

@ -0,0 +1,11 @@
// Objective-C API for talking to basictypes Go package.
// gobind -lang=objc basictypes
//
// File is generated by gobind. Do not edit.
#ifndef __GO_basictypes_H__
#define __GO_basictypes_H__
#include <stdint.h>
#include <objc/objc.h>
#endif

32
bind/testdata/basictypes.objc.h.golden vendored Normal file
View file

@ -0,0 +1,32 @@
// Objective-C API for talking to basictypes Go package.
// gobind -lang=objc basictypes
//
// File is generated by gobind. Do not edit.
#ifndef __Basictypes_H__
#define __Basictypes_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
FOUNDATION_EXPORT const BOOL BasictypesABool;
FOUNDATION_EXPORT const double BasictypesAFloat;
FOUNDATION_EXPORT NSString* _Nonnull const BasictypesALongString;
FOUNDATION_EXPORT const int32_t BasictypesARune;
FOUNDATION_EXPORT NSString* _Nonnull const BasictypesAString;
FOUNDATION_EXPORT const int64_t BasictypesAnInt;
FOUNDATION_EXPORT const int64_t BasictypesAnInt2;
FOUNDATION_EXPORT BOOL BasictypesBool(BOOL p0);
FOUNDATION_EXPORT NSData* _Nullable BasictypesByteArrays(NSData* _Nullable x);
FOUNDATION_EXPORT BOOL BasictypesError(NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT BOOL BasictypesErrorPair(long* _Nullable ret0_, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT void BasictypesInts(int8_t x, int16_t y, int32_t z, int64_t t, long u);
#endif

82
bind/testdata/basictypes.objc.m.golden vendored Normal file
View file

@ -0,0 +1,82 @@
// Objective-C API for talking to basictypes Go package.
// gobind -lang=objc basictypes
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Basictypes.objc.h"
const BOOL BasictypesABool = YES;
const double BasictypesAFloat = 0.2015;
NSString* const BasictypesALongString = @"LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString";
const int32_t BasictypesARune = 32;
NSString* const BasictypesAString = @"a string";
const int64_t BasictypesAnInt = 7LL;
const int64_t BasictypesAnInt2 = 9223372036854775807LL;
BOOL BasictypesBool(BOOL p0) {
char _p0 = (char)p0;
char r0 = proxybasictypes__Bool(_p0);
BOOL _ret0_ = r0 ? YES : NO;
return _ret0_;
}
NSData* _Nullable BasictypesByteArrays(NSData* _Nullable x) {
nbyteslice _x = go_seq_from_objc_bytearray(x, 0);
nbyteslice r0 = proxybasictypes__ByteArrays(_x);
if (![x isKindOfClass:[NSMutableData class]]) {
free(_x.ptr);
}
NSData *_ret0_ = go_seq_to_objc_bytearray(r0, 1);
return _ret0_;
}
BOOL BasictypesError(NSError* _Nullable* _Nullable error) {
int32_t r0 = proxybasictypes__Error();
Universeerror* _error = nil;
GoSeqRef* _error_ref = go_seq_from_refnum(r0);
if (_error_ref != NULL) {
_error = _error_ref.obj;
if (_error == nil) {
_error = [[Universeerror alloc] initWithRef:_error_ref];
}
}
if (_error != nil && error != nil) {
*error = _error;
}
return (_error == nil);
}
BOOL BasictypesErrorPair(long* _Nullable ret0_, NSError* _Nullable* _Nullable error) {
struct proxybasictypes__ErrorPair_return res = proxybasictypes__ErrorPair();
long _ret0_ = (long)res.r0;
Universeerror* _error = nil;
GoSeqRef* _error_ref = go_seq_from_refnum(res.r1);
if (_error_ref != NULL) {
_error = _error_ref.obj;
if (_error == nil) {
_error = [[Universeerror alloc] initWithRef:_error_ref];
}
}
*ret0_ = _ret0_;
if (_error != nil && error != nil) {
*error = _error;
}
return (_error == nil);
}
void BasictypesInts(int8_t x, int16_t y, int32_t z, int64_t t, long u) {
int8_t _x = (int8_t)x;
int16_t _y = (int16_t)y;
int32_t _z = (int32_t)z;
int64_t _t = (int64_t)t;
nint _u = (nint)u;
proxybasictypes__Ints(_x, _y, _z, _t, _u);
}
__attribute__((constructor)) static void init() {
init_seq();
}

171
bind/testdata/benchmark/benchmark.go vendored Normal file
View file

@ -0,0 +1,171 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package benchmark contains benchmarking bound functions for internal use.
package benchmark
import (
"log"
"time"
)
type Benchmarks interface {
// It seems to be much faster to call a native function from Java
// when there is already a native call earlier in the stack.
// Run runs a named benchmark from a different thread, with
// no native call prior in the stack.
Run(name string, n int)
// RunDirect runs a named benchmark directly, with the native
// context from the call itself.
RunDirect(name string, n int)
// Callbacks for Go benchmarks
NewI() I
Noargs()
Onearg(_ int)
Oneret() int
Ref(_ I)
Manyargs(_, _, _, _, _, _, _, _, _, _ int)
String(_ string)
StringRetShort() string
StringRetLong() string
Slice(_ []byte)
}
type (
I interface {
F()
}
AnI struct {
}
)
func (_ *AnI) F() {
}
func NewI() I {
return new(AnI)
}
func runBenchmark(name string, f func(n int)) {
// Run once for warmup
f(1)
n := 1000
var dt time.Duration
minDuration := 1 * time.Second
for dt < minDuration {
n *= 2
t0 := time.Now()
f(n)
dt = time.Since(t0)
}
log.Printf("Benchmark%s %d %d ns/op\n", name, n, dt.Nanoseconds()/int64(n))
}
func runGoBenchmark(name string, f func()) {
runBenchmark("Go"+name, func(n int) {
for i := 0; i < n; i++ {
f()
}
})
runBenchmark("Go"+name+"Direct", func(n int) {
done := make(chan struct{})
go func() {
for i := 0; i < n; i++ {
f()
}
close(done)
}()
<-done
})
}
func RunBenchmarks(b Benchmarks) {
names := []string{
"Empty",
"Noargs",
"Onearg",
"Oneret",
"Manyargs",
"Refforeign",
"Refgo",
"StringShort",
"StringLong",
"StringShortUnicode",
"StringLongUnicode",
"StringRetShort",
"StringRetLong",
"SliceShort",
"SliceLong",
}
for _, name := range names {
runBenchmark("Foreign"+name, func(n int) {
b.Run(name, n)
})
runBenchmark("Foreign"+name+"Direct", func(n int) {
b.RunDirect(name, n)
})
}
runGoBenchmark("Empty", func() {})
runGoBenchmark("Noarg", func() { b.Noargs() })
runGoBenchmark("Onearg", func() { b.Onearg(0) })
runGoBenchmark("Oneret", func() { b.Oneret() })
foreignRef := b.NewI()
runGoBenchmark("Refforeign", func() { b.Ref(foreignRef) })
goRef := NewI()
runGoBenchmark("Refgo", func() { b.Ref(goRef) })
runGoBenchmark("Manyargs", func() { b.Manyargs(0, 0, 0, 0, 0, 0, 0, 0, 0, 0) })
runGoBenchmark("StringShort", func() { b.String(ShortString) })
runGoBenchmark("StringLong", func() { b.String(LongString) })
runGoBenchmark("StringShortUnicode", func() { b.String(ShortStringUnicode) })
runGoBenchmark("StringLongUnicode", func() { b.String(LongStringUnicode) })
runGoBenchmark("StringRetShort", func() { b.StringRetShort() })
runGoBenchmark("StringRetLong", func() { b.StringRetLong() })
runGoBenchmark("SliceShort", func() { b.Slice(ShortSlice) })
runGoBenchmark("SliceLong", func() { b.Slice(LongSlice) })
}
func Noargs() {
}
func Onearg(_ int) {
}
func Manyargs(_, _, _, _, _, _, _, _, _, _ int) {
}
func Oneret() int {
return 0
}
func String(_ string) {
}
func StringRetShort() string {
return ShortString
}
func StringRetLong() string {
return LongString
}
func Slice(_ []byte) {
}
func Ref(_ I) {
}
var (
ShortSlice = make([]byte, 10)
LongSlice = make([]byte, 100000)
)
const (
ShortString = "Hello, World!"
LongString = "Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!, World!"
ShortStringUnicode = "Hello, 世界!"
LongStringUnicode = "Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界! Hello, 世界!, 世界!"
)

9
bind/testdata/cgopkg/cgopkg.go vendored Normal file
View file

@ -0,0 +1,9 @@
package cgopkg
import "C"
import (
_ "golang.org/x/mobile/gl"
)
func Dummy() {}

62
bind/testdata/classes.go vendored Normal file
View file

@ -0,0 +1,62 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package java
import (
gopkg "Java/java"
"Java/java/io"
"Java/java/lang"
"Java/java/lang/System"
"Java/java/util/Spliterators"
"Java/java/util/concurrent"
)
type Runnable struct {
lang.Runnable
}
func (r *Runnable) Run(this gopkg.Runnable) {
}
type InputStream struct {
io.InputStream
}
func (_ *InputStream) Read() (int32, error) {
return 0, nil
}
func NewInputStream() *InputStream {
return new(InputStream)
}
type Future struct {
concurrent.Future
}
func (_ *Future) Get() (lang.Object, error) {
return nil, nil
}
// Use a trailing underscore to override multiple overloaded methods.
func (_ *Future) Get_(_ int64, _ concurrent.TimeUnit) (lang.Object, error) {
return nil, nil
}
type Object struct {
lang.Object
}
func innerClassTypes() {
// java.util.Spliterators.iterator use inner class types
// for the return value as well as parameters.
Spliterators.Iterator(nil)
}
func returnType() {
// Implicit types (java.io.Console) should be wrapped.
cons := System.Console()
cons.Flush()
}

2136
bind/testdata/classes.go.golden vendored Normal file

File diff suppressed because it is too large Load diff

892
bind/testdata/classes.java.c.golden vendored Normal file
View file

@ -0,0 +1,892 @@
// Code generated by gobind. DO NOT EDIT.
#include <jni.h>
#include "seq.h"
#include "classes.h"
static jclass class_java_lang_Runnable;
static jmethodID m_java_lang_Runnable_run;
static jclass class_java_io_InputStream;
static jmethodID m_java_io_InputStream_read__;
static jmethodID m_java_io_InputStream_read___3B;
static jmethodID m_java_io_InputStream_read___3BII;
static jmethodID m_java_io_InputStream_toString;
static jclass class_java_util_concurrent_Future;
static jmethodID m_java_util_concurrent_Future_get__;
static jmethodID m_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit_2;
static jclass class_java_lang_Object;
static jmethodID m_java_lang_Object_toString;
static jclass class_java_util_concurrent_TimeUnit;
static jmethodID m_java_util_concurrent_TimeUnit_toString;
static jclass class_java_util_Spliterators;
static jmethodID m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_2;
static jmethodID m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfInt_2;
static jmethodID m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfLong_2;
static jmethodID m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfDouble_2;
static jmethodID m_java_util_Spliterators_toString;
ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_2(jint a0) {
JNIEnv *env = go_seq_push_local_frame(1);
jobject _a0 = go_seq_from_refnum(env, a0, NULL, NULL);
jobject res = (*env)->CallStaticObjectMethod(env, class_java_util_Spliterators, m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_2, _a0);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfInt_2(jint a0) {
JNIEnv *env = go_seq_push_local_frame(1);
jobject _a0 = go_seq_from_refnum(env, a0, NULL, NULL);
jobject res = (*env)->CallStaticObjectMethod(env, class_java_util_Spliterators, m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfInt_2, _a0);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfLong_2(jint a0) {
JNIEnv *env = go_seq_push_local_frame(1);
jobject _a0 = go_seq_from_refnum(env, a0, NULL, NULL);
jobject res = (*env)->CallStaticObjectMethod(env, class_java_util_Spliterators, m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfLong_2, _a0);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfDouble_2(jint a0) {
JNIEnv *env = go_seq_push_local_frame(1);
jobject _a0 = go_seq_from_refnum(env, a0, NULL, NULL);
jobject res = (*env)->CallStaticObjectMethod(env, class_java_util_Spliterators, m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfDouble_2, _a0);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
static jclass class_java_lang_System;
static jmethodID m_s_java_lang_System_console;
static jmethodID m_java_lang_System_toString;
ret_jint cproxy_s_java_lang_System_console() {
JNIEnv *env = go_seq_push_local_frame(0);
jobject res = (*env)->CallStaticObjectMethod(env, class_java_lang_System, m_s_java_lang_System_console);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
static jclass class_java_Future;
static jclass sclass_java_Future;
static jmethodID m_java_Future_get__;
static jmethodID sm_java_Future_get__;
static jmethodID m_java_Future_get__JLjava_util_concurrent_TimeUnit_2;
static jmethodID sm_java_Future_get__JLjava_util_concurrent_TimeUnit_2;
static jclass class_java_InputStream;
static jclass sclass_java_InputStream;
static jmethodID m_java_InputStream_read__;
static jmethodID sm_java_InputStream_read__;
static jmethodID m_java_InputStream_read___3B;
static jmethodID sm_java_InputStream_read___3B;
static jmethodID m_java_InputStream_read___3BII;
static jmethodID sm_java_InputStream_read___3BII;
static jmethodID m_java_InputStream_toString;
static jmethodID sm_java_InputStream_toString;
static jclass class_java_Object;
static jclass sclass_java_Object;
static jmethodID m_java_Object_toString;
static jmethodID sm_java_Object_toString;
static jclass class_java_Runnable;
static jclass sclass_java_Runnable;
static jmethodID m_java_Runnable_run;
static jmethodID sm_java_Runnable_run;
static jclass class_java_util_Iterator;
static jclass class_java_util_Spliterator;
static jclass class_java_util_PrimitiveIterator_OfInt;
static jclass class_java_util_Spliterator_OfInt;
static jclass class_java_util_PrimitiveIterator_OfLong;
static jclass class_java_util_Spliterator_OfLong;
static jclass class_java_util_PrimitiveIterator_OfDouble;
static jclass class_java_util_Spliterator_OfDouble;
static jclass class_java_io_Console;
static jmethodID m_java_io_Console_flush;
static jmethodID m_java_io_Console_toString;
void init_proxies() {
JNIEnv *env = go_seq_push_local_frame(20);
jclass clazz;
clazz = go_seq_find_class("java/lang/Runnable");
if (clazz != NULL) {
class_java_lang_Runnable = (*env)->NewGlobalRef(env, clazz);
m_java_lang_Runnable_run = go_seq_get_method_id(clazz, "run", "()V");
}
clazz = go_seq_find_class("java/io/InputStream");
if (clazz != NULL) {
class_java_io_InputStream = (*env)->NewGlobalRef(env, clazz);
m_java_io_InputStream_read__ = go_seq_get_method_id(clazz, "read", "()I");
m_java_io_InputStream_read___3B = go_seq_get_method_id(clazz, "read", "([B)I");
m_java_io_InputStream_read___3BII = go_seq_get_method_id(clazz, "read", "([BII)I");
m_java_io_InputStream_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/util/concurrent/Future");
if (clazz != NULL) {
class_java_util_concurrent_Future = (*env)->NewGlobalRef(env, clazz);
m_java_util_concurrent_Future_get__ = go_seq_get_method_id(clazz, "get", "()Ljava/lang/Object;");
m_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit_2 = go_seq_get_method_id(clazz, "get", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;");
}
clazz = go_seq_find_class("java/lang/Object");
if (clazz != NULL) {
class_java_lang_Object = (*env)->NewGlobalRef(env, clazz);
m_java_lang_Object_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/util/concurrent/TimeUnit");
if (clazz != NULL) {
class_java_util_concurrent_TimeUnit = (*env)->NewGlobalRef(env, clazz);
m_java_util_concurrent_TimeUnit_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/util/Spliterators");
if (clazz != NULL) {
class_java_util_Spliterators = (*env)->NewGlobalRef(env, clazz);
m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_2 = go_seq_get_static_method_id(clazz, "iterator", "(Ljava/util/Spliterator;)Ljava/util/Iterator;");
m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfInt_2 = go_seq_get_static_method_id(clazz, "iterator", "(Ljava/util/Spliterator$OfInt;)Ljava/util/PrimitiveIterator$OfInt;");
m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfLong_2 = go_seq_get_static_method_id(clazz, "iterator", "(Ljava/util/Spliterator$OfLong;)Ljava/util/PrimitiveIterator$OfLong;");
m_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfDouble_2 = go_seq_get_static_method_id(clazz, "iterator", "(Ljava/util/Spliterator$OfDouble;)Ljava/util/PrimitiveIterator$OfDouble;");
m_java_util_Spliterators_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/lang/System");
if (clazz != NULL) {
class_java_lang_System = (*env)->NewGlobalRef(env, clazz);
m_s_java_lang_System_console = go_seq_get_static_method_id(clazz, "console", "()Ljava/io/Console;");
m_java_lang_System_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/Future");
if (clazz != NULL) {
class_java_Future = (*env)->NewGlobalRef(env, clazz);
sclass_java_Future = (*env)->GetSuperclass(env, clazz);
sclass_java_Future = (*env)->NewGlobalRef(env, sclass_java_Future);
m_java_Future_get__ = go_seq_get_method_id(clazz, "get", "()Ljava/lang/Object;");
sm_java_Future_get__ = go_seq_get_method_id(sclass_java_Future, "get", "()Ljava/lang/Object;");
m_java_Future_get__JLjava_util_concurrent_TimeUnit_2 = go_seq_get_method_id(clazz, "get", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;");
sm_java_Future_get__JLjava_util_concurrent_TimeUnit_2 = go_seq_get_method_id(sclass_java_Future, "get", "(JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;");
}
clazz = go_seq_find_class("java/InputStream");
if (clazz != NULL) {
class_java_InputStream = (*env)->NewGlobalRef(env, clazz);
sclass_java_InputStream = (*env)->GetSuperclass(env, clazz);
sclass_java_InputStream = (*env)->NewGlobalRef(env, sclass_java_InputStream);
m_java_InputStream_read__ = go_seq_get_method_id(clazz, "read", "()I");
sm_java_InputStream_read__ = go_seq_get_method_id(sclass_java_InputStream, "read", "()I");
m_java_InputStream_read___3B = go_seq_get_method_id(clazz, "read", "([B)I");
sm_java_InputStream_read___3B = go_seq_get_method_id(sclass_java_InputStream, "read", "([B)I");
m_java_InputStream_read___3BII = go_seq_get_method_id(clazz, "read", "([BII)I");
sm_java_InputStream_read___3BII = go_seq_get_method_id(sclass_java_InputStream, "read", "([BII)I");
m_java_InputStream_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
sm_java_InputStream_toString = go_seq_get_method_id(sclass_java_InputStream, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/Object");
if (clazz != NULL) {
class_java_Object = (*env)->NewGlobalRef(env, clazz);
sclass_java_Object = (*env)->GetSuperclass(env, clazz);
sclass_java_Object = (*env)->NewGlobalRef(env, sclass_java_Object);
m_java_Object_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
sm_java_Object_toString = go_seq_get_method_id(sclass_java_Object, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/Runnable");
if (clazz != NULL) {
class_java_Runnable = (*env)->NewGlobalRef(env, clazz);
sclass_java_Runnable = (*env)->GetSuperclass(env, clazz);
sclass_java_Runnable = (*env)->NewGlobalRef(env, sclass_java_Runnable);
m_java_Runnable_run = go_seq_get_method_id(clazz, "run", "()V");
sm_java_Runnable_run = go_seq_get_method_id(sclass_java_Runnable, "run", "()V");
}
clazz = go_seq_find_class("java/util/Iterator");
if (clazz != NULL) {
class_java_util_Iterator = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/util/Spliterator");
if (clazz != NULL) {
class_java_util_Spliterator = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/util/PrimitiveIterator$OfInt");
if (clazz != NULL) {
class_java_util_PrimitiveIterator_OfInt = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/util/Spliterator$OfInt");
if (clazz != NULL) {
class_java_util_Spliterator_OfInt = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/util/PrimitiveIterator$OfLong");
if (clazz != NULL) {
class_java_util_PrimitiveIterator_OfLong = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/util/Spliterator$OfLong");
if (clazz != NULL) {
class_java_util_Spliterator_OfLong = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/util/PrimitiveIterator$OfDouble");
if (clazz != NULL) {
class_java_util_PrimitiveIterator_OfDouble = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/util/Spliterator$OfDouble");
if (clazz != NULL) {
class_java_util_Spliterator_OfDouble = (*env)->NewGlobalRef(env, clazz);
}
clazz = go_seq_find_class("java/io/Console");
if (clazz != NULL) {
class_java_io_Console = (*env)->NewGlobalRef(env, clazz);
m_java_io_Console_flush = go_seq_get_method_id(clazz, "flush", "()V");
m_java_io_Console_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
go_seq_pop_local_frame(env);
}
jint cproxy_java_lang_Runnable_run(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
(*env)->CallVoidMethod(env, _this, m_java_lang_Runnable_run);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
go_seq_pop_local_frame(env);
return _exc_ref;
}
ret_jint cproxy_java_io_InputStream_read__(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jint res = (*env)->CallIntMethod(env, _this, m_java_io_InputStream_read__);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_io_InputStream_read___3B(jint this, nbyteslice a0) {
JNIEnv *env = go_seq_push_local_frame(2);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jbyteArray _a0 = go_seq_to_java_bytearray(env, a0, 0);
jint res = (*env)->CallIntMethod(env, _this, m_java_io_InputStream_read___3B, _a0);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_io_InputStream_read___3BII(jint this, nbyteslice a0, jint a1, jint a2) {
JNIEnv *env = go_seq_push_local_frame(4);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jbyteArray _a0 = go_seq_to_java_bytearray(env, a0, 0);
jint _a1 = a1;
jint _a2 = a2;
jint res = (*env)->CallIntMethod(env, _this, m_java_io_InputStream_read___3BII, _a0, _a1, _a2);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_io_InputStream_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_io_InputStream_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_util_concurrent_Future_get__(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jobject res = (*env)->CallObjectMethod(env, _this, m_java_util_concurrent_Future_get__);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1) {
JNIEnv *env = go_seq_push_local_frame(3);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jlong _a0 = a0;
jobject _a1 = go_seq_from_refnum(env, a1, NULL, NULL);
jobject res = (*env)->CallObjectMethod(env, _this, m_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit_2, _a0, _a1);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_lang_Object_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_lang_Object_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_util_concurrent_TimeUnit_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_util_concurrent_TimeUnit_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_util_Spliterators_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_util_Spliterators_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_lang_System_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_lang_System_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_Future_get__(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jobject res = (*env)->CallObjectMethod(env, _this, m_java_Future_get__);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint csuper_java_Future_get__(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jobject res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_java_Future, sm_java_Future_get__);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1) {
JNIEnv *env = go_seq_push_local_frame(3);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jlong _a0 = a0;
jobject _a1 = go_seq_from_refnum(env, a1, NULL, NULL);
jobject res = (*env)->CallObjectMethod(env, _this, m_java_Future_get__JLjava_util_concurrent_TimeUnit_2, _a0, _a1);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint csuper_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1) {
JNIEnv *env = go_seq_push_local_frame(3);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jlong _a0 = a0;
jobject _a1 = go_seq_from_refnum(env, a1, NULL, NULL);
jobject res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_java_Future, sm_java_Future_get__JLjava_util_concurrent_TimeUnit_2, _a0, _a1);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
jint _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_InputStream_read__(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jint res = (*env)->CallIntMethod(env, _this, m_java_InputStream_read__);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint csuper_java_InputStream_read__(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jint res = (*env)->CallNonvirtualIntMethod(env, _this, sclass_java_InputStream, sm_java_InputStream_read__);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_InputStream_read___3B(jint this, nbyteslice a0) {
JNIEnv *env = go_seq_push_local_frame(2);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jbyteArray _a0 = go_seq_to_java_bytearray(env, a0, 0);
jint res = (*env)->CallIntMethod(env, _this, m_java_InputStream_read___3B, _a0);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint csuper_java_InputStream_read___3B(jint this, nbyteslice a0) {
JNIEnv *env = go_seq_push_local_frame(2);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jbyteArray _a0 = go_seq_to_java_bytearray(env, a0, 0);
jint res = (*env)->CallNonvirtualIntMethod(env, _this, sclass_java_InputStream, sm_java_InputStream_read___3B, _a0);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint cproxy_java_InputStream_read___3BII(jint this, nbyteslice a0, jint a1, jint a2) {
JNIEnv *env = go_seq_push_local_frame(4);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jbyteArray _a0 = go_seq_to_java_bytearray(env, a0, 0);
jint _a1 = a1;
jint _a2 = a2;
jint res = (*env)->CallIntMethod(env, _this, m_java_InputStream_read___3BII, _a0, _a1, _a2);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_jint csuper_java_InputStream_read___3BII(jint this, nbyteslice a0, jint a1, jint a2) {
JNIEnv *env = go_seq_push_local_frame(4);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jbyteArray _a0 = go_seq_to_java_bytearray(env, a0, 0);
jint _a1 = a1;
jint _a2 = a2;
jint res = (*env)->CallNonvirtualIntMethod(env, _this, sclass_java_InputStream, sm_java_InputStream_read___3BII, _a0, _a1, _a2);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = 0;
}
jint _res = res;
go_seq_pop_local_frame(env);
ret_jint __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_InputStream_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_InputStream_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring csuper_java_InputStream_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_java_InputStream, sm_java_InputStream_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_Object_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_Object_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring csuper_java_Object_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallNonvirtualObjectMethod(env, _this, sclass_java_Object, sm_java_Object_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
jint cproxy_java_Runnable_run(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
(*env)->CallVoidMethod(env, _this, m_java_Runnable_run);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
go_seq_pop_local_frame(env);
return _exc_ref;
}
jint csuper_java_Runnable_run(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
(*env)->CallNonvirtualVoidMethod(env, _this, sclass_java_Runnable, sm_java_Runnable_run);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
go_seq_pop_local_frame(env);
return _exc_ref;
}
jint cproxy_java_io_Console_flush(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
(*env)->CallVoidMethod(env, _this, m_java_io_Console_flush);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
go_seq_pop_local_frame(env);
return _exc_ref;
}
ret_nstring cproxy_java_io_Console_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_io_Console_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java classes
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "java.h"
jclass proxy_class_java_Future;
jmethodID proxy_class_java_Future_cons;
jclass proxy_class_java_InputStream;
jmethodID proxy_class_java_InputStream_cons;
jclass proxy_class_java_Object;
jmethodID proxy_class_java_Object_cons;
jclass proxy_class_java_Runnable;
jmethodID proxy_class_java_Runnable_cons;
JNIEXPORT void JNICALL
Java_java_Java__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "java/Future");
proxy_class_java_Future = (*env)->NewGlobalRef(env, clazz);
proxy_class_java_Future_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "java/Object");
proxy_class_java_Object = (*env)->NewGlobalRef(env, clazz);
proxy_class_java_Object_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "java/Runnable");
proxy_class_java_Runnable = (*env)->NewGlobalRef(env, clazz);
proxy_class_java_Runnable_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
}
JNIEXPORT jobject JNICALL
Java_java_Java_newInputStream(JNIEnv* env, jclass _clazz) {
int32_t r0 = proxyjava__NewInputStream();
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_java_InputStream, proxy_class_java_InputStream_cons);
return _r0;
}
JNIEXPORT jint JNICALL
Java_java_Future__1_1New(JNIEnv *env, jclass clazz) {
return new_java_Future();
}
JNIEXPORT jobject JNICALL
Java_java_Future_get__(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
struct proxyjava_Future_Get_return res = proxyjava_Future_Get(o);
jobject _r0 = go_seq_from_refnum(env, res.r0, NULL, NULL);
jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r1);
return _r0;
}
JNIEXPORT jobject JNICALL
Java_java_Future_get__JLjava_util_concurrent_TimeUnit_2(JNIEnv* env, jobject __this__, jlong p0, jobject p1) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int64_t _p0 = (int64_t)p0;
int32_t _p1 = go_seq_to_refnum(env, p1);
struct proxyjava_Future_Get__return res = proxyjava_Future_Get_(o, _p0, _p1);
jobject _r0 = go_seq_from_refnum(env, res.r0, NULL, NULL);
jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r1);
return _r0;
}
JNIEXPORT void JNICALL
Java_java_Future_setFuture(JNIEnv *env, jobject this, jobject v) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t _v = go_seq_to_refnum(env, v);
proxyjava_Future_Future_Set(o, _v);
}
JNIEXPORT jobject JNICALL
Java_java_Future_getFuture(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t r0 = proxyjava_Future_Future_Get(o);
jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL);
return _r0;
}
JNIEXPORT jint JNICALL
Java_java_InputStream__1_1NewInputStream(JNIEnv *env, jclass clazz) {
int32_t refnum = proxyjava__NewInputStream();
return refnum;
}
JNIEXPORT jint JNICALL
Java_java_InputStream_read__(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
struct proxyjava_InputStream_Read_return res = proxyjava_InputStream_Read(o);
jint _r0 = (jint)res.r0;
jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r1);
return _r0;
}
JNIEXPORT void JNICALL
Java_java_InputStream_setInputStream(JNIEnv *env, jobject this, jobject v) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t _v = go_seq_to_refnum(env, v);
proxyjava_InputStream_InputStream_Set(o, _v);
}
JNIEXPORT jobject JNICALL
Java_java_InputStream_getInputStream(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t r0 = proxyjava_InputStream_InputStream_Get(o);
jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL);
return _r0;
}
JNIEXPORT jint JNICALL
Java_java_Object__1_1New(JNIEnv *env, jclass clazz) {
return new_java_Object();
}
JNIEXPORT void JNICALL
Java_java_Object_setObject(JNIEnv *env, jobject this, jobject v) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t _v = go_seq_to_refnum(env, v);
proxyjava_Object_Object_Set(o, _v);
}
JNIEXPORT jobject JNICALL
Java_java_Object_getObject(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t r0 = proxyjava_Object_Object_Get(o);
jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL);
return _r0;
}
JNIEXPORT jint JNICALL
Java_java_Runnable__1_1New(JNIEnv *env, jclass clazz) {
return new_java_Runnable();
}
JNIEXPORT void JNICALL
Java_java_Runnable_run(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int32_t _this_ = go_seq_to_refnum(env, __this__);
proxyjava_Runnable_Run(o, _this_);
}
JNIEXPORT void JNICALL
Java_java_Runnable_setRunnable(JNIEnv *env, jobject this, jobject v) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t _v = go_seq_to_refnum(env, v);
proxyjava_Runnable_Runnable_Set(o, _v);
}
JNIEXPORT jobject JNICALL
Java_java_Runnable_getRunnable(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t r0 = proxyjava_Runnable_Runnable_Get(o);
jobject _r0 = go_seq_from_refnum(env, r0, NULL, NULL);
return _r0;
}

155
bind/testdata/classes.java.golden vendored Normal file
View file

@ -0,0 +1,155 @@
// Code generated by gobind. DO NOT EDIT.
// Java class java.Future is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java classes
package java;
import go.Seq;
public final class Future implements Seq.GoObject, java.util.concurrent.Future {
static { Java.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
Future(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public Future() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public final native java.util.concurrent.Future getFuture();
public final native void setFuture(java.util.concurrent.Future v);
@Override public native java.lang.Object get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException;
/**
* Use a trailing underscore to override multiple overloaded methods.
*/
@Override public native java.lang.Object get(long p0, java.util.concurrent.TimeUnit p1) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException;
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.InputStream is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java classes
package java;
import go.Seq;
public final class InputStream extends java.io.InputStream implements Seq.GoObject {
static { Java.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
public InputStream() {
super();
this.refnum = __NewInputStream();
Seq.trackGoRef(refnum, this);
}
private static native int __NewInputStream();
public final native java.io.InputStream getInputStream();
public final native void setInputStream(java.io.InputStream v);
@Override public native int read() throws java.io.IOException;
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.Object is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java classes
package java;
import go.Seq;
public final class Object extends java.lang.Object implements Seq.GoObject {
static { Java.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
Object(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public Object() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public final native java.lang.Object getObject();
public final native void setObject(java.lang.Object v);
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.Runnable is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java classes
package java;
import go.Seq;
public final class Runnable implements Seq.GoObject, java.lang.Runnable {
static { Java.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
Runnable(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public Runnable() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public final native java.lang.Runnable getRunnable();
public final native void setRunnable(java.lang.Runnable v);
@Override public native void run();
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.Java is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java classes
package java;
import go.Seq;
public abstract class Java {
static {
Seq.touch(); // for loading the native library
_init();
}
private Java() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
public static native InputStream newInputStream();
}

103
bind/testdata/classes.java.h.golden vendored Normal file
View file

@ -0,0 +1,103 @@
// Code generated by gobind. DO NOT EDIT.
#include <jni.h>
#include "seq.h"
extern void init_proxies();
typedef struct ret_jint {
jint res;
jint exc;
} ret_jint;
typedef struct ret_jboolean {
jboolean res;
jint exc;
} ret_jboolean;
typedef struct ret_jshort {
jshort res;
jint exc;
} ret_jshort;
typedef struct ret_jchar {
jchar res;
jint exc;
} ret_jchar;
typedef struct ret_jbyte {
jbyte res;
jint exc;
} ret_jbyte;
typedef struct ret_jlong {
jlong res;
jint exc;
} ret_jlong;
typedef struct ret_jfloat {
jfloat res;
jint exc;
} ret_jfloat;
typedef struct ret_jdouble {
jdouble res;
jint exc;
} ret_jdouble;
typedef struct ret_nstring {
nstring res;
jint exc;
} ret_nstring;
typedef struct ret_nbyteslice {
nbyteslice res;
jint exc;
} ret_nbyteslice;
extern jint cproxy_java_lang_Runnable_run(jint this);
extern ret_jint cproxy_java_io_InputStream_read__(jint this);
extern ret_jint cproxy_java_io_InputStream_read___3B(jint this, nbyteslice a0);
extern ret_jint cproxy_java_io_InputStream_read___3BII(jint this, nbyteslice a0, jint a1, jint a2);
extern ret_nstring cproxy_java_io_InputStream_toString(jint this);
extern ret_jint cproxy_java_util_concurrent_Future_get__(jint this);
extern ret_jint cproxy_java_util_concurrent_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1);
extern ret_nstring cproxy_java_lang_Object_toString(jint this);
extern ret_nstring cproxy_java_util_concurrent_TimeUnit_toString(jint this);
extern ret_nstring cproxy_java_util_Spliterators_toString(jint this);
extern ret_nstring cproxy_java_lang_System_toString(jint this);
extern ret_jint cproxy_java_Future_get__(jint this);
extern ret_jint csuper_java_Future_get__(jint this);
extern ret_jint cproxy_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1);
extern ret_jint csuper_java_Future_get__JLjava_util_concurrent_TimeUnit_2(jint this, jlong a0, jint a1);
extern ret_jint cproxy_java_InputStream_read__(jint this);
extern ret_jint csuper_java_InputStream_read__(jint this);
extern ret_jint cproxy_java_InputStream_read___3B(jint this, nbyteslice a0);
extern ret_jint csuper_java_InputStream_read___3B(jint this, nbyteslice a0);
extern ret_jint cproxy_java_InputStream_read___3BII(jint this, nbyteslice a0, jint a1, jint a2);
extern ret_jint csuper_java_InputStream_read___3BII(jint this, nbyteslice a0, jint a1, jint a2);
extern ret_nstring cproxy_java_InputStream_toString(jint this);
extern ret_nstring csuper_java_InputStream_toString(jint this);
extern ret_nstring cproxy_java_Object_toString(jint this);
extern ret_nstring csuper_java_Object_toString(jint this);
extern jint cproxy_java_Runnable_run(jint this);
extern jint csuper_java_Runnable_run(jint this);
extern jint cproxy_java_io_Console_flush(jint this);
extern ret_nstring cproxy_java_io_Console_toString(jint this);
extern ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_2(jint a0);
extern ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfInt_2(jint a0);
extern ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfLong_2(jint a0);
extern ret_jint cproxy_s_java_util_Spliterators_iterator__Ljava_util_Spliterator_00024OfDouble_2(jint a0);
extern ret_jint cproxy_s_java_lang_System_console();
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java classes
#ifndef __Java_H__
#define __Java_H__
#include <jni.h>
extern jclass proxy_class_java_Future;
extern jmethodID proxy_class_java_Future_cons;
extern jclass proxy_class_java_InputStream;
extern jmethodID proxy_class_java_InputStream_cons;
extern jclass proxy_class_java_Object;
extern jmethodID proxy_class_java_Object_cons;
extern jclass proxy_class_java_Runnable;
extern jmethodID proxy_class_java_Runnable_cons;
#endif

10
bind/testdata/customprefix.go vendored Normal file
View file

@ -0,0 +1,10 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Data for -pkgpath and -prefix options.
package customprefix
func F() {
}

View file

@ -0,0 +1,23 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java -javapkg=com.example customprefix
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "customprefix.h"
JNIEXPORT void JNICALL
Java_com_example_customprefix_Customprefix__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
}
JNIEXPORT void JNICALL
Java_com_example_customprefix_Customprefix_f(JNIEnv* env, jclass _clazz) {
proxycustomprefix__F();
}

26
bind/testdata/customprefix.java.golden vendored Normal file
View file

@ -0,0 +1,26 @@
// Code generated by gobind. DO NOT EDIT.
// Java class com.example.customprefix.Customprefix is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java -javapkg=com.example customprefix
package com.example.customprefix;
import go.Seq;
public abstract class Customprefix {
static {
Seq.touch(); // for loading the native library
_init();
}
private Customprefix() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
public static native void f();
}

View file

@ -0,0 +1,12 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java -javapkg=com.example customprefix
#ifndef __Customprefix_H__
#define __Customprefix_H__
#include <jni.h>
#endif

View file

@ -0,0 +1,11 @@
// Objective-C API for talking to customprefix Go package.
// gobind -lang=objc customprefix
//
// File is generated by gobind. Do not edit.
#ifndef __GO_customprefix_H__
#define __GO_customprefix_H__
#include <stdint.h>
#include <objc/objc.h>
#endif

View file

@ -0,0 +1,16 @@
// Objective-C API for talking to customprefix Go package.
// gobind -lang=objc customprefix
//
// File is generated by gobind. Do not edit.
#ifndef __Customprefix_H__
#define __Customprefix_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
FOUNDATION_EXPORT void CustomprefixF(void);
#endif

View file

@ -0,0 +1,18 @@
// Objective-C API for talking to customprefix Go package.
// gobind -lang=objc customprefix
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Customprefix.objc.h"
void CustomprefixF(void) {
proxycustomprefix__F();
}
__attribute__((constructor)) static void init() {
init_seq();
}

View file

@ -0,0 +1,11 @@
// Objective-C API for talking to customprefix Go package.
// gobind -lang=objc -prefix="EX" customprefix
//
// File is generated by gobind. Do not edit.
#ifndef __GO_customprefix_H__
#define __GO_customprefix_H__
#include <stdint.h>
#include <objc/objc.h>
#endif

View file

@ -0,0 +1,16 @@
// Objective-C API for talking to customprefix Go package.
// gobind -lang=objc -prefix="EX" customprefix
//
// File is generated by gobind. Do not edit.
#ifndef __EXCustomprefix_H__
#define __EXCustomprefix_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
FOUNDATION_EXPORT void EXCustomprefixF(void);
#endif

View file

@ -0,0 +1,18 @@
// Objective-C API for talking to customprefix Go package.
// gobind -lang=objc -prefix="EX" customprefix
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "EXCustomprefix.objc.h"
void EXCustomprefixF(void) {
proxycustomprefix__F();
}
__attribute__((constructor)) static void init() {
init_seq();
}

59
bind/testdata/doc.go vendored Normal file
View file

@ -0,0 +1,59 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// package doc tests that Go documentation is transferred
// to the generated code.
package doc
// F is a function.
func F() {}
// C is a constant.
const C = true
// V is a var.
var V string
// A group of vars.
var (
// A specific var.
Specific string
NoDocVar float64
)
// Before is a method.
func (_ *S) Before() {}
// S is a struct.
type S struct {
// SF is a field.
SF string
// blank (unexported) field.
_ string
// Anonymous field.
*S2
// Multiple fields.
F1, F2 string
}
// After is another method.
func (_ *S) After() {}
// A generic comment with <HTML>.
type (
// S2 is a struct.
S2 struct{}
NoDoc struct{}
)
// NewS is a constructor.
func NewS() *S {
return nil
}
// I is an interface.
type I interface {
// IM is a method.
IM()
}

190
bind/testdata/doc.go.golden vendored Normal file
View file

@ -0,0 +1,190 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package doc.
//
// autogenerated by gobind -lang=go doc
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "doc.h"
*/
import "C"
import (
"doc"
_seq "golang.org/x/mobile/bind/seq"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export new_doc_NoDoc
func new_doc_NoDoc() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(doc.NoDoc)))
}
//export proxydoc_S_SF_Set
func proxydoc_S_SF_Set(refnum C.int32_t, v C.nstring) {
ref := _seq.FromRefNum(int32(refnum))
_v := decodeString(v)
ref.Get().(*doc.S).SF = _v
}
//export proxydoc_S_SF_Get
func proxydoc_S_SF_Get(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*doc.S).SF
_v := encodeString(v)
return _v
}
//export proxydoc_S_S2_Set
func proxydoc_S_S2_Set(refnum C.int32_t, v C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
// Must be a Go object
var _v *doc.S2
if _v_ref := _seq.FromRefNum(int32(v)); _v_ref != nil {
_v = _v_ref.Get().(*doc.S2)
}
ref.Get().(*doc.S).S2 = _v
}
//export proxydoc_S_S2_Get
func proxydoc_S_S2_Get(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*doc.S).S2
var _v C.int32_t = _seq.NullRefNum
if v != nil {
_v = C.int32_t(_seq.ToRefNum(v))
}
return _v
}
//export proxydoc_S_F1_Set
func proxydoc_S_F1_Set(refnum C.int32_t, v C.nstring) {
ref := _seq.FromRefNum(int32(refnum))
_v := decodeString(v)
ref.Get().(*doc.S).F1 = _v
}
//export proxydoc_S_F1_Get
func proxydoc_S_F1_Get(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*doc.S).F1
_v := encodeString(v)
return _v
}
//export proxydoc_S_F2_Set
func proxydoc_S_F2_Set(refnum C.int32_t, v C.nstring) {
ref := _seq.FromRefNum(int32(refnum))
_v := decodeString(v)
ref.Get().(*doc.S).F2 = _v
}
//export proxydoc_S_F2_Get
func proxydoc_S_F2_Get(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*doc.S).F2
_v := encodeString(v)
return _v
}
//export proxydoc_S_After
func proxydoc_S_After(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*doc.S)
v.After()
}
//export proxydoc_S_Before
func proxydoc_S_Before(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*doc.S)
v.Before()
}
//export new_doc_S
func new_doc_S() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(doc.S)))
}
//export new_doc_S2
func new_doc_S2() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(doc.S2)))
}
//export proxydoc_I_IM
func proxydoc_I_IM(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(doc.I)
v.IM()
}
type proxydoc_I _seq.Ref
func (p *proxydoc_I) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxydoc_I) IM() {
C.cproxydoc_I_IM(C.int32_t(p.Bind_proxy_refnum__()))
}
//export var_setdoc_NoDocVar
func var_setdoc_NoDocVar(v C.double) {
_v := float64(v)
doc.NoDocVar = _v
}
//export var_getdoc_NoDocVar
func var_getdoc_NoDocVar() C.double {
v := doc.NoDocVar
_v := C.double(v)
return _v
}
//export var_setdoc_Specific
func var_setdoc_Specific(v C.nstring) {
_v := decodeString(v)
doc.Specific = _v
}
//export var_getdoc_Specific
func var_getdoc_Specific() C.nstring {
v := doc.Specific
_v := encodeString(v)
return _v
}
//export var_setdoc_V
func var_setdoc_V(v C.nstring) {
_v := decodeString(v)
doc.V = _v
}
//export var_getdoc_V
func var_getdoc_V() C.nstring {
v := doc.V
_v := encodeString(v)
return _v
}
//export proxydoc__F
func proxydoc__F() {
doc.F()
}
//export proxydoc__NewS
func proxydoc__NewS() C.int32_t {
res_0 := doc.NewS()
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}

194
bind/testdata/doc.java.c.golden vendored Normal file
View file

@ -0,0 +1,194 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java doc
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "doc.h"
jclass proxy_class_doc_I;
jmethodID proxy_class_doc_I_cons;
static jmethodID mid_I_IM;
jclass proxy_class_doc_NoDoc;
jmethodID proxy_class_doc_NoDoc_cons;
jclass proxy_class_doc_S;
jmethodID proxy_class_doc_S_cons;
jclass proxy_class_doc_S2;
jmethodID proxy_class_doc_S2_cons;
JNIEXPORT void JNICALL
Java_doc_Doc__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "doc/NoDoc");
proxy_class_doc_NoDoc = (*env)->NewGlobalRef(env, clazz);
proxy_class_doc_NoDoc_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "doc/S");
proxy_class_doc_S = (*env)->NewGlobalRef(env, clazz);
proxy_class_doc_S_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "doc/S2");
proxy_class_doc_S2 = (*env)->NewGlobalRef(env, clazz);
proxy_class_doc_S2_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "doc/Doc$proxyI");
proxy_class_doc_I = (*env)->NewGlobalRef(env, clazz);
proxy_class_doc_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "doc/I");
mid_I_IM = (*env)->GetMethodID(env, clazz, "im", "()V");
}
JNIEXPORT void JNICALL
Java_doc_Doc_f(JNIEnv* env, jclass _clazz) {
proxydoc__F();
}
JNIEXPORT jobject JNICALL
Java_doc_Doc_newS(JNIEnv* env, jclass _clazz) {
int32_t r0 = proxydoc__NewS();
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_doc_S, proxy_class_doc_S_cons);
return _r0;
}
JNIEXPORT jint JNICALL
Java_doc_NoDoc__1_1New(JNIEnv *env, jclass clazz) {
return new_doc_NoDoc();
}
JNIEXPORT jint JNICALL
Java_doc_S__1_1NewS(JNIEnv *env, jclass clazz) {
int32_t refnum = proxydoc__NewS();
return refnum;
}
JNIEXPORT void JNICALL
Java_doc_S_after(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxydoc_S_After(o);
}
JNIEXPORT void JNICALL
Java_doc_S_before(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxydoc_S_Before(o);
}
JNIEXPORT void JNICALL
Java_doc_S_setSF(JNIEnv *env, jobject this, jstring v) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring _v = go_seq_from_java_string(env, v);
proxydoc_S_SF_Set(o, _v);
}
JNIEXPORT jstring JNICALL
Java_doc_S_getSF(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring r0 = proxydoc_S_SF_Get(o);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
JNIEXPORT void JNICALL
Java_doc_S_setS2(JNIEnv *env, jobject this, jobject v) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t _v = go_seq_to_refnum(env, v);
proxydoc_S_S2_Set(o, _v);
}
JNIEXPORT jobject JNICALL
Java_doc_S_getS2(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t r0 = proxydoc_S_S2_Get(o);
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_doc_S2, proxy_class_doc_S2_cons);
return _r0;
}
JNIEXPORT void JNICALL
Java_doc_S_setF1(JNIEnv *env, jobject this, jstring v) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring _v = go_seq_from_java_string(env, v);
proxydoc_S_F1_Set(o, _v);
}
JNIEXPORT jstring JNICALL
Java_doc_S_getF1(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring r0 = proxydoc_S_F1_Get(o);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
JNIEXPORT void JNICALL
Java_doc_S_setF2(JNIEnv *env, jobject this, jstring v) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring _v = go_seq_from_java_string(env, v);
proxydoc_S_F2_Set(o, _v);
}
JNIEXPORT jstring JNICALL
Java_doc_S_getF2(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring r0 = proxydoc_S_F2_Get(o);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
JNIEXPORT jint JNICALL
Java_doc_S2__1_1New(JNIEnv *env, jclass clazz) {
return new_doc_S2();
}
JNIEXPORT void JNICALL
Java_doc_Doc_00024proxyI_im(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxydoc_I_IM(o);
}
void cproxydoc_I_IM(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_doc_I, proxy_class_doc_I_cons);
(*env)->CallVoidMethod(env, o, mid_I_IM);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_doc_Doc_setNoDocVar(JNIEnv *env, jclass clazz, jdouble v) {
double _v = (double)v;
var_setdoc_NoDocVar(_v);
}
JNIEXPORT jdouble JNICALL
Java_doc_Doc_getNoDocVar(JNIEnv *env, jclass clazz) {
double r0 = var_getdoc_NoDocVar();
jdouble _r0 = (jdouble)r0;
return _r0;
}
JNIEXPORT void JNICALL
Java_doc_Doc_setSpecific(JNIEnv *env, jclass clazz, jstring v) {
nstring _v = go_seq_from_java_string(env, v);
var_setdoc_Specific(_v);
}
JNIEXPORT jstring JNICALL
Java_doc_Doc_getSpecific(JNIEnv *env, jclass clazz) {
nstring r0 = var_getdoc_Specific();
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
JNIEXPORT void JNICALL
Java_doc_Doc_setV(JNIEnv *env, jclass clazz, jstring v) {
nstring _v = go_seq_from_java_string(env, v);
var_setdoc_V(_v);
}
JNIEXPORT jstring JNICALL
Java_doc_Doc_getV(JNIEnv *env, jclass clazz) {
nstring r0 = var_getdoc_V();
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}

324
bind/testdata/doc.java.golden vendored Normal file
View file

@ -0,0 +1,324 @@
// Code generated by gobind. DO NOT EDIT.
// Java class doc.NoDoc is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java doc
package doc;
import go.Seq;
/**
* A generic comment with &lt;HTML&gt;.
*/
public final class NoDoc implements Seq.Proxy {
static { Doc.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
NoDoc(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public NoDoc() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof NoDoc)) {
return false;
}
NoDoc that = (NoDoc)o;
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("NoDoc").append("{");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class doc.S is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java doc
package doc;
import go.Seq;
/**
* S is a struct.
*/
public final class S implements Seq.Proxy {
static { Doc.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
/**
* NewS is a constructor.
*/
public S() {
this.refnum = __NewS();
Seq.trackGoRef(refnum, this);
}
private static native int __NewS();
S(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
/**
* SF is a field.
*/
public final native String getSF();
/**
* SF is a field.
*/
public final native void setSF(String v);
/**
* Anonymous field.
*/
public final native S2 getS2();
/**
* Anonymous field.
*/
public final native void setS2(S2 v);
/**
* Multiple fields.
*/
public final native String getF1();
/**
* Multiple fields.
*/
public final native void setF1(String v);
/**
* Multiple fields.
*/
public final native String getF2();
/**
* Multiple fields.
*/
public final native void setF2(String v);
/**
* After is another method.
*/
public native void after();
public native void before();
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof S)) {
return false;
}
S that = (S)o;
String thisSF = getSF();
String thatSF = that.getSF();
if (thisSF == null) {
if (thatSF != null) {
return false;
}
} else if (!thisSF.equals(thatSF)) {
return false;
}
S2 thisS2 = getS2();
S2 thatS2 = that.getS2();
if (thisS2 == null) {
if (thatS2 != null) {
return false;
}
} else if (!thisS2.equals(thatS2)) {
return false;
}
String thisF1 = getF1();
String thatF1 = that.getF1();
if (thisF1 == null) {
if (thatF1 != null) {
return false;
}
} else if (!thisF1.equals(thatF1)) {
return false;
}
String thisF2 = getF2();
String thatF2 = that.getF2();
if (thisF2 == null) {
if (thatF2 != null) {
return false;
}
} else if (!thisF2.equals(thatF2)) {
return false;
}
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {getSF(), getS2(), getF1(), getF2()});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("S").append("{");
b.append("SF:").append(getSF()).append(",");
b.append("S2:").append(getS2()).append(",");
b.append("F1:").append(getF1()).append(",");
b.append("F2:").append(getF2()).append(",");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class doc.S2 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java doc
package doc;
import go.Seq;
/**
* S2 is a struct.
*/
public final class S2 implements Seq.Proxy {
static { Doc.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
S2(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public S2() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof S2)) {
return false;
}
S2 that = (S2)o;
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("S2").append("{");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class doc.I is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java doc
package doc;
import go.Seq;
/**
* I is an interface.
*/
public interface I {
/**
* IM is a method.
*/
public void im();
}
// Code generated by gobind. DO NOT EDIT.
// Java class doc.Doc is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java doc
package doc;
import go.Seq;
public abstract class Doc {
static {
Seq.touch(); // for loading the native library
_init();
}
private Doc() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyI implements Seq.Proxy, I {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyI(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void im();
}
/**
* C is a constant.
*/
public static final boolean C = true;
/**
* A group of vars.
*/
public static native void setNoDocVar(double v);
/**
* A group of vars.
*/
public static native double getNoDocVar();
/**
* A specific var.
*/
public static native void setSpecific(String v);
/**
* A specific var.
*/
public static native String getSpecific();
/**
* V is a var.
*/
public static native void setV(String v);
/**
* V is a var.
*/
public static native String getV();
/**
* F is a function.
*/
public static native void f();
/**
* NewS is a constructor.
*/
public static native S newS();
}

23
bind/testdata/doc.java.h.golden vendored Normal file
View file

@ -0,0 +1,23 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java doc
#ifndef __Doc_H__
#define __Doc_H__
#include <jni.h>
extern jclass proxy_class_doc_I;
extern jmethodID proxy_class_doc_I_cons;
void cproxydoc_I_IM(int32_t refnum);
extern jclass proxy_class_doc_NoDoc;
extern jmethodID proxy_class_doc_NoDoc_cons;
extern jclass proxy_class_doc_S;
extern jmethodID proxy_class_doc_S_cons;
extern jclass proxy_class_doc_S2;
extern jmethodID proxy_class_doc_S2_cons;
#endif

13
bind/testdata/doc.objc.go.h.golden vendored Normal file
View file

@ -0,0 +1,13 @@
// Objective-C API for talking to doc Go package.
// gobind -lang=objc doc
//
// File is generated by gobind. Do not edit.
#ifndef __GO_doc_H__
#define __GO_doc_H__
#include <stdint.h>
#include <objc/objc.h>
void cproxydoc_I_IM(int32_t refnum);
#endif

136
bind/testdata/doc.objc.h.golden vendored Normal file
View file

@ -0,0 +1,136 @@
// Objective-C API for talking to doc Go package.
// gobind -lang=objc doc
//
// File is generated by gobind. Do not edit.
#ifndef __Doc_H__
#define __Doc_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@class DocNoDoc;
@class DocS;
@class DocS2;
@protocol DocI;
@class DocI;
@protocol DocI <NSObject>
/**
* IM is a method.
*/
- (void)im;
@end
/**
* A generic comment with <HTML>.
*/
@interface DocNoDoc : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@end
/**
* S is a struct.
*/
@interface DocS : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
/**
* NewS is a constructor.
*/
- (nullable instancetype)init;
/**
* SF is a field.
*/
@property (nonatomic) NSString* _Nonnull sf;
/**
* Anonymous field.
*/
@property (nonatomic) DocS2* _Nullable s2;
/**
* Multiple fields.
*/
@property (nonatomic) NSString* _Nonnull f1;
/**
* Multiple fields.
*/
@property (nonatomic) NSString* _Nonnull f2;
/**
* After is another method.
*/
- (void)after;
- (void)before;
@end
/**
* S2 is a struct.
*/
@interface DocS2 : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@end
/**
* C is a constant.
*/
FOUNDATION_EXPORT const BOOL DocC;
@interface Doc : NSObject
/**
* A group of vars.
*/
+ (double) noDocVar;
+ (void) setNoDocVar:(double)v;
/**
* A specific var.
*/
+ (NSString* _Nonnull) specific;
+ (void) setSpecific:(NSString* _Nonnull)v;
/**
* V is a var.
*/
+ (NSString* _Nonnull) v;
+ (void) setV:(NSString* _Nonnull)v;
@end
/**
* F is a function.
*/
FOUNDATION_EXPORT void DocF(void);
/**
* NewS is a constructor.
*/
FOUNDATION_EXPORT DocS* _Nullable DocNewS(void);
@class DocI;
/**
* I is an interface.
*/
@interface DocI : NSObject <goSeqRefInterface, DocI> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
/**
* IM is a method.
*/
- (void)im;
@end
#endif

231
bind/testdata/doc.objc.m.golden vendored Normal file
View file

@ -0,0 +1,231 @@
// Objective-C API for talking to doc Go package.
// gobind -lang=objc doc
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Doc.objc.h"
@implementation DocNoDoc {
}
- (nonnull instancetype)initWithRef:(_Nonnull id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (nonnull instancetype)init {
self = [super init];
if (self) {
__ref = go_seq_from_refnum(new_doc_NoDoc());
}
return self;
}
@end
@implementation DocS {
}
- (nonnull instancetype)initWithRef:(_Nonnull id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (instancetype)init {
self = [super init];
if (!self) return nil;
int32_t refnum = proxydoc__NewS();
__ref = go_seq_from_refnum(refnum);
return self;
}
- (NSString* _Nonnull)sf {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring r0 = proxydoc_S_SF_Get(refnum);
NSString *_r0 = go_seq_to_objc_string(r0);
return _r0;
}
- (void)setSF:(NSString* _Nonnull)v {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring _v = go_seq_from_objc_string(v);
proxydoc_S_SF_Set(refnum, _v);
}
- (DocS2* _Nullable)s2 {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxydoc_S_S2_Get(refnum);
DocS2* _r0 = nil;
GoSeqRef* _r0_ref = go_seq_from_refnum(r0);
if (_r0_ref != NULL) {
_r0 = _r0_ref.obj;
if (_r0 == nil) {
_r0 = [[DocS2 alloc] initWithRef:_r0_ref];
}
}
return _r0;
}
- (void)setS2:(DocS2* _Nullable)v {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t _v;
if ([v conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> v_proxy = (id<goSeqRefInterface>)(v);
_v = go_seq_go_to_refnum(v_proxy._ref);
} else {
_v = go_seq_to_refnum(v);
}
proxydoc_S_S2_Set(refnum, _v);
}
- (NSString* _Nonnull)f1 {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring r0 = proxydoc_S_F1_Get(refnum);
NSString *_r0 = go_seq_to_objc_string(r0);
return _r0;
}
- (void)setF1:(NSString* _Nonnull)v {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring _v = go_seq_from_objc_string(v);
proxydoc_S_F1_Set(refnum, _v);
}
- (NSString* _Nonnull)f2 {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring r0 = proxydoc_S_F2_Get(refnum);
NSString *_r0 = go_seq_to_objc_string(r0);
return _r0;
}
- (void)setF2:(NSString* _Nonnull)v {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring _v = go_seq_from_objc_string(v);
proxydoc_S_F2_Set(refnum, _v);
}
- (void)after {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxydoc_S_After(refnum);
}
- (void)before {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxydoc_S_Before(refnum);
}
@end
@implementation DocS2 {
}
- (nonnull instancetype)initWithRef:(_Nonnull id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (nonnull instancetype)init {
self = [super init];
if (self) {
__ref = go_seq_from_refnum(new_doc_S2());
}
return self;
}
@end
@implementation DocI {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)im {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxydoc_I_IM(refnum);
}
@end
const BOOL DocC = YES;
@implementation Doc
+ (void) setNoDocVar:(double)v {
double _v = (double)v;
var_setdoc_NoDocVar(_v);
}
+ (double) noDocVar {
double r0 = var_getdoc_NoDocVar();
double _r0 = (double)r0;
return _r0;
}
+ (void) setSpecific:(NSString* _Nonnull)v {
nstring _v = go_seq_from_objc_string(v);
var_setdoc_Specific(_v);
}
+ (NSString* _Nonnull) specific {
nstring r0 = var_getdoc_Specific();
NSString *_r0 = go_seq_to_objc_string(r0);
return _r0;
}
+ (void) setV:(NSString* _Nonnull)v {
nstring _v = go_seq_from_objc_string(v);
var_setdoc_V(_v);
}
+ (NSString* _Nonnull) v {
nstring r0 = var_getdoc_V();
NSString *_r0 = go_seq_to_objc_string(r0);
return _r0;
}
@end
void DocF(void) {
proxydoc__F();
}
DocS* _Nullable DocNewS(void) {
int32_t r0 = proxydoc__NewS();
DocS* _ret0_ = nil;
GoSeqRef* _ret0__ref = go_seq_from_refnum(r0);
if (_ret0__ref != NULL) {
_ret0_ = _ret0__ref.obj;
if (_ret0_ == nil) {
_ret0_ = [[DocS alloc] initWithRef:_ret0__ref];
}
}
return _ret0_;
}
void cproxydoc_I_IM(int32_t refnum) {
@autoreleasepool {
DocI* o = go_seq_objc_from_refnum(refnum);
[o im];
}
}
__attribute__((constructor)) static void init() {
init_seq();
}

59
bind/testdata/ignore.go vendored Normal file
View file

@ -0,0 +1,59 @@
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// package ignore tests that exported, but otherwise
// unsupported functions, variables, fields and methods
// are ignored by the generators
package ignore
var Var interface{}
type (
NamedString string
)
const NamedConst NamedString = "foo"
var V interface{}
func Argument(_ interface{}) {
}
func Result() interface{} {
return nil
}
type S struct {
F interface{}
}
type (
F func()
)
func (_ *S) Argument(_ interface{}) {
}
func (_ *S) Result() interface{} {
return nil
}
type I interface {
Argument(_ interface{})
Result() interface{}
}
var (
Uint uint
Uint32 uint32
Uint64 uint64
C64 complex64 = 0
C128 complex128 = 0
)
const (
Cuint uint = 0
Cuint32 uint32 = 0
Cuint64 uint64 = 0
)

63
bind/testdata/ignore.go.golden vendored Normal file
View file

@ -0,0 +1,63 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package ignore.
//
// autogenerated by gobind -lang=go ignore
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "ignore.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"ignore"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
// skipped field S.F with unsupported type: interface{}
// skipped method S.Argument with unsupported parameter or return types
// skipped method S.Result with unsupported parameter or return types
//export new_ignore_S
func new_ignore_S() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(ignore.S)))
}
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
type proxyignore_I _seq.Ref
func (p *proxyignore_I) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
// skipped method I.Argument with unsupported parameter or result types
// skipped method I.Result with unsupported parameter or result types
// skipped variable C128 with unsupported type complex128
// skipped variable C64 with unsupported type complex64
// skipped variable Uint with unsupported type uint
// skipped variable Uint32 with unsupported type uint32
// skipped variable Uint64 with unsupported type uint64
// skipped variable V with unsupported type interface{}
// skipped variable Var with unsupported type interface{}
// skipped function Argument with unsupported parameter or result types
// skipped function Result with unsupported parameter or result types

75
bind/testdata/ignore.java.c.golden vendored Normal file
View file

@ -0,0 +1,75 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java ignore
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "ignore.h"
jclass proxy_class_ignore_I;
jmethodID proxy_class_ignore_I_cons;
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
jclass proxy_class_ignore_S;
jmethodID proxy_class_ignore_S_cons;
JNIEXPORT void JNICALL
Java_ignore_Ignore__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "ignore/S");
proxy_class_ignore_S = (*env)->NewGlobalRef(env, clazz);
proxy_class_ignore_S_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "ignore/Ignore$proxyI");
proxy_class_ignore_I = (*env)->NewGlobalRef(env, clazz);
proxy_class_ignore_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "ignore/I");
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
}
// skipped function Argument with unsupported parameter or return types
// skipped function Result with unsupported parameter or return types
JNIEXPORT jint JNICALL
Java_ignore_S__1_1New(JNIEnv *env, jclass clazz) {
return new_ignore_S();
}
// skipped function S.Argument with unsupported parameter or return types
// skipped function S.Result with unsupported parameter or return types
// skipped field S with unsupported type: interface{}
// skipped function I.Argument with unsupported parameter or return types
// skipped method I with unsupported parameter or return types
// skipped function I.Result with unsupported parameter or return types
// skipped method I with unsupported parameter or return types
// skipped variable C128 with unsupported type: complex128
// skipped variable C64 with unsupported type: complex64
// skipped variable Uint with unsupported type: uint
// skipped variable Uint32 with unsupported type: uint32
// skipped variable Uint64 with unsupported type: uint64
// skipped variable V with unsupported type: interface{}
// skipped variable Var with unsupported type: interface{}

135
bind/testdata/ignore.java.golden vendored Normal file
View file

@ -0,0 +1,135 @@
// Code generated by gobind. DO NOT EDIT.
// Java class ignore.S is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java ignore
package ignore;
import go.Seq;
public final class S implements Seq.Proxy, I {
static { Ignore.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
S(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public S() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
// skipped field S.F with unsupported type: interface{}
// skipped method S.Argument with unsupported parameter or return types
// skipped method S.Result with unsupported parameter or return types
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof S)) {
return false;
}
S that = (S)o;
// skipped field S.F with unsupported type: interface{}
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("S").append("{");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class ignore.I is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java ignore
package ignore;
import go.Seq;
public interface I {
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
}
// Code generated by gobind. DO NOT EDIT.
// Java class ignore.Ignore is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java ignore
package ignore;
import go.Seq;
public abstract class Ignore {
static {
Seq.touch(); // for loading the native library
_init();
}
private Ignore() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyI implements Seq.Proxy, I {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyI(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
}
// skipped const Cuint with unsupported type: uint
// skipped const Cuint32 with unsupported type: uint32
// skipped const Cuint64 with unsupported type: uint64
// skipped const NamedConst with unsupported type: ignore.NamedString
// skipped variable C128 with unsupported type: complex128
// skipped variable C64 with unsupported type: complex64
// skipped variable Uint with unsupported type: uint
// skipped variable Uint32 with unsupported type: uint32
// skipped variable Uint64 with unsupported type: uint64
// skipped variable V with unsupported type: interface{}
// skipped variable Var with unsupported type: interface{}
// skipped function Argument with unsupported parameter or return types
// skipped function Result with unsupported parameter or return types
}

21
bind/testdata/ignore.java.h.golden vendored Normal file
View file

@ -0,0 +1,21 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java ignore
#ifndef __Ignore_H__
#define __Ignore_H__
#include <jni.h>
extern jclass proxy_class_ignore_I;
extern jmethodID proxy_class_ignore_I_cons;
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
extern jclass proxy_class_ignore_S;
extern jmethodID proxy_class_ignore_S_cons;
#endif

15
bind/testdata/ignore.objc.go.h.golden vendored Normal file
View file

@ -0,0 +1,15 @@
// Objective-C API for talking to ignore Go package.
// gobind -lang=objc ignore
//
// File is generated by gobind. Do not edit.
#ifndef __GO_ignore_H__
#define __GO_ignore_H__
#include <stdint.h>
#include <objc/objc.h>
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
#endif

84
bind/testdata/ignore.objc.h.golden vendored Normal file
View file

@ -0,0 +1,84 @@
// Objective-C API for talking to ignore Go package.
// gobind -lang=objc ignore
//
// File is generated by gobind. Do not edit.
#ifndef __Ignore_H__
#define __Ignore_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@class IgnoreS;
@protocol IgnoreI;
@class IgnoreI;
@protocol IgnoreI <NSObject>
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
@end
@interface IgnoreS : NSObject <goSeqRefInterface, IgnoreI> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
// skipped field S.F with unsupported type: interface{}
// skipped method S.Argument with unsupported parameter or return types
// skipped method S.Result with unsupported parameter or return types
@end
// skipped const Cuint with unsupported type: uint
// skipped const Cuint32 with unsupported type: uint32
// skipped const Cuint64 with unsupported type: uint64
// skipped const NamedConst with unsupported type: ignore.NamedString
@interface Ignore : NSObject
// skipped variable C128 with unsupported type: complex128
// skipped variable C64 with unsupported type: complex64
// skipped variable Uint with unsupported type: uint
// skipped variable Uint32 with unsupported type: uint32
// skipped variable Uint64 with unsupported type: uint64
// skipped variable V with unsupported type: interface{}
// skipped variable Var with unsupported type: interface{}
@end
// skipped function Argument with unsupported parameter or return types
// skipped function Result with unsupported parameter or return types
@class IgnoreI;
@interface IgnoreI : NSObject <goSeqRefInterface, IgnoreI> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
@end
#endif

91
bind/testdata/ignore.objc.m.golden vendored Normal file
View file

@ -0,0 +1,91 @@
// Objective-C API for talking to ignore Go package.
// gobind -lang=objc ignore
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Ignore.objc.h"
@implementation IgnoreS {
}
- (nonnull instancetype)initWithRef:(_Nonnull id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (nonnull instancetype)init {
self = [super init];
if (self) {
__ref = go_seq_from_refnum(new_ignore_S());
}
return self;
}
// skipped unsupported field F with type interface{}
// skipped method S.Argument with unsupported parameter or return types
// skipped method S.Result with unsupported parameter or return types
@end
@implementation IgnoreI {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
@end
// skipped const Cuint with unsupported type: uint
// skipped const Cuint32 with unsupported type: uint32
// skipped const Cuint64 with unsupported type: uint64
// skipped const NamedConst with unsupported type: ignore.NamedString
@implementation Ignore
// skipped variable C128 with unsupported type: complex128
// skipped variable C64 with unsupported type: complex64
// skipped variable Uint with unsupported type: uint
// skipped variable Uint32 with unsupported type: uint32
// skipped variable Uint64 with unsupported type: uint64
// skipped variable V with unsupported type: interface{}
// skipped variable Var with unsupported type: interface{}
@end
// skipped function Argument with unsupported parameter or return types
// skipped function Result with unsupported parameter or return types
// skipped method I.Argument with unsupported parameter or return types
// skipped method I.Result with unsupported parameter or return types
__attribute__((constructor)) static void init() {
init_seq();
}

69
bind/testdata/interfaces.go vendored Normal file
View file

@ -0,0 +1,69 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package interfaces
type I interface {
Rand() int32
}
type SameI interface {
Rand() int32
}
type LargerI interface {
Rand() int32
AnotherFunc()
}
func Add3(r I) int32 {
return r.Rand() + r.Rand() + r.Rand()
}
// chosen by fair dice roll.
// guaranteed to be random.
type seven struct{}
func (seven) Rand() int32 { return 7 }
func Seven() I { return seven{} }
type WithParam interface {
HasParam(p bool)
}
type Error interface {
Err() error
}
func CallErr(e Error) error {
return e.Err()
}
// not implementable
type I1 interface {
J()
H() *seven // not bound
}
// not implementable
type I2 interface {
f()
G()
}
// implementable
// (the implementor has to find a source of I1s)
type I3 interface {
F() I1
}
// not bound
func F() seven { return seven{} }
func G(u seven) {}
// Interfaces is an interface with the same name as its package.
type Interfaces interface {
SomeMethod()
}

257
bind/testdata/interfaces.go.golden vendored Normal file
View file

@ -0,0 +1,257 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package interfaces.
//
// autogenerated by gobind -lang=go interfaces
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "interfaces.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"interfaces"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyinterfaces_Error_Err
func proxyinterfaces_Error_Err(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.Error)
res_0 := v.Err()
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}
type proxyinterfaces_Error _seq.Ref
func (p *proxyinterfaces_Error) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyinterfaces_Error) Err() error {
res := C.cproxyinterfaces_Error_Err(C.int32_t(p.Bind_proxy_refnum__()))
var _res error
_res_ref := _seq.FromRefNum(int32(res))
if _res_ref != nil {
if res < 0 { // go object
_res = _res_ref.Get().(error)
} else { // foreign object
_res = (*proxy_error)(_res_ref)
}
}
return _res
}
//export proxyinterfaces_I_Rand
func proxyinterfaces_I_Rand(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.I)
res_0 := v.Rand()
_res_0 := C.int32_t(res_0)
return _res_0
}
type proxyinterfaces_I _seq.Ref
func (p *proxyinterfaces_I) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyinterfaces_I) Rand() int32 {
res := C.cproxyinterfaces_I_Rand(C.int32_t(p.Bind_proxy_refnum__()))
_res := int32(res)
return _res
}
//export proxyinterfaces_I1_J
func proxyinterfaces_I1_J(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.I1)
v.J()
}
//export proxyinterfaces_I2_G
func proxyinterfaces_I2_G(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.I2)
v.G()
}
//export proxyinterfaces_I3_F
func proxyinterfaces_I3_F(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.I3)
res_0 := v.F()
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}
type proxyinterfaces_I3 _seq.Ref
func (p *proxyinterfaces_I3) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyinterfaces_I3) F() interfaces.I1 {
res := C.cproxyinterfaces_I3_F(C.int32_t(p.Bind_proxy_refnum__()))
var _res interfaces.I1
_res_ref := _seq.FromRefNum(int32(res))
if _res_ref != nil {
if res < 0 { // go object
_res = _res_ref.Get().(interfaces.I1)
}
}
return _res
}
//export proxyinterfaces_Interfaces_SomeMethod
func proxyinterfaces_Interfaces_SomeMethod(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.Interfaces)
v.SomeMethod()
}
type proxyinterfaces_Interfaces _seq.Ref
func (p *proxyinterfaces_Interfaces) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyinterfaces_Interfaces) SomeMethod() {
C.cproxyinterfaces_Interfaces_SomeMethod(C.int32_t(p.Bind_proxy_refnum__()))
}
//export proxyinterfaces_LargerI_AnotherFunc
func proxyinterfaces_LargerI_AnotherFunc(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.LargerI)
v.AnotherFunc()
}
//export proxyinterfaces_LargerI_Rand
func proxyinterfaces_LargerI_Rand(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.LargerI)
res_0 := v.Rand()
_res_0 := C.int32_t(res_0)
return _res_0
}
type proxyinterfaces_LargerI _seq.Ref
func (p *proxyinterfaces_LargerI) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyinterfaces_LargerI) AnotherFunc() {
C.cproxyinterfaces_LargerI_AnotherFunc(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxyinterfaces_LargerI) Rand() int32 {
res := C.cproxyinterfaces_LargerI_Rand(C.int32_t(p.Bind_proxy_refnum__()))
_res := int32(res)
return _res
}
//export proxyinterfaces_SameI_Rand
func proxyinterfaces_SameI_Rand(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.SameI)
res_0 := v.Rand()
_res_0 := C.int32_t(res_0)
return _res_0
}
type proxyinterfaces_SameI _seq.Ref
func (p *proxyinterfaces_SameI) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyinterfaces_SameI) Rand() int32 {
res := C.cproxyinterfaces_SameI_Rand(C.int32_t(p.Bind_proxy_refnum__()))
_res := int32(res)
return _res
}
//export proxyinterfaces_WithParam_HasParam
func proxyinterfaces_WithParam_HasParam(refnum C.int32_t, param_p0 C.char) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(interfaces.WithParam)
_param_p0 := param_p0 != 0
v.HasParam(_param_p0)
}
type proxyinterfaces_WithParam _seq.Ref
func (p *proxyinterfaces_WithParam) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyinterfaces_WithParam) HasParam(param_p0 bool) {
var _param_p0 C.char = 0
if param_p0 {
_param_p0 = 1
}
C.cproxyinterfaces_WithParam_HasParam(C.int32_t(p.Bind_proxy_refnum__()), _param_p0)
}
//export proxyinterfaces__Add3
func proxyinterfaces__Add3(param_r C.int32_t) C.int32_t {
var _param_r interfaces.I
_param_r_ref := _seq.FromRefNum(int32(param_r))
if _param_r_ref != nil {
if param_r < 0 { // go object
_param_r = _param_r_ref.Get().(interfaces.I)
} else { // foreign object
_param_r = (*proxyinterfaces_I)(_param_r_ref)
}
}
res_0 := interfaces.Add3(_param_r)
_res_0 := C.int32_t(res_0)
return _res_0
}
//export proxyinterfaces__CallErr
func proxyinterfaces__CallErr(param_e C.int32_t) C.int32_t {
var _param_e interfaces.Error
_param_e_ref := _seq.FromRefNum(int32(param_e))
if _param_e_ref != nil {
if param_e < 0 { // go object
_param_e = _param_e_ref.Get().(interfaces.Error)
} else { // foreign object
_param_e = (*proxyinterfaces_Error)(_param_e_ref)
}
}
res_0 := interfaces.CallErr(_param_e)
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}
//export proxyinterfaces__Seven
func proxyinterfaces__Seven() C.int32_t {
res_0 := interfaces.Seven()
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}

277
bind/testdata/interfaces.java.c.golden vendored Normal file
View file

@ -0,0 +1,277 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java interfaces
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "interfaces.h"
jclass proxy_class_interfaces_Error;
jmethodID proxy_class_interfaces_Error_cons;
static jmethodID mid_Error_Err;
jclass proxy_class_interfaces_I;
jmethodID proxy_class_interfaces_I_cons;
static jmethodID mid_I_Rand;
jclass proxy_class_interfaces_I1;
jmethodID proxy_class_interfaces_I1_cons;
static jmethodID mid_I1_J;
jclass proxy_class_interfaces_I2;
jmethodID proxy_class_interfaces_I2_cons;
static jmethodID mid_I2_G;
jclass proxy_class_interfaces_I3;
jmethodID proxy_class_interfaces_I3_cons;
static jmethodID mid_I3_F;
jclass proxy_class_interfaces_Interfaces;
jmethodID proxy_class_interfaces_Interfaces_cons;
static jmethodID mid_Interfaces_SomeMethod;
jclass proxy_class_interfaces_LargerI;
jmethodID proxy_class_interfaces_LargerI_cons;
static jmethodID mid_LargerI_AnotherFunc;
static jmethodID mid_LargerI_Rand;
jclass proxy_class_interfaces_SameI;
jmethodID proxy_class_interfaces_SameI_cons;
static jmethodID mid_SameI_Rand;
jclass proxy_class_interfaces_WithParam;
jmethodID proxy_class_interfaces_WithParam_cons;
static jmethodID mid_WithParam_HasParam;
JNIEXPORT void JNICALL
Java_interfaces_Interfaces__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyError");
proxy_class_interfaces_Error = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_Error_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/Error");
mid_Error_Err = (*env)->GetMethodID(env, clazz, "err", "()V");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI");
proxy_class_interfaces_I = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_I_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/I");
mid_I_Rand = (*env)->GetMethodID(env, clazz, "rand", "()I");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI1");
proxy_class_interfaces_I1 = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_I1_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/I1");
mid_I1_J = (*env)->GetMethodID(env, clazz, "j", "()V");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI2");
proxy_class_interfaces_I2 = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_I2_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/I2");
mid_I2_G = (*env)->GetMethodID(env, clazz, "g", "()V");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyI3");
proxy_class_interfaces_I3 = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_I3_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/I3");
mid_I3_F = (*env)->GetMethodID(env, clazz, "f", "()Linterfaces/I1;");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyInterfaces");
proxy_class_interfaces_Interfaces = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_Interfaces_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/Interfaces_");
mid_Interfaces_SomeMethod = (*env)->GetMethodID(env, clazz, "someMethod", "()V");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyLargerI");
proxy_class_interfaces_LargerI = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_LargerI_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/LargerI");
mid_LargerI_AnotherFunc = (*env)->GetMethodID(env, clazz, "anotherFunc", "()V");
mid_LargerI_Rand = (*env)->GetMethodID(env, clazz, "rand", "()I");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxySameI");
proxy_class_interfaces_SameI = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_SameI_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/SameI");
mid_SameI_Rand = (*env)->GetMethodID(env, clazz, "rand", "()I");
clazz = (*env)->FindClass(env, "interfaces/Interfaces$proxyWithParam");
proxy_class_interfaces_WithParam = (*env)->NewGlobalRef(env, clazz);
proxy_class_interfaces_WithParam_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "interfaces/WithParam");
mid_WithParam_HasParam = (*env)->GetMethodID(env, clazz, "hasParam", "(Z)V");
}
JNIEXPORT jint JNICALL
Java_interfaces_Interfaces_add3(JNIEnv* env, jclass _clazz, jobject r) {
int32_t _r = go_seq_to_refnum(env, r);
int32_t r0 = proxyinterfaces__Add3(_r);
jint _r0 = (jint)r0;
return _r0;
}
JNIEXPORT void JNICALL
Java_interfaces_Interfaces_callErr(JNIEnv* env, jclass _clazz, jobject e) {
int32_t _e = go_seq_to_refnum(env, e);
int32_t r0 = proxyinterfaces__CallErr(_e);
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r0);
}
JNIEXPORT jobject JNICALL
Java_interfaces_Interfaces_seven(JNIEnv* env, jclass _clazz) {
int32_t r0 = proxyinterfaces__Seven();
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_interfaces_I, proxy_class_interfaces_I_cons);
return _r0;
}
JNIEXPORT void JNICALL
Java_interfaces_Interfaces_00024proxyError_err(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int32_t r0 = proxyinterfaces_Error_Err(o);
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r0);
}
int32_t cproxyinterfaces_Error_Err(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_Error, proxy_class_interfaces_Error_cons);
(*env)->CallVoidMethod(env, o, mid_Error_Err);
jobject exc = go_seq_get_exception(env);
int32_t _exc = go_seq_to_refnum(env, exc);
go_seq_pop_local_frame(env);
return _exc;
}
JNIEXPORT jint JNICALL
Java_interfaces_Interfaces_00024proxyI_rand(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int32_t r0 = proxyinterfaces_I_Rand(o);
jint _r0 = (jint)r0;
return _r0;
}
int32_t cproxyinterfaces_I_Rand(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_I, proxy_class_interfaces_I_cons);
jint res = (*env)->CallIntMethod(env, o, mid_I_Rand);
int32_t _res = (int32_t)res;
go_seq_pop_local_frame(env);
return _res;
}
JNIEXPORT void JNICALL
Java_interfaces_Interfaces_00024proxyI1_j(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxyinterfaces_I1_J(o);
}
void cproxyinterfaces_I1_J(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_I1, proxy_class_interfaces_I1_cons);
(*env)->CallVoidMethod(env, o, mid_I1_J);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_interfaces_Interfaces_00024proxyI2_g(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxyinterfaces_I2_G(o);
}
void cproxyinterfaces_I2_G(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_I2, proxy_class_interfaces_I2_cons);
(*env)->CallVoidMethod(env, o, mid_I2_G);
go_seq_pop_local_frame(env);
}
JNIEXPORT jobject JNICALL
Java_interfaces_Interfaces_00024proxyI3_f(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int32_t r0 = proxyinterfaces_I3_F(o);
jobject _r0 = go_seq_from_refnum(env, r0, proxy_class_interfaces_I1, proxy_class_interfaces_I1_cons);
return _r0;
}
int32_t cproxyinterfaces_I3_F(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_I3, proxy_class_interfaces_I3_cons);
jobject res = (*env)->CallObjectMethod(env, o, mid_I3_F);
int32_t _res = go_seq_to_refnum(env, res);
go_seq_pop_local_frame(env);
return _res;
}
JNIEXPORT void JNICALL
Java_interfaces_Interfaces_00024proxyInterfaces_someMethod(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxyinterfaces_Interfaces_SomeMethod(o);
}
void cproxyinterfaces_Interfaces_SomeMethod(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_Interfaces, proxy_class_interfaces_Interfaces_cons);
(*env)->CallVoidMethod(env, o, mid_Interfaces_SomeMethod);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_interfaces_Interfaces_00024proxyLargerI_anotherFunc(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxyinterfaces_LargerI_AnotherFunc(o);
}
void cproxyinterfaces_LargerI_AnotherFunc(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_LargerI, proxy_class_interfaces_LargerI_cons);
(*env)->CallVoidMethod(env, o, mid_LargerI_AnotherFunc);
go_seq_pop_local_frame(env);
}
JNIEXPORT jint JNICALL
Java_interfaces_Interfaces_00024proxyLargerI_rand(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int32_t r0 = proxyinterfaces_LargerI_Rand(o);
jint _r0 = (jint)r0;
return _r0;
}
int32_t cproxyinterfaces_LargerI_Rand(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_LargerI, proxy_class_interfaces_LargerI_cons);
jint res = (*env)->CallIntMethod(env, o, mid_LargerI_Rand);
int32_t _res = (int32_t)res;
go_seq_pop_local_frame(env);
return _res;
}
JNIEXPORT jint JNICALL
Java_interfaces_Interfaces_00024proxySameI_rand(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int32_t r0 = proxyinterfaces_SameI_Rand(o);
jint _r0 = (jint)r0;
return _r0;
}
int32_t cproxyinterfaces_SameI_Rand(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_SameI, proxy_class_interfaces_SameI_cons);
jint res = (*env)->CallIntMethod(env, o, mid_SameI_Rand);
int32_t _res = (int32_t)res;
go_seq_pop_local_frame(env);
return _res;
}
JNIEXPORT void JNICALL
Java_interfaces_Interfaces_00024proxyWithParam_hasParam(JNIEnv* env, jobject __this__, jboolean p0) {
int32_t o = go_seq_to_refnum_go(env, __this__);
char _p0 = (char)p0;
proxyinterfaces_WithParam_HasParam(o, _p0);
}
void cproxyinterfaces_WithParam_HasParam(int32_t refnum, char p0) {
JNIEnv *env = go_seq_push_local_frame(1);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_interfaces_WithParam, proxy_class_interfaces_WithParam_cons);
jboolean _p0 = p0 ? JNI_TRUE : JNI_FALSE;
(*env)->CallVoidMethod(env, o, mid_WithParam_HasParam, _p0);
go_seq_pop_local_frame(env);
}

277
bind/testdata/interfaces.java.golden vendored Normal file
View file

@ -0,0 +1,277 @@
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.Error is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
public interface Error {
public void err() throws Exception;
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.I is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
public interface I {
public int rand();
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.I1 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
/**
* not implementable
*/
public interface I1 {
public void j();
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.I2 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
/**
* not implementable
*/
public interface I2 {
public void g();
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.I3 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
/**
* implementable
(the implementor has to find a source of I1s)
*/
public interface I3 {
public I1 f();
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.Interfaces_ is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
/**
* Interfaces is an interface with the same name as its package.
*/
public interface Interfaces_ {
public void someMethod();
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.LargerI is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
public interface LargerI extends I, SameI {
public void anotherFunc();
public int rand();
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.SameI is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
public interface SameI {
public int rand();
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.WithParam is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
public interface WithParam {
public void hasParam(boolean p0);
}
// Code generated by gobind. DO NOT EDIT.
// Java class interfaces.Interfaces is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java interfaces
package interfaces;
import go.Seq;
public abstract class Interfaces {
static {
Seq.touch(); // for loading the native library
_init();
}
private Interfaces() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyError implements Seq.Proxy, Error {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyError(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void err() throws Exception;
}
private static final class proxyI implements Seq.Proxy, I {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyI(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native int rand();
}
private static final class proxyI1 implements Seq.Proxy, I1 {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyI1(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void j();
}
private static final class proxyI2 implements Seq.Proxy, I2 {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyI2(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void g();
}
private static final class proxyI3 implements Seq.Proxy, I3 {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyI3(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native I1 f();
}
private static final class proxyInterfaces implements Seq.Proxy, Interfaces_ {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyInterfaces(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void someMethod();
}
private static final class proxyLargerI implements Seq.Proxy, LargerI {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyLargerI(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void anotherFunc();
public native int rand();
}
private static final class proxySameI implements Seq.Proxy, SameI {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxySameI(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native int rand();
}
private static final class proxyWithParam implements Seq.Proxy, WithParam {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyWithParam(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void hasParam(boolean p0);
}
public static native int add3(I r);
public static native void callErr(Error e) throws Exception;
public static native I seven();
}

59
bind/testdata/interfaces.java.h.golden vendored Normal file
View file

@ -0,0 +1,59 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java interfaces
#ifndef __Interfaces_H__
#define __Interfaces_H__
#include <jni.h>
extern jclass proxy_class_interfaces_Error;
extern jmethodID proxy_class_interfaces_Error_cons;
int32_t cproxyinterfaces_Error_Err(int32_t refnum);
extern jclass proxy_class_interfaces_I;
extern jmethodID proxy_class_interfaces_I_cons;
int32_t cproxyinterfaces_I_Rand(int32_t refnum);
extern jclass proxy_class_interfaces_I1;
extern jmethodID proxy_class_interfaces_I1_cons;
void cproxyinterfaces_I1_J(int32_t refnum);
extern jclass proxy_class_interfaces_I2;
extern jmethodID proxy_class_interfaces_I2_cons;
void cproxyinterfaces_I2_G(int32_t refnum);
extern jclass proxy_class_interfaces_I3;
extern jmethodID proxy_class_interfaces_I3_cons;
int32_t cproxyinterfaces_I3_F(int32_t refnum);
extern jclass proxy_class_interfaces_Interfaces;
extern jmethodID proxy_class_interfaces_Interfaces_cons;
void cproxyinterfaces_Interfaces_SomeMethod(int32_t refnum);
extern jclass proxy_class_interfaces_LargerI;
extern jmethodID proxy_class_interfaces_LargerI_cons;
void cproxyinterfaces_LargerI_AnotherFunc(int32_t refnum);
int32_t cproxyinterfaces_LargerI_Rand(int32_t refnum);
extern jclass proxy_class_interfaces_SameI;
extern jmethodID proxy_class_interfaces_SameI_cons;
int32_t cproxyinterfaces_SameI_Rand(int32_t refnum);
extern jclass proxy_class_interfaces_WithParam;
extern jmethodID proxy_class_interfaces_WithParam_cons;
void cproxyinterfaces_WithParam_HasParam(int32_t refnum, char p0);
#endif

View file

@ -0,0 +1,27 @@
// Objective-C API for talking to interfaces Go package.
// gobind -lang=objc interfaces
//
// File is generated by gobind. Do not edit.
#ifndef __GO_interfaces_H__
#define __GO_interfaces_H__
#include <stdint.h>
#include <objc/objc.h>
int32_t cproxyinterfaces_Error_Err(int32_t refnum);
int32_t cproxyinterfaces_I_Rand(int32_t refnum);
int32_t cproxyinterfaces_I3_F(int32_t refnum);
void cproxyinterfaces_Interfaces_SomeMethod(int32_t refnum);
void cproxyinterfaces_LargerI_AnotherFunc(int32_t refnum);
int32_t cproxyinterfaces_LargerI_Rand(int32_t refnum);
int32_t cproxyinterfaces_SameI_Rand(int32_t refnum);
void cproxyinterfaces_WithParam_HasParam(int32_t refnum, char p0);
#endif

166
bind/testdata/interfaces.objc.h.golden vendored Normal file
View file

@ -0,0 +1,166 @@
// Objective-C API for talking to interfaces Go package.
// gobind -lang=objc interfaces
//
// File is generated by gobind. Do not edit.
#ifndef __Interfaces_H__
#define __Interfaces_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@protocol InterfacesError;
@class InterfacesError;
@protocol InterfacesI;
@class InterfacesI;
@protocol InterfacesI1;
@protocol InterfacesI2;
@protocol InterfacesI3;
@class InterfacesI3;
@protocol InterfacesInterfaces;
@class InterfacesInterfaces;
@protocol InterfacesLargerI;
@class InterfacesLargerI;
@protocol InterfacesSameI;
@class InterfacesSameI;
@protocol InterfacesWithParam;
@class InterfacesWithParam;
@protocol InterfacesError <NSObject>
- (BOOL)err:(NSError* _Nullable* _Nullable)error;
@end
@protocol InterfacesI <NSObject>
- (int32_t)rand;
@end
/**
* not implementable
*/
@interface InterfacesI1 : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)j;
@end
/**
* not implementable
*/
@interface InterfacesI2 : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)g;
@end
@protocol InterfacesI3 <NSObject>
- (InterfacesI1* _Nullable)f;
@end
@protocol InterfacesInterfaces <NSObject>
- (void)someMethod;
@end
@protocol InterfacesLargerI <NSObject>
- (void)anotherFunc;
- (int32_t)rand;
@end
@protocol InterfacesSameI <NSObject>
- (int32_t)rand;
@end
@protocol InterfacesWithParam <NSObject>
- (void)hasParam:(BOOL)p0;
@end
FOUNDATION_EXPORT int32_t InterfacesAdd3(id<InterfacesI> _Nullable r);
FOUNDATION_EXPORT BOOL InterfacesCallErr(id<InterfacesError> _Nullable e, NSError* _Nullable* _Nullable error);
FOUNDATION_EXPORT id<InterfacesI> _Nullable InterfacesSeven(void);
@class InterfacesError;
@class InterfacesI;
@class InterfacesI3;
@class InterfacesInterfaces;
@class InterfacesLargerI;
@class InterfacesSameI;
@class InterfacesWithParam;
@interface InterfacesError : NSObject <goSeqRefInterface, InterfacesError> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (BOOL)err:(NSError* _Nullable* _Nullable)error;
@end
@interface InterfacesI : NSObject <goSeqRefInterface, InterfacesI> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (int32_t)rand;
@end
/**
* implementable
(the implementor has to find a source of I1s)
*/
@interface InterfacesI3 : NSObject <goSeqRefInterface, InterfacesI3> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (InterfacesI1* _Nullable)f;
@end
/**
* Interfaces is an interface with the same name as its package.
*/
@interface InterfacesInterfaces : NSObject <goSeqRefInterface, InterfacesInterfaces> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)someMethod;
@end
@interface InterfacesLargerI : NSObject <goSeqRefInterface, InterfacesLargerI> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)anotherFunc;
- (int32_t)rand;
@end
@interface InterfacesSameI : NSObject <goSeqRefInterface, InterfacesSameI> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (int32_t)rand;
@end
@interface InterfacesWithParam : NSObject <goSeqRefInterface, InterfacesWithParam> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)hasParam:(BOOL)p0;
@end
#endif

351
bind/testdata/interfaces.objc.m.golden vendored Normal file
View file

@ -0,0 +1,351 @@
// Objective-C API for talking to interfaces Go package.
// gobind -lang=objc interfaces
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Interfaces.objc.h"
@implementation InterfacesError {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (BOOL)err:(NSError* _Nullable* _Nullable)error {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxyinterfaces_Error_Err(refnum);
Universeerror* _error = nil;
GoSeqRef* _error_ref = go_seq_from_refnum(r0);
if (_error_ref != NULL) {
_error = _error_ref.obj;
if (_error == nil) {
_error = [[Universeerror alloc] initWithRef:_error_ref];
}
}
if (_error != nil && error != nil) {
*error = _error;
}
return (_error == nil);
}
@end
@implementation InterfacesI {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (int32_t)rand {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxyinterfaces_I_Rand(refnum);
int32_t _ret0_ = (int32_t)r0;
return _ret0_;
}
@end
@implementation InterfacesI1 {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)j {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxyinterfaces_I1_J(refnum);
}
@end
@implementation InterfacesI2 {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)g {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxyinterfaces_I2_G(refnum);
}
@end
@implementation InterfacesI3 {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (InterfacesI1* _Nullable)f {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxyinterfaces_I3_F(refnum);
InterfacesI1* _ret0_ = nil;
GoSeqRef* _ret0__ref = go_seq_from_refnum(r0);
if (_ret0__ref != NULL) {
_ret0_ = _ret0__ref.obj;
if (_ret0_ == nil) {
_ret0_ = [[InterfacesI1 alloc] initWithRef:_ret0__ref];
}
}
return _ret0_;
}
@end
@implementation InterfacesInterfaces {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)someMethod {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxyinterfaces_Interfaces_SomeMethod(refnum);
}
@end
@implementation InterfacesLargerI {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)anotherFunc {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxyinterfaces_LargerI_AnotherFunc(refnum);
}
- (int32_t)rand {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxyinterfaces_LargerI_Rand(refnum);
int32_t _ret0_ = (int32_t)r0;
return _ret0_;
}
@end
@implementation InterfacesSameI {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (int32_t)rand {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxyinterfaces_SameI_Rand(refnum);
int32_t _ret0_ = (int32_t)r0;
return _ret0_;
}
@end
@implementation InterfacesWithParam {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)hasParam:(BOOL)p0 {
int32_t refnum = go_seq_go_to_refnum(self._ref);
char _p0 = (char)p0;
proxyinterfaces_WithParam_HasParam(refnum, _p0);
}
@end
int32_t InterfacesAdd3(id<InterfacesI> _Nullable r) {
int32_t _r;
if ([r conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> r_proxy = (id<goSeqRefInterface>)(r);
_r = go_seq_go_to_refnum(r_proxy._ref);
} else {
_r = go_seq_to_refnum(r);
}
int32_t r0 = proxyinterfaces__Add3(_r);
int32_t _ret0_ = (int32_t)r0;
return _ret0_;
}
BOOL InterfacesCallErr(id<InterfacesError> _Nullable e, NSError* _Nullable* _Nullable error) {
int32_t _e;
if ([e conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> e_proxy = (id<goSeqRefInterface>)(e);
_e = go_seq_go_to_refnum(e_proxy._ref);
} else {
_e = go_seq_to_refnum(e);
}
int32_t r0 = proxyinterfaces__CallErr(_e);
Universeerror* _error = nil;
GoSeqRef* _error_ref = go_seq_from_refnum(r0);
if (_error_ref != NULL) {
_error = _error_ref.obj;
if (_error == nil) {
_error = [[Universeerror alloc] initWithRef:_error_ref];
}
}
if (_error != nil && error != nil) {
*error = _error;
}
return (_error == nil);
}
id<InterfacesI> _Nullable InterfacesSeven(void) {
int32_t r0 = proxyinterfaces__Seven();
InterfacesI* _ret0_ = nil;
GoSeqRef* _ret0__ref = go_seq_from_refnum(r0);
if (_ret0__ref != NULL) {
_ret0_ = _ret0__ref.obj;
if (_ret0_ == nil) {
_ret0_ = [[InterfacesI alloc] initWithRef:_ret0__ref];
}
}
return _ret0_;
}
int32_t cproxyinterfaces_Error_Err(int32_t refnum) {
@autoreleasepool {
InterfacesError* o = go_seq_objc_from_refnum(refnum);
NSError* error = nil;
BOOL returnVal = [o err:&error];
NSError *_error = nil;
if (!returnVal) {
_error = error;
}
int32_t __error;
if ([_error conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> _error_proxy = (id<goSeqRefInterface>)(_error);
__error = go_seq_go_to_refnum(_error_proxy._ref);
} else {
__error = go_seq_to_refnum(_error);
}
return __error;
}
}
int32_t cproxyinterfaces_I_Rand(int32_t refnum) {
@autoreleasepool {
InterfacesI* o = go_seq_objc_from_refnum(refnum);
int32_t ret0_;
ret0_ = [o rand];
int32_t _ret0_ = (int32_t)ret0_;
return _ret0_;
}
}
void cproxyinterfaces_I1_J(int32_t refnum) {
@autoreleasepool {
InterfacesI1* o = go_seq_objc_from_refnum(refnum);
[o j];
}
}
void cproxyinterfaces_I2_G(int32_t refnum) {
@autoreleasepool {
InterfacesI2* o = go_seq_objc_from_refnum(refnum);
[o g];
}
}
int32_t cproxyinterfaces_I3_F(int32_t refnum) {
@autoreleasepool {
InterfacesI3* o = go_seq_objc_from_refnum(refnum);
InterfacesI1* _Nullable ret0_;
ret0_ = [o f];
int32_t _ret0_;
if ([ret0_ conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> ret0__proxy = (id<goSeqRefInterface>)(ret0_);
_ret0_ = go_seq_go_to_refnum(ret0__proxy._ref);
} else {
_ret0_ = go_seq_to_refnum(ret0_);
}
return _ret0_;
}
}
void cproxyinterfaces_Interfaces_SomeMethod(int32_t refnum) {
@autoreleasepool {
InterfacesInterfaces* o = go_seq_objc_from_refnum(refnum);
[o someMethod];
}
}
void cproxyinterfaces_LargerI_AnotherFunc(int32_t refnum) {
@autoreleasepool {
InterfacesLargerI* o = go_seq_objc_from_refnum(refnum);
[o anotherFunc];
}
}
int32_t cproxyinterfaces_LargerI_Rand(int32_t refnum) {
@autoreleasepool {
InterfacesLargerI* o = go_seq_objc_from_refnum(refnum);
int32_t ret0_;
ret0_ = [o rand];
int32_t _ret0_ = (int32_t)ret0_;
return _ret0_;
}
}
int32_t cproxyinterfaces_SameI_Rand(int32_t refnum) {
@autoreleasepool {
InterfacesSameI* o = go_seq_objc_from_refnum(refnum);
int32_t ret0_;
ret0_ = [o rand];
int32_t _ret0_ = (int32_t)ret0_;
return _ret0_;
}
}
void cproxyinterfaces_WithParam_HasParam(int32_t refnum, char p0) {
@autoreleasepool {
InterfacesWithParam* o = go_seq_objc_from_refnum(refnum);
BOOL _p0 = p0 ? YES : NO;
[o hasParam:_p0];
}
}
__attribute__((constructor)) static void init() {
init_seq();
}

14
bind/testdata/issue10788.go vendored Normal file
View file

@ -0,0 +1,14 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package issue10788
type TestStruct struct {
Value string
}
type TestInterface interface {
DoSomeWork(s *TestStruct)
MultipleUnnamedParams(_ int, p0 string, 日本 int64)
}

86
bind/testdata/issue10788.go.golden vendored Normal file
View file

@ -0,0 +1,86 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package issue10788.
//
// autogenerated by gobind -lang=go issue10788
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "issue10788.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"issue10788"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyissue10788_TestStruct_Value_Set
func proxyissue10788_TestStruct_Value_Set(refnum C.int32_t, v C.nstring) {
ref := _seq.FromRefNum(int32(refnum))
_v := decodeString(v)
ref.Get().(*issue10788.TestStruct).Value = _v
}
//export proxyissue10788_TestStruct_Value_Get
func proxyissue10788_TestStruct_Value_Get(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*issue10788.TestStruct).Value
_v := encodeString(v)
return _v
}
//export new_issue10788_TestStruct
func new_issue10788_TestStruct() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(issue10788.TestStruct)))
}
//export proxyissue10788_TestInterface_DoSomeWork
func proxyissue10788_TestInterface_DoSomeWork(refnum C.int32_t, param_s C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(issue10788.TestInterface)
// Must be a Go object
var _param_s *issue10788.TestStruct
if _param_s_ref := _seq.FromRefNum(int32(param_s)); _param_s_ref != nil {
_param_s = _param_s_ref.Get().(*issue10788.TestStruct)
}
v.DoSomeWork(_param_s)
}
//export proxyissue10788_TestInterface_MultipleUnnamedParams
func proxyissue10788_TestInterface_MultipleUnnamedParams(refnum C.int32_t, param_p0 C.nint, param_p1 C.nstring, param_日本 C.int64_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(issue10788.TestInterface)
_param_p0 := int(param_p0)
_param_p1 := decodeString(param_p1)
_param_日本 := int64(param_日本)
v.MultipleUnnamedParams(_param_p0, _param_p1, _param_日本)
}
type proxyissue10788_TestInterface _seq.Ref
func (p *proxyissue10788_TestInterface) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyissue10788_TestInterface) DoSomeWork(param_s *issue10788.TestStruct) {
var _param_s C.int32_t = _seq.NullRefNum
if param_s != nil {
_param_s = C.int32_t(_seq.ToRefNum(param_s))
}
C.cproxyissue10788_TestInterface_DoSomeWork(C.int32_t(p.Bind_proxy_refnum__()), _param_s)
}
func (p *proxyissue10788_TestInterface) MultipleUnnamedParams(param_p0 int, param_p1 string, param_日本 int64) {
_param_p0 := C.nint(param_p0)
_param_p1 := encodeString(param_p1)
_param_日本 := C.int64_t(param_日本)
C.cproxyissue10788_TestInterface_MultipleUnnamedParams(C.int32_t(p.Bind_proxy_refnum__()), _param_p0, _param_p1, _param_日本)
}

88
bind/testdata/issue10788.java.c.golden vendored Normal file
View file

@ -0,0 +1,88 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue10788
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "issue10788.h"
jclass proxy_class_issue10788_TestInterface;
jmethodID proxy_class_issue10788_TestInterface_cons;
static jmethodID mid_TestInterface_DoSomeWork;
static jmethodID mid_TestInterface_MultipleUnnamedParams;
jclass proxy_class_issue10788_TestStruct;
jmethodID proxy_class_issue10788_TestStruct_cons;
JNIEXPORT void JNICALL
Java_issue10788_Issue10788__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "issue10788/TestStruct");
proxy_class_issue10788_TestStruct = (*env)->NewGlobalRef(env, clazz);
proxy_class_issue10788_TestStruct_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "issue10788/Issue10788$proxyTestInterface");
proxy_class_issue10788_TestInterface = (*env)->NewGlobalRef(env, clazz);
proxy_class_issue10788_TestInterface_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "issue10788/TestInterface");
mid_TestInterface_DoSomeWork = (*env)->GetMethodID(env, clazz, "doSomeWork", "(Lissue10788/TestStruct;)V");
mid_TestInterface_MultipleUnnamedParams = (*env)->GetMethodID(env, clazz, "multipleUnnamedParams", "(JLjava/lang/String;J)V");
}
JNIEXPORT jint JNICALL
Java_issue10788_TestStruct__1_1New(JNIEnv *env, jclass clazz) {
return new_issue10788_TestStruct();
}
JNIEXPORT void JNICALL
Java_issue10788_TestStruct_setValue(JNIEnv *env, jobject this, jstring v) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring _v = go_seq_from_java_string(env, v);
proxyissue10788_TestStruct_Value_Set(o, _v);
}
JNIEXPORT jstring JNICALL
Java_issue10788_TestStruct_getValue(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(env, this);
nstring r0 = proxyissue10788_TestStruct_Value_Get(o);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
JNIEXPORT void JNICALL
Java_issue10788_Issue10788_00024proxyTestInterface_doSomeWork(JNIEnv* env, jobject __this__, jobject s) {
int32_t o = go_seq_to_refnum_go(env, __this__);
int32_t _s = go_seq_to_refnum(env, s);
proxyissue10788_TestInterface_DoSomeWork(o, _s);
}
void cproxyissue10788_TestInterface_DoSomeWork(int32_t refnum, int32_t s) {
JNIEnv *env = go_seq_push_local_frame(1);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_issue10788_TestInterface, proxy_class_issue10788_TestInterface_cons);
jobject _s = go_seq_from_refnum(env, s, proxy_class_issue10788_TestStruct, proxy_class_issue10788_TestStruct_cons);
(*env)->CallVoidMethod(env, o, mid_TestInterface_DoSomeWork, _s);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_issue10788_Issue10788_00024proxyTestInterface_multipleUnnamedParams(JNIEnv* env, jobject __this__, jlong p0, jstring p1, jlong p2) {
int32_t o = go_seq_to_refnum_go(env, __this__);
nint _p0 = (nint)p0;
nstring _p1 = go_seq_from_java_string(env, p1);
int64_t _p2 = (int64_t)p2;
proxyissue10788_TestInterface_MultipleUnnamedParams(o, _p0, _p1, _p2);
}
void cproxyissue10788_TestInterface_MultipleUnnamedParams(int32_t refnum, nint p0, nstring p1, int64_t p2) {
JNIEnv *env = go_seq_push_local_frame(3);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_issue10788_TestInterface, proxy_class_issue10788_TestInterface_cons);
jlong _p0 = (jlong)p0;
jstring _p1 = go_seq_to_java_string(env, p1);
jlong _p2 = (jlong)p2;
(*env)->CallVoidMethod(env, o, mid_TestInterface_MultipleUnnamedParams, _p0, _p1, _p2);
go_seq_pop_local_frame(env);
}

110
bind/testdata/issue10788.java.golden vendored Normal file
View file

@ -0,0 +1,110 @@
// Code generated by gobind. DO NOT EDIT.
// Java class issue10788.TestStruct is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue10788
package issue10788;
import go.Seq;
public final class TestStruct implements Seq.Proxy {
static { Issue10788.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
TestStruct(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public TestStruct() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public final native String getValue();
public final native void setValue(String v);
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof TestStruct)) {
return false;
}
TestStruct that = (TestStruct)o;
String thisValue = getValue();
String thatValue = that.getValue();
if (thisValue == null) {
if (thatValue != null) {
return false;
}
} else if (!thisValue.equals(thatValue)) {
return false;
}
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {getValue()});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("TestStruct").append("{");
b.append("Value:").append(getValue()).append(",");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class issue10788.TestInterface is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue10788
package issue10788;
import go.Seq;
public interface TestInterface {
public void doSomeWork(TestStruct s);
public void multipleUnnamedParams(long p0, String p1, long p2);
}
// Code generated by gobind. DO NOT EDIT.
// Java class issue10788.Issue10788 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue10788
package issue10788;
import go.Seq;
public abstract class Issue10788 {
static {
Seq.touch(); // for loading the native library
_init();
}
private Issue10788() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyTestInterface implements Seq.Proxy, TestInterface {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyTestInterface(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void doSomeWork(TestStruct s);
public native void multipleUnnamedParams(long p0, String p1, long p2);
}
}

21
bind/testdata/issue10788.java.h.golden vendored Normal file
View file

@ -0,0 +1,21 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue10788
#ifndef __Issue10788_H__
#define __Issue10788_H__
#include <jni.h>
extern jclass proxy_class_issue10788_TestInterface;
extern jmethodID proxy_class_issue10788_TestInterface_cons;
void cproxyissue10788_TestInterface_DoSomeWork(int32_t refnum, int32_t s);
void cproxyissue10788_TestInterface_MultipleUnnamedParams(int32_t refnum, nint p0, nstring p1, int64_t p2);
extern jclass proxy_class_issue10788_TestStruct;
extern jmethodID proxy_class_issue10788_TestStruct_cons;
#endif

View file

@ -0,0 +1,15 @@
// Objective-C API for talking to issue10788 Go package.
// gobind -lang=objc issue10788
//
// File is generated by gobind. Do not edit.
#ifndef __GO_issue10788_H__
#define __GO_issue10788_H__
#include <stdint.h>
#include <objc/objc.h>
void cproxyissue10788_TestInterface_DoSomeWork(int32_t refnum, int32_t s);
void cproxyissue10788_TestInterface_MultipleUnnamedParams(int32_t refnum, nint p0, nstring p1, int64_t 日本);
#endif

43
bind/testdata/issue10788.objc.h.golden vendored Normal file
View file

@ -0,0 +1,43 @@
// Objective-C API for talking to issue10788 Go package.
// gobind -lang=objc issue10788
//
// File is generated by gobind. Do not edit.
#ifndef __Issue10788_H__
#define __Issue10788_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@class Issue10788TestStruct;
@protocol Issue10788TestInterface;
@class Issue10788TestInterface;
@protocol Issue10788TestInterface <NSObject>
- (void)doSomeWork:(Issue10788TestStruct* _Nullable)s;
- (void)multipleUnnamedParams:(long)p0 p1:(NSString* _Nullable)p1 日本:(int64_t)日本;
@end
@interface Issue10788TestStruct : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSString* _Nonnull value;
@end
@class Issue10788TestInterface;
@interface Issue10788TestInterface : NSObject <goSeqRefInterface, Issue10788TestInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)doSomeWork:(Issue10788TestStruct* _Nullable)s;
- (void)multipleUnnamedParams:(long)p0 p1:(NSString* _Nullable)p1 日本:(int64_t)日本;
@end
#endif

105
bind/testdata/issue10788.objc.m.golden vendored Normal file
View file

@ -0,0 +1,105 @@
// Objective-C API for talking to issue10788 Go package.
// gobind -lang=objc issue10788
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Issue10788.objc.h"
@implementation Issue10788TestStruct {
}
- (nonnull instancetype)initWithRef:(_Nonnull id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (nonnull instancetype)init {
self = [super init];
if (self) {
__ref = go_seq_from_refnum(new_issue10788_TestStruct());
}
return self;
}
- (NSString* _Nonnull)value {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring r0 = proxyissue10788_TestStruct_Value_Get(refnum);
NSString *_r0 = go_seq_to_objc_string(r0);
return _r0;
}
- (void)setValue:(NSString* _Nonnull)v {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring _v = go_seq_from_objc_string(v);
proxyissue10788_TestStruct_Value_Set(refnum, _v);
}
@end
@implementation Issue10788TestInterface {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)doSomeWork:(Issue10788TestStruct* _Nullable)s {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t _s;
if ([s conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> s_proxy = (id<goSeqRefInterface>)(s);
_s = go_seq_go_to_refnum(s_proxy._ref);
} else {
_s = go_seq_to_refnum(s);
}
proxyissue10788_TestInterface_DoSomeWork(refnum, _s);
}
- (void)multipleUnnamedParams:(long)p0 p1:(NSString* _Nullable)p1 日本:(int64_t)日本 {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nint _p0 = (nint)p0;
nstring _p1 = go_seq_from_objc_string(p1);
int64_t _日本 = (int64_t)日本;
proxyissue10788_TestInterface_MultipleUnnamedParams(refnum, _p0, _p1, _日本);
}
@end
void cproxyissue10788_TestInterface_DoSomeWork(int32_t refnum, int32_t s) {
@autoreleasepool {
Issue10788TestInterface* o = go_seq_objc_from_refnum(refnum);
Issue10788TestStruct* _s = nil;
GoSeqRef* _s_ref = go_seq_from_refnum(s);
if (_s_ref != NULL) {
_s = _s_ref.obj;
if (_s == nil) {
_s = [[Issue10788TestStruct alloc] initWithRef:_s_ref];
}
}
[o doSomeWork:_s];
}
}
void cproxyissue10788_TestInterface_MultipleUnnamedParams(int32_t refnum, nint p0, nstring p1, int64_t 日本) {
@autoreleasepool {
Issue10788TestInterface* o = go_seq_objc_from_refnum(refnum);
long _p0 = (long)p0;
NSString *_p1 = go_seq_to_objc_string(p1);
int64_t _日本 = (int64_t)日本;
[o multipleUnnamedParams:_p0 p1:_p1 日本:_日本];
}
}
__attribute__((constructor)) static void init() {
init_seq();
}

9
bind/testdata/issue12328.go vendored Normal file
View file

@ -0,0 +1,9 @@
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package issue12328
type T struct {
Err error
}

54
bind/testdata/issue12328.go.golden vendored Normal file
View file

@ -0,0 +1,54 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package issue12328.
//
// autogenerated by gobind -lang=go issue12328
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "issue12328.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"issue12328"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyissue12328_T_Err_Set
func proxyissue12328_T_Err_Set(refnum C.int32_t, v C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
var _v error
_v_ref := _seq.FromRefNum(int32(v))
if _v_ref != nil {
if v < 0 { // go object
_v = _v_ref.Get().(error)
} else { // foreign object
_v = (*proxy_error)(_v_ref)
}
}
ref.Get().(*issue12328.T).Err = _v
}
//export proxyissue12328_T_Err_Get
func proxyissue12328_T_Err_Get(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*issue12328.T).Err
var _v C.int32_t = _seq.NullRefNum
if v != nil {
_v = C.int32_t(_seq.ToRefNum(v))
}
return _v
}
//export new_issue12328_T
func new_issue12328_T() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(issue12328.T)))
}

43
bind/testdata/issue12328.java.c.golden vendored Normal file
View file

@ -0,0 +1,43 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue12328
#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_issue12328_Issue12328__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "issue12328/T");
proxy_class_issue12328_T = (*env)->NewGlobalRef(env, clazz);
proxy_class_issue12328_T_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
}
JNIEXPORT jint JNICALL
Java_issue12328_T__1_1New(JNIEnv *env, jclass clazz) {
return new_issue12328_T();
}
JNIEXPORT void JNICALL
Java_issue12328_T_setErr(JNIEnv *env, jobject this, jobject v) {
int32_t o = go_seq_to_refnum_go(env, this);
int32_t _v = go_seq_to_refnum(env, v);
proxyissue12328_T_Err_Set(o, _v);
}
JNIEXPORT jobject JNICALL
Java_issue12328_T_getErr(JNIEnv *env, jobject this) {
int32_t o = go_seq_to_refnum_go(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;
}

82
bind/testdata/issue12328.java.golden vendored Normal file
View file

@ -0,0 +1,82 @@
// Code generated by gobind. DO NOT EDIT.
// Java class issue12328.T is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue12328
package issue12328;
import go.Seq;
public final class T implements Seq.Proxy {
static { Issue12328.touch(); }
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
T(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public T() { this.refnum = __New(); Seq.trackGoRef(refnum, this); }
private static native int __New();
public final native java.lang.Exception getErr();
public final native void setErr(java.lang.Exception v);
@Override public boolean equals(Object o) {
if (o == null || !(o instanceof T)) {
return false;
}
T that = (T)o;
java.lang.Exception thisErr = getErr();
java.lang.Exception thatErr = that.getErr();
if (thisErr == null) {
if (thatErr != null) {
return false;
}
} else if (!thisErr.equals(thatErr)) {
return false;
}
return true;
}
@Override public int hashCode() {
return java.util.Arrays.hashCode(new Object[] {getErr()});
}
@Override public String toString() {
StringBuilder b = new StringBuilder();
b.append("T").append("{");
b.append("Err:").append(getErr()).append(",");
return b.append("}").toString();
}
}
// Code generated by gobind. DO NOT EDIT.
// Java class issue12328.Issue12328 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue12328
package issue12328;
import go.Seq;
public abstract class Issue12328 {
static {
Seq.touch(); // for loading the native library
_init();
}
private Issue12328() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
}

14
bind/testdata/issue12328.java.h.golden vendored Normal file
View file

@ -0,0 +1,14 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue12328
#ifndef __Issue12328_H__
#define __Issue12328_H__
#include <jni.h>
extern jclass proxy_class_issue12328_T;
extern jmethodID proxy_class_issue12328_T_cons;
#endif

View file

@ -0,0 +1,11 @@
// Objective-C API for talking to issue12328 Go package.
// gobind -lang=objc issue12328
//
// File is generated by gobind. Do not edit.
#ifndef __GO_issue12328_H__
#define __GO_issue12328_H__
#include <stdint.h>
#include <objc/objc.h>
#endif

25
bind/testdata/issue12328.objc.h.golden vendored Normal file
View file

@ -0,0 +1,25 @@
// Objective-C API for talking to issue12328 Go package.
// gobind -lang=objc issue12328
//
// File is generated by gobind. Do not edit.
#ifndef __Issue12328_H__
#define __Issue12328_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@class Issue12328T;
@interface Issue12328T : NSObject <goSeqRefInterface> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (nonnull instancetype)init;
@property (nonatomic) NSError* _Nullable err;
@end
#endif

61
bind/testdata/issue12328.objc.m.golden vendored Normal file
View file

@ -0,0 +1,61 @@
// Objective-C API for talking to issue12328 Go package.
// gobind -lang=objc issue12328
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Issue12328.objc.h"
@implementation Issue12328T {
}
- (nonnull instancetype)initWithRef:(_Nonnull id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (nonnull instancetype)init {
self = [super init];
if (self) {
__ref = go_seq_from_refnum(new_issue12328_T());
}
return self;
}
- (NSError* _Nullable)err {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t r0 = proxyissue12328_T_Err_Get(refnum);
Universeerror* _r0 = nil;
GoSeqRef* _r0_ref = go_seq_from_refnum(r0);
if (_r0_ref != NULL) {
_r0 = _r0_ref.obj;
if (_r0 == nil) {
_r0 = [[Universeerror alloc] initWithRef:_r0_ref];
}
}
return _r0;
}
- (void)setErr:(NSError* _Nullable)v {
int32_t refnum = go_seq_go_to_refnum(self._ref);
int32_t _v;
if ([v conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> v_proxy = (id<goSeqRefInterface>)(v);
_v = go_seq_go_to_refnum(v_proxy._ref);
} else {
_v = go_seq_to_refnum(v);
}
proxyissue12328_T_Err_Set(refnum, _v);
}
@end
__attribute__((constructor)) static void init() {
init_seq();
}

6
bind/testdata/issue12403.go vendored Normal file
View file

@ -0,0 +1,6 @@
package issue12403
type Parsable interface {
FromJSON(jstr string) string
ToJSON() (string, error)
}

74
bind/testdata/issue12403.go.golden vendored Normal file
View file

@ -0,0 +1,74 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package issue12403.
//
// autogenerated by gobind -lang=go issue12403
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "issue12403.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"issue12403"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyissue12403_Parsable_FromJSON
func proxyissue12403_Parsable_FromJSON(refnum C.int32_t, param_jstr C.nstring) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(issue12403.Parsable)
_param_jstr := decodeString(param_jstr)
res_0 := v.FromJSON(_param_jstr)
_res_0 := encodeString(res_0)
return _res_0
}
//export proxyissue12403_Parsable_ToJSON
func proxyissue12403_Parsable_ToJSON(refnum C.int32_t) (C.nstring, C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(issue12403.Parsable)
res_0, res_1 := v.ToJSON()
_res_0 := encodeString(res_0)
var _res_1 C.int32_t = _seq.NullRefNum
if res_1 != nil {
_res_1 = C.int32_t(_seq.ToRefNum(res_1))
}
return _res_0, _res_1
}
type proxyissue12403_Parsable _seq.Ref
func (p *proxyissue12403_Parsable) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyissue12403_Parsable) FromJSON(param_jstr string) string {
_param_jstr := encodeString(param_jstr)
res := C.cproxyissue12403_Parsable_FromJSON(C.int32_t(p.Bind_proxy_refnum__()), _param_jstr)
_res := decodeString(res)
return _res
}
func (p *proxyissue12403_Parsable) ToJSON() (string, error) {
res := C.cproxyissue12403_Parsable_ToJSON(C.int32_t(p.Bind_proxy_refnum__()))
res_0 := decodeString(res.r0)
var res_1 error
res_1_ref := _seq.FromRefNum(int32(res.r1))
if res_1_ref != nil {
if res.r1 < 0 { // go object
res_1 = res_1_ref.Get().(error)
} else { // foreign object
res_1 = (*proxy_error)(res_1_ref)
}
}
return res_0, res_1
}

75
bind/testdata/issue12403.java.c.golden vendored Normal file
View file

@ -0,0 +1,75 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue12403
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "issue12403.h"
jclass proxy_class_issue12403_Parsable;
jmethodID proxy_class_issue12403_Parsable_cons;
static jmethodID mid_Parsable_FromJSON;
static jmethodID mid_Parsable_ToJSON;
JNIEXPORT void JNICALL
Java_issue12403_Issue12403__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "issue12403/Issue12403$proxyParsable");
proxy_class_issue12403_Parsable = (*env)->NewGlobalRef(env, clazz);
proxy_class_issue12403_Parsable_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "issue12403/Parsable");
mid_Parsable_FromJSON = (*env)->GetMethodID(env, clazz, "fromJSON", "(Ljava/lang/String;)Ljava/lang/String;");
mid_Parsable_ToJSON = (*env)->GetMethodID(env, clazz, "toJSON", "()Ljava/lang/String;");
}
JNIEXPORT jstring JNICALL
Java_issue12403_Issue12403_00024proxyParsable_fromJSON(JNIEnv* env, jobject __this__, jstring jstr) {
int32_t o = go_seq_to_refnum_go(env, __this__);
nstring _jstr = go_seq_from_java_string(env, jstr);
nstring r0 = proxyissue12403_Parsable_FromJSON(o, _jstr);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
nstring cproxyissue12403_Parsable_FromJSON(int32_t refnum, nstring jstr) {
JNIEnv *env = go_seq_push_local_frame(1);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_issue12403_Parsable, proxy_class_issue12403_Parsable_cons);
jstring _jstr = go_seq_to_java_string(env, jstr);
jstring res = (*env)->CallObjectMethod(env, o, mid_Parsable_FromJSON, _jstr);
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
return _res;
}
JNIEXPORT jstring JNICALL
Java_issue12403_Issue12403_00024proxyParsable_toJSON(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
struct proxyissue12403_Parsable_ToJSON_return res = proxyissue12403_Parsable_ToJSON(o);
jstring _r0 = go_seq_to_java_string(env, res.r0);
jobject _r1 = go_seq_from_refnum(env, res.r1, proxy_class__error, proxy_class__error_cons);
go_seq_maybe_throw_exception(env, _r1);
return _r0;
}
struct cproxyissue12403_Parsable_ToJSON_return cproxyissue12403_Parsable_ToJSON(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_issue12403_Parsable, proxy_class_issue12403_Parsable_cons);
jstring res = (*env)->CallObjectMethod(env, o, mid_Parsable_ToJSON);
jobject exc = go_seq_get_exception(env);
int32_t _exc = go_seq_to_refnum(env, exc);
if (exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
cproxyissue12403_Parsable_ToJSON_return sres = {
_res, _exc
};
go_seq_pop_local_frame(env);
return sres;
}

53
bind/testdata/issue12403.java.golden vendored Normal file
View file

@ -0,0 +1,53 @@
// Code generated by gobind. DO NOT EDIT.
// Java class issue12403.Parsable is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue12403
package issue12403;
import go.Seq;
public interface Parsable {
public String fromJSON(String jstr);
public String toJSON() throws Exception;
}
// Code generated by gobind. DO NOT EDIT.
// Java class issue12403.Issue12403 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue12403
package issue12403;
import go.Seq;
public abstract class Issue12403 {
static {
Seq.touch(); // for loading the native library
_init();
}
private Issue12403() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyParsable implements Seq.Proxy, Parsable {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyParsable(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native String fromJSON(String jstr);
public native String toJSON() throws Exception;
}
}

23
bind/testdata/issue12403.java.h.golden vendored Normal file
View file

@ -0,0 +1,23 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue12403
#ifndef __Issue12403_H__
#define __Issue12403_H__
#include <jni.h>
extern jclass proxy_class_issue12403_Parsable;
extern jmethodID proxy_class_issue12403_Parsable_cons;
nstring cproxyissue12403_Parsable_FromJSON(int32_t refnum, nstring jstr);
typedef struct cproxyissue12403_Parsable_ToJSON_return {
nstring r0;
int32_t r1;
} cproxyissue12403_Parsable_ToJSON_return;
struct cproxyissue12403_Parsable_ToJSON_return cproxyissue12403_Parsable_ToJSON(int32_t refnum);
#endif

View file

@ -0,0 +1,19 @@
// Objective-C API for talking to issue12403 Go package.
// gobind -lang=objc issue12403
//
// File is generated by gobind. Do not edit.
#ifndef __GO_issue12403_H__
#define __GO_issue12403_H__
#include <stdint.h>
#include <objc/objc.h>
nstring cproxyissue12403_Parsable_FromJSON(int32_t refnum, nstring jstr);
typedef struct cproxyissue12403_Parsable_ToJSON_return {
nstring r0;
int32_t r1;
} cproxyissue12403_Parsable_ToJSON_return;
struct cproxyissue12403_Parsable_ToJSON_return cproxyissue12403_Parsable_ToJSON(int32_t refnum);
#endif

33
bind/testdata/issue12403.objc.h.golden vendored Normal file
View file

@ -0,0 +1,33 @@
// Objective-C API for talking to issue12403 Go package.
// gobind -lang=objc issue12403
//
// File is generated by gobind. Do not edit.
#ifndef __Issue12403_H__
#define __Issue12403_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@protocol Issue12403Parsable;
@class Issue12403Parsable;
@protocol Issue12403Parsable <NSObject>
- (NSString* _Nonnull)fromJSON:(NSString* _Nullable)jstr;
- (NSString* _Nonnull)toJSON:(NSError* _Nullable* _Nullable)error;
@end
@class Issue12403Parsable;
@interface Issue12403Parsable : NSObject <goSeqRefInterface, Issue12403Parsable> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (NSString* _Nonnull)fromJSON:(NSString* _Nullable)jstr;
- (NSString* _Nonnull)toJSON:(NSError* _Nullable* _Nullable)error;
@end
#endif

91
bind/testdata/issue12403.objc.m.golden vendored Normal file
View file

@ -0,0 +1,91 @@
// Objective-C API for talking to issue12403 Go package.
// gobind -lang=objc issue12403
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Issue12403.objc.h"
@implementation Issue12403Parsable {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (NSString* _Nonnull)fromJSON:(NSString* _Nullable)jstr {
int32_t refnum = go_seq_go_to_refnum(self._ref);
nstring _jstr = go_seq_from_objc_string(jstr);
nstring r0 = proxyissue12403_Parsable_FromJSON(refnum, _jstr);
NSString *_ret0_ = go_seq_to_objc_string(r0);
return _ret0_;
}
- (NSString* _Nonnull)toJSON:(NSError* _Nullable* _Nullable)error {
int32_t refnum = go_seq_go_to_refnum(self._ref);
struct proxyissue12403_Parsable_ToJSON_return res = proxyissue12403_Parsable_ToJSON(refnum);
NSString *_ret0_ = go_seq_to_objc_string(res.r0);
Universeerror* _error = nil;
GoSeqRef* _error_ref = go_seq_from_refnum(res.r1);
if (_error_ref != NULL) {
_error = _error_ref.obj;
if (_error == nil) {
_error = [[Universeerror alloc] initWithRef:_error_ref];
}
}
if (_error != nil && error != nil) {
*error = _error;
}
if (_error != nil) {
return nil;
}
return _ret0_;
}
@end
nstring cproxyissue12403_Parsable_FromJSON(int32_t refnum, nstring jstr) {
@autoreleasepool {
Issue12403Parsable* o = go_seq_objc_from_refnum(refnum);
NSString *_jstr = go_seq_to_objc_string(jstr);
NSString* _Nonnull ret0_;
ret0_ = [o fromJSON:_jstr];
nstring _ret0_ = go_seq_from_objc_string(ret0_);
return _ret0_;
}
}
struct cproxyissue12403_Parsable_ToJSON_return cproxyissue12403_Parsable_ToJSON(int32_t refnum) {
@autoreleasepool {
Issue12403Parsable* o = go_seq_objc_from_refnum(refnum);
NSString* _Nonnull ret0_;
NSError* error = nil;
ret0_ = [o toJSON:&error];
nstring _ret0_ = go_seq_from_objc_string(ret0_);
NSError *_error = nil;
if (error != nil) {
_error = error;
}
int32_t __error;
if ([_error conformsToProtocol:@protocol(goSeqRefInterface)]) {
id<goSeqRefInterface> _error_proxy = (id<goSeqRefInterface>)(_error);
__error = go_seq_go_to_refnum(_error_proxy._ref);
} else {
__error = go_seq_to_refnum(_error);
}
cproxyissue12403_Parsable_ToJSON_return _sres = {
_ret0_, __error
};
return _sres;
}
}
__attribute__((constructor)) static void init() {
init_seq();
}

5
bind/testdata/issue29559.go vendored Normal file
View file

@ -0,0 +1,5 @@
package issue29559
type AString = string
func TakesAString(s AString) {}

29
bind/testdata/issue29559.go.golden vendored Normal file
View file

@ -0,0 +1,29 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package issue29559.
//
// autogenerated by gobind -lang=go issue29559
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "issue29559.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"issue29559"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyissue29559__TakesAString
func proxyissue29559__TakesAString(param_s C.nstring) {
_param_s := decodeString(param_s)
issue29559.TakesAString(_param_s)
}

24
bind/testdata/issue29559.java.c.golden vendored Normal file
View file

@ -0,0 +1,24 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue29559
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "issue29559.h"
JNIEXPORT void JNICALL
Java_issue29559_Issue29559__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
}
JNIEXPORT void JNICALL
Java_issue29559_Issue29559_takesAString(JNIEnv* env, jclass _clazz, jstring s) {
nstring _s = go_seq_from_java_string(env, s);
proxyissue29559__TakesAString(_s);
}

26
bind/testdata/issue29559.java.golden vendored Normal file
View file

@ -0,0 +1,26 @@
// Code generated by gobind. DO NOT EDIT.
// Java class issue29559.Issue29559 is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java issue29559
package issue29559;
import go.Seq;
public abstract class Issue29559 {
static {
Seq.touch(); // for loading the native library
_init();
}
private Issue29559() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
public static native void takesAString(String s);
}

12
bind/testdata/issue29559.java.h.golden vendored Normal file
View file

@ -0,0 +1,12 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java issue29559
#ifndef __Issue29559_H__
#define __Issue29559_H__
#include <jni.h>
#endif

View file

@ -0,0 +1,11 @@
// Objective-C API for talking to issue29559 Go package.
// gobind -lang=objc issue29559
//
// File is generated by gobind. Do not edit.
#ifndef __GO_issue29559_H__
#define __GO_issue29559_H__
#include <stdint.h>
#include <objc/objc.h>
#endif

16
bind/testdata/issue29559.objc.h.golden vendored Normal file
View file

@ -0,0 +1,16 @@
// Objective-C API for talking to issue29559 Go package.
// gobind -lang=objc issue29559
//
// File is generated by gobind. Do not edit.
#ifndef __Issue29559_H__
#define __Issue29559_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
FOUNDATION_EXPORT void Issue29559TakesAString(NSString* _Nullable s);
#endif

19
bind/testdata/issue29559.objc.m.golden vendored Normal file
View file

@ -0,0 +1,19 @@
// Objective-C API for talking to issue29559 Go package.
// gobind -lang=objc issue29559
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Issue29559.objc.h"
void Issue29559TakesAString(NSString* _Nullable s) {
nstring _s = go_seq_from_objc_string(s);
proxyissue29559__TakesAString(_s);
}
__attribute__((constructor)) static void init() {
init_seq();
}

16
bind/testdata/java.go vendored Normal file
View file

@ -0,0 +1,16 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package java
import (
"Java/java/lang"
)
type (
F lang.Float
L lang.Long
O lang.Object
R lang.Runnable
)

407
bind/testdata/java.go.golden vendored Normal file
View file

@ -0,0 +1,407 @@
// Code generated by gobind. DO NOT EDIT.
package Float
import "Java"
const _ = Java.Dummy
const (
MAX_VALUE = 3.4028235E38
MIN_NORMAL = 1.17549435E-38
MIN_VALUE = 1.4E-45
MAX_EXPONENT = 127
MIN_EXPONENT = -126
SIZE = 32
BYTES = 4
)
var (
// Cast takes a proxy for a Java object and converts it to a java.lang.Float proxy.
// Cast panics if the argument is not a proxy or if the underlying object does
// not extend or implement java.lang.Float.
Cast func(v interface{}) Java.Java_lang_Float
)
// Code generated by gobind. DO NOT EDIT.
package lang
import "Java"
const _ = Java.Dummy
type Float Java.Java_lang_Float
type Long Java.Java_lang_Long
type Object Java.Java_lang_Object
type Runnable Java.Java_lang_Runnable
// Code generated by gobind. DO NOT EDIT.
package Long
import "Java"
const _ = Java.Dummy
const (
MIN_VALUE = -9223372036854775808
MAX_VALUE = 9223372036854775807
SIZE = 64
BYTES = 8
)
var (
// Cast takes a proxy for a Java object and converts it to a java.lang.Long proxy.
// Cast panics if the argument is not a proxy or if the underlying object does
// not extend or implement java.lang.Long.
Cast func(v interface{}) Java.Java_lang_Long
)
// Code generated by gobind. DO NOT EDIT.
package Object
import "Java"
const _ = Java.Dummy
const ()
var (
// Cast takes a proxy for a Java object and converts it to a java.lang.Object proxy.
// Cast panics if the argument is not a proxy or if the underlying object does
// not extend or implement java.lang.Object.
Cast func(v interface{}) Java.Java_lang_Object
)
// Code generated by gobind. DO NOT EDIT.
package Runnable
import "Java"
const _ = Java.Dummy
const ()
var (
// Cast takes a proxy for a Java object and converts it to a java.lang.Runnable proxy.
// Cast panics if the argument is not a proxy or if the underlying object does
// not extend or implement java.lang.Runnable.
Cast func(v interface{}) Java.Java_lang_Runnable
)
// Code generated by gobind. DO NOT EDIT.
package Java
// Used to silence this package not used errors
const Dummy = 0
type Java_lang_Float interface {
ToString() string
}
type Java_lang_Long interface {
ToString() string
}
type Java_lang_Object interface {
ToString() string
}
type Java_lang_Runnable interface {
}
// Code generated by gobind. DO NOT EDIT.
package main
/*
#include <stdlib.h> // for free()
#include <jni.h>
#include "seq.h"
#include "classes.h"
*/
import "C"
import (
"Java"
_seq "golang.org/x/mobile/bind/seq"
)
import "Java/java/lang/Float"
import "Java/java/lang/Long"
import "Java/java/lang/Object"
import "Java/java/lang/Runnable"
import "unsafe"
import "reflect"
import "fmt"
type proxy interface{ Bind_proxy_refnum__() int32 }
// Suppress unused package error
var _ = _seq.FromRefNum
const _ = Java.Dummy
//export initClasses
func initClasses() {
C.init_proxies()
init_java_lang_Float()
init_java_lang_Long()
init_java_lang_Object()
init_java_lang_Runnable()
}
var class_java_lang_Float C.jclass
func init_java_lang_Float() {
cls := C.CString("java/lang/Float")
clazz := C.go_seq_find_class(cls)
C.free(unsafe.Pointer(cls))
if uintptr(clazz) == 0 {
return
}
class_java_lang_Float = clazz
Float.Cast = func(v interface{}) Java.Java_lang_Float {
t := reflect.TypeOf((*proxy_class_java_lang_Float)(nil))
cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Float)
ref := C.jint(_seq.ToRefNum(cv))
if C.go_seq_isinstanceof(ref, class_java_lang_Float) != 1 {
panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Float"))
}
return cv
}
}
type proxy_class_java_lang_Float _seq.Ref
func (p *proxy_class_java_lang_Float) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxy_class_java_lang_Float) ToString() string {
res := C.cproxy_java_lang_Float_toString(C.jint(p.Bind_proxy_refnum__()))
_res := decodeString(res.res)
var _exc error
_exc_ref := _seq.FromRefNum(int32(res.exc))
if _exc_ref != nil {
if res.exc < 0 { // go object
_exc = _exc_ref.Get().(error)
} else { // foreign object
_exc = (*proxy_error)(_exc_ref)
}
}
if _exc != nil {
panic(_exc)
}
return _res
}
var class_java_lang_Long C.jclass
func init_java_lang_Long() {
cls := C.CString("java/lang/Long")
clazz := C.go_seq_find_class(cls)
C.free(unsafe.Pointer(cls))
if uintptr(clazz) == 0 {
return
}
class_java_lang_Long = clazz
Long.Cast = func(v interface{}) Java.Java_lang_Long {
t := reflect.TypeOf((*proxy_class_java_lang_Long)(nil))
cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Long)
ref := C.jint(_seq.ToRefNum(cv))
if C.go_seq_isinstanceof(ref, class_java_lang_Long) != 1 {
panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Long"))
}
return cv
}
}
type proxy_class_java_lang_Long _seq.Ref
func (p *proxy_class_java_lang_Long) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxy_class_java_lang_Long) ToString() string {
res := C.cproxy_java_lang_Long_toString(C.jint(p.Bind_proxy_refnum__()))
_res := decodeString(res.res)
var _exc error
_exc_ref := _seq.FromRefNum(int32(res.exc))
if _exc_ref != nil {
if res.exc < 0 { // go object
_exc = _exc_ref.Get().(error)
} else { // foreign object
_exc = (*proxy_error)(_exc_ref)
}
}
if _exc != nil {
panic(_exc)
}
return _res
}
var class_java_lang_Object C.jclass
func init_java_lang_Object() {
cls := C.CString("java/lang/Object")
clazz := C.go_seq_find_class(cls)
C.free(unsafe.Pointer(cls))
if uintptr(clazz) == 0 {
return
}
class_java_lang_Object = clazz
Object.Cast = func(v interface{}) Java.Java_lang_Object {
t := reflect.TypeOf((*proxy_class_java_lang_Object)(nil))
cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Object)
ref := C.jint(_seq.ToRefNum(cv))
if C.go_seq_isinstanceof(ref, class_java_lang_Object) != 1 {
panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Object"))
}
return cv
}
}
type proxy_class_java_lang_Object _seq.Ref
func (p *proxy_class_java_lang_Object) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxy_class_java_lang_Object) ToString() string {
res := C.cproxy_java_lang_Object_toString(C.jint(p.Bind_proxy_refnum__()))
_res := decodeString(res.res)
var _exc error
_exc_ref := _seq.FromRefNum(int32(res.exc))
if _exc_ref != nil {
if res.exc < 0 { // go object
_exc = _exc_ref.Get().(error)
} else { // foreign object
_exc = (*proxy_error)(_exc_ref)
}
}
if _exc != nil {
panic(_exc)
}
return _res
}
var class_java_lang_Runnable C.jclass
func init_java_lang_Runnable() {
cls := C.CString("java/lang/Runnable")
clazz := C.go_seq_find_class(cls)
C.free(unsafe.Pointer(cls))
if uintptr(clazz) == 0 {
return
}
class_java_lang_Runnable = clazz
Runnable.Cast = func(v interface{}) Java.Java_lang_Runnable {
t := reflect.TypeOf((*proxy_class_java_lang_Runnable)(nil))
cv := reflect.ValueOf(v).Convert(t).Interface().(*proxy_class_java_lang_Runnable)
ref := C.jint(_seq.ToRefNum(cv))
if C.go_seq_isinstanceof(ref, class_java_lang_Runnable) != 1 {
panic(fmt.Errorf("%T is not an instance of %s", v, "java.lang.Runnable"))
}
return cv
}
}
type proxy_class_java_lang_Runnable _seq.Ref
func (p *proxy_class_java_lang_Runnable) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package java.
//
// autogenerated by gobind -lang=go java
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "java.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"java"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyjava_F_ToString
func proxyjava_F_ToString(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(java.F)
res_0 := v.ToString()
_res_0 := encodeString(res_0)
return _res_0
}
type proxyjava_F _seq.Ref
func (p *proxyjava_F) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyjava_F) ToString() string {
res := C.cproxyjava_F_ToString(C.int32_t(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
//export proxyjava_L_ToString
func proxyjava_L_ToString(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(java.L)
res_0 := v.ToString()
_res_0 := encodeString(res_0)
return _res_0
}
type proxyjava_L _seq.Ref
func (p *proxyjava_L) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyjava_L) ToString() string {
res := C.cproxyjava_L_ToString(C.int32_t(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
//export proxyjava_O_ToString
func proxyjava_O_ToString(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(java.O)
res_0 := v.ToString()
_res_0 := encodeString(res_0)
return _res_0
}
type proxyjava_O _seq.Ref
func (p *proxyjava_O) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxyjava_O) ToString() string {
res := C.cproxyjava_O_ToString(C.int32_t(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
type proxyjava_R _seq.Ref
func (p *proxyjava_R) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}

191
bind/testdata/java.java.c.golden vendored Normal file
View file

@ -0,0 +1,191 @@
// Code generated by gobind. DO NOT EDIT.
#include <jni.h>
#include "seq.h"
#include "classes.h"
static jclass class_java_lang_Float;
static jmethodID m_java_lang_Float_toString;
static jclass class_java_lang_Long;
static jmethodID m_java_lang_Long_toString;
static jclass class_java_lang_Object;
static jmethodID m_java_lang_Object_toString;
static jclass class_java_lang_Runnable;
void init_proxies() {
JNIEnv *env = go_seq_push_local_frame(4);
jclass clazz;
clazz = go_seq_find_class("java/lang/Float");
if (clazz != NULL) {
class_java_lang_Float = (*env)->NewGlobalRef(env, clazz);
m_java_lang_Float_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/lang/Long");
if (clazz != NULL) {
class_java_lang_Long = (*env)->NewGlobalRef(env, clazz);
m_java_lang_Long_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/lang/Object");
if (clazz != NULL) {
class_java_lang_Object = (*env)->NewGlobalRef(env, clazz);
m_java_lang_Object_toString = go_seq_get_method_id(clazz, "toString", "()Ljava/lang/String;");
}
clazz = go_seq_find_class("java/lang/Runnable");
if (clazz != NULL) {
class_java_lang_Runnable = (*env)->NewGlobalRef(env, clazz);
}
go_seq_pop_local_frame(env);
}
ret_nstring cproxy_java_lang_Float_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_lang_Float_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_lang_Long_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_lang_Long_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
ret_nstring cproxy_java_lang_Object_toString(jint this) {
JNIEnv *env = go_seq_push_local_frame(1);
// Must be a Java object
jobject _this = go_seq_from_refnum(env, this, NULL, NULL);
jstring res = (*env)->CallObjectMethod(env, _this, m_java_lang_Object_toString);
jobject _exc = go_seq_get_exception(env);
int32_t _exc_ref = go_seq_to_refnum(env, _exc);
if (_exc != NULL) {
res = NULL;
}
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
ret_nstring __res = {_res, _exc_ref};
return __res;
}
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java java
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "java.h"
jclass proxy_class_java_F;
jmethodID proxy_class_java_F_cons;
static jmethodID mid_F_ToString;
jclass proxy_class_java_L;
jmethodID proxy_class_java_L_cons;
static jmethodID mid_L_ToString;
jclass proxy_class_java_O;
jmethodID proxy_class_java_O_cons;
static jmethodID mid_O_ToString;
jclass proxy_class_java_R;
jmethodID proxy_class_java_R_cons;
JNIEXPORT void JNICALL
Java_java_Java__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "java/Java$proxyF");
proxy_class_java_F = (*env)->NewGlobalRef(env, clazz);
proxy_class_java_F_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "java/F");
mid_F_ToString = (*env)->GetMethodID(env, clazz, "toString", "()Ljava/lang/String;");
clazz = (*env)->FindClass(env, "java/Java$proxyL");
proxy_class_java_L = (*env)->NewGlobalRef(env, clazz);
proxy_class_java_L_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "java/L");
mid_L_ToString = (*env)->GetMethodID(env, clazz, "toString", "()Ljava/lang/String;");
clazz = (*env)->FindClass(env, "java/Java$proxyO");
proxy_class_java_O = (*env)->NewGlobalRef(env, clazz);
proxy_class_java_O_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "java/O");
mid_O_ToString = (*env)->GetMethodID(env, clazz, "toString", "()Ljava/lang/String;");
clazz = (*env)->FindClass(env, "java/Java$proxyR");
proxy_class_java_R = (*env)->NewGlobalRef(env, clazz);
proxy_class_java_R_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "java/R");
}
JNIEXPORT jstring JNICALL
Java_java_Java_00024proxyF_toString(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
nstring r0 = proxyjava_F_ToString(o);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
nstring cproxyjava_F_ToString(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_java_F, proxy_class_java_F_cons);
jstring res = (*env)->CallObjectMethod(env, o, mid_F_ToString);
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
return _res;
}
JNIEXPORT jstring JNICALL
Java_java_Java_00024proxyL_toString(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
nstring r0 = proxyjava_L_ToString(o);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
nstring cproxyjava_L_ToString(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_java_L, proxy_class_java_L_cons);
jstring res = (*env)->CallObjectMethod(env, o, mid_L_ToString);
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
return _res;
}
JNIEXPORT jstring JNICALL
Java_java_Java_00024proxyO_toString(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
nstring r0 = proxyjava_O_ToString(o);
jstring _r0 = go_seq_to_java_string(env, r0);
return _r0;
}
nstring cproxyjava_O_ToString(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_java_O, proxy_class_java_O_cons);
jstring res = (*env)->CallObjectMethod(env, o, mid_O_ToString);
nstring _res = go_seq_from_java_string(env, res);
go_seq_pop_local_frame(env);
return _res;
}

127
bind/testdata/java.java.golden vendored Normal file
View file

@ -0,0 +1,127 @@
// Code generated by gobind. DO NOT EDIT.
// Java class java.F is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java java
package java;
import go.Seq;
public interface F extends R {
public String toString();
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.L is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java java
package java;
import go.Seq;
public interface L extends R {
public String toString();
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.O is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java java
package java;
import go.Seq;
public interface O extends R {
public String toString();
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.R is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java java
package java;
import go.Seq;
public interface R {
}
// Code generated by gobind. DO NOT EDIT.
// Java class java.Java is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java java
package java;
import go.Seq;
public abstract class Java {
static {
Seq.touch(); // for loading the native library
_init();
}
private Java() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyF implements Seq.Proxy, F {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyF(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native String toString();
}
private static final class proxyL implements Seq.Proxy, L {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyL(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native String toString();
}
private static final class proxyO implements Seq.Proxy, O {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyO(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native String toString();
}
private static final class proxyR implements Seq.Proxy, R {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyR(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
}
}

82
bind/testdata/java.java.h.golden vendored Normal file
View file

@ -0,0 +1,82 @@
// Code generated by gobind. DO NOT EDIT.
#include <jni.h>
#include "seq.h"
extern void init_proxies();
typedef struct ret_jint {
jint res;
jint exc;
} ret_jint;
typedef struct ret_jboolean {
jboolean res;
jint exc;
} ret_jboolean;
typedef struct ret_jshort {
jshort res;
jint exc;
} ret_jshort;
typedef struct ret_jchar {
jchar res;
jint exc;
} ret_jchar;
typedef struct ret_jbyte {
jbyte res;
jint exc;
} ret_jbyte;
typedef struct ret_jlong {
jlong res;
jint exc;
} ret_jlong;
typedef struct ret_jfloat {
jfloat res;
jint exc;
} ret_jfloat;
typedef struct ret_jdouble {
jdouble res;
jint exc;
} ret_jdouble;
typedef struct ret_nstring {
nstring res;
jint exc;
} ret_nstring;
typedef struct ret_nbyteslice {
nbyteslice res;
jint exc;
} ret_nbyteslice;
extern ret_nstring cproxy_java_lang_Float_toString(jint this);
extern ret_nstring cproxy_java_lang_Long_toString(jint this);
extern ret_nstring cproxy_java_lang_Object_toString(jint this);
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java java
#ifndef __Java_H__
#define __Java_H__
#include <jni.h>
extern jclass proxy_class_java_F;
extern jmethodID proxy_class_java_F_cons;
nstring cproxyjava_F_ToString(int32_t refnum);
extern jclass proxy_class_java_L;
extern jmethodID proxy_class_java_L_cons;
nstring cproxyjava_L_ToString(int32_t refnum);
extern jclass proxy_class_java_O;
extern jmethodID proxy_class_java_O_cons;
nstring cproxyjava_O_ToString(int32_t refnum);
extern jclass proxy_class_java_R;
extern jmethodID proxy_class_java_R_cons;
#endif

66
bind/testdata/keywords.go vendored Normal file
View file

@ -0,0 +1,66 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package keywords
type KeywordCaller interface {
Abstract()
Assert()
Boolean()
Break()
Byte()
Case()
Catch()
Char()
Class()
Const()
Continue()
Default()
Do()
Double()
Else()
Enum()
Extends()
Final()
Finally()
Float()
For()
Goto()
If()
Implements()
Import()
Instanceof()
Int()
Interface()
Long()
Native()
New()
Package()
Private()
Protected()
Public()
Return()
Short()
Static()
Strictfp()
Super()
Switch()
Synchronized()
This()
Throw()
Throws()
Transient()
Try()
Void()
Volatile()
While()
False()
Null()
True()
Bool()
Nil()
}
func Const(id string) {}
func Static(strictfp string) {}

646
bind/testdata/keywords.go.golden vendored Normal file
View file

@ -0,0 +1,646 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package keywords.
//
// autogenerated by gobind -lang=go keywords
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "keywords.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"keywords"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxykeywords_KeywordCaller_Abstract
func proxykeywords_KeywordCaller_Abstract(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Abstract()
}
//export proxykeywords_KeywordCaller_Assert
func proxykeywords_KeywordCaller_Assert(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Assert()
}
//export proxykeywords_KeywordCaller_Bool
func proxykeywords_KeywordCaller_Bool(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Bool()
}
//export proxykeywords_KeywordCaller_Boolean
func proxykeywords_KeywordCaller_Boolean(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Boolean()
}
//export proxykeywords_KeywordCaller_Break
func proxykeywords_KeywordCaller_Break(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Break()
}
//export proxykeywords_KeywordCaller_Byte
func proxykeywords_KeywordCaller_Byte(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Byte()
}
//export proxykeywords_KeywordCaller_Case
func proxykeywords_KeywordCaller_Case(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Case()
}
//export proxykeywords_KeywordCaller_Catch
func proxykeywords_KeywordCaller_Catch(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Catch()
}
//export proxykeywords_KeywordCaller_Char
func proxykeywords_KeywordCaller_Char(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Char()
}
//export proxykeywords_KeywordCaller_Class
func proxykeywords_KeywordCaller_Class(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Class()
}
//export proxykeywords_KeywordCaller_Const
func proxykeywords_KeywordCaller_Const(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Const()
}
//export proxykeywords_KeywordCaller_Continue
func proxykeywords_KeywordCaller_Continue(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Continue()
}
//export proxykeywords_KeywordCaller_Default
func proxykeywords_KeywordCaller_Default(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Default()
}
//export proxykeywords_KeywordCaller_Do
func proxykeywords_KeywordCaller_Do(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Do()
}
//export proxykeywords_KeywordCaller_Double
func proxykeywords_KeywordCaller_Double(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Double()
}
//export proxykeywords_KeywordCaller_Else
func proxykeywords_KeywordCaller_Else(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Else()
}
//export proxykeywords_KeywordCaller_Enum
func proxykeywords_KeywordCaller_Enum(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Enum()
}
//export proxykeywords_KeywordCaller_Extends
func proxykeywords_KeywordCaller_Extends(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Extends()
}
//export proxykeywords_KeywordCaller_False
func proxykeywords_KeywordCaller_False(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.False()
}
//export proxykeywords_KeywordCaller_Final
func proxykeywords_KeywordCaller_Final(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Final()
}
//export proxykeywords_KeywordCaller_Finally
func proxykeywords_KeywordCaller_Finally(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Finally()
}
//export proxykeywords_KeywordCaller_Float
func proxykeywords_KeywordCaller_Float(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Float()
}
//export proxykeywords_KeywordCaller_For
func proxykeywords_KeywordCaller_For(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.For()
}
//export proxykeywords_KeywordCaller_Goto
func proxykeywords_KeywordCaller_Goto(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Goto()
}
//export proxykeywords_KeywordCaller_If
func proxykeywords_KeywordCaller_If(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.If()
}
//export proxykeywords_KeywordCaller_Implements
func proxykeywords_KeywordCaller_Implements(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Implements()
}
//export proxykeywords_KeywordCaller_Import
func proxykeywords_KeywordCaller_Import(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Import()
}
//export proxykeywords_KeywordCaller_Instanceof
func proxykeywords_KeywordCaller_Instanceof(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Instanceof()
}
//export proxykeywords_KeywordCaller_Int
func proxykeywords_KeywordCaller_Int(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Int()
}
//export proxykeywords_KeywordCaller_Interface
func proxykeywords_KeywordCaller_Interface(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Interface()
}
//export proxykeywords_KeywordCaller_Long
func proxykeywords_KeywordCaller_Long(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Long()
}
//export proxykeywords_KeywordCaller_Native
func proxykeywords_KeywordCaller_Native(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Native()
}
//export proxykeywords_KeywordCaller_New
func proxykeywords_KeywordCaller_New(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.New()
}
//export proxykeywords_KeywordCaller_Nil
func proxykeywords_KeywordCaller_Nil(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Nil()
}
//export proxykeywords_KeywordCaller_Null
func proxykeywords_KeywordCaller_Null(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Null()
}
//export proxykeywords_KeywordCaller_Package
func proxykeywords_KeywordCaller_Package(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Package()
}
//export proxykeywords_KeywordCaller_Private
func proxykeywords_KeywordCaller_Private(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Private()
}
//export proxykeywords_KeywordCaller_Protected
func proxykeywords_KeywordCaller_Protected(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Protected()
}
//export proxykeywords_KeywordCaller_Public
func proxykeywords_KeywordCaller_Public(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Public()
}
//export proxykeywords_KeywordCaller_Return
func proxykeywords_KeywordCaller_Return(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Return()
}
//export proxykeywords_KeywordCaller_Short
func proxykeywords_KeywordCaller_Short(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Short()
}
//export proxykeywords_KeywordCaller_Static
func proxykeywords_KeywordCaller_Static(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Static()
}
//export proxykeywords_KeywordCaller_Strictfp
func proxykeywords_KeywordCaller_Strictfp(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Strictfp()
}
//export proxykeywords_KeywordCaller_Super
func proxykeywords_KeywordCaller_Super(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Super()
}
//export proxykeywords_KeywordCaller_Switch
func proxykeywords_KeywordCaller_Switch(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Switch()
}
//export proxykeywords_KeywordCaller_Synchronized
func proxykeywords_KeywordCaller_Synchronized(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Synchronized()
}
//export proxykeywords_KeywordCaller_This
func proxykeywords_KeywordCaller_This(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.This()
}
//export proxykeywords_KeywordCaller_Throw
func proxykeywords_KeywordCaller_Throw(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Throw()
}
//export proxykeywords_KeywordCaller_Throws
func proxykeywords_KeywordCaller_Throws(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Throws()
}
//export proxykeywords_KeywordCaller_Transient
func proxykeywords_KeywordCaller_Transient(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Transient()
}
//export proxykeywords_KeywordCaller_True
func proxykeywords_KeywordCaller_True(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.True()
}
//export proxykeywords_KeywordCaller_Try
func proxykeywords_KeywordCaller_Try(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Try()
}
//export proxykeywords_KeywordCaller_Void
func proxykeywords_KeywordCaller_Void(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Void()
}
//export proxykeywords_KeywordCaller_Volatile
func proxykeywords_KeywordCaller_Volatile(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.Volatile()
}
//export proxykeywords_KeywordCaller_While
func proxykeywords_KeywordCaller_While(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(keywords.KeywordCaller)
v.While()
}
type proxykeywords_KeywordCaller _seq.Ref
func (p *proxykeywords_KeywordCaller) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxykeywords_KeywordCaller) Abstract() {
C.cproxykeywords_KeywordCaller_Abstract(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Assert() {
C.cproxykeywords_KeywordCaller_Assert(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Bool() {
C.cproxykeywords_KeywordCaller_Bool(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Boolean() {
C.cproxykeywords_KeywordCaller_Boolean(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Break() {
C.cproxykeywords_KeywordCaller_Break(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Byte() {
C.cproxykeywords_KeywordCaller_Byte(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Case() {
C.cproxykeywords_KeywordCaller_Case(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Catch() {
C.cproxykeywords_KeywordCaller_Catch(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Char() {
C.cproxykeywords_KeywordCaller_Char(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Class() {
C.cproxykeywords_KeywordCaller_Class(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Const() {
C.cproxykeywords_KeywordCaller_Const(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Continue() {
C.cproxykeywords_KeywordCaller_Continue(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Default() {
C.cproxykeywords_KeywordCaller_Default(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Do() {
C.cproxykeywords_KeywordCaller_Do(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Double() {
C.cproxykeywords_KeywordCaller_Double(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Else() {
C.cproxykeywords_KeywordCaller_Else(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Enum() {
C.cproxykeywords_KeywordCaller_Enum(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Extends() {
C.cproxykeywords_KeywordCaller_Extends(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) False() {
C.cproxykeywords_KeywordCaller_False(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Final() {
C.cproxykeywords_KeywordCaller_Final(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Finally() {
C.cproxykeywords_KeywordCaller_Finally(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Float() {
C.cproxykeywords_KeywordCaller_Float(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) For() {
C.cproxykeywords_KeywordCaller_For(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Goto() {
C.cproxykeywords_KeywordCaller_Goto(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) If() {
C.cproxykeywords_KeywordCaller_If(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Implements() {
C.cproxykeywords_KeywordCaller_Implements(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Import() {
C.cproxykeywords_KeywordCaller_Import(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Instanceof() {
C.cproxykeywords_KeywordCaller_Instanceof(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Int() {
C.cproxykeywords_KeywordCaller_Int(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Interface() {
C.cproxykeywords_KeywordCaller_Interface(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Long() {
C.cproxykeywords_KeywordCaller_Long(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Native() {
C.cproxykeywords_KeywordCaller_Native(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) New() {
C.cproxykeywords_KeywordCaller_New(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Nil() {
C.cproxykeywords_KeywordCaller_Nil(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Null() {
C.cproxykeywords_KeywordCaller_Null(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Package() {
C.cproxykeywords_KeywordCaller_Package(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Private() {
C.cproxykeywords_KeywordCaller_Private(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Protected() {
C.cproxykeywords_KeywordCaller_Protected(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Public() {
C.cproxykeywords_KeywordCaller_Public(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Return() {
C.cproxykeywords_KeywordCaller_Return(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Short() {
C.cproxykeywords_KeywordCaller_Short(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Static() {
C.cproxykeywords_KeywordCaller_Static(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Strictfp() {
C.cproxykeywords_KeywordCaller_Strictfp(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Super() {
C.cproxykeywords_KeywordCaller_Super(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Switch() {
C.cproxykeywords_KeywordCaller_Switch(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Synchronized() {
C.cproxykeywords_KeywordCaller_Synchronized(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) This() {
C.cproxykeywords_KeywordCaller_This(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Throw() {
C.cproxykeywords_KeywordCaller_Throw(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Throws() {
C.cproxykeywords_KeywordCaller_Throws(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Transient() {
C.cproxykeywords_KeywordCaller_Transient(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) True() {
C.cproxykeywords_KeywordCaller_True(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Try() {
C.cproxykeywords_KeywordCaller_Try(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Void() {
C.cproxykeywords_KeywordCaller_Void(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) Volatile() {
C.cproxykeywords_KeywordCaller_Volatile(C.int32_t(p.Bind_proxy_refnum__()))
}
func (p *proxykeywords_KeywordCaller) While() {
C.cproxykeywords_KeywordCaller_While(C.int32_t(p.Bind_proxy_refnum__()))
}
//export proxykeywords__Const
func proxykeywords__Const(param_id C.nstring) {
_param_id := decodeString(param_id)
keywords.Const(_param_id)
}
//export proxykeywords__Static
func proxykeywords__Static(param_strictfp C.nstring) {
_param_strictfp := decodeString(param_strictfp)
keywords.Static(_param_strictfp)
}

862
bind/testdata/keywords.java.c.golden vendored Normal file
View file

@ -0,0 +1,862 @@
// Code generated by gobind. DO NOT EDIT.
// JNI functions for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java keywords
#include <android/log.h>
#include <stdint.h>
#include "seq.h"
#include "_cgo_export.h"
#include "keywords.h"
jclass proxy_class_keywords_KeywordCaller;
jmethodID proxy_class_keywords_KeywordCaller_cons;
static jmethodID mid_KeywordCaller_Abstract;
static jmethodID mid_KeywordCaller_Assert;
static jmethodID mid_KeywordCaller_Bool;
static jmethodID mid_KeywordCaller_Boolean;
static jmethodID mid_KeywordCaller_Break;
static jmethodID mid_KeywordCaller_Byte;
static jmethodID mid_KeywordCaller_Case;
static jmethodID mid_KeywordCaller_Catch;
static jmethodID mid_KeywordCaller_Char;
static jmethodID mid_KeywordCaller_Class;
static jmethodID mid_KeywordCaller_Const;
static jmethodID mid_KeywordCaller_Continue;
static jmethodID mid_KeywordCaller_Default;
static jmethodID mid_KeywordCaller_Do;
static jmethodID mid_KeywordCaller_Double;
static jmethodID mid_KeywordCaller_Else;
static jmethodID mid_KeywordCaller_Enum;
static jmethodID mid_KeywordCaller_Extends;
static jmethodID mid_KeywordCaller_False;
static jmethodID mid_KeywordCaller_Final;
static jmethodID mid_KeywordCaller_Finally;
static jmethodID mid_KeywordCaller_Float;
static jmethodID mid_KeywordCaller_For;
static jmethodID mid_KeywordCaller_Goto;
static jmethodID mid_KeywordCaller_If;
static jmethodID mid_KeywordCaller_Implements;
static jmethodID mid_KeywordCaller_Import;
static jmethodID mid_KeywordCaller_Instanceof;
static jmethodID mid_KeywordCaller_Int;
static jmethodID mid_KeywordCaller_Interface;
static jmethodID mid_KeywordCaller_Long;
static jmethodID mid_KeywordCaller_Native;
static jmethodID mid_KeywordCaller_New;
static jmethodID mid_KeywordCaller_Nil;
static jmethodID mid_KeywordCaller_Null;
static jmethodID mid_KeywordCaller_Package;
static jmethodID mid_KeywordCaller_Private;
static jmethodID mid_KeywordCaller_Protected;
static jmethodID mid_KeywordCaller_Public;
static jmethodID mid_KeywordCaller_Return;
static jmethodID mid_KeywordCaller_Short;
static jmethodID mid_KeywordCaller_Static;
static jmethodID mid_KeywordCaller_Strictfp;
static jmethodID mid_KeywordCaller_Super;
static jmethodID mid_KeywordCaller_Switch;
static jmethodID mid_KeywordCaller_Synchronized;
static jmethodID mid_KeywordCaller_This;
static jmethodID mid_KeywordCaller_Throw;
static jmethodID mid_KeywordCaller_Throws;
static jmethodID mid_KeywordCaller_Transient;
static jmethodID mid_KeywordCaller_True;
static jmethodID mid_KeywordCaller_Try;
static jmethodID mid_KeywordCaller_Void;
static jmethodID mid_KeywordCaller_Volatile;
static jmethodID mid_KeywordCaller_While;
JNIEXPORT void JNICALL
Java_keywords_Keywords__1init(JNIEnv *env, jclass _unused) {
jclass clazz;
clazz = (*env)->FindClass(env, "keywords/Keywords$proxyKeywordCaller");
proxy_class_keywords_KeywordCaller = (*env)->NewGlobalRef(env, clazz);
proxy_class_keywords_KeywordCaller_cons = (*env)->GetMethodID(env, clazz, "<init>", "(I)V");
clazz = (*env)->FindClass(env, "keywords/KeywordCaller");
mid_KeywordCaller_Abstract = (*env)->GetMethodID(env, clazz, "abstract_", "()V");
mid_KeywordCaller_Assert = (*env)->GetMethodID(env, clazz, "assert_", "()V");
mid_KeywordCaller_Bool = (*env)->GetMethodID(env, clazz, "bool", "()V");
mid_KeywordCaller_Boolean = (*env)->GetMethodID(env, clazz, "boolean_", "()V");
mid_KeywordCaller_Break = (*env)->GetMethodID(env, clazz, "break_", "()V");
mid_KeywordCaller_Byte = (*env)->GetMethodID(env, clazz, "byte_", "()V");
mid_KeywordCaller_Case = (*env)->GetMethodID(env, clazz, "case_", "()V");
mid_KeywordCaller_Catch = (*env)->GetMethodID(env, clazz, "catch_", "()V");
mid_KeywordCaller_Char = (*env)->GetMethodID(env, clazz, "char_", "()V");
mid_KeywordCaller_Class = (*env)->GetMethodID(env, clazz, "class_", "()V");
mid_KeywordCaller_Const = (*env)->GetMethodID(env, clazz, "const_", "()V");
mid_KeywordCaller_Continue = (*env)->GetMethodID(env, clazz, "continue_", "()V");
mid_KeywordCaller_Default = (*env)->GetMethodID(env, clazz, "default_", "()V");
mid_KeywordCaller_Do = (*env)->GetMethodID(env, clazz, "do_", "()V");
mid_KeywordCaller_Double = (*env)->GetMethodID(env, clazz, "double_", "()V");
mid_KeywordCaller_Else = (*env)->GetMethodID(env, clazz, "else_", "()V");
mid_KeywordCaller_Enum = (*env)->GetMethodID(env, clazz, "enum_", "()V");
mid_KeywordCaller_Extends = (*env)->GetMethodID(env, clazz, "extends_", "()V");
mid_KeywordCaller_False = (*env)->GetMethodID(env, clazz, "false_", "()V");
mid_KeywordCaller_Final = (*env)->GetMethodID(env, clazz, "final_", "()V");
mid_KeywordCaller_Finally = (*env)->GetMethodID(env, clazz, "finally_", "()V");
mid_KeywordCaller_Float = (*env)->GetMethodID(env, clazz, "float_", "()V");
mid_KeywordCaller_For = (*env)->GetMethodID(env, clazz, "for_", "()V");
mid_KeywordCaller_Goto = (*env)->GetMethodID(env, clazz, "goto_", "()V");
mid_KeywordCaller_If = (*env)->GetMethodID(env, clazz, "if_", "()V");
mid_KeywordCaller_Implements = (*env)->GetMethodID(env, clazz, "implements_", "()V");
mid_KeywordCaller_Import = (*env)->GetMethodID(env, clazz, "import_", "()V");
mid_KeywordCaller_Instanceof = (*env)->GetMethodID(env, clazz, "instanceof_", "()V");
mid_KeywordCaller_Int = (*env)->GetMethodID(env, clazz, "int_", "()V");
mid_KeywordCaller_Interface = (*env)->GetMethodID(env, clazz, "interface_", "()V");
mid_KeywordCaller_Long = (*env)->GetMethodID(env, clazz, "long_", "()V");
mid_KeywordCaller_Native = (*env)->GetMethodID(env, clazz, "native_", "()V");
mid_KeywordCaller_New = (*env)->GetMethodID(env, clazz, "new_", "()V");
mid_KeywordCaller_Nil = (*env)->GetMethodID(env, clazz, "nil", "()V");
mid_KeywordCaller_Null = (*env)->GetMethodID(env, clazz, "null_", "()V");
mid_KeywordCaller_Package = (*env)->GetMethodID(env, clazz, "package_", "()V");
mid_KeywordCaller_Private = (*env)->GetMethodID(env, clazz, "private_", "()V");
mid_KeywordCaller_Protected = (*env)->GetMethodID(env, clazz, "protected_", "()V");
mid_KeywordCaller_Public = (*env)->GetMethodID(env, clazz, "public_", "()V");
mid_KeywordCaller_Return = (*env)->GetMethodID(env, clazz, "return_", "()V");
mid_KeywordCaller_Short = (*env)->GetMethodID(env, clazz, "short_", "()V");
mid_KeywordCaller_Static = (*env)->GetMethodID(env, clazz, "static_", "()V");
mid_KeywordCaller_Strictfp = (*env)->GetMethodID(env, clazz, "strictfp_", "()V");
mid_KeywordCaller_Super = (*env)->GetMethodID(env, clazz, "super_", "()V");
mid_KeywordCaller_Switch = (*env)->GetMethodID(env, clazz, "switch_", "()V");
mid_KeywordCaller_Synchronized = (*env)->GetMethodID(env, clazz, "synchronized_", "()V");
mid_KeywordCaller_This = (*env)->GetMethodID(env, clazz, "this_", "()V");
mid_KeywordCaller_Throw = (*env)->GetMethodID(env, clazz, "throw_", "()V");
mid_KeywordCaller_Throws = (*env)->GetMethodID(env, clazz, "throws_", "()V");
mid_KeywordCaller_Transient = (*env)->GetMethodID(env, clazz, "transient_", "()V");
mid_KeywordCaller_True = (*env)->GetMethodID(env, clazz, "true_", "()V");
mid_KeywordCaller_Try = (*env)->GetMethodID(env, clazz, "try_", "()V");
mid_KeywordCaller_Void = (*env)->GetMethodID(env, clazz, "void_", "()V");
mid_KeywordCaller_Volatile = (*env)->GetMethodID(env, clazz, "volatile_", "()V");
mid_KeywordCaller_While = (*env)->GetMethodID(env, clazz, "while_", "()V");
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_const_1(JNIEnv* env, jclass _clazz, jstring id) {
nstring _id = go_seq_from_java_string(env, id);
proxykeywords__Const(_id);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_static_1(JNIEnv* env, jclass _clazz, jstring strictfp_) {
nstring _strictfp_ = go_seq_from_java_string(env, strictfp_);
proxykeywords__Static(_strictfp_);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_abstract_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Abstract(o);
}
void cproxykeywords_KeywordCaller_Abstract(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Abstract);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_assert_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Assert(o);
}
void cproxykeywords_KeywordCaller_Assert(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Assert);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_bool(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Bool(o);
}
void cproxykeywords_KeywordCaller_Bool(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Bool);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_boolean_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Boolean(o);
}
void cproxykeywords_KeywordCaller_Boolean(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Boolean);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_break_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Break(o);
}
void cproxykeywords_KeywordCaller_Break(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Break);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_byte_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Byte(o);
}
void cproxykeywords_KeywordCaller_Byte(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Byte);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_case_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Case(o);
}
void cproxykeywords_KeywordCaller_Case(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Case);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_catch_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Catch(o);
}
void cproxykeywords_KeywordCaller_Catch(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Catch);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_char_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Char(o);
}
void cproxykeywords_KeywordCaller_Char(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Char);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_class_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Class(o);
}
void cproxykeywords_KeywordCaller_Class(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Class);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_const_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Const(o);
}
void cproxykeywords_KeywordCaller_Const(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Const);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_continue_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Continue(o);
}
void cproxykeywords_KeywordCaller_Continue(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Continue);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_default_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Default(o);
}
void cproxykeywords_KeywordCaller_Default(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Default);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_do_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Do(o);
}
void cproxykeywords_KeywordCaller_Do(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Do);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_double_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Double(o);
}
void cproxykeywords_KeywordCaller_Double(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Double);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_else_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Else(o);
}
void cproxykeywords_KeywordCaller_Else(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Else);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_enum_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Enum(o);
}
void cproxykeywords_KeywordCaller_Enum(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Enum);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_extends_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Extends(o);
}
void cproxykeywords_KeywordCaller_Extends(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Extends);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_false_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_False(o);
}
void cproxykeywords_KeywordCaller_False(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_False);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_final_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Final(o);
}
void cproxykeywords_KeywordCaller_Final(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Final);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_finally_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Finally(o);
}
void cproxykeywords_KeywordCaller_Finally(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Finally);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_float_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Float(o);
}
void cproxykeywords_KeywordCaller_Float(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Float);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_for_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_For(o);
}
void cproxykeywords_KeywordCaller_For(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_For);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_goto_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Goto(o);
}
void cproxykeywords_KeywordCaller_Goto(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Goto);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_if_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_If(o);
}
void cproxykeywords_KeywordCaller_If(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_If);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_implements_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Implements(o);
}
void cproxykeywords_KeywordCaller_Implements(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Implements);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_import_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Import(o);
}
void cproxykeywords_KeywordCaller_Import(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Import);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_instanceof_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Instanceof(o);
}
void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Instanceof);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_int_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Int(o);
}
void cproxykeywords_KeywordCaller_Int(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Int);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_interface_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Interface(o);
}
void cproxykeywords_KeywordCaller_Interface(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Interface);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_long_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Long(o);
}
void cproxykeywords_KeywordCaller_Long(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Long);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_native_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Native(o);
}
void cproxykeywords_KeywordCaller_Native(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Native);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_new_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_New(o);
}
void cproxykeywords_KeywordCaller_New(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_New);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_nil(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Nil(o);
}
void cproxykeywords_KeywordCaller_Nil(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Nil);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_null_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Null(o);
}
void cproxykeywords_KeywordCaller_Null(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Null);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_package_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Package(o);
}
void cproxykeywords_KeywordCaller_Package(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Package);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_private_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Private(o);
}
void cproxykeywords_KeywordCaller_Private(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Private);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_protected_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Protected(o);
}
void cproxykeywords_KeywordCaller_Protected(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Protected);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_public_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Public(o);
}
void cproxykeywords_KeywordCaller_Public(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Public);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_return_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Return(o);
}
void cproxykeywords_KeywordCaller_Return(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Return);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_short_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Short(o);
}
void cproxykeywords_KeywordCaller_Short(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Short);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_static_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Static(o);
}
void cproxykeywords_KeywordCaller_Static(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Static);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_strictfp_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Strictfp(o);
}
void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Strictfp);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_super_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Super(o);
}
void cproxykeywords_KeywordCaller_Super(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Super);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_switch_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Switch(o);
}
void cproxykeywords_KeywordCaller_Switch(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Switch);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_synchronized_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Synchronized(o);
}
void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Synchronized);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_this_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_This(o);
}
void cproxykeywords_KeywordCaller_This(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_This);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_throw_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Throw(o);
}
void cproxykeywords_KeywordCaller_Throw(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Throw);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_throws_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Throws(o);
}
void cproxykeywords_KeywordCaller_Throws(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Throws);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_transient_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Transient(o);
}
void cproxykeywords_KeywordCaller_Transient(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Transient);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_true_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_True(o);
}
void cproxykeywords_KeywordCaller_True(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_True);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_try_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Try(o);
}
void cproxykeywords_KeywordCaller_Try(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Try);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_void_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Void(o);
}
void cproxykeywords_KeywordCaller_Void(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Void);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_volatile_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_Volatile(o);
}
void cproxykeywords_KeywordCaller_Volatile(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_Volatile);
go_seq_pop_local_frame(env);
}
JNIEXPORT void JNICALL
Java_keywords_Keywords_00024proxyKeywordCaller_while_1(JNIEnv* env, jobject __this__) {
int32_t o = go_seq_to_refnum_go(env, __this__);
proxykeywords_KeywordCaller_While(o);
}
void cproxykeywords_KeywordCaller_While(int32_t refnum) {
JNIEnv *env = go_seq_push_local_frame(0);
jobject o = go_seq_from_refnum(env, refnum, proxy_class_keywords_KeywordCaller, proxy_class_keywords_KeywordCaller_cons);
(*env)->CallVoidMethod(env, o, mid_KeywordCaller_While);
go_seq_pop_local_frame(env);
}

161
bind/testdata/keywords.java.golden vendored Normal file
View file

@ -0,0 +1,161 @@
// Code generated by gobind. DO NOT EDIT.
// Java class keywords.KeywordCaller is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java keywords
package keywords;
import go.Seq;
public interface KeywordCaller {
public void abstract_();
public void assert_();
public void bool();
public void boolean_();
public void break_();
public void byte_();
public void case_();
public void catch_();
public void char_();
public void class_();
public void const_();
public void continue_();
public void default_();
public void do_();
public void double_();
public void else_();
public void enum_();
public void extends_();
public void false_();
public void final_();
public void finally_();
public void float_();
public void for_();
public void goto_();
public void if_();
public void implements_();
public void import_();
public void instanceof_();
public void int_();
public void interface_();
public void long_();
public void native_();
public void new_();
public void nil();
public void null_();
public void package_();
public void private_();
public void protected_();
public void public_();
public void return_();
public void short_();
public void static_();
public void strictfp_();
public void super_();
public void switch_();
public void synchronized_();
public void this_();
public void throw_();
public void throws_();
public void transient_();
public void true_();
public void try_();
public void void_();
public void volatile_();
public void while_();
}
// Code generated by gobind. DO NOT EDIT.
// Java class keywords.Keywords is a proxy for talking to a Go program.
//
// autogenerated by gobind -lang=java keywords
package keywords;
import go.Seq;
public abstract class Keywords {
static {
Seq.touch(); // for loading the native library
_init();
}
private Keywords() {} // uninstantiable
// touch is called from other bound packages to initialize this package
public static void touch() {}
private static native void _init();
private static final class proxyKeywordCaller implements Seq.Proxy, KeywordCaller {
private final int refnum;
@Override public final int incRefnum() {
Seq.incGoRef(refnum, this);
return refnum;
}
proxyKeywordCaller(int refnum) { this.refnum = refnum; Seq.trackGoRef(refnum, this); }
public native void abstract_();
public native void assert_();
public native void bool();
public native void boolean_();
public native void break_();
public native void byte_();
public native void case_();
public native void catch_();
public native void char_();
public native void class_();
public native void const_();
public native void continue_();
public native void default_();
public native void do_();
public native void double_();
public native void else_();
public native void enum_();
public native void extends_();
public native void false_();
public native void final_();
public native void finally_();
public native void float_();
public native void for_();
public native void goto_();
public native void if_();
public native void implements_();
public native void import_();
public native void instanceof_();
public native void int_();
public native void interface_();
public native void long_();
public native void native_();
public native void new_();
public native void nil();
public native void null_();
public native void package_();
public native void private_();
public native void protected_();
public native void public_();
public native void return_();
public native void short_();
public native void static_();
public native void strictfp_();
public native void super_();
public native void switch_();
public native void synchronized_();
public native void this_();
public native void throw_();
public native void throws_();
public native void transient_();
public native void true_();
public native void try_();
public native void void_();
public native void volatile_();
public native void while_();
}
public static native void const_(String id);
public static native void static_(String strictfp_);
}

125
bind/testdata/keywords.java.h.golden vendored Normal file
View file

@ -0,0 +1,125 @@
// Code generated by gobind. DO NOT EDIT.
// JNI function headers for the Go <=> Java bridge.
//
// autogenerated by gobind -lang=java keywords
#ifndef __Keywords_H__
#define __Keywords_H__
#include <jni.h>
extern jclass proxy_class_keywords_KeywordCaller;
extern jmethodID proxy_class_keywords_KeywordCaller_cons;
void cproxykeywords_KeywordCaller_Abstract(int32_t refnum);
void cproxykeywords_KeywordCaller_Assert(int32_t refnum);
void cproxykeywords_KeywordCaller_Bool(int32_t refnum);
void cproxykeywords_KeywordCaller_Boolean(int32_t refnum);
void cproxykeywords_KeywordCaller_Break(int32_t refnum);
void cproxykeywords_KeywordCaller_Byte(int32_t refnum);
void cproxykeywords_KeywordCaller_Case(int32_t refnum);
void cproxykeywords_KeywordCaller_Catch(int32_t refnum);
void cproxykeywords_KeywordCaller_Char(int32_t refnum);
void cproxykeywords_KeywordCaller_Class(int32_t refnum);
void cproxykeywords_KeywordCaller_Const(int32_t refnum);
void cproxykeywords_KeywordCaller_Continue(int32_t refnum);
void cproxykeywords_KeywordCaller_Default(int32_t refnum);
void cproxykeywords_KeywordCaller_Do(int32_t refnum);
void cproxykeywords_KeywordCaller_Double(int32_t refnum);
void cproxykeywords_KeywordCaller_Else(int32_t refnum);
void cproxykeywords_KeywordCaller_Enum(int32_t refnum);
void cproxykeywords_KeywordCaller_Extends(int32_t refnum);
void cproxykeywords_KeywordCaller_False(int32_t refnum);
void cproxykeywords_KeywordCaller_Final(int32_t refnum);
void cproxykeywords_KeywordCaller_Finally(int32_t refnum);
void cproxykeywords_KeywordCaller_Float(int32_t refnum);
void cproxykeywords_KeywordCaller_For(int32_t refnum);
void cproxykeywords_KeywordCaller_Goto(int32_t refnum);
void cproxykeywords_KeywordCaller_If(int32_t refnum);
void cproxykeywords_KeywordCaller_Implements(int32_t refnum);
void cproxykeywords_KeywordCaller_Import(int32_t refnum);
void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum);
void cproxykeywords_KeywordCaller_Int(int32_t refnum);
void cproxykeywords_KeywordCaller_Interface(int32_t refnum);
void cproxykeywords_KeywordCaller_Long(int32_t refnum);
void cproxykeywords_KeywordCaller_Native(int32_t refnum);
void cproxykeywords_KeywordCaller_New(int32_t refnum);
void cproxykeywords_KeywordCaller_Nil(int32_t refnum);
void cproxykeywords_KeywordCaller_Null(int32_t refnum);
void cproxykeywords_KeywordCaller_Package(int32_t refnum);
void cproxykeywords_KeywordCaller_Private(int32_t refnum);
void cproxykeywords_KeywordCaller_Protected(int32_t refnum);
void cproxykeywords_KeywordCaller_Public(int32_t refnum);
void cproxykeywords_KeywordCaller_Return(int32_t refnum);
void cproxykeywords_KeywordCaller_Short(int32_t refnum);
void cproxykeywords_KeywordCaller_Static(int32_t refnum);
void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum);
void cproxykeywords_KeywordCaller_Super(int32_t refnum);
void cproxykeywords_KeywordCaller_Switch(int32_t refnum);
void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum);
void cproxykeywords_KeywordCaller_This(int32_t refnum);
void cproxykeywords_KeywordCaller_Throw(int32_t refnum);
void cproxykeywords_KeywordCaller_Throws(int32_t refnum);
void cproxykeywords_KeywordCaller_Transient(int32_t refnum);
void cproxykeywords_KeywordCaller_True(int32_t refnum);
void cproxykeywords_KeywordCaller_Try(int32_t refnum);
void cproxykeywords_KeywordCaller_Void(int32_t refnum);
void cproxykeywords_KeywordCaller_Volatile(int32_t refnum);
void cproxykeywords_KeywordCaller_While(int32_t refnum);
#endif

121
bind/testdata/keywords.objc.go.h.golden vendored Normal file
View file

@ -0,0 +1,121 @@
// Objective-C API for talking to keywords Go package.
// gobind -lang=objc keywords
//
// File is generated by gobind. Do not edit.
#ifndef __GO_keywords_H__
#define __GO_keywords_H__
#include <stdint.h>
#include <objc/objc.h>
void cproxykeywords_KeywordCaller_Abstract(int32_t refnum);
void cproxykeywords_KeywordCaller_Assert(int32_t refnum);
void cproxykeywords_KeywordCaller_Bool(int32_t refnum);
void cproxykeywords_KeywordCaller_Boolean(int32_t refnum);
void cproxykeywords_KeywordCaller_Break(int32_t refnum);
void cproxykeywords_KeywordCaller_Byte(int32_t refnum);
void cproxykeywords_KeywordCaller_Case(int32_t refnum);
void cproxykeywords_KeywordCaller_Catch(int32_t refnum);
void cproxykeywords_KeywordCaller_Char(int32_t refnum);
void cproxykeywords_KeywordCaller_Class(int32_t refnum);
void cproxykeywords_KeywordCaller_Const(int32_t refnum);
void cproxykeywords_KeywordCaller_Continue(int32_t refnum);
void cproxykeywords_KeywordCaller_Default(int32_t refnum);
void cproxykeywords_KeywordCaller_Do(int32_t refnum);
void cproxykeywords_KeywordCaller_Double(int32_t refnum);
void cproxykeywords_KeywordCaller_Else(int32_t refnum);
void cproxykeywords_KeywordCaller_Enum(int32_t refnum);
void cproxykeywords_KeywordCaller_Extends(int32_t refnum);
void cproxykeywords_KeywordCaller_False(int32_t refnum);
void cproxykeywords_KeywordCaller_Final(int32_t refnum);
void cproxykeywords_KeywordCaller_Finally(int32_t refnum);
void cproxykeywords_KeywordCaller_Float(int32_t refnum);
void cproxykeywords_KeywordCaller_For(int32_t refnum);
void cproxykeywords_KeywordCaller_Goto(int32_t refnum);
void cproxykeywords_KeywordCaller_If(int32_t refnum);
void cproxykeywords_KeywordCaller_Implements(int32_t refnum);
void cproxykeywords_KeywordCaller_Import(int32_t refnum);
void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum);
void cproxykeywords_KeywordCaller_Int(int32_t refnum);
void cproxykeywords_KeywordCaller_Interface(int32_t refnum);
void cproxykeywords_KeywordCaller_Long(int32_t refnum);
void cproxykeywords_KeywordCaller_Native(int32_t refnum);
void cproxykeywords_KeywordCaller_New(int32_t refnum);
void cproxykeywords_KeywordCaller_Nil(int32_t refnum);
void cproxykeywords_KeywordCaller_Null(int32_t refnum);
void cproxykeywords_KeywordCaller_Package(int32_t refnum);
void cproxykeywords_KeywordCaller_Private(int32_t refnum);
void cproxykeywords_KeywordCaller_Protected(int32_t refnum);
void cproxykeywords_KeywordCaller_Public(int32_t refnum);
void cproxykeywords_KeywordCaller_Return(int32_t refnum);
void cproxykeywords_KeywordCaller_Short(int32_t refnum);
void cproxykeywords_KeywordCaller_Static(int32_t refnum);
void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum);
void cproxykeywords_KeywordCaller_Super(int32_t refnum);
void cproxykeywords_KeywordCaller_Switch(int32_t refnum);
void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum);
void cproxykeywords_KeywordCaller_This(int32_t refnum);
void cproxykeywords_KeywordCaller_Throw(int32_t refnum);
void cproxykeywords_KeywordCaller_Throws(int32_t refnum);
void cproxykeywords_KeywordCaller_Transient(int32_t refnum);
void cproxykeywords_KeywordCaller_True(int32_t refnum);
void cproxykeywords_KeywordCaller_Try(int32_t refnum);
void cproxykeywords_KeywordCaller_Void(int32_t refnum);
void cproxykeywords_KeywordCaller_Volatile(int32_t refnum);
void cproxykeywords_KeywordCaller_While(int32_t refnum);
#endif

143
bind/testdata/keywords.objc.h.golden vendored Normal file
View file

@ -0,0 +1,143 @@
// Objective-C API for talking to keywords Go package.
// gobind -lang=objc keywords
//
// File is generated by gobind. Do not edit.
#ifndef __Keywords_H__
#define __Keywords_H__
@import Foundation;
#include "ref.h"
#include "Universe.objc.h"
@protocol KeywordsKeywordCaller;
@class KeywordsKeywordCaller;
@protocol KeywordsKeywordCaller <NSObject>
- (void)abstract;
- (void)assert;
- (void)bool_;
- (void)boolean;
- (void)break;
- (void)byte;
- (void)case;
- (void)catch;
- (void)char_;
- (void)class;
- (void)const_;
- (void)continue;
- (void)default;
- (void)do;
- (void)double_;
- (void)else;
- (void)enum;
- (void)extends;
- (void)false;
- (void)final;
- (void)finally;
- (void)float_;
- (void)for;
- (void)goto;
- (void)if;
- (void)implements;
- (void)import;
- (void)instanceof;
- (void)int_;
- (void)interface;
- (void)long_;
- (void)native;
- (void)new;
- (void)nil_;
- (void)null;
- (void)package;
- (void)private;
- (void)protected;
- (void)public;
- (void)return;
- (void)short_;
- (void)static;
- (void)strictfp;
- (void)super_;
- (void)switch;
- (void)synchronized;
- (void)this;
- (void)throw;
- (void)throws;
- (void)transient;
- (void)true;
- (void)try;
- (void)void_;
- (void)volatile_;
- (void)while;
@end
FOUNDATION_EXPORT void KeywordsConst(NSString* _Nullable id_);
FOUNDATION_EXPORT void KeywordsStatic(NSString* _Nullable strictfp);
@class KeywordsKeywordCaller;
@interface KeywordsKeywordCaller : NSObject <goSeqRefInterface, KeywordsKeywordCaller> {
}
@property(strong, readonly) _Nonnull id _ref;
- (nonnull instancetype)initWithRef:(_Nonnull id)ref;
- (void)abstract;
- (void)assert;
- (void)bool_;
- (void)boolean;
- (void)break;
- (void)byte;
- (void)case;
- (void)catch;
- (void)char_;
- (void)class;
- (void)const_;
- (void)continue;
- (void)default;
- (void)do;
- (void)double_;
- (void)else;
- (void)enum;
- (void)extends;
- (void)false;
- (void)final;
- (void)finally;
- (void)float_;
- (void)for;
- (void)goto;
- (void)if;
- (void)implements;
- (void)import;
- (void)instanceof;
- (void)int_;
- (void)interface;
- (void)long_;
- (void)native;
- (void)new;
- (void)nil_;
- (void)null;
- (void)package;
- (void)private;
- (void)protected;
- (void)public;
- (void)return;
- (void)short_;
- (void)static;
- (void)strictfp;
- (void)super_;
- (void)switch;
- (void)synchronized;
- (void)this;
- (void)throw;
- (void)throws;
- (void)transient;
- (void)true;
- (void)try;
- (void)void_;
- (void)volatile_;
- (void)while;
@end
#endif

696
bind/testdata/keywords.objc.m.golden vendored Normal file
View file

@ -0,0 +1,696 @@
// Objective-C API for talking to keywords Go package.
// gobind -lang=objc keywords
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Keywords.objc.h"
@implementation KeywordsKeywordCaller {
}
- (nonnull instancetype)initWithRef:(id)ref {
self = [super init];
if (self) { __ref = ref; }
return self;
}
- (void)abstract {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Abstract(refnum);
}
- (void)assert {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Assert(refnum);
}
- (void)bool_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Bool(refnum);
}
- (void)boolean {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Boolean(refnum);
}
- (void)break {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Break(refnum);
}
- (void)byte {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Byte(refnum);
}
- (void)case {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Case(refnum);
}
- (void)catch {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Catch(refnum);
}
- (void)char_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Char(refnum);
}
- (void)class {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Class(refnum);
}
- (void)const_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Const(refnum);
}
- (void)continue {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Continue(refnum);
}
- (void)default {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Default(refnum);
}
- (void)do {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Do(refnum);
}
- (void)double_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Double(refnum);
}
- (void)else {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Else(refnum);
}
- (void)enum {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Enum(refnum);
}
- (void)extends {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Extends(refnum);
}
- (void)false {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_False(refnum);
}
- (void)final {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Final(refnum);
}
- (void)finally {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Finally(refnum);
}
- (void)float_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Float(refnum);
}
- (void)for {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_For(refnum);
}
- (void)goto {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Goto(refnum);
}
- (void)if {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_If(refnum);
}
- (void)implements {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Implements(refnum);
}
- (void)import {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Import(refnum);
}
- (void)instanceof {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Instanceof(refnum);
}
- (void)int_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Int(refnum);
}
- (void)interface {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Interface(refnum);
}
- (void)long_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Long(refnum);
}
- (void)native {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Native(refnum);
}
- (void)new {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_New(refnum);
}
- (void)nil_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Nil(refnum);
}
- (void)null {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Null(refnum);
}
- (void)package {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Package(refnum);
}
- (void)private {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Private(refnum);
}
- (void)protected {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Protected(refnum);
}
- (void)public {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Public(refnum);
}
- (void)return {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Return(refnum);
}
- (void)short_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Short(refnum);
}
- (void)static {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Static(refnum);
}
- (void)strictfp {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Strictfp(refnum);
}
- (void)super_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Super(refnum);
}
- (void)switch {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Switch(refnum);
}
- (void)synchronized {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Synchronized(refnum);
}
- (void)this {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_This(refnum);
}
- (void)throw {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Throw(refnum);
}
- (void)throws {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Throws(refnum);
}
- (void)transient {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Transient(refnum);
}
- (void)true {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_True(refnum);
}
- (void)try {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Try(refnum);
}
- (void)void_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Void(refnum);
}
- (void)volatile_ {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_Volatile(refnum);
}
- (void)while {
int32_t refnum = go_seq_go_to_refnum(self._ref);
proxykeywords_KeywordCaller_While(refnum);
}
@end
void KeywordsConst(NSString* _Nullable id_) {
nstring _id_ = go_seq_from_objc_string(id_);
proxykeywords__Const(_id_);
}
void KeywordsStatic(NSString* _Nullable strictfp) {
nstring _strictfp = go_seq_from_objc_string(strictfp);
proxykeywords__Static(_strictfp);
}
void cproxykeywords_KeywordCaller_Abstract(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o abstract];
}
}
void cproxykeywords_KeywordCaller_Assert(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o assert];
}
}
void cproxykeywords_KeywordCaller_Bool(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o bool_];
}
}
void cproxykeywords_KeywordCaller_Boolean(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o boolean];
}
}
void cproxykeywords_KeywordCaller_Break(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o break];
}
}
void cproxykeywords_KeywordCaller_Byte(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o byte];
}
}
void cproxykeywords_KeywordCaller_Case(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o case];
}
}
void cproxykeywords_KeywordCaller_Catch(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o catch];
}
}
void cproxykeywords_KeywordCaller_Char(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o char_];
}
}
void cproxykeywords_KeywordCaller_Class(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o class];
}
}
void cproxykeywords_KeywordCaller_Const(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o const_];
}
}
void cproxykeywords_KeywordCaller_Continue(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o continue];
}
}
void cproxykeywords_KeywordCaller_Default(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o default];
}
}
void cproxykeywords_KeywordCaller_Do(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o do];
}
}
void cproxykeywords_KeywordCaller_Double(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o double_];
}
}
void cproxykeywords_KeywordCaller_Else(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o else];
}
}
void cproxykeywords_KeywordCaller_Enum(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o enum];
}
}
void cproxykeywords_KeywordCaller_Extends(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o extends];
}
}
void cproxykeywords_KeywordCaller_False(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o false];
}
}
void cproxykeywords_KeywordCaller_Final(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o final];
}
}
void cproxykeywords_KeywordCaller_Finally(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o finally];
}
}
void cproxykeywords_KeywordCaller_Float(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o float_];
}
}
void cproxykeywords_KeywordCaller_For(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o for];
}
}
void cproxykeywords_KeywordCaller_Goto(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o goto];
}
}
void cproxykeywords_KeywordCaller_If(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o if];
}
}
void cproxykeywords_KeywordCaller_Implements(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o implements];
}
}
void cproxykeywords_KeywordCaller_Import(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o import];
}
}
void cproxykeywords_KeywordCaller_Instanceof(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o instanceof];
}
}
void cproxykeywords_KeywordCaller_Int(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o int_];
}
}
void cproxykeywords_KeywordCaller_Interface(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o interface];
}
}
void cproxykeywords_KeywordCaller_Long(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o long_];
}
}
void cproxykeywords_KeywordCaller_Native(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o native];
}
}
void cproxykeywords_KeywordCaller_New(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o new];
}
}
void cproxykeywords_KeywordCaller_Nil(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o nil_];
}
}
void cproxykeywords_KeywordCaller_Null(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o null];
}
}
void cproxykeywords_KeywordCaller_Package(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o package];
}
}
void cproxykeywords_KeywordCaller_Private(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o private];
}
}
void cproxykeywords_KeywordCaller_Protected(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o protected];
}
}
void cproxykeywords_KeywordCaller_Public(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o public];
}
}
void cproxykeywords_KeywordCaller_Return(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o return];
}
}
void cproxykeywords_KeywordCaller_Short(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o short_];
}
}
void cproxykeywords_KeywordCaller_Static(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o static];
}
}
void cproxykeywords_KeywordCaller_Strictfp(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o strictfp];
}
}
void cproxykeywords_KeywordCaller_Super(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o super_];
}
}
void cproxykeywords_KeywordCaller_Switch(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o switch];
}
}
void cproxykeywords_KeywordCaller_Synchronized(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o synchronized];
}
}
void cproxykeywords_KeywordCaller_This(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o this];
}
}
void cproxykeywords_KeywordCaller_Throw(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o throw];
}
}
void cproxykeywords_KeywordCaller_Throws(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o throws];
}
}
void cproxykeywords_KeywordCaller_Transient(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o transient];
}
}
void cproxykeywords_KeywordCaller_True(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o true];
}
}
void cproxykeywords_KeywordCaller_Try(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o try];
}
}
void cproxykeywords_KeywordCaller_Void(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o void_];
}
}
void cproxykeywords_KeywordCaller_Volatile(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o volatile_];
}
}
void cproxykeywords_KeywordCaller_While(int32_t refnum) {
@autoreleasepool {
KeywordsKeywordCaller* o = go_seq_objc_from_refnum(refnum);
[o while];
}
}
__attribute__((constructor)) static void init() {
init_seq();
}

15
bind/testdata/objc.go vendored Normal file
View file

@ -0,0 +1,15 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package objc
import (
"ObjC/Foundation"
)
type (
S Foundation.NSString
D Foundation.NSDate
O Foundation.NSObjectC
)

93
bind/testdata/objc.go.golden vendored Normal file
View file

@ -0,0 +1,93 @@
// Code generated by gobind. DO NOT EDIT.
package ObjC
// Used to silence this package not used errors
const Dummy = 0
type Foundation_NSString interface {
}
type Foundation_NSDate interface {
}
type Foundation_NSObjectC interface {
}
// Code generated by gobind. DO NOT EDIT.
package main
// #include "interfaces.h"
import "C"
import "ObjC"
import _seq "golang.org/x/mobile/bind/seq"
type proxy interface{ Bind_proxy_refnum__() int32 }
// Suppress unused package error
var _ = _seq.FromRefNum
const _ = ObjC.Dummy
func init() {
}
type proxy_class_NSString _seq.Ref
func (p *proxy_class_NSString) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func init() {
}
type proxy_class_NSDate _seq.Ref
func (p *proxy_class_NSDate) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func init() {
}
type proxy_class_NSObjectC _seq.Ref
func (p *proxy_class_NSObjectC) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package objc.
//
// autogenerated by gobind -lang=go objc
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "objc.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
type proxyobjc_D _seq.Ref
func (p *proxyobjc_D) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
type proxyobjc_O _seq.Ref
func (p *proxyobjc_O) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
type proxyobjc_S _seq.Ref
func (p *proxyobjc_S) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}

60
bind/testdata/objcw.go vendored Normal file
View file

@ -0,0 +1,60 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package objc
import (
"ObjC/Foundation"
"ObjC/Foundation/NSMutableString"
"ObjC/NetworkExtension/NEPacket"
"ObjC/UIKit"
)
type GoNSDate struct {
Foundation.NSDate
this Foundation.NSDate
}
func (d *GoNSDate) Hash(this Foundation.NSDate) int {
return 0
}
type GoNSObject struct {
C Foundation.NSObjectC // The class
P Foundation.NSObjectP // The protocol
}
func (o *GoNSObject) Description(this Foundation.NSObjectC) string {
return ""
}
func DupNSDate(date Foundation.NSDate) Foundation.NSDate {
return date
}
type GoUIResponder struct {
UIKit.UIResponder
}
func (r *GoUIResponder) PressesBegan(_ Foundation.NSSet, _ UIKit.UIPressesEvent) {
}
const NSUTF8StringEncoding = 8
func CreateReadNSMutableString() {
myData := []byte{'A', 'B'}
// Test byte slices. Use NSMutableString because NSString is
// represented as Go strings in bindings.
// Pass slice from Go to native.
mString := NSMutableString.NewWithData(myData, uint(NSUTF8StringEncoding))
// Pass slice from native to Go.
_ = mString.DataUsingEncoding(uint(NSUTF8StringEncoding))
}
// From <sys/socket.h>
const PF_INET = 2
func CallUcharFunction() {
_ = NEPacket.NewWithData(nil, uint8(PF_INET))
}

620
bind/testdata/objcw.go.golden vendored Normal file
View file

@ -0,0 +1,620 @@
// Code generated by gobind. DO NOT EDIT.
package ObjC
// Used to silence this package not used errors
const Dummy = 0
type Foundation_NSDate interface {
Hash() uint
Description() string
}
type Foundation_NSObjectC interface {
Hash() uint
Description() string
}
type Foundation_NSObjectP interface {
Hash() uint
Description() string
}
type Foundation_NSSet interface {
Hash() uint
Description() string
}
type Foundation_NSMutableString interface {
Hash() uint
Description() string
DataUsingEncoding(encoding uint) []byte
}
type UIKit_UIResponder interface {
Hash() uint
Description() string
}
type UIKit_UIPressesEvent interface {
Hash() uint
Description() string
}
type NetworkExtension_NEPacket interface {
Hash() uint
Description() string
}
type Objc_GoNSDate interface {
Hash() uint
Description() string
Super() Objc_GoNSDate
}
type Objc_GoNSObject interface {
Hash() uint
Description() string
Super() Objc_GoNSObject
}
type Objc_GoUIResponder interface {
Hash() uint
Description() string
Super() Objc_GoUIResponder
}
// Code generated by gobind. DO NOT EDIT.
package main
// #include "interfaces.h"
import "C"
import "ObjC"
import _seq "golang.org/x/mobile/bind/seq"
import "ObjC/Foundation/NSMutableString"
import "ObjC/NetworkExtension/NEPacket"
type proxy interface{ Bind_proxy_refnum__() int32 }
// Suppress unused package error
var _ = _seq.FromRefNum
const _ = ObjC.Dummy
func init() {
}
type proxy_class_NSDate _seq.Ref
func (p *proxy_class_NSDate) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_NSDate) Hash() uint {
res := C.cproxy_NSDate_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_NSDate) Description() string {
res := C.cproxy_NSDate_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
}
type proxy_class_NSObjectC _seq.Ref
func (p *proxy_class_NSObjectC) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_NSObjectC) Hash() uint {
res := C.cproxy_NSObjectC_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_NSObjectC) Description() string {
res := C.cproxy_NSObjectC_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
}
type proxy_class_NSObjectP _seq.Ref
func (p *proxy_class_NSObjectP) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_NSObjectP) Hash() uint {
res := C.cproxy_NSObjectP_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_NSObjectP) Description() string {
res := C.cproxy_NSObjectP_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
}
type proxy_class_NSSet _seq.Ref
func (p *proxy_class_NSSet) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_NSSet) Hash() uint {
res := C.cproxy_NSSet_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_NSSet) Description() string {
res := C.cproxy_NSSet_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
NSMutableString.NewWithData = func(data []byte, encoding uint) ObjC.Foundation_NSMutableString {
_data := fromSlice(data, false)
_encoding := C.ulong(encoding)
res := C.cproxy_s_NSMutableString_NewWithData(_data, _encoding)
var _res ObjC.Foundation_NSMutableString
_res_ref := _seq.FromRefNum(int32(res))
if _res_ref != nil {
if res < 0 { // go object
_res = _res_ref.Get().(ObjC.Foundation_NSMutableString)
} else { // foreign object
_res = (*proxy_class_NSMutableString)(_res_ref)
}
}
return _res
}
}
type proxy_class_NSMutableString _seq.Ref
func (p *proxy_class_NSMutableString) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_NSMutableString) Hash() uint {
res := C.cproxy_NSMutableString_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_NSMutableString) Description() string {
res := C.cproxy_NSMutableString_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func (p *proxy_class_NSMutableString) DataUsingEncoding(encoding uint) []byte {
_encoding := C.ulong(encoding)
res := C.cproxy_NSMutableString_DataUsingEncoding(C.int(p.Bind_proxy_refnum__()), _encoding)
_res := toSlice(res, true)
return _res
}
func init() {
}
type proxy_class_UIResponder _seq.Ref
func (p *proxy_class_UIResponder) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_UIResponder) Hash() uint {
res := C.cproxy_UIResponder_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_UIResponder) Description() string {
res := C.cproxy_UIResponder_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
}
type proxy_class_UIPressesEvent _seq.Ref
func (p *proxy_class_UIPressesEvent) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_UIPressesEvent) Hash() uint {
res := C.cproxy_UIPressesEvent_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_UIPressesEvent) Description() string {
res := C.cproxy_UIPressesEvent_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
NEPacket.NewWithData = func(data []byte, protocolFamily uint8) ObjC.NetworkExtension_NEPacket {
_data := fromSlice(data, false)
_protocolFamily := C.uchar(protocolFamily)
res := C.cproxy_s_NEPacket_NewWithData(_data, _protocolFamily)
var _res ObjC.NetworkExtension_NEPacket
_res_ref := _seq.FromRefNum(int32(res))
if _res_ref != nil {
if res < 0 { // go object
_res = _res_ref.Get().(ObjC.NetworkExtension_NEPacket)
} else { // foreign object
_res = (*proxy_class_NEPacket)(_res_ref)
}
}
return _res
}
}
type proxy_class_NEPacket _seq.Ref
func (p *proxy_class_NEPacket) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_NEPacket) Hash() uint {
res := C.cproxy_NEPacket_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_NEPacket) Description() string {
res := C.cproxy_NEPacket_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
}
type proxy_class_GoNSDate _seq.Ref
func (p *proxy_class_GoNSDate) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_GoNSDate) Hash() uint {
res := C.cproxy_GoNSDate_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_GoNSDate) Description() string {
res := C.cproxy_GoNSDate_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func (p *proxy_class_GoNSDate) Super() ObjC.Objc_GoNSDate {
return &super_GoNSDate{p}
}
type super_GoNSDate struct{ *proxy_class_GoNSDate }
func (p *super_GoNSDate) Hash() uint {
res := C.csuper_GoNSDate_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *super_GoNSDate) Description() string {
res := C.csuper_GoNSDate_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
}
type proxy_class_GoNSObject _seq.Ref
func (p *proxy_class_GoNSObject) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_GoNSObject) Hash() uint {
res := C.cproxy_GoNSObject_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_GoNSObject) Description() string {
res := C.cproxy_GoNSObject_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func (p *proxy_class_GoNSObject) Super() ObjC.Objc_GoNSObject {
return &super_GoNSObject{p}
}
type super_GoNSObject struct{ *proxy_class_GoNSObject }
func (p *super_GoNSObject) Hash() uint {
res := C.csuper_GoNSObject_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *super_GoNSObject) Description() string {
res := C.csuper_GoNSObject_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func init() {
}
type proxy_class_GoUIResponder _seq.Ref
func (p *proxy_class_GoUIResponder) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
func (p *proxy_class_GoUIResponder) Hash() uint {
res := C.cproxy_GoUIResponder_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *proxy_class_GoUIResponder) Description() string {
res := C.cproxy_GoUIResponder_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
func (p *proxy_class_GoUIResponder) Super() ObjC.Objc_GoUIResponder {
return &super_GoUIResponder{p}
}
type super_GoUIResponder struct{ *proxy_class_GoUIResponder }
func (p *super_GoUIResponder) Hash() uint {
res := C.csuper_GoUIResponder_Hash(C.int(p.Bind_proxy_refnum__()))
_res := uint(res)
return _res
}
func (p *super_GoUIResponder) Description() string {
res := C.csuper_GoUIResponder_Description(C.int(p.Bind_proxy_refnum__()))
_res := decodeString(res)
return _res
}
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package objc.
//
// autogenerated by gobind -lang=go objcw
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "objc.h"
*/
import "C"
import (
"ObjC/Foundation"
"ObjC/UIKit"
_seq "golang.org/x/mobile/bind/seq"
"objcw"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxyobjc_GoNSDate_NSDate_Set
func proxyobjc_GoNSDate_NSDate_Set(refnum C.int32_t, v C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
var _v Foundation.NSDate
_v_ref := _seq.FromRefNum(int32(v))
if _v_ref != nil {
if v < 0 { // go object
_v = _v_ref.Get().(Foundation.NSDate)
} else { // foreign object
_v = (*proxy_class_NSDate)(_v_ref)
}
}
ref.Get().(*objc.GoNSDate).NSDate = _v
}
//export proxyobjc_GoNSDate_NSDate_Get
func proxyobjc_GoNSDate_NSDate_Get(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*objc.GoNSDate).NSDate
var _v C.int32_t = _seq.NullRefNum
if v != nil {
_v = C.int32_t(_seq.ToRefNum(v))
}
return _v
}
//export proxyobjc_GoNSDate_Hash
func proxyobjc_GoNSDate_Hash(refnum C.int32_t, param_this C.int32_t) C.nint {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*objc.GoNSDate)
var _param_this Foundation.NSDate
_param_this_ref := _seq.FromRefNum(int32(param_this))
if _param_this_ref != nil {
if param_this < 0 { // go object
_param_this = _param_this_ref.Get().(Foundation.NSDate)
} else { // foreign object
_param_this = (*proxy_class_NSDate)(_param_this_ref)
}
}
res_0 := v.Hash(_param_this)
_res_0 := C.nint(res_0)
return _res_0
}
//export new_objc_GoNSDate
func new_objc_GoNSDate() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(objc.GoNSDate)))
}
//export proxyobjc_GoNSObject_C_Set
func proxyobjc_GoNSObject_C_Set(refnum C.int32_t, v C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
var _v Foundation.NSObjectC
_v_ref := _seq.FromRefNum(int32(v))
if _v_ref != nil {
if v < 0 { // go object
_v = _v_ref.Get().(Foundation.NSObjectC)
} else { // foreign object
_v = (*proxy_class_NSObjectC)(_v_ref)
}
}
ref.Get().(*objc.GoNSObject).C = _v
}
//export proxyobjc_GoNSObject_C_Get
func proxyobjc_GoNSObject_C_Get(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*objc.GoNSObject).C
var _v C.int32_t = _seq.NullRefNum
if v != nil {
_v = C.int32_t(_seq.ToRefNum(v))
}
return _v
}
//export proxyobjc_GoNSObject_P_Set
func proxyobjc_GoNSObject_P_Set(refnum C.int32_t, v C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
var _v Foundation.NSObjectP
_v_ref := _seq.FromRefNum(int32(v))
if _v_ref != nil {
if v < 0 { // go object
_v = _v_ref.Get().(Foundation.NSObjectP)
} else { // foreign object
_v = (*proxy_class_NSObjectP)(_v_ref)
}
}
ref.Get().(*objc.GoNSObject).P = _v
}
//export proxyobjc_GoNSObject_P_Get
func proxyobjc_GoNSObject_P_Get(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*objc.GoNSObject).P
var _v C.int32_t = _seq.NullRefNum
if v != nil {
_v = C.int32_t(_seq.ToRefNum(v))
}
return _v
}
//export proxyobjc_GoNSObject_Description
func proxyobjc_GoNSObject_Description(refnum C.int32_t, param_this C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*objc.GoNSObject)
var _param_this Foundation.NSObjectC
_param_this_ref := _seq.FromRefNum(int32(param_this))
if _param_this_ref != nil {
if param_this < 0 { // go object
_param_this = _param_this_ref.Get().(Foundation.NSObjectC)
} else { // foreign object
_param_this = (*proxy_class_NSObjectC)(_param_this_ref)
}
}
res_0 := v.Description(_param_this)
_res_0 := encodeString(res_0)
return _res_0
}
//export new_objc_GoNSObject
func new_objc_GoNSObject() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(objc.GoNSObject)))
}
//export proxyobjc_GoUIResponder_UIResponder_Set
func proxyobjc_GoUIResponder_UIResponder_Set(refnum C.int32_t, v C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
var _v UIKit.UIResponder
_v_ref := _seq.FromRefNum(int32(v))
if _v_ref != nil {
if v < 0 { // go object
_v = _v_ref.Get().(UIKit.UIResponder)
} else { // foreign object
_v = (*proxy_class_UIResponder)(_v_ref)
}
}
ref.Get().(*objc.GoUIResponder).UIResponder = _v
}
//export proxyobjc_GoUIResponder_UIResponder_Get
func proxyobjc_GoUIResponder_UIResponder_Get(refnum C.int32_t) C.int32_t {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*objc.GoUIResponder).UIResponder
var _v C.int32_t = _seq.NullRefNum
if v != nil {
_v = C.int32_t(_seq.ToRefNum(v))
}
return _v
}
//export proxyobjc_GoUIResponder_PressesBegan
func proxyobjc_GoUIResponder_PressesBegan(refnum C.int32_t, param_p0 C.int32_t, param_p1 C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*objc.GoUIResponder)
var _param_p0 Foundation.NSSet
_param_p0_ref := _seq.FromRefNum(int32(param_p0))
if _param_p0_ref != nil {
if param_p0 < 0 { // go object
_param_p0 = _param_p0_ref.Get().(Foundation.NSSet)
} else { // foreign object
_param_p0 = (*proxy_class_NSSet)(_param_p0_ref)
}
}
var _param_p1 UIKit.UIPressesEvent
_param_p1_ref := _seq.FromRefNum(int32(param_p1))
if _param_p1_ref != nil {
if param_p1 < 0 { // go object
_param_p1 = _param_p1_ref.Get().(UIKit.UIPressesEvent)
} else { // foreign object
_param_p1 = (*proxy_class_UIPressesEvent)(_param_p1_ref)
}
}
v.PressesBegan(_param_p0, _param_p1)
}
//export new_objc_GoUIResponder
func new_objc_GoUIResponder() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(objc.GoUIResponder)))
}
//export proxyobjc__CallUcharFunction
func proxyobjc__CallUcharFunction() {
objc.CallUcharFunction()
}
//export proxyobjc__CreateReadNSMutableString
func proxyobjc__CreateReadNSMutableString() {
objc.CreateReadNSMutableString()
}
//export proxyobjc__DupNSDate
func proxyobjc__DupNSDate(param_date C.int32_t) C.int32_t {
var _param_date Foundation.NSDate
_param_date_ref := _seq.FromRefNum(int32(param_date))
if _param_date_ref != nil {
if param_date < 0 { // go object
_param_date = _param_date_ref.Get().(Foundation.NSDate)
} else { // foreign object
_param_date = (*proxy_class_NSDate)(_param_date_ref)
}
}
res_0 := objc.DupNSDate(_param_date)
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}

46
bind/testdata/structs.go vendored Normal file
View file

@ -0,0 +1,46 @@
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package structs
type S struct {
X, Y float64
unexported bool
}
func (s *S) Sum() float64 {
return s.X + s.Y
}
func (s *S) Identity() (*S, error) {
return s, nil
}
func Identity(s *S) *S {
return s
}
func IdentityWithError(s *S) (*S, error) {
return s, nil
}
type (
S2 struct{}
I interface {
M()
}
)
func (s *S2) M() {
}
func (_ *S2) String() string {
return ""
}
// Structs is a struct with the same name as its package.
type Structs struct{}
func (_ *Structs) M() {
}

167
bind/testdata/structs.go.golden vendored Normal file
View file

@ -0,0 +1,167 @@
// Code generated by gobind. DO NOT EDIT.
// Package main is an autogenerated binder stub for package structs.
//
// autogenerated by gobind -lang=go structs
package main
/*
#include <stdlib.h>
#include <stdint.h>
#include "seq.h"
#include "structs.h"
*/
import "C"
import (
_seq "golang.org/x/mobile/bind/seq"
"structs"
)
// suppress the error if seq ends up unused
var _ = _seq.FromRefNum
//export proxystructs_S_X_Set
func proxystructs_S_X_Set(refnum C.int32_t, v C.double) {
ref := _seq.FromRefNum(int32(refnum))
_v := float64(v)
ref.Get().(*structs.S).X = _v
}
//export proxystructs_S_X_Get
func proxystructs_S_X_Get(refnum C.int32_t) C.double {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*structs.S).X
_v := C.double(v)
return _v
}
//export proxystructs_S_Y_Set
func proxystructs_S_Y_Set(refnum C.int32_t, v C.double) {
ref := _seq.FromRefNum(int32(refnum))
_v := float64(v)
ref.Get().(*structs.S).Y = _v
}
//export proxystructs_S_Y_Get
func proxystructs_S_Y_Get(refnum C.int32_t) C.double {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*structs.S).Y
_v := C.double(v)
return _v
}
//export proxystructs_S_Identity
func proxystructs_S_Identity(refnum C.int32_t) (C.int32_t, C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*structs.S)
res_0, res_1 := v.Identity()
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
var _res_1 C.int32_t = _seq.NullRefNum
if res_1 != nil {
_res_1 = C.int32_t(_seq.ToRefNum(res_1))
}
return _res_0, _res_1
}
//export proxystructs_S_Sum
func proxystructs_S_Sum(refnum C.int32_t) C.double {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*structs.S)
res_0 := v.Sum()
_res_0 := C.double(res_0)
return _res_0
}
//export new_structs_S
func new_structs_S() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(structs.S)))
}
//export proxystructs_S2_M
func proxystructs_S2_M(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*structs.S2)
v.M()
}
//export proxystructs_S2_String
func proxystructs_S2_String(refnum C.int32_t) C.nstring {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*structs.S2)
res_0 := v.String()
_res_0 := encodeString(res_0)
return _res_0
}
//export new_structs_S2
func new_structs_S2() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(structs.S2)))
}
//export proxystructs_Structs_M
func proxystructs_Structs_M(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(*structs.Structs)
v.M()
}
//export new_structs_Structs
func new_structs_Structs() C.int32_t {
return C.int32_t(_seq.ToRefNum(new(structs.Structs)))
}
//export proxystructs_I_M
func proxystructs_I_M(refnum C.int32_t) {
ref := _seq.FromRefNum(int32(refnum))
v := ref.Get().(structs.I)
v.M()
}
type proxystructs_I _seq.Ref
func (p *proxystructs_I) Bind_proxy_refnum__() int32 {
return (*_seq.Ref)(p).Bind_IncNum()
}
func (p *proxystructs_I) M() {
C.cproxystructs_I_M(C.int32_t(p.Bind_proxy_refnum__()))
}
//export proxystructs__Identity
func proxystructs__Identity(param_s C.int32_t) C.int32_t {
// Must be a Go object
var _param_s *structs.S
if _param_s_ref := _seq.FromRefNum(int32(param_s)); _param_s_ref != nil {
_param_s = _param_s_ref.Get().(*structs.S)
}
res_0 := structs.Identity(_param_s)
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
return _res_0
}
//export proxystructs__IdentityWithError
func proxystructs__IdentityWithError(param_s C.int32_t) (C.int32_t, C.int32_t) {
// Must be a Go object
var _param_s *structs.S
if _param_s_ref := _seq.FromRefNum(int32(param_s)); _param_s_ref != nil {
_param_s = _param_s_ref.Get().(*structs.S)
}
res_0, res_1 := structs.IdentityWithError(_param_s)
var _res_0 C.int32_t = _seq.NullRefNum
if res_0 != nil {
_res_0 = C.int32_t(_seq.ToRefNum(res_0))
}
var _res_1 C.int32_t = _seq.NullRefNum
if res_1 != nil {
_res_1 = C.int32_t(_seq.ToRefNum(res_1))
}
return _res_0, _res_1
}

Some files were not shown because too many files have changed in this diff Show more