| 1 |
// Objective-C API for talking to Go package. |
| 2 |
// gobind -lang=objc |
| 3 |
// |
| 4 |
// File is generated by gobind. Do not edit. |
| 5 |
|
| 6 |
#include <Foundation/Foundation.h> |
| 7 |
#include "seq.h" |
| 8 |
#include "_cgo_export.h" |
| 9 |
#include "Universe.objc.h" |
| 10 |
|
| 11 |
@implementation Universeerror { |
| 12 |
} |
| 13 |
|
| 14 |
- (nonnull instancetype)initWithRef:(id)ref { |
| 15 |
if (self) { |
| 16 |
__ref = ref; |
| 17 |
self = [super initWithDomain:@"go" code:1 userInfo:@{NSLocalizedDescriptionKey: [self error]}]; |
| 18 |
} |
| 19 |
return self; |
| 20 |
} |
| 21 |
|
| 22 |
- (NSString* _Nonnull)error { |
| 23 |
int32_t refnum = go_seq_go_to_refnum(self._ref); |
| 24 |
nstring r0 = proxy_error_Error(refnum); |
| 25 |
NSString *_ret0_ = go_seq_to_objc_string(r0); |
| 26 |
return _ret0_; |
| 27 |
} |
| 28 |
|
| 29 |
@end |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
nstring cproxy_error_Error(int32_t refnum) { |
| 34 |
@autoreleasepool { |
| 35 |
Universeerror* o = go_seq_objc_from_refnum(refnum); |
| 36 |
NSString* _Nonnull ret0_; |
| 37 |
ret0_ = [o localizedDescription]; |
| 38 |
nstring _ret0_ = go_seq_from_objc_string(ret0_); |
| 39 |
return _ret0_; |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
__attribute__((constructor)) static void init() { |
| 44 |
init_seq(); |
| 45 |
} |