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
@@ -0,0 +1,52 @@
1
+ # generated by mtc bindgen from /home/teefan/Projects/Ruby/mt-lang/third_party/stb-upstream/stb_image.h
2
+ external
3
+
4
+ include "stb_image.h"
5
+
6
+ type stbi_uc = ubyte
7
+ type stbi_us = ushort
8
+
9
+ struct stbi_io_callbacks:
10
+ read: fn(arg0: ptr[void], arg1: ptr[char], arg2: int) -> int
11
+ skip: fn(arg0: ptr[void], arg1: int) -> void
12
+ eof: fn(arg0: ptr[void]) -> int
13
+
14
+ external function stbi_load_from_memory(buffer: const_ptr[stbi_uc], len: int, x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[stbi_uc]
15
+ external function stbi_load_from_callbacks(clbk: const_ptr[stbi_io_callbacks], user: ptr[void], x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[stbi_uc]
16
+ external function stbi_load(filename: cstr, x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[stbi_uc]
17
+ external function stbi_load_gif_from_memory(buffer: const_ptr[stbi_uc], len: int, delays: ptr[ptr[int]], x: ptr[int], y: ptr[int], z: ptr[int], comp: ptr[int], req_comp: int) -> ptr[stbi_uc]
18
+ external function stbi_load_16_from_memory(buffer: const_ptr[stbi_uc], len: int, x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[stbi_us]
19
+ external function stbi_load_16_from_callbacks(clbk: const_ptr[stbi_io_callbacks], user: ptr[void], x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[stbi_us]
20
+ external function stbi_load_16(filename: cstr, x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[stbi_us]
21
+ external function stbi_loadf_from_memory(buffer: const_ptr[stbi_uc], len: int, x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[float]
22
+ external function stbi_loadf_from_callbacks(clbk: const_ptr[stbi_io_callbacks], user: ptr[void], x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[float]
23
+ external function stbi_loadf(filename: cstr, x: ptr[int], y: ptr[int], channels_in_file: ptr[int], desired_channels: int) -> ptr[float]
24
+ external function stbi_hdr_to_ldr_gamma(gamma: float) -> void
25
+ external function stbi_hdr_to_ldr_scale(scale: float) -> void
26
+ external function stbi_ldr_to_hdr_gamma(gamma: float) -> void
27
+ external function stbi_ldr_to_hdr_scale(scale: float) -> void
28
+ external function stbi_is_hdr_from_callbacks(clbk: const_ptr[stbi_io_callbacks], user: ptr[void]) -> int
29
+ external function stbi_is_hdr_from_memory(buffer: const_ptr[stbi_uc], len: int) -> int
30
+ external function stbi_is_hdr(filename: cstr) -> int
31
+ external function stbi_failure_reason() -> cstr
32
+ external function stbi_image_free(retval_from_stbi_load: ptr[void]) -> void
33
+ external function stbi_info_from_memory(buffer: const_ptr[stbi_uc], len: int, x: ptr[int], y: ptr[int], comp: ptr[int]) -> int
34
+ external function stbi_info_from_callbacks(clbk: const_ptr[stbi_io_callbacks], user: ptr[void], x: ptr[int], y: ptr[int], comp: ptr[int]) -> int
35
+ external function stbi_is_16_bit_from_memory(buffer: const_ptr[stbi_uc], len: int) -> int
36
+ external function stbi_is_16_bit_from_callbacks(clbk: const_ptr[stbi_io_callbacks], user: ptr[void]) -> int
37
+ external function stbi_info(filename: cstr, x: ptr[int], y: ptr[int], comp: ptr[int]) -> int
38
+ external function stbi_is_16_bit(filename: cstr) -> int
39
+ external function stbi_set_unpremultiply_on_load(flag_true_if_should_unpremultiply: int) -> void
40
+ external function stbi_convert_iphone_png_to_rgb(flag_true_if_should_convert: int) -> void
41
+ external function stbi_set_flip_vertically_on_load(flag_true_if_should_flip: int) -> void
42
+ external function stbi_set_unpremultiply_on_load_thread(flag_true_if_should_unpremultiply: int) -> void
43
+ external function stbi_convert_iphone_png_to_rgb_thread(flag_true_if_should_convert: int) -> void
44
+ external function stbi_set_flip_vertically_on_load_thread(flag_true_if_should_flip: int) -> void
45
+ external function stbi_zlib_decode_malloc_guesssize(buffer: cstr, len: int, initial_size: int, outlen: ptr[int]) -> ptr[char]
46
+ external function stbi_zlib_decode_malloc_guesssize_headerflag(buffer: cstr, len: int, initial_size: int, outlen: ptr[int], parse_header: int) -> ptr[char]
47
+ external function stbi_zlib_decode_malloc(buffer: cstr, len: int, outlen: ptr[int]) -> ptr[char]
48
+ external function stbi_zlib_decode_buffer(obuffer: ptr[char], olen: int, ibuffer: cstr, ilen: int) -> int
49
+ external function stbi_zlib_decode_noheader_malloc(buffer: cstr, len: int, outlen: ptr[int]) -> ptr[char]
50
+ external function stbi_zlib_decode_noheader_buffer(obuffer: ptr[char], olen: int, ibuffer: cstr, ilen: int) -> int
51
+
52
+ const STBI_VERSION: int = 1
@@ -0,0 +1,128 @@
1
+ # generated by mtc bindgen from /home/teefan/Projects/Ruby/mt-lang/third_party/stb-upstream/stb_image_resize2.h
2
+ external
3
+
4
+ include "stb_image_resize2.h"
5
+
6
+ type stbir_uint8 = ubyte
7
+ type stbir_uint16 = ushort
8
+ type stbir_uint32 = uint
9
+ type stbir_uint64 = ptr_uint
10
+
11
+ enum stbir_pixel_layout: int
12
+ STBIR_1CHANNEL = 1
13
+ STBIR_2CHANNEL = 2
14
+ STBIR_RGB = 3
15
+ STBIR_BGR = 0
16
+ STBIR_4CHANNEL = 5
17
+ STBIR_RGBA = 4
18
+ STBIR_BGRA = 6
19
+ STBIR_ARGB = 7
20
+ STBIR_ABGR = 8
21
+ STBIR_RA = 9
22
+ STBIR_AR = 10
23
+ STBIR_RGBA_PM = 11
24
+ STBIR_BGRA_PM = 12
25
+ STBIR_ARGB_PM = 13
26
+ STBIR_ABGR_PM = 14
27
+ STBIR_RA_PM = 15
28
+ STBIR_AR_PM = 16
29
+ STBIR_RGBA_NO_AW = 11
30
+ STBIR_BGRA_NO_AW = 12
31
+ STBIR_ARGB_NO_AW = 13
32
+ STBIR_ABGR_NO_AW = 14
33
+ STBIR_RA_NO_AW = 15
34
+ STBIR_AR_NO_AW = 16
35
+
36
+ external function stbir_resize_uint8_srgb(input_pixels: const_ptr[ubyte], input_w: int, input_h: int, input_stride_in_bytes: int, output_pixels: ptr[ubyte], output_w: int, output_h: int, output_stride_in_bytes: int, pixel_type: stbir_pixel_layout) -> ptr[ubyte]
37
+ external function stbir_resize_uint8_linear(input_pixels: const_ptr[ubyte], input_w: int, input_h: int, input_stride_in_bytes: int, output_pixels: ptr[ubyte], output_w: int, output_h: int, output_stride_in_bytes: int, pixel_type: stbir_pixel_layout) -> ptr[ubyte]
38
+ external function stbir_resize_float_linear(input_pixels: const_ptr[float], input_w: int, input_h: int, input_stride_in_bytes: int, output_pixels: ptr[float], output_w: int, output_h: int, output_stride_in_bytes: int, pixel_type: stbir_pixel_layout) -> ptr[float]
39
+
40
+ enum stbir_edge: int
41
+ STBIR_EDGE_CLAMP = 0
42
+ STBIR_EDGE_REFLECT = 1
43
+ STBIR_EDGE_WRAP = 2
44
+ STBIR_EDGE_ZERO = 3
45
+
46
+ enum stbir_filter: int
47
+ STBIR_FILTER_DEFAULT = 0
48
+ STBIR_FILTER_BOX = 1
49
+ STBIR_FILTER_TRIANGLE = 2
50
+ STBIR_FILTER_CUBICBSPLINE = 3
51
+ STBIR_FILTER_CATMULLROM = 4
52
+ STBIR_FILTER_MITCHELL = 5
53
+ STBIR_FILTER_POINT_SAMPLE = 6
54
+ STBIR_FILTER_OTHER = 7
55
+
56
+ enum stbir_datatype: int
57
+ STBIR_TYPE_UINT8 = 0
58
+ STBIR_TYPE_UINT8_SRGB = 1
59
+ STBIR_TYPE_UINT8_SRGB_ALPHA = 2
60
+ STBIR_TYPE_UINT16 = 3
61
+ STBIR_TYPE_FLOAT = 4
62
+ STBIR_TYPE_HALF_FLOAT = 5
63
+
64
+ external function stbir_resize(input_pixels: const_ptr[void], input_w: int, input_h: int, input_stride_in_bytes: int, output_pixels: ptr[void], output_w: int, output_h: int, output_stride_in_bytes: int, pixel_layout: stbir_pixel_layout, data_type: stbir_datatype, edge: stbir_edge, filter: stbir_filter) -> ptr[void]
65
+
66
+ type stbir_input_callback = fn(arg0: ptr[void], arg1: const_ptr[void], arg2: int, arg3: int, arg4: int, arg5: ptr[void]) -> const_ptr[void]
67
+ type stbir_output_callback = fn(arg0: const_ptr[void], arg1: int, arg2: int, arg3: ptr[void]) -> void
68
+ type stbir__kernel_callback = fn(arg0: float, arg1: float, arg2: ptr[void]) -> float
69
+ type stbir__support_callback = fn(arg0: float, arg1: ptr[void]) -> float
70
+
71
+ opaque stbir__info = c"stbir__info"
72
+
73
+ struct STBIR_RESIZE:
74
+ user_data: ptr[void]
75
+ input_pixels: const_ptr[void]
76
+ input_w: int
77
+ input_h: int
78
+ input_s0: double
79
+ input_t0: double
80
+ input_s1: double
81
+ input_t1: double
82
+ input_cb: ptr[stbir_input_callback]
83
+ output_pixels: ptr[void]
84
+ output_w: int
85
+ output_h: int
86
+ output_subx: int
87
+ output_suby: int
88
+ output_subw: int
89
+ output_subh: int
90
+ output_cb: ptr[stbir_output_callback]
91
+ input_stride_in_bytes: int
92
+ output_stride_in_bytes: int
93
+ splits: int
94
+ fast_alpha: int
95
+ needs_rebuild: int
96
+ called_alloc: int
97
+ input_pixel_layout_public: stbir_pixel_layout
98
+ output_pixel_layout_public: stbir_pixel_layout
99
+ input_data_type: stbir_datatype
100
+ output_data_type: stbir_datatype
101
+ horizontal_filter: stbir_filter
102
+ vertical_filter: stbir_filter
103
+ horizontal_edge: stbir_edge
104
+ vertical_edge: stbir_edge
105
+ horizontal_filter_kernel: ptr[stbir__kernel_callback]
106
+ horizontal_filter_support: ptr[stbir__support_callback]
107
+ vertical_filter_kernel: ptr[stbir__kernel_callback]
108
+ vertical_filter_support: ptr[stbir__support_callback]
109
+ samplers: ptr[stbir__info]
110
+
111
+ external function stbir_resize_init(resize: ptr[STBIR_RESIZE], input_pixels: const_ptr[void], input_w: int, input_h: int, input_stride_in_bytes: int, output_pixels: ptr[void], output_w: int, output_h: int, output_stride_in_bytes: int, pixel_layout: stbir_pixel_layout, data_type: stbir_datatype) -> void
112
+ external function stbir_set_datatypes(resize: ptr[STBIR_RESIZE], input_type: stbir_datatype, output_type: stbir_datatype) -> void
113
+ external function stbir_set_pixel_callbacks(resize: ptr[STBIR_RESIZE], input_cb: ptr[stbir_input_callback], output_cb: ptr[stbir_output_callback]) -> void
114
+ external function stbir_set_user_data(resize: ptr[STBIR_RESIZE], user_data: ptr[void]) -> void
115
+ external function stbir_set_buffer_ptrs(resize: ptr[STBIR_RESIZE], input_pixels: const_ptr[void], input_stride_in_bytes: int, output_pixels: ptr[void], output_stride_in_bytes: int) -> void
116
+ external function stbir_set_pixel_layouts(resize: ptr[STBIR_RESIZE], input_pixel_layout: stbir_pixel_layout, output_pixel_layout: stbir_pixel_layout) -> int
117
+ external function stbir_set_edgemodes(resize: ptr[STBIR_RESIZE], horizontal_edge: stbir_edge, vertical_edge: stbir_edge) -> int
118
+ external function stbir_set_filters(resize: ptr[STBIR_RESIZE], horizontal_filter: stbir_filter, vertical_filter: stbir_filter) -> int
119
+ external function stbir_set_filter_callbacks(resize: ptr[STBIR_RESIZE], horizontal_filter: ptr[stbir__kernel_callback], horizontal_support: ptr[stbir__support_callback], vertical_filter: ptr[stbir__kernel_callback], vertical_support: ptr[stbir__support_callback]) -> int
120
+ external function stbir_set_pixel_subrect(resize: ptr[STBIR_RESIZE], subx: int, suby: int, subw: int, subh: int) -> int
121
+ external function stbir_set_input_subrect(resize: ptr[STBIR_RESIZE], s0: double, t0: double, s1: double, t1: double) -> int
122
+ external function stbir_set_output_pixel_subrect(resize: ptr[STBIR_RESIZE], subx: int, suby: int, subw: int, subh: int) -> int
123
+ external function stbir_set_non_pm_alpha_speed_over_quality(resize: ptr[STBIR_RESIZE], non_pma_alpha_speed_over_quality: int) -> int
124
+ external function stbir_build_samplers(resize: ptr[STBIR_RESIZE]) -> int
125
+ external function stbir_free_samplers(resize: ptr[STBIR_RESIZE]) -> void
126
+ external function stbir_resize_extended(resize: ptr[STBIR_RESIZE]) -> int
127
+ external function stbir_build_samplers_with_splits(resize: ptr[STBIR_RESIZE], try_splits: int) -> int
128
+ external function stbir_resize_extended_split(resize: ptr[STBIR_RESIZE], split_start: int, split_count: int) -> int
@@ -0,0 +1,19 @@
1
+ # generated by mtc bindgen from /home/teefan/Projects/Ruby/mt-lang/third_party/stb-upstream/stb_image_write.h
2
+ external
3
+
4
+ include "stb_image_write.h"
5
+
6
+ external function stbi_write_png(filename: cstr, w: int, h: int, comp: int, data: const_ptr[void], stride_in_bytes: int) -> int
7
+ external function stbi_write_bmp(filename: cstr, w: int, h: int, comp: int, data: const_ptr[void]) -> int
8
+ external function stbi_write_tga(filename: cstr, w: int, h: int, comp: int, data: const_ptr[void]) -> int
9
+ external function stbi_write_hdr(filename: cstr, w: int, h: int, comp: int, data: const_ptr[float]) -> int
10
+ external function stbi_write_jpg(filename: cstr, x: int, y: int, comp: int, data: const_ptr[void], quality: int) -> int
11
+
12
+ type stbi_write_func = fn(arg0: ptr[void], arg1: ptr[void], arg2: int) -> void
13
+
14
+ external function stbi_write_png_to_func(func: ptr[stbi_write_func], context: ptr[void], w: int, h: int, comp: int, data: const_ptr[void], stride_in_bytes: int) -> int
15
+ external function stbi_write_bmp_to_func(func: ptr[stbi_write_func], context: ptr[void], w: int, h: int, comp: int, data: const_ptr[void]) -> int
16
+ external function stbi_write_tga_to_func(func: ptr[stbi_write_func], context: ptr[void], w: int, h: int, comp: int, data: const_ptr[void]) -> int
17
+ external function stbi_write_hdr_to_func(func: ptr[stbi_write_func], context: ptr[void], w: int, h: int, comp: int, data: const_ptr[float]) -> int
18
+ external function stbi_write_jpg_to_func(func: ptr[stbi_write_func], context: ptr[void], x: int, y: int, comp: int, data: const_ptr[void], quality: int) -> int
19
+ external function stbi_flip_vertically_on_write(flip_boolean: int) -> void
@@ -0,0 +1,38 @@
1
+ # generated by mtc bindgen from /home/teefan/Projects/Ruby/mt-lang/third_party/stb-upstream/stb_rect_pack.h
2
+ external
3
+
4
+ include "stb_rect_pack.h"
5
+
6
+ type stbrp_coord = int
7
+
8
+ external function stbrp_pack_rects(context: ptr[stbrp_context], rects: ptr[stbrp_rect], num_rects: int) -> int
9
+
10
+ struct stbrp_rect:
11
+ id: int
12
+ w: int
13
+ h: int
14
+ x: int
15
+ y: int
16
+ was_packed: int
17
+
18
+ external function stbrp_init_target(context: ptr[stbrp_context], width: int, height: int, nodes: ptr[stbrp_node], num_nodes: int) -> void
19
+ external function stbrp_setup_allow_out_of_mem(context: ptr[stbrp_context], allow_out_of_mem: int) -> void
20
+ external function stbrp_setup_heuristic(context: ptr[stbrp_context], heuristic: int) -> void
21
+
22
+ struct stbrp_node:
23
+ x: int
24
+ y: int
25
+ next: ptr[stbrp_node]
26
+
27
+ struct stbrp_context:
28
+ width: int
29
+ height: int
30
+ align: int
31
+ init_mode: int
32
+ heuristic: int
33
+ num_nodes: int
34
+ active_head: ptr[stbrp_node]
35
+ free_head: ptr[stbrp_node]
36
+ extra: array[stbrp_node, 2]
37
+
38
+ const STBRP__MAXVAL: int = 2147483647
@@ -0,0 +1,175 @@
1
+ # generated by mtc bindgen from /home/teefan/Projects/Ruby/mt-lang/third_party/stb-upstream/stb_truetype.h
2
+ external
3
+
4
+ include "stb_truetype.h"
5
+
6
+ struct stbtt__buf:
7
+ data: ptr[ubyte]
8
+ cursor: int
9
+ size: int
10
+
11
+ struct stbtt_bakedchar:
12
+ x0: ushort
13
+ y0: ushort
14
+ x1: ushort
15
+ y1: ushort
16
+ xoff: float
17
+ yoff: float
18
+ xadvance: float
19
+
20
+ external function stbtt_BakeFontBitmap(data: const_ptr[ubyte], offset: int, pixel_height: float, pixels: ptr[ubyte], pw: int, ph: int, first_char: int, num_chars: int, chardata: ptr[stbtt_bakedchar]) -> int
21
+
22
+ struct stbtt_aligned_quad:
23
+ x0: float
24
+ y0: float
25
+ s0: float
26
+ t0: float
27
+ x1: float
28
+ y1: float
29
+ s1: float
30
+ t1: float
31
+
32
+ external function stbtt_GetBakedQuad(chardata: const_ptr[stbtt_bakedchar], pw: int, ph: int, char_index: int, xpos: ptr[float], ypos: ptr[float], q: ptr[stbtt_aligned_quad], opengl_fillrule: int) -> void
33
+ external function stbtt_GetScaledFontVMetrics(fontdata: const_ptr[ubyte], index: int, size: float, ascent: ptr[float], descent: ptr[float], lineGap: ptr[float]) -> void
34
+
35
+ struct stbtt_packedchar:
36
+ x0: ushort
37
+ y0: ushort
38
+ x1: ushort
39
+ y1: ushort
40
+ xoff: float
41
+ yoff: float
42
+ xadvance: float
43
+ xoff2: float
44
+ yoff2: float
45
+
46
+ external function stbtt_PackBegin(spc: ptr[stbtt_pack_context], pixels: ptr[ubyte], width: int, height: int, stride_in_bytes: int, padding: int, alloc_context: ptr[void]) -> int
47
+ external function stbtt_PackEnd(spc: ptr[stbtt_pack_context]) -> void
48
+ external function stbtt_PackFontRange(spc: ptr[stbtt_pack_context], fontdata: const_ptr[ubyte], font_index: int, font_size: float, first_unicode_char_in_range: int, num_chars_in_range: int, chardata_for_range: ptr[stbtt_packedchar]) -> int
49
+
50
+ struct stbtt_pack_range:
51
+ font_size: float
52
+ first_unicode_codepoint_in_range: int
53
+ array_of_unicode_codepoints: ptr[int]
54
+ num_chars: int
55
+ chardata_for_range: ptr[stbtt_packedchar]
56
+ h_oversample: ubyte
57
+ v_oversample: ubyte
58
+
59
+ external function stbtt_PackFontRanges(spc: ptr[stbtt_pack_context], fontdata: const_ptr[ubyte], font_index: int, ranges: ptr[stbtt_pack_range], num_ranges: int) -> int
60
+ external function stbtt_PackSetOversampling(spc: ptr[stbtt_pack_context], h_oversample: uint, v_oversample: uint) -> void
61
+ external function stbtt_PackSetSkipMissingCodepoints(spc: ptr[stbtt_pack_context], skip: int) -> void
62
+ external function stbtt_GetPackedQuad(chardata: const_ptr[stbtt_packedchar], pw: int, ph: int, char_index: int, xpos: ptr[float], ypos: ptr[float], q: ptr[stbtt_aligned_quad], align_to_integer: int) -> void
63
+
64
+ struct stbtt_pack_context:
65
+ user_allocator_context: ptr[void]
66
+ pack_info: ptr[void]
67
+ width: int
68
+ height: int
69
+ stride_in_bytes: int
70
+ padding: int
71
+ skip_missing: int
72
+ h_oversample: uint
73
+ v_oversample: uint
74
+ pixels: ptr[ubyte]
75
+ nodes: ptr[void]
76
+
77
+ external function stbtt_GetNumberOfFonts(data: const_ptr[ubyte]) -> int
78
+ external function stbtt_GetFontOffsetForIndex(data: const_ptr[ubyte], index: int) -> int
79
+
80
+ struct stbtt_fontinfo:
81
+ userdata: ptr[void]
82
+ data: ptr[ubyte]
83
+ fontstart: int
84
+ numGlyphs: int
85
+ loca: int
86
+ head: int
87
+ glyf: int
88
+ hhea: int
89
+ hmtx: int
90
+ kern: int
91
+ gpos: int
92
+ svg: int
93
+ index_map: int
94
+ indexToLocFormat: int
95
+ cff: stbtt__buf
96
+ charstrings: stbtt__buf
97
+ gsubrs: stbtt__buf
98
+ subrs: stbtt__buf
99
+ fontdicts: stbtt__buf
100
+ fdselect: stbtt__buf
101
+
102
+ external function stbtt_InitFont(info: ptr[stbtt_fontinfo], data: const_ptr[ubyte], offset: int) -> int
103
+ external function stbtt_FindGlyphIndex(info: const_ptr[stbtt_fontinfo], unicode_codepoint: int) -> int
104
+ external function stbtt_ScaleForPixelHeight(info: const_ptr[stbtt_fontinfo], pixels: float) -> float
105
+ external function stbtt_ScaleForMappingEmToPixels(info: const_ptr[stbtt_fontinfo], pixels: float) -> float
106
+ external function stbtt_GetFontVMetrics(info: const_ptr[stbtt_fontinfo], ascent: ptr[int], descent: ptr[int], lineGap: ptr[int]) -> void
107
+ external function stbtt_GetFontVMetricsOS2(info: const_ptr[stbtt_fontinfo], typoAscent: ptr[int], typoDescent: ptr[int], typoLineGap: ptr[int]) -> int
108
+ external function stbtt_GetFontBoundingBox(info: const_ptr[stbtt_fontinfo], x0: ptr[int], y0: ptr[int], x1: ptr[int], y1: ptr[int]) -> void
109
+ external function stbtt_GetCodepointHMetrics(info: const_ptr[stbtt_fontinfo], codepoint: int, advanceWidth: ptr[int], leftSideBearing: ptr[int]) -> void
110
+ external function stbtt_GetCodepointKernAdvance(info: const_ptr[stbtt_fontinfo], ch1: int, ch2: int) -> int
111
+ external function stbtt_GetCodepointBox(info: const_ptr[stbtt_fontinfo], codepoint: int, x0: ptr[int], y0: ptr[int], x1: ptr[int], y1: ptr[int]) -> int
112
+ external function stbtt_GetGlyphHMetrics(info: const_ptr[stbtt_fontinfo], glyph_index: int, advanceWidth: ptr[int], leftSideBearing: ptr[int]) -> void
113
+ external function stbtt_GetGlyphKernAdvance(info: const_ptr[stbtt_fontinfo], glyph1: int, glyph2: int) -> int
114
+ external function stbtt_GetGlyphBox(info: const_ptr[stbtt_fontinfo], glyph_index: int, x0: ptr[int], y0: ptr[int], x1: ptr[int], y1: ptr[int]) -> int
115
+
116
+ struct stbtt_kerningentry:
117
+ glyph1: int
118
+ glyph2: int
119
+ advance: int
120
+
121
+ external function stbtt_GetKerningTableLength(info: const_ptr[stbtt_fontinfo]) -> int
122
+ external function stbtt_GetKerningTable(info: const_ptr[stbtt_fontinfo], table: ptr[stbtt_kerningentry], table_length: int) -> int
123
+
124
+ struct stbtt_vertex:
125
+ x: short
126
+ y: short
127
+ cx: short
128
+ cy: short
129
+ cx1: short
130
+ cy1: short
131
+ type_: ubyte
132
+ padding: ubyte
133
+
134
+ external function stbtt_IsGlyphEmpty(info: const_ptr[stbtt_fontinfo], glyph_index: int) -> int
135
+ external function stbtt_GetCodepointShape(info: const_ptr[stbtt_fontinfo], unicode_codepoint: int, vertices: ptr[ptr[stbtt_vertex]]) -> int
136
+ external function stbtt_GetGlyphShape(info: const_ptr[stbtt_fontinfo], glyph_index: int, vertices: ptr[ptr[stbtt_vertex]]) -> int
137
+ external function stbtt_FreeShape(info: const_ptr[stbtt_fontinfo], vertices: ptr[stbtt_vertex]) -> void
138
+ external function stbtt_FindSVGDoc(info: const_ptr[stbtt_fontinfo], gl: int) -> ptr[ubyte]
139
+ external function stbtt_GetCodepointSVG(info: const_ptr[stbtt_fontinfo], unicode_codepoint: int, svg: ptr[cstr]) -> int
140
+ external function stbtt_GetGlyphSVG(info: const_ptr[stbtt_fontinfo], gl: int, svg: ptr[cstr]) -> int
141
+ external function stbtt_FreeBitmap(bitmap: ptr[ubyte], userdata: ptr[void]) -> void
142
+ external function stbtt_GetCodepointBitmap(info: const_ptr[stbtt_fontinfo], scale_x: float, scale_y: float, codepoint: int, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte]
143
+ external function stbtt_GetCodepointBitmapSubpixel(info: const_ptr[stbtt_fontinfo], scale_x: float, scale_y: float, shift_x: float, shift_y: float, codepoint: int, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte]
144
+ external function stbtt_MakeCodepointBitmap(info: const_ptr[stbtt_fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, codepoint: int) -> void
145
+ external function stbtt_MakeCodepointBitmapSubpixel(info: const_ptr[stbtt_fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, shift_x: float, shift_y: float, codepoint: int) -> void
146
+ external function stbtt_MakeCodepointBitmapSubpixelPrefilter(info: const_ptr[stbtt_fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, shift_x: float, shift_y: float, oversample_x: int, oversample_y: int, sub_x: ptr[float], sub_y: ptr[float], codepoint: int) -> void
147
+ external function stbtt_GetCodepointBitmapBox(font: const_ptr[stbtt_fontinfo], codepoint: int, scale_x: float, scale_y: float, ix0: ptr[int], iy0: ptr[int], ix1: ptr[int], iy1: ptr[int]) -> void
148
+ external function stbtt_GetCodepointBitmapBoxSubpixel(font: const_ptr[stbtt_fontinfo], codepoint: int, scale_x: float, scale_y: float, shift_x: float, shift_y: float, ix0: ptr[int], iy0: ptr[int], ix1: ptr[int], iy1: ptr[int]) -> void
149
+ external function stbtt_GetGlyphBitmap(info: const_ptr[stbtt_fontinfo], scale_x: float, scale_y: float, glyph: int, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte]
150
+ external function stbtt_GetGlyphBitmapSubpixel(info: const_ptr[stbtt_fontinfo], scale_x: float, scale_y: float, shift_x: float, shift_y: float, glyph: int, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte]
151
+ external function stbtt_MakeGlyphBitmap(info: const_ptr[stbtt_fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, glyph: int) -> void
152
+ external function stbtt_MakeGlyphBitmapSubpixel(info: const_ptr[stbtt_fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, shift_x: float, shift_y: float, glyph: int) -> void
153
+ external function stbtt_MakeGlyphBitmapSubpixelPrefilter(info: const_ptr[stbtt_fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, shift_x: float, shift_y: float, oversample_x: int, oversample_y: int, sub_x: ptr[float], sub_y: ptr[float], glyph: int) -> void
154
+ external function stbtt_GetGlyphBitmapBox(font: const_ptr[stbtt_fontinfo], glyph: int, scale_x: float, scale_y: float, ix0: ptr[int], iy0: ptr[int], ix1: ptr[int], iy1: ptr[int]) -> void
155
+ external function stbtt_GetGlyphBitmapBoxSubpixel(font: const_ptr[stbtt_fontinfo], glyph: int, scale_x: float, scale_y: float, shift_x: float, shift_y: float, ix0: ptr[int], iy0: ptr[int], ix1: ptr[int], iy1: ptr[int]) -> void
156
+
157
+ struct stbtt__bitmap:
158
+ w: int
159
+ h: int
160
+ stride: int
161
+ pixels: ptr[ubyte]
162
+
163
+ external function stbtt_Rasterize(result: ptr[stbtt__bitmap], flatness_in_pixels: float, vertices: ptr[stbtt_vertex], num_verts: int, scale_x: float, scale_y: float, shift_x: float, shift_y: float, x_off: int, y_off: int, invert: int, userdata: ptr[void]) -> void
164
+ external function stbtt_FreeSDF(bitmap: ptr[ubyte], userdata: ptr[void]) -> void
165
+ external function stbtt_GetGlyphSDF(info: const_ptr[stbtt_fontinfo], scale: float, glyph: int, padding: int, onedge_value: ubyte, pixel_dist_scale: float, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte]
166
+ external function stbtt_GetCodepointSDF(info: const_ptr[stbtt_fontinfo], scale: float, codepoint: int, padding: int, onedge_value: ubyte, pixel_dist_scale: float, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte]
167
+ external function stbtt_FindMatchingFont(fontdata: const_ptr[ubyte], name: cstr, flags_: int) -> int
168
+ external function stbtt_CompareUTF8toUTF16_bigendian(s1: cstr, len1: int, s2: cstr, len2: int) -> int
169
+ external function stbtt_GetFontNameString(font: const_ptr[stbtt_fontinfo], length: ptr[int], platformID: int, encodingID: int, languageID: int, nameID: int) -> cstr
170
+
171
+ const STBTT_MACSTYLE_DONTCARE: int = 0
172
+ const STBTT_MACSTYLE_BOLD: int = 1
173
+ const STBTT_MACSTYLE_ITALIC: int = 2
174
+ const STBTT_MACSTYLE_UNDERSCORE: int = 4
175
+ const STBTT_MACSTYLE_NONE: int = 8
@@ -0,0 +1,31 @@
1
+ # generated by mtc bindgen from /home/teefan/Projects/Ruby/mt-lang/third_party/stb-upstream/stb_vorbis.c
2
+ external
3
+
4
+ include "stb_vorbis.c"
5
+
6
+ struct stb_vorbis_alloc:
7
+ alloc_buffer: ptr[char]
8
+ alloc_buffer_length_in_bytes: int
9
+
10
+ struct stb_vorbis_info:
11
+ sample_rate: uint
12
+ channels: int
13
+ setup_memory_required: uint
14
+ setup_temp_memory_required: uint
15
+ temp_memory_required: uint
16
+ max_frame_size: int
17
+
18
+ struct stb_vorbis_comment:
19
+ vendor: ptr[char]
20
+ comment_list_length: int
21
+ comment_list: ptr[ptr[char]]
22
+
23
+ external function stb_vorbis_decode_filename(filename: cstr, channels: ptr[int], sample_rate: ptr[int], output: ptr[ptr[short]]) -> int
24
+ external function stb_vorbis_decode_memory(mem: const_ptr[ubyte], len: int, channels: ptr[int], sample_rate: ptr[int], output: ptr[ptr[short]]) -> int
25
+
26
+ type stb_vorbis_float_size_test = array[char, 1]
27
+
28
+ const STB_VORBIS_MAX_CHANNELS: int = 16
29
+ const STB_VORBIS_PUSHDATA_CRC_COUNT: int = 4
30
+ const STB_VORBIS_FAST_HUFFMAN_LENGTH: int = 10
31
+ const STB_VORBIS_ENDIAN: int = 0
data/std/c/stdio.mt ADDED
@@ -0,0 +1,90 @@
1
+ external
2
+
3
+ include "stdio.h"
4
+
5
+ opaque FILE = c"FILE"
6
+ opaque va_list = c"va_list"
7
+ opaque fpos_t = c"fpos_t"
8
+
9
+ const EOF: int = -1
10
+ const SEEK_SET: int = 0
11
+ const SEEK_CUR: int = 1
12
+ const SEEK_END: int = 2
13
+
14
+ const _IOFBF: int = 0
15
+ const _IOLBF: int = 1
16
+ const _IONBF: int = 2
17
+
18
+ const BUFSIZ: int = 8192
19
+
20
+ # File Access & Lifecycle
21
+
22
+ external function fopen(path: cstr, mode: cstr) -> FILE?
23
+ external function freopen(path: cstr, mode: cstr, stream: FILE?) -> FILE?
24
+ external function fclose(stream: FILE?) -> int
25
+ external function fflush(stream: FILE?) -> int
26
+ external function setbuf(stream: FILE?, buffer: ptr[char]) -> void
27
+ external function setvbuf(stream: FILE?, buffer: ptr[char], mode: int, size: ptr_uint) -> int
28
+ external function tmpfile() -> FILE?
29
+ external function tmpnam(buffer: ptr[char]) -> cstr
30
+ external function rename(old_path: cstr, new_path: cstr) -> int
31
+ external function remove(path: cstr) -> int
32
+
33
+ # Formatted Output
34
+
35
+ external function fprintf(stream: FILE?, format: cstr, ...) -> int
36
+ external function printf(format: cstr, ...) -> int
37
+ external function sprintf(buffer: ptr[char], format: cstr, ...) -> int
38
+ external function snprintf(buffer: ptr[char], maxlen: ptr_uint, format: cstr, ...) -> int
39
+
40
+ # Variadic Formatted Output
41
+
42
+ external function vfprintf(stream: FILE?, format: cstr, args: va_list) -> int
43
+ external function vprintf(format: cstr, args: va_list) -> int
44
+ external function vsprintf(buffer: ptr[char], format: cstr, args: va_list) -> int
45
+ external function vsnprintf(buffer: ptr[char], maxlen: ptr_uint, format: cstr, args: va_list) -> int
46
+
47
+ # Formatted Input
48
+
49
+ external function fscanf(stream: FILE?, format: cstr, ...) -> int
50
+ external function scanf(format: cstr, ...) -> int
51
+ external function sscanf(buffer: cstr, format: cstr, ...) -> int
52
+
53
+ # Variadic Formatted Input
54
+
55
+ external function vfscanf(stream: FILE?, format: cstr, args: va_list) -> int
56
+ external function vscanf(format: cstr, args: va_list) -> int
57
+ external function vsscanf(buffer: cstr, format: cstr, args: va_list) -> int
58
+
59
+ # Character Input & Output
60
+
61
+ external function fgetc(stream: FILE?) -> int
62
+ external function fgets(buffer: ptr[char], count: int, stream: FILE?) -> ptr[char]?
63
+ external function fputc(ch: int, stream: FILE?) -> int
64
+ external function fputs(text: cstr, stream: FILE?) -> int
65
+ external function getc(stream: FILE?) -> int
66
+ external function getchar() -> int
67
+ external function putc(ch: int, stream: FILE?) -> int
68
+ external function putchar(ch: int) -> int
69
+ external function puts(text: cstr) -> int
70
+ external function ungetc(ch: int, stream: FILE?) -> int
71
+
72
+ # Direct/Binary Input & Output
73
+
74
+ external function fread(buffer: ptr[void], element_size: ptr_uint, count: ptr_uint, stream: FILE?) -> ptr_uint
75
+ external function fwrite(buffer: const_ptr[void], element_size: ptr_uint, count: ptr_uint, stream: FILE?) -> ptr_uint
76
+
77
+ # File Positioning
78
+
79
+ external function fgetpos(stream: FILE?, pos: ptr[fpos_t]) -> int
80
+ external function fseek(stream: FILE?, offset: ptr_int, whence: int) -> int
81
+ external function fsetpos(stream: FILE?, pos: ptr[fpos_t]) -> int
82
+ external function ftell(stream: FILE?) -> ptr_int
83
+ external function rewind(stream: FILE?) -> void
84
+
85
+ # Error Handling
86
+
87
+ external function clearerr(stream: FILE?) -> void
88
+ external function feof(stream: FILE?) -> int
89
+ external function ferror(stream: FILE?) -> int
90
+ external function perror(s: cstr) -> void