github.com/thommil/tge-mobile@v0.0.0-20190308225214-66a08abd51aa/bind/testdata/structs.go.golden (about)

     1  // Package main is an autogenerated binder stub for package structs.
     2  //   gobind -lang=go structs
     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 "structs.h"
    12  
    13  */
    14  import "C"
    15  
    16  import (
    17  	_seq "github.com/thommil/tge-mobile/bind/seq"
    18  	"structs"
    19  )
    20  
    21  // suppress the error if seq ends up unused
    22  var _ = _seq.FromRefNum
    23  
    24  //export proxystructs_S_X_Set
    25  func proxystructs_S_X_Set(refnum C.int32_t, v C.double) {
    26  	ref := _seq.FromRefNum(int32(refnum))
    27  	_v := float64(v)
    28  	ref.Get().(*structs.S).X = _v
    29  }
    30  
    31  //export proxystructs_S_X_Get
    32  func proxystructs_S_X_Get(refnum C.int32_t) C.double {
    33  	ref := _seq.FromRefNum(int32(refnum))
    34  	v := ref.Get().(*structs.S).X
    35  	_v := C.double(v)
    36  	return _v
    37  }
    38  
    39  //export proxystructs_S_Y_Set
    40  func proxystructs_S_Y_Set(refnum C.int32_t, v C.double) {
    41  	ref := _seq.FromRefNum(int32(refnum))
    42  	_v := float64(v)
    43  	ref.Get().(*structs.S).Y = _v
    44  }
    45  
    46  //export proxystructs_S_Y_Get
    47  func proxystructs_S_Y_Get(refnum C.int32_t) C.double {
    48  	ref := _seq.FromRefNum(int32(refnum))
    49  	v := ref.Get().(*structs.S).Y
    50  	_v := C.double(v)
    51  	return _v
    52  }
    53  
    54  //export proxystructs_S_Identity
    55  func proxystructs_S_Identity(refnum C.int32_t) (C.int32_t, C.int32_t) {
    56  	ref := _seq.FromRefNum(int32(refnum))
    57  	v := ref.Get().(*structs.S)
    58  	res_0, res_1 := v.Identity()
    59  	var _res_0 C.int32_t = _seq.NullRefNum
    60  	if res_0 != nil {
    61  		_res_0 = C.int32_t(_seq.ToRefNum(res_0))
    62  	}
    63  	var _res_1 C.int32_t = _seq.NullRefNum
    64  	if res_1 != nil {
    65  		_res_1 = C.int32_t(_seq.ToRefNum(res_1))
    66  	}
    67  	return _res_0, _res_1
    68  }
    69  
    70  //export proxystructs_S_Sum
    71  func proxystructs_S_Sum(refnum C.int32_t) C.double {
    72  	ref := _seq.FromRefNum(int32(refnum))
    73  	v := ref.Get().(*structs.S)
    74  	res_0 := v.Sum()
    75  	_res_0 := C.double(res_0)
    76  	return _res_0
    77  }
    78  
    79  //export new_structs_S
    80  func new_structs_S() C.int32_t {
    81  	return C.int32_t(_seq.ToRefNum(new(structs.S)))
    82  }
    83  
    84  //export proxystructs_S2_M
    85  func proxystructs_S2_M(refnum C.int32_t) {
    86  	ref := _seq.FromRefNum(int32(refnum))
    87  	v := ref.Get().(*structs.S2)
    88  	v.M()
    89  }
    90  
    91  //export proxystructs_S2_String
    92  func proxystructs_S2_String(refnum C.int32_t) C.nstring {
    93  	ref := _seq.FromRefNum(int32(refnum))
    94  	v := ref.Get().(*structs.S2)
    95  	res_0 := v.String()
    96  	_res_0 := encodeString(res_0)
    97  	return _res_0
    98  }
    99  
   100  //export new_structs_S2
   101  func new_structs_S2() C.int32_t {
   102  	return C.int32_t(_seq.ToRefNum(new(structs.S2)))
   103  }
   104  
   105  //export proxystructs_Structs_M
   106  func proxystructs_Structs_M(refnum C.int32_t) {
   107  	ref := _seq.FromRefNum(int32(refnum))
   108  	v := ref.Get().(*structs.Structs)
   109  	v.M()
   110  }
   111  
   112  //export new_structs_Structs
   113  func new_structs_Structs() C.int32_t {
   114  	return C.int32_t(_seq.ToRefNum(new(structs.Structs)))
   115  }
   116  
   117  //export proxystructs_I_M
   118  func proxystructs_I_M(refnum C.int32_t) {
   119  	ref := _seq.FromRefNum(int32(refnum))
   120  	v := ref.Get().(structs.I)
   121  	v.M()
   122  }
   123  
   124  type proxystructs_I _seq.Ref
   125  
   126  func (p *proxystructs_I) Bind_proxy_refnum__() int32 { return (*_seq.Ref)(p).Bind_IncNum() }
   127  
   128  func (p *proxystructs_I) M() {
   129  	C.cproxystructs_I_M(C.int32_t(p.Bind_proxy_refnum__()))
   130  }
   131  
   132  //export proxystructs__Identity
   133  func proxystructs__Identity(param_s C.int32_t) C.int32_t {
   134  	// Must be a Go object
   135  	var _param_s *structs.S
   136  	if _param_s_ref := _seq.FromRefNum(int32(param_s)); _param_s_ref != nil {
   137  		_param_s = _param_s_ref.Get().(*structs.S)
   138  	}
   139  	res_0 := structs.Identity(_param_s)
   140  	var _res_0 C.int32_t = _seq.NullRefNum
   141  	if res_0 != nil {
   142  		_res_0 = C.int32_t(_seq.ToRefNum(res_0))
   143  	}
   144  	return _res_0
   145  }
   146  
   147  //export proxystructs__IdentityWithError
   148  func proxystructs__IdentityWithError(param_s C.int32_t) (C.int32_t, C.int32_t) {
   149  	// Must be a Go object
   150  	var _param_s *structs.S
   151  	if _param_s_ref := _seq.FromRefNum(int32(param_s)); _param_s_ref != nil {
   152  		_param_s = _param_s_ref.Get().(*structs.S)
   153  	}
   154  	res_0, res_1 := structs.IdentityWithError(_param_s)
   155  	var _res_0 C.int32_t = _seq.NullRefNum
   156  	if res_0 != nil {
   157  		_res_0 = C.int32_t(_seq.ToRefNum(res_0))
   158  	}
   159  	var _res_1 C.int32_t = _seq.NullRefNum
   160  	if res_1 != nil {
   161  		_res_1 = C.int32_t(_seq.ToRefNum(res_1))
   162  	}
   163  	return _res_0, _res_1
   164  }