underscores.objc.m.golden 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Objective-C API for talking to underscores Go package.
  2. // gobind -lang=objc underscores
  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 "Underscore_pkg.objc.h"
  9. @implementation Underscore_pkgUnderscore_struct {
  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_underscore_pkg_Underscore_struct());
  20. }
  21. return self;
  22. }
  23. - (NSString* _Nonnull)underscore_field {
  24. int32_t refnum = go_seq_go_to_refnum(self._ref);
  25. nstring r0 = proxyunderscore_pkg_Underscore_struct_Underscore_field_Get(refnum);
  26. NSString *_r0 = go_seq_to_objc_string(r0);
  27. return _r0;
  28. }
  29. - (void)setUnderscore_field:(NSString* _Nonnull)v {
  30. int32_t refnum = go_seq_go_to_refnum(self._ref);
  31. nstring _v = go_seq_from_objc_string(v);
  32. proxyunderscore_pkg_Underscore_struct_Underscore_field_Set(refnum, _v);
  33. }
  34. @end
  35. @implementation Underscore_pkg
  36. + (void) setUnderscore_var:(long)v {
  37. nint _v = (nint)v;
  38. var_setunderscore_pkg_Underscore_var(_v);
  39. }
  40. + (long) underscore_var {
  41. nint r0 = var_getunderscore_pkg_Underscore_var();
  42. long _r0 = (long)r0;
  43. return _r0;
  44. }
  45. @end
  46. void Underscore_pkgUnderscore_func(void) {
  47. proxyunderscore_pkg__Underscore_func();
  48. }
  49. __attribute__((constructor)) static void init() {
  50. init_seq();
  51. }