2015-06-05 15:24:08 -04:00
|
|
|
// Objective-C API for talking to interfaces Go package.
|
|
|
|
// gobind -lang=objc interfaces
|
|
|
|
//
|
|
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
|
|
|
|
#include "GoInterfaces.h"
|
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
#include "seq.h"
|
|
|
|
|
2015-07-20 08:21:11 -04:00
|
|
|
static NSString* errDomain = @"go.interfaces";
|
|
|
|
|
|
|
|
@protocol goSeqRefInterface
|
|
|
|
-(GoSeqRef*) ref;
|
|
|
|
@end
|
2015-06-05 15:24:08 -04:00
|
|
|
|
|
|
|
#define _DESCRIPTOR_ "interfaces"
|
|
|
|
|
|
|
|
#define _CALL_Add3_ 1
|
2015-08-25 00:26:23 -04:00
|
|
|
#define _CALL_CallErr_ 2
|
|
|
|
#define _CALL_Seven_ 3
|
|
|
|
|
|
|
|
#define _GO_interfaces_Error_DESCRIPTOR_ "go.interfaces.Error"
|
|
|
|
#define _GO_interfaces_Error_Err_ (0x10a)
|
|
|
|
|
|
|
|
@interface GoInterfacesError : NSObject <GoInterfacesError> {
|
|
|
|
}
|
|
|
|
@property(strong, readonly) id ref;
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
|
|
- (BOOL)Err:(NSError**)error;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation GoInterfacesError {
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref {
|
|
|
|
self = [super init];
|
|
|
|
if (self) { _ref = ref; }
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)Err:(NSError**)error {
|
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeRef(&in_, self.ref);
|
|
|
|
go_seq_send(_GO_interfaces_Error_DESCRIPTOR_, _GO_interfaces_Error_Err_, &in_, &out_);
|
|
|
|
NSString* _error = go_seq_readUTF8(&out_);
|
|
|
|
if ([_error length] != 0 && error != nil) {
|
|
|
|
NSMutableDictionary* details = [NSMutableDictionary dictionary];
|
|
|
|
[details setValue:_error forKey:NSLocalizedDescriptionKey];
|
|
|
|
*error = [NSError errorWithDomain:errDomain code:1 userInfo:details];
|
|
|
|
}
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ([_error length] == 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
static void proxyGoInterfacesError(id obj, int code, GoSeq* in, GoSeq* out) {
|
|
|
|
switch (code) {
|
|
|
|
case _GO_interfaces_Error_Err_: {
|
|
|
|
id<GoInterfacesError> o = (id<GoInterfacesError>)(obj);
|
|
|
|
NSError* error = NULL;
|
|
|
|
BOOL returnVal = [o Err:&error];
|
|
|
|
if (returnVal) {
|
|
|
|
go_seq_writeUTF8(out, NULL);
|
|
|
|
} else {
|
|
|
|
NSString* errorDesc = [error localizedDescription];
|
|
|
|
if (errorDesc == NULL || errorDesc.length == 0) {
|
|
|
|
errorDesc = @"gobind: unknown error";
|
|
|
|
}
|
|
|
|
go_seq_writeUTF8(out, errorDesc);
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
default:
|
|
|
|
NSLog(@"unknown code %x for _GO_interfaces_Error_DESCRIPTOR_", code);
|
|
|
|
}
|
|
|
|
}
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2015-07-20 08:21:11 -04:00
|
|
|
#define _GO_interfaces_I_DESCRIPTOR_ "go.interfaces.I"
|
|
|
|
#define _GO_interfaces_I_Rand_ (0x10a)
|
|
|
|
|
|
|
|
@interface GoInterfacesI : NSObject <GoInterfacesI> {
|
|
|
|
}
|
|
|
|
@property(strong, readonly) id ref;
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
|
|
- (int32_t)Rand;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation GoInterfacesI {
|
|
|
|
}
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2015-07-20 08:21:11 -04:00
|
|
|
- (id)initWithRef:(id)ref {
|
|
|
|
self = [super init];
|
|
|
|
if (self) { _ref = ref; }
|
|
|
|
return self;
|
|
|
|
}
|
2015-06-05 15:24:08 -04:00
|
|
|
|
2015-07-20 08:21:11 -04:00
|
|
|
- (int32_t)Rand {
|
2015-06-05 15:24:08 -04:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
2015-07-20 08:21:11 -04:00
|
|
|
go_seq_writeRef(&in_, self.ref);
|
|
|
|
go_seq_send(_GO_interfaces_I_DESCRIPTOR_, _GO_interfaces_I_Rand_, &in_, &out_);
|
|
|
|
int32_t ret0_ = go_seq_readInt32(&out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ret0_;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
static void proxyGoInterfacesI(id obj, int code, GoSeq* in, GoSeq* out) {
|
|
|
|
switch (code) {
|
|
|
|
case _GO_interfaces_I_Rand_: {
|
|
|
|
id<GoInterfacesI> o = (id<GoInterfacesI>)(obj);
|
|
|
|
int32_t returnVal = [o Rand];
|
|
|
|
go_seq_writeInt32(out, returnVal);
|
|
|
|
} break;
|
|
|
|
default:
|
|
|
|
NSLog(@"unknown code %x for _GO_interfaces_I_DESCRIPTOR_", code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-08-26 12:28:14 -04:00
|
|
|
#define _GO_interfaces_I1_DESCRIPTOR_ "go.interfaces.I1"
|
|
|
|
#define _GO_interfaces_I1_J_ (0x10a)
|
|
|
|
|
|
|
|
@implementation GoInterfacesI1 {
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref {
|
|
|
|
self = [super init];
|
|
|
|
if (self) { _ref = ref; }
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)J {
|
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeRef(&in_, self.ref);
|
|
|
|
go_seq_send(_GO_interfaces_I1_DESCRIPTOR_, _GO_interfaces_I1_J_, &in_, &out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
#define _GO_interfaces_I2_DESCRIPTOR_ "go.interfaces.I2"
|
|
|
|
#define _GO_interfaces_I2_G_ (0x10a)
|
|
|
|
|
|
|
|
@implementation GoInterfacesI2 {
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref {
|
|
|
|
self = [super init];
|
|
|
|
if (self) { _ref = ref; }
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)G {
|
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeRef(&in_, self.ref);
|
|
|
|
go_seq_send(_GO_interfaces_I2_DESCRIPTOR_, _GO_interfaces_I2_G_, &in_, &out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
#define _GO_interfaces_I3_DESCRIPTOR_ "go.interfaces.I3"
|
|
|
|
#define _GO_interfaces_I3_F_ (0x10a)
|
|
|
|
|
|
|
|
@interface GoInterfacesI3 : NSObject <GoInterfacesI3> {
|
|
|
|
}
|
|
|
|
@property(strong, readonly) id ref;
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref;
|
2015-08-31 01:06:30 -04:00
|
|
|
- (GoInterfacesI1*)F;
|
2015-08-26 12:28:14 -04:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation GoInterfacesI3 {
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref {
|
|
|
|
self = [super init];
|
|
|
|
if (self) { _ref = ref; }
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
2015-08-31 01:06:30 -04:00
|
|
|
- (GoInterfacesI1*)F {
|
2015-08-26 12:28:14 -04:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeRef(&in_, self.ref);
|
|
|
|
go_seq_send(_GO_interfaces_I3_DESCRIPTOR_, _GO_interfaces_I3_F_, &in_, &out_);
|
|
|
|
GoSeqRef* ret0__ref = go_seq_readRef(&out_);
|
2015-08-31 01:06:30 -04:00
|
|
|
GoInterfacesI1* ret0_ = ret0__ref.obj;
|
2015-08-26 12:28:14 -04:00
|
|
|
if (ret0_ == NULL) {
|
|
|
|
ret0_ = [[GoInterfacesI1 alloc] initWithRef:ret0__ref];
|
|
|
|
}
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ret0_;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
static void proxyGoInterfacesI3(id obj, int code, GoSeq* in, GoSeq* out) {
|
|
|
|
switch (code) {
|
|
|
|
case _GO_interfaces_I3_F_: {
|
|
|
|
id<GoInterfacesI3> o = (id<GoInterfacesI3>)(obj);
|
2015-08-31 01:06:30 -04:00
|
|
|
GoInterfacesI1* returnVal = [o F];
|
|
|
|
if ([(id<NSObject>)(returnVal) isKindOfClass:[GoInterfacesI1 class]]) {
|
2015-08-26 12:28:14 -04:00
|
|
|
id<goSeqRefInterface>retVal_proxy = (id<goSeqRefInterface>)(returnVal);
|
|
|
|
go_seq_writeRef(out, retVal_proxy.ref);
|
|
|
|
} else {
|
|
|
|
go_seq_writeRef(out, returnVal);
|
|
|
|
}
|
|
|
|
} break;
|
|
|
|
default:
|
|
|
|
NSLog(@"unknown code %x for _GO_interfaces_I3_DESCRIPTOR_", code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-20 08:21:11 -04:00
|
|
|
#define _GO_interfaces_WithParam_DESCRIPTOR_ "go.interfaces.WithParam"
|
|
|
|
#define _GO_interfaces_WithParam_HasParam_ (0x10a)
|
|
|
|
|
|
|
|
@interface GoInterfacesWithParam : NSObject <GoInterfacesWithParam> {
|
|
|
|
}
|
|
|
|
@property(strong, readonly) id ref;
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref;
|
|
|
|
- (void)HasParam:(BOOL)p0;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation GoInterfacesWithParam {
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)initWithRef:(id)ref {
|
|
|
|
self = [super init];
|
|
|
|
if (self) { _ref = ref; }
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)HasParam:(BOOL)p0 {
|
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeRef(&in_, self.ref);
|
|
|
|
go_seq_writeBool(&in_, p0);
|
|
|
|
go_seq_send(_GO_interfaces_WithParam_DESCRIPTOR_, _GO_interfaces_WithParam_HasParam_, &in_, &out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
static void proxyGoInterfacesWithParam(id obj, int code, GoSeq* in, GoSeq* out) {
|
|
|
|
switch (code) {
|
|
|
|
case _GO_interfaces_WithParam_HasParam_: {
|
|
|
|
id<GoInterfacesWithParam> o = (id<GoInterfacesWithParam>)(obj);
|
|
|
|
BOOL p0 = go_seq_readBool(in);
|
|
|
|
[o HasParam:p0];
|
|
|
|
} break;
|
|
|
|
default:
|
|
|
|
NSLog(@"unknown code %x for _GO_interfaces_WithParam_DESCRIPTOR_", code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int32_t GoInterfacesAdd3(id<GoInterfacesI> r) {
|
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
if ([(id<NSObject>)(r) isKindOfClass:[GoInterfacesI class]]) {
|
|
|
|
id<goSeqRefInterface> r_proxy = (id<goSeqRefInterface>)(r);
|
|
|
|
go_seq_writeRef(&in_, r_proxy.ref);
|
|
|
|
} else {
|
|
|
|
go_seq_writeObjcRef(&in_, r);
|
|
|
|
}
|
2015-06-05 15:24:08 -04:00
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_Add3_, &in_, &out_);
|
|
|
|
int32_t ret0_ = go_seq_readInt32(&out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ret0_;
|
|
|
|
}
|
|
|
|
|
2015-08-25 00:26:23 -04:00
|
|
|
BOOL GoInterfacesCallErr(id<GoInterfacesError> e, NSError** error) {
|
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
if ([(id<NSObject>)(e) isKindOfClass:[GoInterfacesError class]]) {
|
|
|
|
id<goSeqRefInterface> e_proxy = (id<goSeqRefInterface>)(e);
|
|
|
|
go_seq_writeRef(&in_, e_proxy.ref);
|
|
|
|
} else {
|
|
|
|
go_seq_writeObjcRef(&in_, e);
|
|
|
|
}
|
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_CallErr_, &in_, &out_);
|
|
|
|
NSString* _error = go_seq_readUTF8(&out_);
|
|
|
|
if ([_error length] != 0 && error != nil) {
|
|
|
|
NSMutableDictionary* details = [NSMutableDictionary dictionary];
|
|
|
|
[details setValue:_error forKey:NSLocalizedDescriptionKey];
|
|
|
|
*error = [NSError errorWithDomain:errDomain code:1 userInfo:details];
|
|
|
|
}
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ([_error length] == 0);
|
|
|
|
}
|
|
|
|
|
2015-07-20 08:21:11 -04:00
|
|
|
id<GoInterfacesI> GoInterfacesSeven() {
|
2015-06-05 15:24:08 -04:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_Seven_, &in_, &out_);
|
|
|
|
GoSeqRef* ret0__ref = go_seq_readRef(&out_);
|
2015-07-20 08:21:11 -04:00
|
|
|
id<GoInterfacesI> ret0_ = ret0__ref.obj;
|
2015-06-05 15:24:08 -04:00
|
|
|
if (ret0_ == NULL) {
|
2015-07-06 11:55:50 -04:00
|
|
|
ret0_ = [[GoInterfacesI alloc] initWithRef:ret0__ref];
|
2015-06-05 15:24:08 -04:00
|
|
|
}
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ret0_;
|
|
|
|
}
|
|
|
|
|
2015-07-20 08:21:11 -04:00
|
|
|
__attribute__((constructor)) static void init() {
|
2015-08-25 00:26:23 -04:00
|
|
|
go_seq_register_proxy("go.interfaces.Error", proxyGoInterfacesError);
|
2015-07-20 08:21:11 -04:00
|
|
|
go_seq_register_proxy("go.interfaces.I", proxyGoInterfacesI);
|
2015-08-26 12:28:14 -04:00
|
|
|
go_seq_register_proxy("go.interfaces.I3", proxyGoInterfacesI3);
|
2015-07-20 08:21:11 -04:00
|
|
|
go_seq_register_proxy("go.interfaces.WithParam", proxyGoInterfacesWithParam);
|
|
|
|
}
|