This change makes gobind to generate proper Go-side proxy code to handle interface methods that have parameters and return values. It allows gobind to accept struct pointer types as parameters or a return value of a method. Fixes golang/go#9487, golang/go#9488. Change-Id: Id243c42ee0701d40e3871e392140368c2f8f9bc6 Reviewed-on: https://go-review.googlesource.com/2348 Reviewed-by: David Crawshaw <crawshaw@golang.org>
58 lines
1.2 KiB
Plaintext
58 lines
1.2 KiB
Plaintext
// Package go_interfaces is an autogenerated binder stub for package interfaces.
|
|
// gobind -lang=go interfaces
|
|
//
|
|
// File is generated by gobind. Do not edit.
|
|
package go_interfaces
|
|
|
|
import (
|
|
"golang.org/x/mobile/bind/seq"
|
|
"interfaces"
|
|
)
|
|
|
|
func proxy_Add3(out, in *seq.Buffer) {
|
|
var param_r interfaces.I
|
|
param_r_ref := in.ReadRef()
|
|
if param_r_ref.Num < 0 { // go object
|
|
param_r = param_r_ref.Get().(interfaces.I)
|
|
} else { // foreign object
|
|
param_r = (*proxyI)(param_r_ref)
|
|
}
|
|
res := interfaces.Add3(param_r)
|
|
out.WriteInt32(res)
|
|
}
|
|
|
|
const (
|
|
proxyIDescriptor = "go.interfaces.I"
|
|
proxyIRandCode = 0x10a
|
|
)
|
|
|
|
func proxyIRand(out, in *seq.Buffer) {
|
|
ref := in.ReadRef()
|
|
v := ref.Get().(interfaces.I)
|
|
res := v.Rand()
|
|
out.WriteInt32(res)
|
|
}
|
|
|
|
func init() {
|
|
seq.Register(proxyIDescriptor, proxyIRandCode, proxyIRand)
|
|
}
|
|
|
|
type proxyI seq.Ref
|
|
|
|
func (p *proxyI) Rand() int32 {
|
|
in := new(seq.Buffer)
|
|
out := seq.Transact((*seq.Ref)(p), proxyIRandCode, in)
|
|
res_0 := out.ReadInt32()
|
|
return res_0
|
|
}
|
|
|
|
func proxy_Seven(out, in *seq.Buffer) {
|
|
res := interfaces.Seven()
|
|
out.WriteGoRef(res)
|
|
}
|
|
|
|
func init() {
|
|
seq.Register("interfaces", 1, proxy_Add3)
|
|
seq.Register("interfaces", 2, proxy_Seven)
|
|
}
|