issue12328.objc.m.golden 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Objective-C API for talking to issue12328 Go package.
  2. // gobind -lang=objc issue12328
  3. //
  4. // File is generated by gobind. Do not edit.
  5. #include <Foundation/Foundation.h>
  6. #include "seq.h"
  7. #include "_cgo_export.h"
  8. #include "Issue12328.objc.h"
  9. @implementation Issue12328T {
  10. }
  11. - (nonnull instancetype)initWithRef:(_Nonnull id)ref {
  12. self = [super init];
  13. if (self) { __ref = ref; }
  14. return self;
  15. }
  16. - (nonnull instancetype)init {
  17. self = [super init];
  18. if (self) {
  19. __ref = go_seq_from_refnum(new_issue12328_T());
  20. }
  21. return self;
  22. }
  23. - (NSError* _Nullable)err {
  24. int32_t refnum = go_seq_go_to_refnum(self._ref);
  25. int32_t r0 = proxyissue12328_T_Err_Get(refnum);
  26. Universeerror* _r0 = nil;
  27. GoSeqRef* _r0_ref = go_seq_from_refnum(r0);
  28. if (_r0_ref != NULL) {
  29. _r0 = _r0_ref.obj;
  30. if (_r0 == nil) {
  31. _r0 = [[Universeerror alloc] initWithRef:_r0_ref];
  32. }
  33. }
  34. return _r0;
  35. }
  36. - (void)setErr:(NSError* _Nullable)v {
  37. int32_t refnum = go_seq_go_to_refnum(self._ref);
  38. int32_t _v;
  39. if ([v conformsToProtocol:@protocol(goSeqRefInterface)]) {
  40. id<goSeqRefInterface> v_proxy = (id<goSeqRefInterface>)(v);
  41. _v = go_seq_go_to_refnum(v_proxy._ref);
  42. } else {
  43. _v = go_seq_to_refnum(v);
  44. }
  45. proxyissue12328_T_Err_Set(refnum, _v);
  46. }
  47. @end
  48. __attribute__((constructor)) static void init() {
  49. init_seq();
  50. }