| // Objective-C API for talking to issue10788 Go package. |
| // gobind -lang=objc issue10788 |
| // |
| // File is generated by gobind. Do not edit. |
| |
| #include "GoIssue10788.h" |
| #include <Foundation/Foundation.h> |
| #include "seq.h" |
| |
| static NSString* errDomain = @"go.issue10788"; |
| |
| @protocol goSeqRefInterface |
| -(GoSeqRef*) _ref; |
| @end |
| |
| #define _DESCRIPTOR_ "issue10788" |
| |
| @class GoIssue10788TestInterface; |
| |
| @interface GoIssue10788TestInterface : NSObject <GoIssue10788TestInterface> { |
| } |
| @property(strong, readonly) id _ref; |
| |
| - (id)initWithRef:(id)ref; |
| - (void)doSomeWork:(GoIssue10788TestStruct*)s; |
| - (void)multipleUnnamedParams:(int)p0 p1:(NSString*)p1 p2:(int64_t)p2; |
| @end |
| |
| #define _GO_issue10788_TestStruct_DESCRIPTOR_ "go.issue10788.TestStruct" |
| #define _GO_issue10788_TestStruct_FIELD_Value_GET_ (0x00f) |
| #define _GO_issue10788_TestStruct_FIELD_Value_SET_ (0x01f) |
| |
| @implementation GoIssue10788TestStruct { |
| } |
| |
| - (id)initWithRef:(id)ref { |
| self = [super init]; |
| if (self) { __ref = ref; } |
| return self; |
| } |
| |
| - (NSString*)value { |
| GoSeq in_ = {}; |
| GoSeq out_ = {}; |
| go_seq_writeRef(&in_, self._ref); |
| go_seq_send(_GO_issue10788_TestStruct_DESCRIPTOR_, _GO_issue10788_TestStruct_FIELD_Value_GET_, &in_, &out_); |
| NSString* ret_ = go_seq_readUTF8(&out_); |
| go_seq_free(&in_); |
| go_seq_free(&out_); |
| return ret_; |
| } |
| |
| - (void)setValue:(NSString*)v { |
| GoSeq in_ = {}; |
| GoSeq out_ = {}; |
| go_seq_writeRef(&in_, self._ref); |
| go_seq_writeUTF8(&in_, v); |
| go_seq_send(_GO_issue10788_TestStruct_DESCRIPTOR_, _GO_issue10788_TestStruct_FIELD_Value_SET_, &in_, &out_); |
| go_seq_free(&in_); |
| go_seq_free(&out_); |
| } |
| |
| @end |
| |
| #define _GO_issue10788_TestInterface_DESCRIPTOR_ "go.issue10788.TestInterface" |
| #define _GO_issue10788_TestInterface_DoSomeWork_ (0x10a) |
| #define _GO_issue10788_TestInterface_MultipleUnnamedParams_ (0x20a) |
| |
| @implementation GoIssue10788TestInterface { |
| } |
| |
| - (id)initWithRef:(id)ref { |
| self = [super init]; |
| if (self) { __ref = ref; } |
| return self; |
| } |
| |
| - (void)doSomeWork:(GoIssue10788TestStruct*)s { |
| GoSeq in_ = {}; |
| GoSeq out_ = {}; |
| go_seq_writeRef(&in_, self._ref); |
| if ([(id<NSObject>)(s) isKindOfClass:[GoIssue10788TestStruct class]]) { |
| id<goSeqRefInterface> s_proxy = (id<goSeqRefInterface>)(s); |
| go_seq_writeRef(&in_, s_proxy._ref); |
| } else { |
| go_seq_writeObjcRef(&in_, s); |
| } |
| go_seq_send(_GO_issue10788_TestInterface_DESCRIPTOR_, _GO_issue10788_TestInterface_DoSomeWork_, &in_, &out_); |
| go_seq_free(&in_); |
| go_seq_free(&out_); |
| } |
| |
| - (void)multipleUnnamedParams:(int)p0 p1:(NSString*)p1 p2:(int64_t)p2 { |
| GoSeq in_ = {}; |
| GoSeq out_ = {}; |
| go_seq_writeRef(&in_, self._ref); |
| go_seq_writeInt(&in_, p0); |
| go_seq_writeUTF8(&in_, p1); |
| go_seq_writeInt64(&in_, p2); |
| go_seq_send(_GO_issue10788_TestInterface_DESCRIPTOR_, _GO_issue10788_TestInterface_MultipleUnnamedParams_, &in_, &out_); |
| go_seq_free(&in_); |
| go_seq_free(&out_); |
| } |
| |
| @end |
| |
| static void proxyGoIssue10788TestInterface(id obj, int code, GoSeq* in, GoSeq* out) { |
| switch (code) { |
| case _GO_issue10788_TestInterface_DoSomeWork_: { |
| id<GoIssue10788TestInterface> o = (id<GoIssue10788TestInterface>)(obj); |
| GoSeqRef* s_ref = go_seq_readRef(in); |
| GoIssue10788TestStruct* s = s_ref.obj; |
| if (s == NULL) { |
| s = [[GoIssue10788TestStruct alloc] initWithRef:s_ref]; |
| } |
| [o doSomeWork:s]; |
| } break; |
| case _GO_issue10788_TestInterface_MultipleUnnamedParams_: { |
| id<GoIssue10788TestInterface> o = (id<GoIssue10788TestInterface>)(obj); |
| int p0 = go_seq_readInt(in); |
| NSString* p1 = go_seq_readUTF8(in); |
| int64_t p2 = go_seq_readInt64(in); |
| [o multipleUnnamedParams:p0 p1:p1 p2:p2]; |
| } break; |
| default: |
| NSLog(@"unknown code %x for _GO_issue10788_TestInterface_DESCRIPTOR_", code); |
| } |
| } |
| |
| |
| __attribute__((constructor)) static void init() { |
| go_seq_register_proxy("go.issue10788.TestInterface", proxyGoIssue10788TestInterface); |
| } |