github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/mobile/bind/testdata/vars.objc.m.golden (about)

     1  // Objective-C API for talking to vars Go package.
     2  //   gobind -lang=objc vars
     3  //
     4  // File is generated by gobind. Do not edit.
     5  
     6  #include "GoVars.h"
     7  #include <Foundation/Foundation.h>
     8  #include "seq.h"
     9  
    10  static NSString* errDomain = @"go.vars";
    11  
    12  @protocol goSeqRefInterface
    13  -(GoSeqRef*) _ref;
    14  @end
    15  
    16  #define _DESCRIPTOR_ "vars"
    17  
    18  @class GoVarsI;
    19  
    20  @interface GoVarsI : NSObject <GoVarsI> {
    21  }
    22  @property(strong, readonly) id _ref;
    23  
    24  - (id)initWithRef:(id)ref;
    25  @end
    26  
    27  #define _GO_vars_S_DESCRIPTOR_ "go.vars.S"
    28  
    29  @implementation GoVarsS {
    30  }
    31  
    32  - (id)initWithRef:(id)ref {
    33  	self = [super init];
    34  	if (self) { __ref = ref; }
    35  	return self;
    36  }
    37  
    38  @end
    39  
    40  #define _GO_vars_I_DESCRIPTOR_ "go.vars.I"
    41  
    42  @implementation GoVarsI {
    43  }
    44  
    45  - (id)initWithRef:(id)ref {
    46  	self = [super init];
    47  	if (self) { __ref = ref; }
    48  	return self;
    49  }
    50  
    51  @end
    52  
    53  static void proxyGoVarsI(id obj, int code, GoSeq* in, GoSeq* out) {
    54  	switch (code) {
    55  	default:
    56  		NSLog(@"unknown code %x for _GO_vars_I_DESCRIPTOR_", code);
    57  	}
    58  }
    59  
    60  @implementation GoVars
    61  + (void) setABool:(BOOL)v {
    62  	GoSeq in_ = {};
    63  	GoSeq out_ = {};
    64  	go_seq_writeBool(&in_, v);
    65  	go_seq_send("vars.ABool", 1, &in_, &out_);
    66  	go_seq_free(&in_);
    67  	go_seq_free(&out_);
    68  }
    69  
    70  + (BOOL) aBool {
    71  	GoSeq in_ = {};
    72  	GoSeq out_ = {};
    73  	go_seq_send("vars.ABool", 2, &in_, &out_);
    74  	BOOL ret = go_seq_readBool(&out_);
    75  	go_seq_free(&in_);
    76  	go_seq_free(&out_);
    77  	return ret;
    78  }
    79  
    80  + (void) setAFloat:(double)v {
    81  	GoSeq in_ = {};
    82  	GoSeq out_ = {};
    83  	go_seq_writeFloat64(&in_, v);
    84  	go_seq_send("vars.AFloat", 1, &in_, &out_);
    85  	go_seq_free(&in_);
    86  	go_seq_free(&out_);
    87  }
    88  
    89  + (double) aFloat {
    90  	GoSeq in_ = {};
    91  	GoSeq out_ = {};
    92  	go_seq_send("vars.AFloat", 2, &in_, &out_);
    93  	double ret = go_seq_readFloat64(&out_);
    94  	go_seq_free(&in_);
    95  	go_seq_free(&out_);
    96  	return ret;
    97  }
    98  
    99  + (void) setAFloat32:(float)v {
   100  	GoSeq in_ = {};
   101  	GoSeq out_ = {};
   102  	go_seq_writeFloat32(&in_, v);
   103  	go_seq_send("vars.AFloat32", 1, &in_, &out_);
   104  	go_seq_free(&in_);
   105  	go_seq_free(&out_);
   106  }
   107  
   108  + (float) aFloat32 {
   109  	GoSeq in_ = {};
   110  	GoSeq out_ = {};
   111  	go_seq_send("vars.AFloat32", 2, &in_, &out_);
   112  	float ret = go_seq_readFloat32(&out_);
   113  	go_seq_free(&in_);
   114  	go_seq_free(&out_);
   115  	return ret;
   116  }
   117  
   118  + (void) setAFloat64:(double)v {
   119  	GoSeq in_ = {};
   120  	GoSeq out_ = {};
   121  	go_seq_writeFloat64(&in_, v);
   122  	go_seq_send("vars.AFloat64", 1, &in_, &out_);
   123  	go_seq_free(&in_);
   124  	go_seq_free(&out_);
   125  }
   126  
   127  + (double) aFloat64 {
   128  	GoSeq in_ = {};
   129  	GoSeq out_ = {};
   130  	go_seq_send("vars.AFloat64", 2, &in_, &out_);
   131  	double ret = go_seq_readFloat64(&out_);
   132  	go_seq_free(&in_);
   133  	go_seq_free(&out_);
   134  	return ret;
   135  }
   136  
   137  + (void) setAString:(NSString*)v {
   138  	GoSeq in_ = {};
   139  	GoSeq out_ = {};
   140  	go_seq_writeUTF8(&in_, v);
   141  	go_seq_send("vars.AString", 1, &in_, &out_);
   142  	go_seq_free(&in_);
   143  	go_seq_free(&out_);
   144  }
   145  
   146  + (NSString*) aString {
   147  	GoSeq in_ = {};
   148  	GoSeq out_ = {};
   149  	go_seq_send("vars.AString", 2, &in_, &out_);
   150  	NSString* ret = go_seq_readUTF8(&out_);
   151  	go_seq_free(&in_);
   152  	go_seq_free(&out_);
   153  	return ret;
   154  }
   155  
   156  + (void) setAStructPtr:(GoVarsS*)v {
   157  	GoSeq in_ = {};
   158  	GoSeq out_ = {};
   159  	if ([(id<NSObject>)(v) isKindOfClass:[GoVarsS class]]) {
   160  		id<goSeqRefInterface> v_proxy = (id<goSeqRefInterface>)(v);
   161  		go_seq_writeRef(&in_, v_proxy._ref);
   162  	} else {
   163  		go_seq_writeObjcRef(&in_, v);
   164  	}
   165  	go_seq_send("vars.AStructPtr", 1, &in_, &out_);
   166  	go_seq_free(&in_);
   167  	go_seq_free(&out_);
   168  }
   169  
   170  + (GoVarsS*) aStructPtr {
   171  	GoSeq in_ = {};
   172  	GoSeq out_ = {};
   173  	go_seq_send("vars.AStructPtr", 2, &in_, &out_);
   174  	GoSeqRef* ret_ref = go_seq_readRef(&out_);
   175  	GoVarsS* ret = ret_ref.obj;
   176  	if (ret == NULL) {
   177  		ret = [[GoVarsS alloc] initWithRef:ret_ref];
   178  	}
   179  	go_seq_free(&in_);
   180  	go_seq_free(&out_);
   181  	return ret;
   182  }
   183  
   184  + (void) setAnInt:(int)v {
   185  	GoSeq in_ = {};
   186  	GoSeq out_ = {};
   187  	go_seq_writeInt(&in_, v);
   188  	go_seq_send("vars.AnInt", 1, &in_, &out_);
   189  	go_seq_free(&in_);
   190  	go_seq_free(&out_);
   191  }
   192  
   193  + (int) anInt {
   194  	GoSeq in_ = {};
   195  	GoSeq out_ = {};
   196  	go_seq_send("vars.AnInt", 2, &in_, &out_);
   197  	int ret = go_seq_readInt(&out_);
   198  	go_seq_free(&in_);
   199  	go_seq_free(&out_);
   200  	return ret;
   201  }
   202  
   203  + (void) setAnInt16:(int16_t)v {
   204  	GoSeq in_ = {};
   205  	GoSeq out_ = {};
   206  	go_seq_writeInt16(&in_, v);
   207  	go_seq_send("vars.AnInt16", 1, &in_, &out_);
   208  	go_seq_free(&in_);
   209  	go_seq_free(&out_);
   210  }
   211  
   212  + (int16_t) anInt16 {
   213  	GoSeq in_ = {};
   214  	GoSeq out_ = {};
   215  	go_seq_send("vars.AnInt16", 2, &in_, &out_);
   216  	int16_t ret = go_seq_readInt16(&out_);
   217  	go_seq_free(&in_);
   218  	go_seq_free(&out_);
   219  	return ret;
   220  }
   221  
   222  + (void) setAnInt32:(int32_t)v {
   223  	GoSeq in_ = {};
   224  	GoSeq out_ = {};
   225  	go_seq_writeInt32(&in_, v);
   226  	go_seq_send("vars.AnInt32", 1, &in_, &out_);
   227  	go_seq_free(&in_);
   228  	go_seq_free(&out_);
   229  }
   230  
   231  + (int32_t) anInt32 {
   232  	GoSeq in_ = {};
   233  	GoSeq out_ = {};
   234  	go_seq_send("vars.AnInt32", 2, &in_, &out_);
   235  	int32_t ret = go_seq_readInt32(&out_);
   236  	go_seq_free(&in_);
   237  	go_seq_free(&out_);
   238  	return ret;
   239  }
   240  
   241  + (void) setAnInt64:(int64_t)v {
   242  	GoSeq in_ = {};
   243  	GoSeq out_ = {};
   244  	go_seq_writeInt64(&in_, v);
   245  	go_seq_send("vars.AnInt64", 1, &in_, &out_);
   246  	go_seq_free(&in_);
   247  	go_seq_free(&out_);
   248  }
   249  
   250  + (int64_t) anInt64 {
   251  	GoSeq in_ = {};
   252  	GoSeq out_ = {};
   253  	go_seq_send("vars.AnInt64", 2, &in_, &out_);
   254  	int64_t ret = go_seq_readInt64(&out_);
   255  	go_seq_free(&in_);
   256  	go_seq_free(&out_);
   257  	return ret;
   258  }
   259  
   260  + (void) setAnInt8:(int8_t)v {
   261  	GoSeq in_ = {};
   262  	GoSeq out_ = {};
   263  	go_seq_writeInt8(&in_, v);
   264  	go_seq_send("vars.AnInt8", 1, &in_, &out_);
   265  	go_seq_free(&in_);
   266  	go_seq_free(&out_);
   267  }
   268  
   269  + (int8_t) anInt8 {
   270  	GoSeq in_ = {};
   271  	GoSeq out_ = {};
   272  	go_seq_send("vars.AnInt8", 2, &in_, &out_);
   273  	int8_t ret = go_seq_readInt8(&out_);
   274  	go_seq_free(&in_);
   275  	go_seq_free(&out_);
   276  	return ret;
   277  }
   278  
   279  + (void) setAnInterface:(id<GoVarsI>)v {
   280  	GoSeq in_ = {};
   281  	GoSeq out_ = {};
   282  	if ([(id<NSObject>)(v) isKindOfClass:[GoVarsI class]]) {
   283  		id<goSeqRefInterface> v_proxy = (id<goSeqRefInterface>)(v);
   284  		go_seq_writeRef(&in_, v_proxy._ref);
   285  	} else {
   286  		go_seq_writeObjcRef(&in_, v);
   287  	}
   288  	go_seq_send("vars.AnInterface", 1, &in_, &out_);
   289  	go_seq_free(&in_);
   290  	go_seq_free(&out_);
   291  }
   292  
   293  + (id<GoVarsI>) anInterface {
   294  	GoSeq in_ = {};
   295  	GoSeq out_ = {};
   296  	go_seq_send("vars.AnInterface", 2, &in_, &out_);
   297  	GoSeqRef* ret_ref = go_seq_readRef(&out_);
   298  	id<GoVarsI> ret = ret_ref.obj;
   299  	if (ret == NULL) {
   300  		ret = [[GoVarsI alloc] initWithRef:ret_ref];
   301  	}
   302  	go_seq_free(&in_);
   303  	go_seq_free(&out_);
   304  	return ret;
   305  }
   306  
   307  @end
   308  
   309  
   310  __attribute__((constructor)) static void init() {
   311  	go_seq_register_proxy("go.vars.I", proxyGoVarsI);
   312  }