Translate error type to NSError. Interface type is not supported yet. Change-Id: I54abba2360cff41ef8ca08063b0120e7edd65a47 Reviewed-on: https://go-review.googlesource.com/10793 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
102 lines
2.3 KiB
Plaintext
102 lines
2.3 KiB
Plaintext
// Objective-C API for talking to structs Go package.
|
|
// gobind -lang=objc structs
|
|
//
|
|
// File is generated by gobind. Do not edit.
|
|
|
|
#include "GoStructs.h"
|
|
#include <Foundation/Foundation.h>
|
|
#include "seq.h"
|
|
|
|
static NSString *errDomain = @"go.structs";
|
|
|
|
#define _DESCRIPTOR_ "structs"
|
|
|
|
#define _CALL_Identity_ 1
|
|
|
|
#define _GO_structs_S_DESCRIPTOR_ "go.structs.S"
|
|
#define _GO_structs_S_FIELD_X_GET_ (0x00f)
|
|
#define _GO_structs_S_FIELD_X_SET_ (0x01f)
|
|
#define _GO_structs_S_FIELD_Y_GET_ (0x10f)
|
|
#define _GO_structs_S_FIELD_Y_SET_ (0x11f)
|
|
#define _GO_structs_S_Sum_ (0x00c)
|
|
|
|
@implementation GoStructs_S {
|
|
}
|
|
|
|
- (id)initWithRef:(GoSeqRef*)ref {
|
|
self = [super init];
|
|
if (self) { _ref = ref; }
|
|
return self;
|
|
}
|
|
|
|
- (double)X {
|
|
GoSeq in_ = {};
|
|
GoSeq out_ = {};
|
|
go_seq_writeRef(&in_, self.ref);
|
|
go_seq_send(_GO_structs_S_DESCRIPTOR_, _GO_structs_S_FIELD_X_GET_, &in_, &out_);
|
|
double ret_ = go_seq_readFloat64(&out_);
|
|
go_seq_free(&in_);
|
|
go_seq_free(&out_);
|
|
return ret_;
|
|
}
|
|
|
|
- (void)setX:(double)v {
|
|
GoSeq in_ = {};
|
|
GoSeq out_ = {};
|
|
go_seq_writeRef(&in_, self.ref);
|
|
go_seq_writeFloat64(&in_, v);
|
|
go_seq_send(_GO_structs_S_DESCRIPTOR_, _GO_structs_S_FIELD_X_SET_, &in_, &out_);
|
|
go_seq_free(&in_);
|
|
go_seq_free(&out_);
|
|
}
|
|
|
|
- (double)Y {
|
|
GoSeq in_ = {};
|
|
GoSeq out_ = {};
|
|
go_seq_writeRef(&in_, self.ref);
|
|
go_seq_send(_GO_structs_S_DESCRIPTOR_, _GO_structs_S_FIELD_Y_GET_, &in_, &out_);
|
|
double ret_ = go_seq_readFloat64(&out_);
|
|
go_seq_free(&in_);
|
|
go_seq_free(&out_);
|
|
return ret_;
|
|
}
|
|
|
|
- (void)setY:(double)v {
|
|
GoSeq in_ = {};
|
|
GoSeq out_ = {};
|
|
go_seq_writeRef(&in_, self.ref);
|
|
go_seq_writeFloat64(&in_, v);
|
|
go_seq_send(_GO_structs_S_DESCRIPTOR_, _GO_structs_S_FIELD_Y_SET_, &in_, &out_);
|
|
go_seq_free(&in_);
|
|
go_seq_free(&out_);
|
|
}
|
|
|
|
- (double)Sum {
|
|
GoSeq in_ = {};
|
|
GoSeq out_ = {};
|
|
go_seq_writeRef(&in_, self.ref);
|
|
go_seq_send(_GO_structs_S_DESCRIPTOR_, _GO_structs_S_Sum_, &in_, &out_);
|
|
double ret0_ = go_seq_readFloat64(&out_);
|
|
go_seq_free(&in_);
|
|
go_seq_free(&out_);
|
|
return ret0_;
|
|
}
|
|
|
|
@end
|
|
|
|
GoStructs_S* GoStructs_Identity(GoStructs_S* s) {
|
|
GoSeq in_ = {};
|
|
GoSeq out_ = {};
|
|
go_seq_writeRef(&in_, s.ref);
|
|
go_seq_send(_DESCRIPTOR_, _CALL_Identity_, &in_, &out_);
|
|
GoSeqRef* ret0__ref = go_seq_readRef(&out_);
|
|
GoStructs_S* ret0_ = ret0__ref.obj;
|
|
if (ret0_ == NULL) {
|
|
ret0_ = [[GoStructs_S alloc] initWithRef:ret0__ref];
|
|
}
|
|
go_seq_free(&in_);
|
|
go_seq_free(&out_);
|
|
return ret0_;
|
|
}
|
|
|