1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
/*
// Generated by rust2go. Please DO NOT edit this C part manually.
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct StringRef {
const uint8_t *ptr;
uintptr_t len;
} StringRef;
typedef struct DemoResponseRef {
bool pass;
} DemoResponseRef;
typedef struct WakerRef {
const void *ptr;
const void *vtable;
} WakerRef;
typedef struct DemoRequestRef {
struct StringRef name;
uint8_t age;
} DemoRequestRef;
// hack from: https://stackoverflow.com/a/69904977
__attribute__((weak))
void DemoCall_demo_check_cb(const void *f_ptr, struct DemoResponseRef resp, const void *slot) {
((void (*)(struct DemoResponseRef, const void*))f_ptr)(resp, slot);
}
// hack from: https://stackoverflow.com/a/69904977
__attribute__((weak))
void DemoCall_demo_check_async_cb(const void *f_ptr, struct WakerRef waker, struct DemoResponseRef resp, const void *slot) {
((void (*)(struct WakerRef, struct DemoResponseRef, const void*))f_ptr)(waker, resp, slot);
}
*/
import "C"
import "unsafe"
//export CDemoCall_demo_check
func CDemoCall_demo_check(_ C.DemoRequestRef, slot *C.void, cb *C.void)
//export CDemoCall_demo_check_async
func CDemoCall_demo_check_async(w C.WakerRef, _ C.DemoRequestRef, slot *C.void, cb *C.void)
func main()