-
Notifications
You must be signed in to change notification settings - Fork 0
/
ic0.h
113 lines (79 loc) · 2.96 KB
/
ic0.h
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#ifndef IC0_H
#define IC0_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
#define WASM_IMPORT(module, name) \
__attribute__((import_module(module))) \
__attribute__((import_name(name)));
#define WASM_EXPORT(name) asm(name) \
__attribute__((visibility("default")));
uint32_t ic0_msg_arg_data_size()
WASM_IMPORT("ic0", "msg_arg_data_size");
void ic0_msg_arg_data_copy(uint32_t dst, uint32_t off, uint32_t size)
WASM_IMPORT("ic0", "msg_arg_data_copy");
uint32_t ic0_msg_caller_size()
WASM_IMPORT("ic0", "msg_caller_size");
void ic0_msg_caller_copy(uint32_t dst, uint32_t off, uint32_t size)
WASM_IMPORT("ic0", "msg_caller_copy");
uint32_t ic0_msg_reject_code()
WASM_IMPORT("ic0", "msg_reject_code");
uint32_t ic0_msg_reject_msg_size()
WASM_IMPORT("ic0", "msg_reject_msg_size");
void ic0_msg_reject_msg_copy(uint32_t dst, uint32_t off, uint32_t size)
WASM_IMPORT("ic0", "msg_reject_msg_copy");
void ic0_msg_reply_data_append(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "msg_reply_data_append");
void ic0_msg_reply()
WASM_IMPORT("ic0", "msg_reply");
void ic0_msg_reject(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "msg_reject");
uint64_t ic0_msg_funds_available(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "msg_funds_available");
uint64_t ic0_msg_funds_refunded(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "msg_funds_refunded");
void ic0_msg_funds_accept(uint32_t src, uint32_t size, uint64_t amount)
WASM_IMPORT("ic0", "msg_funds_accept");
uint32_t ic0_canister_self_size()
WASM_IMPORT("ic0", "canister_self_size");
void ic0_canister_self_copy(uint32_t dst, uint32_t off, uint32_t size)
WASM_IMPORT("ic0", "canister_self_copy");
uint64_t ic0_canister_balance(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "canister_balance");
void ic0_call_new(
uint32_t callee_src,
uint32_t callee_size,
uint32_t name_src,
uint32_t name_size,
uint32_t reply_fun,
uint32_t reply_env,
uint32_t reject_fun,
uint32_t reject_env
) WASM_IMPORT("ic0", "call_new");
void ic0_call_on_cleanup(uint32_t fun, uint32_t env)
WASM_IMPORT("ic0", "call_on_cleanup");
void ic0_call_data_append(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "call_data_append");
void ic0_call_funds_add(uint32_t src, uint32_t size, uint64_t amount)
WASM_IMPORT("ic0", "call_funds_add");
uint32_t ic0_call_perform()
WASM_IMPORT("ic0", "call_perform")
uint32_t ic0_stable_size()
WASM_IMPORT("ic0", "stable_size");
uint32_t ic0_stable_grow(uint32_t new_pages)
WASM_IMPORT("ic0", "stable_grow");
void ic0_stable_write(uint32_t off, uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "stable_write");
void ic0_stable_read(uint32_t dst, uint32_t off, uint32_t size)
WASM_IMPORT("ic0", "stable_read");
uint64_t ic0_time()
WASM_IMPORT("ic0", "time");
void ic0_debug_print(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "debug_print");
void ic0_trap(uint32_t src, uint32_t size)
WASM_IMPORT("ic0", "trap");
#ifdef __cplusplus
}
#endif
#endif /* IC0_H */