mt-lang 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/docs/index.html +4 -3
  3. data/lib/milk_tea/base.rb +1 -1
  4. data/std/asset_pack.mt +267 -0
  5. data/std/async/libuv_runtime.mt +539 -0
  6. data/std/async/mailbox.mt +191 -0
  7. data/std/async/runtime.mt +87 -0
  8. data/std/async.mt +87 -0
  9. data/std/base64.mt +185 -0
  10. data/std/behavior_tree.mt +396 -0
  11. data/std/binary.mt +314 -0
  12. data/std/binary_heap.mt +157 -0
  13. data/std/bitset.mt +239 -0
  14. data/std/box2d.mt +535 -0
  15. data/std/bytes.mt +46 -0
  16. data/std/c/box2d.mt +1254 -0
  17. data/std/c/cgltf.mt +647 -0
  18. data/std/c/cjson.mt +106 -0
  19. data/std/c/crypto.mt +11 -0
  20. data/std/c/crypto_support.h +51 -0
  21. data/std/c/ctype.mt +19 -0
  22. data/std/c/ctype_bindgen.h +29 -0
  23. data/std/c/curl.mt +1223 -0
  24. data/std/c/enet.mt +473 -0
  25. data/std/c/errno.mt +41 -0
  26. data/std/c/errno_bindgen.h +53 -0
  27. data/std/c/flecs.mt +2945 -0
  28. data/std/c/fs.linux.mt +43 -0
  29. data/std/c/fs.windows.mt +43 -0
  30. data/std/c/fs_support.h +954 -0
  31. data/std/c/gl.mt +2065 -0
  32. data/std/c/gl_registry_helpers.h +10748 -0
  33. data/std/c/glfw.mt +499 -0
  34. data/std/c/libc.mt +167 -0
  35. data/std/c/libuv.mt +1491 -0
  36. data/std/c/math.mt +22 -0
  37. data/std/c/math_bindgen.h +31 -0
  38. data/std/c/miniaudio.mt +3420 -0
  39. data/std/c/pcre2.mt +735 -0
  40. data/std/c/process.mt +58 -0
  41. data/std/c/process_support.h +1147 -0
  42. data/std/c/raygui.mt +1602 -0
  43. data/std/c/raylib.mt +1245 -0
  44. data/std/c/raymath.mt +163 -0
  45. data/std/c/rlgl.mt +434 -0
  46. data/std/c/rpng.mt +60 -0
  47. data/std/c/rres.mt +187 -0
  48. data/std/c/sdl3.mt +4132 -0
  49. data/std/c/sqlite3.mt +951 -0
  50. data/std/c/stb_image.mt +52 -0
  51. data/std/c/stb_image_resize2.mt +128 -0
  52. data/std/c/stb_image_write.mt +19 -0
  53. data/std/c/stb_rect_pack.mt +38 -0
  54. data/std/c/stb_truetype.mt +175 -0
  55. data/std/c/stb_vorbis.mt +31 -0
  56. data/std/c/stdio.mt +90 -0
  57. data/std/c/steamworks.h +5769 -0
  58. data/std/c/steamworks.mt +4771 -0
  59. data/std/c/string.mt +16 -0
  60. data/std/c/string_bindgen.h +36 -0
  61. data/std/c/sync.mt +33 -0
  62. data/std/c/sync_support.h +219 -0
  63. data/std/c/terminal.mt +24 -0
  64. data/std/c/terminal_support.h +408 -0
  65. data/std/c/time.mt +26 -0
  66. data/std/c/tls.mt +24 -0
  67. data/std/c/tls_support.h +626 -0
  68. data/std/c/tracy.mt +53 -0
  69. data/std/c/zlib.mt +20 -0
  70. data/std/c/zlib_support.h +239 -0
  71. data/std/c/zstd.mt +231 -0
  72. data/std/cell.mt +60 -0
  73. data/std/cgltf.mt +115 -0
  74. data/std/cjson.mt +90 -0
  75. data/std/cli.mt +768 -0
  76. data/std/cookie.mt +198 -0
  77. data/std/counter.mt +160 -0
  78. data/std/crypto.mt +74 -0
  79. data/std/cstring.mt +13 -0
  80. data/std/ctype.mt +52 -0
  81. data/std/curl/runtime.mt +261 -0
  82. data/std/curl.mt +38 -0
  83. data/std/deque.mt +348 -0
  84. data/std/encoding.mt +93 -0
  85. data/std/enet.mt +133 -0
  86. data/std/env.mt +41 -0
  87. data/std/errno.mt +47 -0
  88. data/std/flecs.mt +978 -0
  89. data/std/fmt.mt +271 -0
  90. data/std/fs.linux.mt +696 -0
  91. data/std/fs.windows.mt +711 -0
  92. data/std/fsm.mt +267 -0
  93. data/std/gl.mt +2062 -0
  94. data/std/glfw.mt +471 -0
  95. data/std/goap.mt +342 -0
  96. data/std/graph.mt +521 -0
  97. data/std/gzip.mt +77 -0
  98. data/std/hash.mt +429 -0
  99. data/std/http/server.mt +810 -0
  100. data/std/http.mt +1227 -0
  101. data/std/intern.mt +53 -0
  102. data/std/jobs.mt +288 -0
  103. data/std/json.mt +627 -0
  104. data/std/libc.mt +34 -0
  105. data/std/libuv.mt +554 -0
  106. data/std/linear_algebra.mt +243 -0
  107. data/std/linked_map.mt +372 -0
  108. data/std/linked_map_view.mt +49 -0
  109. data/std/linked_set.mt +117 -0
  110. data/std/log.mt +69 -0
  111. data/std/map.mt +418 -0
  112. data/std/math.mt +24 -0
  113. data/std/mem/arena.mt +137 -0
  114. data/std/mem/endian.mt +51 -0
  115. data/std/mem/heap.mt +298 -0
  116. data/std/mem/pool.mt +164 -0
  117. data/std/mem/stack.mt +47 -0
  118. data/std/mem/tracking.mt +119 -0
  119. data/std/miniaudio.mt +1299 -0
  120. data/std/multiset.mt +191 -0
  121. data/std/net/channel.mt +727 -0
  122. data/std/net/clock.mt +237 -0
  123. data/std/net/discovery.mt +277 -0
  124. data/std/net/lobby.mt +813 -0
  125. data/std/net/manager.mt +539 -0
  126. data/std/net/mux.mt +839 -0
  127. data/std/net/nat.mt +122 -0
  128. data/std/net/packet.mt +219 -0
  129. data/std/net/punch.mt +162 -0
  130. data/std/net/rpc.mt +119 -0
  131. data/std/net/session.mt +1157 -0
  132. data/std/net/stun.mt +252 -0
  133. data/std/net/sync.mt +183 -0
  134. data/std/net/turn.mt +459 -0
  135. data/std/net.mt +2944 -0
  136. data/std/oauth2.mt +408 -0
  137. data/std/option.mt +51 -0
  138. data/std/ordered_map.mt +497 -0
  139. data/std/ordered_set.mt +348 -0
  140. data/std/path.mt +368 -0
  141. data/std/pcre2/runtime.mt +35 -0
  142. data/std/pcre2.mt +78 -0
  143. data/std/priority_queue.mt +55 -0
  144. data/std/process.mt +837 -0
  145. data/std/queue.mt +55 -0
  146. data/std/random.mt +146 -0
  147. data/std/raygui.mt +99 -0
  148. data/std/raylib/debug_console.mt +71 -0
  149. data/std/raylib/easing.mt +388 -0
  150. data/std/raylib/packed_assets.mt +255 -0
  151. data/std/raylib/runtime.mt +30 -0
  152. data/std/raylib/tracy_gpu.mt +37 -0
  153. data/std/raylib.mt +1510 -0
  154. data/std/raymath.mt +153 -0
  155. data/std/result.mt +89 -0
  156. data/std/rlgl.mt +268 -0
  157. data/std/rpng.mt +46 -0
  158. data/std/rres.mt +36 -0
  159. data/std/sdl3/runtime.mt +54 -0
  160. data/std/sdl3.mt +1731 -0
  161. data/std/serialize.mt +68 -0
  162. data/std/set.mt +124 -0
  163. data/std/spatial.mt +176 -0
  164. data/std/sqlite3.mt +151 -0
  165. data/std/stack.mt +55 -0
  166. data/std/stb_image.mt +47 -0
  167. data/std/stb_image_resize2.mt +41 -0
  168. data/std/stb_image_write.mt +17 -0
  169. data/std/stb_rect_pack.mt +15 -0
  170. data/std/stb_truetype.mt +77 -0
  171. data/std/stb_vorbis.mt +16 -0
  172. data/std/stdio.mt +88 -0
  173. data/std/steamworks.mt +1542 -0
  174. data/std/str.mt +293 -0
  175. data/std/string.mt +234 -0
  176. data/std/sync.mt +194 -0
  177. data/std/tar.mt +704 -0
  178. data/std/terminal.mt +1002 -0
  179. data/std/testing.mt +266 -0
  180. data/std/thread.mt +120 -0
  181. data/std/time.mt +105 -0
  182. data/std/tls.mt +616 -0
  183. data/std/toml.mt +1310 -0
  184. data/std/tracy.mt +42 -0
  185. data/std/uri.mt +118 -0
  186. data/std/url.mt +372 -0
  187. data/std/vec.mt +433 -0
  188. data/std/zstd.mt +94 -0
  189. metadata +187 -2
