2015-06-05 19:24:08 +00:00
|
|
|
// Objective-C API for talking to basictypes Go package.
|
|
|
|
// gobind -lang=objc basictypes
|
|
|
|
//
|
|
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
|
|
|
|
#include "GoBasictypes.h"
|
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
#include "seq.h"
|
|
|
|
|
|
|
|
static NSString *errDomain = @"go.basictypes";
|
|
|
|
|
|
|
|
#define _DESCRIPTOR_ "basictypes"
|
|
|
|
|
|
|
|
#define _CALL_Bool_ 1
|
|
|
|
#define _CALL_ByteArrays_ 2
|
|
|
|
#define _CALL_Error_ 3
|
|
|
|
#define _CALL_ErrorPair_ 4
|
|
|
|
#define _CALL_Ints_ 5
|
|
|
|
|
2015-07-06 15:55:50 +00:00
|
|
|
BOOL GoBasictypesBool(BOOL p0) {
|
2015-06-05 19:24:08 +00:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeBool(&in_, p0);
|
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_Bool_, &in_, &out_);
|
|
|
|
BOOL ret0_ = go_seq_readBool(&out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ret0_;
|
|
|
|
}
|
|
|
|
|
2015-07-06 15:55:50 +00:00
|
|
|
NSData* GoBasictypesByteArrays(NSData* x) {
|
2015-06-05 19:24:08 +00:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeByteArray(&in_, x);
|
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_ByteArrays_, &in_, &out_);
|
|
|
|
NSData* ret0_ = go_seq_readByteArray(&out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
return ret0_;
|
|
|
|
}
|
|
|
|
|
2015-07-06 15:55:50 +00:00
|
|
|
BOOL GoBasictypesError(NSError** error) {
|
2015-06-05 19:24:08 +00:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_Error_, &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-06 15:55:50 +00:00
|
|
|
BOOL GoBasictypesErrorPair(int* ret0_, NSError** error) {
|
2015-06-05 19:24:08 +00:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_ErrorPair_, &in_, &out_);
|
2015-07-06 15:55:50 +00:00
|
|
|
int ret0__val = go_seq_readInt(&out_);
|
2015-06-23 19:11:37 +00:00
|
|
|
if (ret0_ != NULL) {
|
2015-07-06 15:55:50 +00:00
|
|
|
*ret0_ = ret0__val;
|
2015-06-23 19:11:37 +00:00
|
|
|
}
|
2015-06-05 19:24:08 +00:00
|
|
|
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-06 15:55:50 +00:00
|
|
|
void GoBasictypesInts(int8_t x, int16_t y, int32_t z, int64_t t, int u) {
|
2015-06-05 19:24:08 +00:00
|
|
|
GoSeq in_ = {};
|
|
|
|
GoSeq out_ = {};
|
|
|
|
go_seq_writeInt8(&in_, x);
|
|
|
|
go_seq_writeInt16(&in_, y);
|
|
|
|
go_seq_writeInt32(&in_, z);
|
|
|
|
go_seq_writeInt64(&in_, t);
|
|
|
|
go_seq_writeInt(&in_, u);
|
|
|
|
go_seq_send(_DESCRIPTOR_, _CALL_Ints_, &in_, &out_);
|
|
|
|
go_seq_free(&in_);
|
|
|
|
go_seq_free(&out_);
|
|
|
|
}
|
|
|
|
|