github.com/danbrough/mobile@v0.0.3-beta03/bind/testdata/interfaces.go.golden (about)

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