data/std/c/string.mt ADDED
@@ -0,0 +1,16 @@
1
+ # generated by mtc bindgen from /home/teefan/Projects/Ruby/mt-lang/std/c/string_bindgen.h
2
+ external
3
+
4
+ include "string_bindgen.h"
5
+
6
+ external function mt_string_memcpy(destination: ptr[void], source: const_ptr[void], size_bytes: ptr_uint) -> ptr[void]
7
+ external function mt_string_memmove(destination: ptr[void], source: const_ptr[void], size_bytes: ptr_uint) -> ptr[void]
8
+ external function mt_string_memset(destination: ptr[void], value: int, size_bytes: ptr_uint) -> ptr[void]
9
+ external function mt_string_memcmp(left: const_ptr[void], right: const_ptr[void], size_bytes: ptr_uint) -> int
10
+ external function mt_string_memchr(source: const_ptr[void], value: int, size_bytes: ptr_uint) -> ptr[void]?
11
+ external function mt_string_strlen(text: cstr) -> ptr_uint
12
+ external function mt_string_strcmp(left: cstr, right: cstr) -> int
13
+ external function mt_string_strncmp(left: cstr, right: cstr, size_bytes: ptr_uint) -> int
14
+ external function mt_string_strchr(text: cstr, value: int) -> ptr[char]?
15
+ external function mt_string_strrchr(text: cstr, value: int) -> ptr[char]?
16
+ external function mt_string_strstr(haystack: cstr, needle: cstr) -> ptr[char]?
@@ -0,0 +1,36 @@
1
+ #ifndef MT_LANG_STRING_BINDGEN_H
2
+ #define MT_LANG_STRING_BINDGEN_H
3
+
4
+ #include <string.h>
5
+
6
+ #ifdef __cplusplus
7
+ extern "C" {
8
+ #endif
9
+
10
+ static inline void *mt_string_memcpy(void *destination, const void *source, size_t size_bytes) { return memcpy(destination, source, size_bytes); }
11
+ static inline void *mt_string_memmove(void *destination, const void *source, size_t size_bytes) { return memmove(destination, source, size_bytes); }
12
+ static inline void *mt_string_memset(void *destination, int value, size_t size_bytes) { return memset(destination, value, size_bytes); }
13
+ static inline int mt_string_memcmp(const void *left, const void *right, size_t size_bytes) { return memcmp(left, right, size_bytes); }
14
+ #ifdef __cplusplus
15
+ static inline void *mt_string_memchr(const void *source, int value, size_t size_bytes) { return const_cast<void *>(memchr(source, value, size_bytes)); }
16
+ #else
17
+ static inline void *mt_string_memchr(const void *source, int value, size_t size_bytes) { return memchr(source, value, size_bytes); }
18
+ #endif
19
+ static inline size_t mt_string_strlen(const char *text) { return strlen(text); }
20
+ static inline int mt_string_strcmp(const char *left, const char *right) { return strcmp(left, right); }
21
+ static inline int mt_string_strncmp(const char *left, const char *right, size_t size_bytes) { return strncmp(left, right, size_bytes); }
22
+ #ifdef __cplusplus
23
+ static inline char *mt_string_strchr(const char *text, int value) { return const_cast<char *>(strchr(text, value)); }
24
+ static inline char *mt_string_strrchr(const char *text, int value) { return const_cast<char *>(strrchr(text, value)); }
25
+ static inline char *mt_string_strstr(const char *haystack, const char *needle) { return const_cast<char *>(strstr(haystack, needle)); }
26
+ #else
27
+ static inline char *mt_string_strchr(const char *text, int value) { return strchr(text, value); }
28
+ static inline char *mt_string_strrchr(const char *text, int value) { return strrchr(text, value); }
29
+ static inline char *mt_string_strstr(const char *haystack, const char *needle) { return strstr(haystack, needle); }
30
+ #endif
31
+
32
+ #ifdef __cplusplus
33
+ }
34
+ #endif
35
+
36
+ #endif
data/std/c/sync.mt ADDED
@@ -0,0 +1,33 @@
1
+ external
2
+
3
+ link "uv"
4
+ include "sync_support.h"
5
+
6
+ opaque mt_mutex = c"mt_mutex"
7
+ opaque mt_condition = c"mt_condition"
8
+ opaque mt_semaphore = c"mt_semaphore"
9
+ opaque mt_atomic_uint = c"mt_atomic_uint"
10
+
11
+ external function mt_mutex_create(out out_mutex: ptr[mt_mutex]?) -> int
12
+ external function mt_mutex_create_recursive(out out_mutex: ptr[mt_mutex]?) -> int
13
+ external function mt_mutex_destroy(handle: ptr[mt_mutex]?) -> void
14
+ external function mt_mutex_lock(handle: ptr[mt_mutex]) -> void
15
+ external function mt_mutex_try_lock(handle: ptr[mt_mutex]) -> int
16
+ external function mt_mutex_unlock(handle: ptr[mt_mutex]) -> void
17
+ external function mt_condition_create(out out_condition: ptr[mt_condition]?) -> int
18
+ external function mt_condition_destroy(handle: ptr[mt_condition]?) -> void
19
+ external function mt_condition_signal(handle: ptr[mt_condition]) -> void
20
+ external function mt_condition_broadcast(handle: ptr[mt_condition]) -> void
21
+ external function mt_condition_wait(handle: ptr[mt_condition], mutex: ptr[mt_mutex]) -> void
22
+ external function mt_semaphore_create(initial_value: uint, out out_semaphore: ptr[mt_semaphore]?) -> int
23
+ external function mt_semaphore_destroy(handle: ptr[mt_semaphore]?) -> void
24
+ external function mt_semaphore_post(handle: ptr[mt_semaphore]) -> void
25
+ external function mt_semaphore_wait(handle: ptr[mt_semaphore]) -> void
26
+ external function mt_semaphore_try_wait(handle: ptr[mt_semaphore]) -> int
27
+ external function mt_atomic_uint_create(out out_atomic: ptr[mt_atomic_uint]?, initial_value: uint) -> int
28
+ external function mt_atomic_uint_destroy(handle: ptr[mt_atomic_uint]?) -> void
29
+ external function mt_atomic_uint_load(atomic: ptr[mt_atomic_uint]) -> uint
30
+ external function mt_atomic_uint_store(atomic: ptr[mt_atomic_uint], new_value: uint) -> void
31
+ external function mt_atomic_uint_fetch_add(atomic: ptr[mt_atomic_uint], delta: uint) -> uint
32
+ external function mt_atomic_uint_fetch_sub(atomic: ptr[mt_atomic_uint], delta: uint) -> uint
33
+ external function mt_atomic_uint_compare_exchange(atomic: ptr[mt_atomic_uint], expected: ptr[uint], desired: uint) -> bool
@@ -0,0 +1,219 @@
1
+ #ifndef MT_SYNC_SUPPORT_H
2
+ #define MT_SYNC_SUPPORT_H
3
+
4
+ #include <stdlib.h>
5
+ #include <uv.h>
6
+
7
+ typedef struct mt_mutex {
8
+ uv_mutex_t native;
9
+ } mt_mutex;
10
+
11
+ typedef struct mt_condition {
12
+ uv_cond_t native;
13
+ } mt_condition;
14
+
15
+ typedef struct mt_semaphore {
16
+ uv_sem_t native;
17
+ } mt_semaphore;
18
+
19
+ static inline int mt_mutex_create(mt_mutex** out_mutex) {
20
+ if (out_mutex != NULL) {
21
+ *out_mutex = NULL;
22
+ }
23
+
24
+ mt_mutex* mutex = (mt_mutex*) malloc(sizeof(mt_mutex));
25
+ if (mutex == NULL) {
26
+ return UV_ENOMEM;
27
+ }
28
+
29
+ int status = uv_mutex_init(&mutex->native);
30
+ if (status != 0) {
31
+ free(mutex);
32
+ return status;
33
+ }
34
+
35
+ if (out_mutex != NULL) {
36
+ *out_mutex = mutex;
37
+ }
38
+ return 0;
39
+ }
40
+
41
+ static inline int mt_mutex_create_recursive(mt_mutex** out_mutex) {
42
+ if (out_mutex != NULL) {
43
+ *out_mutex = NULL;
44
+ }
45
+
46
+ mt_mutex* mutex = (mt_mutex*) malloc(sizeof(mt_mutex));
47
+ if (mutex == NULL) {
48
+ return UV_ENOMEM;
49
+ }
50
+
51
+ int status = uv_mutex_init_recursive(&mutex->native);
52
+ if (status != 0) {
53
+ free(mutex);
54
+ return status;
55
+ }
56
+
57
+ if (out_mutex != NULL) {
58
+ *out_mutex = mutex;
59
+ }
60
+ return 0;
61
+ }
62
+
63
+ static inline void mt_mutex_destroy(mt_mutex* handle) {
64
+ if (handle == NULL) {
65
+ return;
66
+ }
67
+
68
+ uv_mutex_destroy(&handle->native);
69
+ free(handle);
70
+ }
71
+
72
+ static inline void mt_mutex_lock(mt_mutex* handle) {
73
+ uv_mutex_lock(&handle->native);
74
+ }
75
+
76
+ static inline int mt_mutex_try_lock(mt_mutex* handle) {
77
+ return uv_mutex_trylock(&handle->native);
78
+ }
79
+
80
+ static inline void mt_mutex_unlock(mt_mutex* handle) {
81
+ uv_mutex_unlock(&handle->native);
82
+ }
83
+
84
+ static inline int mt_condition_create(mt_condition** out_condition) {
85
+ if (out_condition != NULL) {
86
+ *out_condition = NULL;
87
+ }
88
+
89
+ mt_condition* condition = (mt_condition*) malloc(sizeof(mt_condition));
90
+ if (condition == NULL) {
91
+ return UV_ENOMEM;
92
+ }
93
+
94
+ int status = uv_cond_init(&condition->native);
95
+ if (status != 0) {
96
+ free(condition);
97
+ return status;
98
+ }
99
+
100
+ if (out_condition != NULL) {
101
+ *out_condition = condition;
102
+ }
103
+ return 0;
104
+ }
105
+
106
+ static inline void mt_condition_destroy(mt_condition* handle) {
107
+ if (handle == NULL) {
108
+ return;
109
+ }
110
+
111
+ uv_cond_destroy(&handle->native);
112
+ free(handle);
113
+ }
114
+
115
+ static inline void mt_condition_signal(mt_condition* handle) {
116
+ uv_cond_signal(&handle->native);
117
+ }
118
+
119
+ static inline void mt_condition_broadcast(mt_condition* handle) {
120
+ uv_cond_broadcast(&handle->native);
121
+ }
122
+
123
+ static inline void mt_condition_wait(mt_condition* handle, mt_mutex* mutex) {
124
+ uv_cond_wait(&handle->native, &mutex->native);
125
+ }
126
+
127
+ static inline int mt_semaphore_create(unsigned int initial_value, mt_semaphore** out_semaphore) {
128
+ if (out_semaphore != NULL) {
129
+ *out_semaphore = NULL;
130
+ }
131
+
132
+ mt_semaphore* semaphore = (mt_semaphore*) malloc(sizeof(mt_semaphore));
133
+ if (semaphore == NULL) {
134
+ return UV_ENOMEM;
135
+ }
136
+
137
+ int status = uv_sem_init(&semaphore->native, initial_value);
138
+ if (status != 0) {
139
+ free(semaphore);
140
+ return status;
141
+ }
142
+
143
+ if (out_semaphore != NULL) {
144
+ *out_semaphore = semaphore;
145
+ }
146
+ return 0;
147
+ }
148
+
149
+ static inline void mt_semaphore_destroy(mt_semaphore* handle) {
150
+ if (handle == NULL) {
151
+ return;
152
+ }
153
+
154
+ uv_sem_destroy(&handle->native);
155
+ free(handle);
156
+ }
157
+
158
+ static inline void mt_semaphore_post(mt_semaphore* handle) {
159
+ uv_sem_post(&handle->native);
160
+ }
161
+
162
+ static inline void mt_semaphore_wait(mt_semaphore* handle) {
163
+ uv_sem_wait(&handle->native);
164
+ }
165
+
166
+ static inline int mt_semaphore_try_wait(mt_semaphore* handle) {
167
+ return uv_sem_trywait(&handle->native);
168
+ }
169
+
170
+ typedef struct mt_atomic_uint {
171
+ unsigned int value;
172
+ } mt_atomic_uint;
173
+
174
+ static inline int mt_atomic_uint_create(mt_atomic_uint** out_atomic, unsigned int initial_value) {
175
+ if (out_atomic != NULL) {
176
+ *out_atomic = NULL;
177
+ }
178
+
179
+ mt_atomic_uint* atomic = (mt_atomic_uint*) malloc(sizeof(mt_atomic_uint));
180
+ if (atomic == NULL) {
181
+ return UV_ENOMEM;
182
+ }
183
+
184
+ atomic->value = initial_value;
185
+ if (out_atomic != NULL) {
186
+ *out_atomic = atomic;
187
+ }
188
+ return 0;
189
+ }
190
+
191
+ static inline void mt_atomic_uint_destroy(mt_atomic_uint* handle) {
192
+ if (handle == NULL) {
193
+ return;
194
+ }
195
+
196
+ free(handle);
197
+ }
198
+
199
+ static inline unsigned int mt_atomic_uint_load(mt_atomic_uint* atomic) {
200
+ return __atomic_load_n(&atomic->value, __ATOMIC_SEQ_CST);
201
+ }
202
+
203
+ static inline void mt_atomic_uint_store(mt_atomic_uint* atomic, unsigned int new_value) {
204
+ __atomic_store_n(&atomic->value, new_value, __ATOMIC_SEQ_CST);
205
+ }
206
+
207
+ static inline unsigned int mt_atomic_uint_fetch_add(mt_atomic_uint* atomic, unsigned int delta) {
208
+ return __atomic_fetch_add(&atomic->value, delta, __ATOMIC_SEQ_CST);
209
+ }
210
+
211
+ static inline unsigned int mt_atomic_uint_fetch_sub(mt_atomic_uint* atomic, unsigned int delta) {
212
+ return __atomic_fetch_sub(&atomic->value, delta, __ATOMIC_SEQ_CST);
213
+ }
214
+
215
+ static inline bool mt_atomic_uint_compare_exchange(mt_atomic_uint* atomic, unsigned int* expected, unsigned int desired) {
216
+ return __atomic_compare_exchange_n(&atomic->value, expected, desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
217
+ }
218
+
219
+ #endif
data/std/c/terminal.mt ADDED
@@ -0,0 +1,24 @@
1
+ external
2
+
3
+ include "terminal_support.h"
4
+
5
+ struct mt_terminal_size = c"mt_terminal_size":
6
+ width: int
7
+ height: int
8
+
9
+ struct mt_terminal_error = c"mt_terminal_error":
10
+ code: int
11
+ message_data: ptr[char]?
12
+ message_len: ptr_uint
13
+
14
+ external function mt_terminal_stdin_is_tty() -> bool
15
+ external function mt_terminal_stdout_is_tty() -> bool
16
+ external function mt_terminal_stderr_is_tty() -> bool
17
+ external function mt_terminal_get_size(out result: mt_terminal_size, out error: mt_terminal_error) -> int
18
+ external function mt_terminal_enter_raw_mode(out error: mt_terminal_error) -> int
19
+ external function mt_terminal_leave_raw_mode(out error: mt_terminal_error) -> int
20
+ external function mt_terminal_write_stdout(buffer: const_ptr[ubyte]?, len: ptr_uint, out out_written: ptr_uint, out error: mt_terminal_error) -> int
21
+ external function mt_terminal_write_stderr(buffer: const_ptr[ubyte]?, len: ptr_uint, out out_written: ptr_uint, out error: mt_terminal_error) -> int
22
+ external function mt_terminal_flush_stdout(out error: mt_terminal_error) -> int
23
+ external function mt_terminal_flush_stderr(out error: mt_terminal_error) -> int
24
+ external function mt_terminal_read_stdin(buffer: ptr[ubyte]?, capacity: ptr_uint, timeout_ms: int, out out_read: ptr_uint, out error: mt_terminal_error) -> int