github.com/acrespo/mobile@v0.0.0-20190107162257-dc0771356504/bind/testdata/interfaces.go.golden (about) 1 // Package main is an autogenerated binder stub for package interfaces. 2 // gobind -lang=go interfaces 3 // 4 // File is generated by gobind. Do not edit. 5 package main 6 7 /* 8 #include <stdlib.h> 9 #include <stdint.h> 10 #include "seq.h" 11 #include "interfaces.h" 12 13 */ 14 import "C" 15 16 import ( 17 _seq "golang.org/x/mobile/bind/seq" 18 "interfaces" 19 ) 20 21 // suppress the error if seq ends up unused 22 var _ = _seq.FromRefNum 23 24 //export proxyinterfaces_Error_Err 25 func proxyinterfaces_Error_Err(refnum C.int32_t) C.int32_t { 26 ref := _seq.FromRefNum(int32(refnum)) 27 v := ref.Get().(interfaces.Error) 28 res_0 := v.Err() 29 var _res_0 C.int32_t = _seq.NullRefNum 30 if res_0 != nil { 31 _res_0 = C.int32_t(_seq.ToRefNum(res_0)) 32 } 33 return _res_0 34 } 35 36 type proxyinterfaces_Error _seq.Ref 37 38 func (p *proxyinterfaces_Error) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } 39 40 func (p *proxyinterfaces_Error) Err() error { 41 res := C.cproxyinterfaces_Error_Err(C.int32_t(p.Bind_proxy_refnum__())) 42 var _res error 43 _res_ref := _seq.FromRefNum(int32(res)) 44 if _res_ref != nil { 45 if res < 0 { // go object 46 _res = _res_ref.Get().(error) 47 } else { // foreign object 48 _res = (*proxy_error)(_res_ref) 49 } 50 } 51 return _res 52 } 53 54 //export proxyinterfaces_I_Rand 55 func proxyinterfaces_I_Rand(refnum C.int32_t) C.int32_t { 56 ref := _seq.FromRefNum(int32(refnum)) 57 v := ref.Get().(interfaces.I) 58 res_0 := v.Rand() 59 _res_0 := C.int32_t(res_0) 60 return _res_0 61 } 62 63 type proxyinterfaces_I _seq.Ref 64 65 func (p *proxyinterfaces_I) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } 66 67 func (p *proxyinterfaces_I) Rand() int32 { 68 res := C.cproxyinterfaces_I_Rand(C.int32_t(p.Bind_proxy_refnum__())) 69 _res := int32(res) 70 return _res 71 } 72 73 //export proxyinterfaces_I1_J 74 func proxyinterfaces_I1_J(refnum C.int32_t) { 75 ref := _seq.FromRefNum(int32(refnum)) 76 v := ref.Get().(interfaces.I1) 77 v.J() 78 } 79 80 //export proxyinterfaces_I2_G 81 func proxyinterfaces_I2_G(refnum C.int32_t) { 82 ref := _seq.FromRefNum(int32(refnum)) 83 v := ref.Get().(interfaces.I2) 84 v.G() 85 } 86 87 //export proxyinterfaces_I3_F 88 func proxyinterfaces_I3_F(refnum C.int32_t) C.int32_t { 89 ref := _seq.FromRefNum(int32(refnum)) 90 v := ref.Get().(interfaces.I3) 91 res_0 := v.F() 92 var _res_0 C.int32_t = _seq.NullRefNum 93 if res_0 != nil { 94 _res_0 = C.int32_t(_seq.ToRefNum(res_0)) 95 } 96 return _res_0 97 } 98 99 type proxyinterfaces_I3 _seq.Ref 100 101 func (p *proxyinterfaces_I3) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } 102 103 func (p *proxyinterfaces_I3) F() interfaces.I1 { 104 res := C.cproxyinterfaces_I3_F(C.int32_t(p.Bind_proxy_refnum__())) 105 var _res interfaces.I1 106 _res_ref := _seq.FromRefNum(int32(res)) 107 if _res_ref != nil { 108 if res < 0 { // go object 109 _res = _res_ref.Get().(interfaces.I1) 110 } 111 } 112 return _res 113 } 114 115 //export proxyinterfaces_Interfaces_SomeMethod 116 func proxyinterfaces_Interfaces_SomeMethod(refnum C.int32_t) { 117 ref := _seq.FromRefNum(int32(refnum)) 118 v := ref.Get().(interfaces.Interfaces) 119 v.SomeMethod() 120 } 121 122 type proxyinterfaces_Interfaces _seq.Ref 123 124 func (p *proxyinterfaces_Interfaces) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } 125 126 func (p *proxyinterfaces_Interfaces) SomeMethod() { 127 C.cproxyinterfaces_Interfaces_SomeMethod(C.int32_t(p.Bind_proxy_refnum__())) 128 } 129 130 //export proxyinterfaces_LargerI_AnotherFunc 131 func proxyinterfaces_LargerI_AnotherFunc(refnum C.int32_t) { 132 ref := _seq.FromRefNum(int32(refnum)) 133 v := ref.Get().(interfaces.LargerI) 134 v.AnotherFunc() 135 } 136 137 //export proxyinterfaces_LargerI_Rand 138 func proxyinterfaces_LargerI_Rand(refnum C.int32_t) C.int32_t { 139 ref := _seq.FromRefNum(int32(refnum)) 140 v := ref.Get().(interfaces.LargerI) 141 res_0 := v.Rand() 142 _res_0 := C.int32_t(res_0) 143 return _res_0 144 } 145 146 type proxyinterfaces_LargerI _seq.Ref 147 148 func (p *proxyinterfaces_LargerI) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } 149 150 func (p *proxyinterfaces_LargerI) AnotherFunc() { 151 C.cproxyinterfaces_LargerI_AnotherFunc(C.int32_t(p.Bind_proxy_refnum__())) 152 } 153 154 func (p *proxyinterfaces_LargerI) Rand() int32 { 155 res := C.cproxyinterfaces_LargerI_Rand(C.int32_t(p.Bind_proxy_refnum__())) 156 _res := int32(res) 157 return _res 158 } 159 160 //export proxyinterfaces_SameI_Rand 161 func proxyinterfaces_SameI_Rand(refnum C.int32_t) C.int32_t { 162 ref := _seq.FromRefNum(int32(refnum)) 163 v := ref.Get().(interfaces.SameI) 164 res_0 := v.Rand() 165 _res_0 := C.int32_t(res_0) 166 return _res_0 167 } 168 169 type proxyinterfaces_SameI _seq.Ref 170 171 func (p *proxyinterfaces_SameI) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } 172 173 func (p *proxyinterfaces_SameI) Rand() int32 { 174 res := C.cproxyinterfaces_SameI_Rand(C.int32_t(p.Bind_proxy_refnum__())) 175 _res := int32(res) 176 return _res 177 } 178 179 //export proxyinterfaces_WithParam_HasParam 180 func proxyinterfaces_WithParam_HasParam(refnum C.int32_t, param_p0 C.char) { 181 ref := _seq.FromRefNum(int32(refnum)) 182 v := ref.Get().(interfaces.WithParam) 183 _param_p0 := param_p0 != 0 184 v.HasParam(_param_p0) 185 } 186 187 type proxyinterfaces_WithParam _seq.Ref 188 189 func (p *proxyinterfaces_WithParam) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() } 190 191 func (p *proxyinterfaces_WithParam) HasParam(param_p0 bool) { 192 var _param_p0 C.char = 0 193 if param_p0 { 194 _param_p0 = 1 195 } 196 C.cproxyinterfaces_WithParam_HasParam(C.int32_t(p.Bind_proxy_refnum__()), _param_p0) 197 } 198 199 //export proxyinterfaces__Add3 200 func proxyinterfaces__Add3(param_r C.int32_t) C.int32_t { 201 var _param_r interfaces.I 202 _param_r_ref := _seq.FromRefNum(int32(param_r)) 203 if _param_r_ref != nil { 204 if param_r < 0 { // go object 205 _param_r = _param_r_ref.Get().(interfaces.I) 206 } else { // foreign object 207 _param_r = (*proxyinterfaces_I)(_param_r_ref) 208 } 209 } 210 res_0 := interfaces.Add3(_param_r) 211 _res_0 := C.int32_t(res_0) 212 return _res_0 213 } 214 215 //export proxyinterfaces__CallErr 216 func proxyinterfaces__CallErr(param_e C.int32_t) C.int32_t { 217 var _param_e interfaces.Error 218 _param_e_ref := _seq.FromRefNum(int32(param_e)) 219 if _param_e_ref != nil { 220 if param_e < 0 { // go object 221 _param_e = _param_e_ref.Get().(interfaces.Error) 222 } else { // foreign object 223 _param_e = (*proxyinterfaces_Error)(_param_e_ref) 224 } 225 } 226 res_0 := interfaces.CallErr(_param_e) 227 var _res_0 C.int32_t = _seq.NullRefNum 228 if res_0 != nil { 229 _res_0 = C.int32_t(_seq.ToRefNum(res_0)) 230 } 231 return _res_0 232 } 233 234 //export proxyinterfaces__Seven 235 func proxyinterfaces__Seven() C.int32_t { 236 res_0 := interfaces.Seven() 237 var _res_0 C.int32_t = _seq.NullRefNum 238 if res_0 != nil { 239 _res_0 = C.int32_t(_seq.ToRefNum(res_0)) 240 } 241 return _res_0 242 }