Debian Codegraph @

bind/testdata/aliases.objc.m.golden

raw
1 // Objective-C API for talking to aliases Go package.
2 // gobind -lang=objc aliases
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 "Aliases.objc.h"
10
11
12 @implementation AliasesS {
13 }
14
15 - (nonnull instancetype)initWithRef:(_Nonnull id)ref {
16 self = [super init];
17 if (self) { __ref = ref; }
18 return self;
19 }
20
21 - (nonnull instancetype)init {
22 self = [super init];
23 if (self) {
24 __ref = go_seq_from_refnum(new_aliases_S());
25 }
26 return self;
27 }
28
29 @end
30
31
32
33 void AliasesTakesAByte(byte a) {
34 uint8_t _a = (uint8_t)a;
35 proxyaliases__TakesAByte(_a);
36 }
37
38 void AliasesTakesAByteSlice(NSData* _Nullable a) {
39 nbyteslice _a = go_seq_from_objc_bytearray(a, 0);
40 proxyaliases__TakesAByteSlice(_a);
41 if (![a isKindOfClass:[NSMutableData class]]) {
42 free(_a.ptr);
43 }
44 }
45
46 void AliasesTakesAByteSliceAlias(NSData* _Nullable a) {
47 nbyteslice _a = go_seq_from_objc_bytearray(a, 0);
48 proxyaliases__TakesAByteSliceAlias(_a);
49 if (![a isKindOfClass:[NSMutableData class]]) {
50 free(_a.ptr);
51 }
52 }
53
54 void AliasesTakesAStructPtr(AliasesS* _Nullable a) {
55 int32_t _a;
56 if ([a conformsToProtocol:@protocol(goSeqRefInterface)]) {
57 id<goSeqRefInterface> a_proxy = (id<goSeqRefInterface>)(a);
58 _a = go_seq_go_to_refnum(a_proxy._ref);
59 } else {
60 _a = go_seq_to_refnum(a);
61 }
62 proxyaliases__TakesAStructPtr(_a);
63 }
64
65 void AliasesTakesAStructPtrAlias(AliasesS* _Nullable a) {
66 int32_t _a;
67 if ([a conformsToProtocol:@protocol(goSeqRefInterface)]) {
68 id<goSeqRefInterface> a_proxy = (id<goSeqRefInterface>)(a);
69 _a = go_seq_go_to_refnum(a_proxy._ref);
70 } else {
71 _a = go_seq_to_refnum(a);
72 }
73 proxyaliases__TakesAStructPtrAlias(_a);
74 }
75
76 __attribute__((constructor)) static void init() {
77 init_seq();
78 }