2
0
mirror of synced 2025-02-23 06:48:15 +00:00
mobile/bind/testdata/basictypes.objc.m.golden
Elias Naur 6a96d4c7cf bind: make the default name prefix empty on ObjC
Since generated names now have their package names prefixed, the
extra prefix, "Go", is both confusing and counter-productive to
making the generated ObjC code look like any other native code.

Change the default to the empty prefix, while preserving support
for an explicit prefix if needed.

This is a backwards incompatible change; to keep the old behaviour,
specify "-prefix Go" to the gobind or gomobile command.

While we're here, fix the Ivy example for the recent change in
error returns.

Change-Id: I7fef4a92a18ddadee972ccf359652e3b31624f33
Reviewed-on: https://go-review.googlesource.com/34643
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-12-24 13:37:27 +00:00

83 lines
2.7 KiB
Plaintext

// Objective-C API for talking to basictypes Go package.
// gobind -lang=objc basictypes
//
// File is generated by gobind. Do not edit.
#include <Foundation/Foundation.h>
#include "seq.h"
#include "_cgo_export.h"
#include "Basictypes.objc.h"
const BOOL BasictypesABool = YES;
const double BasictypesAFloat = 0.2015;
NSString* const BasictypesALongString = @"LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString,LongString";
const int32_t BasictypesARune = 32;
NSString* const BasictypesAString = @"a string";
const int64_t BasictypesAnInt = 7LL;
const int64_t BasictypesAnInt2 = 9223372036854775807LL;
BOOL BasictypesBool(BOOL p0) {
char _p0 = (char)p0;
char r0 = proxybasictypes__Bool(_p0);
BOOL _ret0_ = r0 ? YES : NO;
return _ret0_;
}
NSData* BasictypesByteArrays(NSData* x) {
nbyteslice _x = go_seq_from_objc_bytearray(x, 0);
nbyteslice r0 = proxybasictypes__ByteArrays(_x);
if (![x isKindOfClass:[NSMutableData class]]) {
free(_x.ptr);
}
NSData *_ret0_ = go_seq_to_objc_bytearray(r0, 1);
return _ret0_;
}
BOOL BasictypesError(NSError** error) {
int32_t r0 = proxybasictypes__Error();
Universeerror* _error = nil;
GoSeqRef* _error_ref = go_seq_from_refnum(r0);
if (_error_ref != NULL) {
_error = _error_ref.obj;
if (_error == nil) {
_error = [[Universeerror alloc] initWithRef:_error_ref];
}
}
if (_error != nil && error != nil) {
*error = _error;
}
return (_error == nil);
}
BOOL BasictypesErrorPair(long* ret0_, NSError** error) {
struct proxybasictypes__ErrorPair_return res = proxybasictypes__ErrorPair();
long _ret0_ = (long)res.r0;
Universeerror* _error = nil;
GoSeqRef* _error_ref = go_seq_from_refnum(res.r1);
if (_error_ref != NULL) {
_error = _error_ref.obj;
if (_error == nil) {
_error = [[Universeerror alloc] initWithRef:_error_ref];
}
}
*ret0_ = _ret0_;
if (_error != nil && error != nil) {
*error = _error;
}
return (_error == nil);
}
void BasictypesInts(int8_t x, int16_t y, int32_t z, int64_t t, long u) {
int8_t _x = (int8_t)x;
int16_t _y = (int16_t)y;
int32_t _z = (int32_t)z;
int64_t _t = (int64_t)t;
nint _u = (nint)u;
proxybasictypes__Ints(_x, _y, _z, _t, _u);
}
__attribute__((constructor)) static void init() {
init_seq();
}