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.
- checksums.yaml +4 -4
- data/docs/index.html +4 -3
- data/lib/milk_tea/base.rb +1 -1
- data/std/asset_pack.mt +267 -0
- data/std/async/libuv_runtime.mt +539 -0
- data/std/async/mailbox.mt +191 -0
- data/std/async/runtime.mt +87 -0
- data/std/async.mt +87 -0
- data/std/base64.mt +185 -0
- data/std/behavior_tree.mt +396 -0
- data/std/binary.mt +314 -0
- data/std/binary_heap.mt +157 -0
- data/std/bitset.mt +239 -0
- data/std/box2d.mt +535 -0
- data/std/bytes.mt +46 -0
- data/std/c/box2d.mt +1254 -0
- data/std/c/cgltf.mt +647 -0
- data/std/c/cjson.mt +106 -0
- data/std/c/crypto.mt +11 -0
- data/std/c/crypto_support.h +51 -0
- data/std/c/ctype.mt +19 -0
- data/std/c/ctype_bindgen.h +29 -0
- data/std/c/curl.mt +1223 -0
- data/std/c/enet.mt +473 -0
- data/std/c/errno.mt +41 -0
- data/std/c/errno_bindgen.h +53 -0
- data/std/c/flecs.mt +2945 -0
- data/std/c/fs.linux.mt +43 -0
- data/std/c/fs.windows.mt +43 -0
- data/std/c/fs_support.h +954 -0
- data/std/c/gl.mt +2065 -0
- data/std/c/gl_registry_helpers.h +10748 -0
- data/std/c/glfw.mt +499 -0
- data/std/c/libc.mt +167 -0
- data/std/c/libuv.mt +1491 -0
- data/std/c/math.mt +22 -0
- data/std/c/math_bindgen.h +31 -0
- data/std/c/miniaudio.mt +3420 -0
- data/std/c/pcre2.mt +735 -0
- data/std/c/process.mt +58 -0
- data/std/c/process_support.h +1147 -0
- data/std/c/raygui.mt +1602 -0
- data/std/c/raylib.mt +1245 -0
- data/std/c/raymath.mt +163 -0
- data/std/c/rlgl.mt +434 -0
- data/std/c/rpng.mt +60 -0
- data/std/c/rres.mt +187 -0
- data/std/c/sdl3.mt +4132 -0
- data/std/c/sqlite3.mt +951 -0
- data/std/c/stb_image.mt +52 -0
- data/std/c/stb_image_resize2.mt +128 -0
- data/std/c/stb_image_write.mt +19 -0
- data/std/c/stb_rect_pack.mt +38 -0
- data/std/c/stb_truetype.mt +175 -0
- data/std/c/stb_vorbis.mt +31 -0
- data/std/c/stdio.mt +90 -0
- data/std/c/steamworks.h +5769 -0
- data/std/c/steamworks.mt +4771 -0
- data/std/c/string.mt +16 -0
- data/std/c/string_bindgen.h +36 -0
- data/std/c/sync.mt +33 -0
- data/std/c/sync_support.h +219 -0
- data/std/c/terminal.mt +24 -0
- data/std/c/terminal_support.h +408 -0
- data/std/c/time.mt +26 -0
- data/std/c/tls.mt +24 -0
- data/std/c/tls_support.h +626 -0
- data/std/c/tracy.mt +53 -0
- data/std/c/zlib.mt +20 -0
- data/std/c/zlib_support.h +239 -0
- data/std/c/zstd.mt +231 -0
- data/std/cell.mt +60 -0
- data/std/cgltf.mt +115 -0
- data/std/cjson.mt +90 -0
- data/std/cli.mt +768 -0
- data/std/cookie.mt +198 -0
- data/std/counter.mt +160 -0
- data/std/crypto.mt +74 -0
- data/std/cstring.mt +13 -0
- data/std/ctype.mt +52 -0
- data/std/curl/runtime.mt +261 -0
- data/std/curl.mt +38 -0
- data/std/deque.mt +348 -0
- data/std/encoding.mt +93 -0
- data/std/enet.mt +133 -0
- data/std/env.mt +41 -0
- data/std/errno.mt +47 -0
- data/std/flecs.mt +978 -0
- data/std/fmt.mt +271 -0
- data/std/fs.linux.mt +696 -0
- data/std/fs.windows.mt +711 -0
- data/std/fsm.mt +267 -0
- data/std/gl.mt +2062 -0
- data/std/glfw.mt +471 -0
- data/std/goap.mt +342 -0
- data/std/graph.mt +521 -0
- data/std/gzip.mt +77 -0
- data/std/hash.mt +429 -0
- data/std/http/server.mt +810 -0
- data/std/http.mt +1227 -0
- data/std/intern.mt +53 -0
- data/std/jobs.mt +288 -0
- data/std/json.mt +627 -0
- data/std/libc.mt +34 -0
- data/std/libuv.mt +554 -0
- data/std/linear_algebra.mt +243 -0
- data/std/linked_map.mt +372 -0
- data/std/linked_map_view.mt +49 -0
- data/std/linked_set.mt +117 -0
- data/std/log.mt +69 -0
- data/std/map.mt +418 -0
- data/std/math.mt +24 -0
- data/std/mem/arena.mt +137 -0
- data/std/mem/endian.mt +51 -0
- data/std/mem/heap.mt +298 -0
- data/std/mem/pool.mt +164 -0
- data/std/mem/stack.mt +47 -0
- data/std/mem/tracking.mt +119 -0
- data/std/miniaudio.mt +1299 -0
- data/std/multiset.mt +191 -0
- data/std/net/channel.mt +727 -0
- data/std/net/clock.mt +237 -0
- data/std/net/discovery.mt +277 -0
- data/std/net/lobby.mt +813 -0
- data/std/net/manager.mt +539 -0
- data/std/net/mux.mt +839 -0
- data/std/net/nat.mt +122 -0
- data/std/net/packet.mt +219 -0
- data/std/net/punch.mt +162 -0
- data/std/net/rpc.mt +119 -0
- data/std/net/session.mt +1157 -0
- data/std/net/stun.mt +252 -0
- data/std/net/sync.mt +183 -0
- data/std/net/turn.mt +459 -0
- data/std/net.mt +2944 -0
- data/std/oauth2.mt +408 -0
- data/std/option.mt +51 -0
- data/std/ordered_map.mt +497 -0
- data/std/ordered_set.mt +348 -0
- data/std/path.mt +368 -0
- data/std/pcre2/runtime.mt +35 -0
- data/std/pcre2.mt +78 -0
- data/std/priority_queue.mt +55 -0
- data/std/process.mt +837 -0
- data/std/queue.mt +55 -0
- data/std/random.mt +146 -0
- data/std/raygui.mt +99 -0
- data/std/raylib/debug_console.mt +71 -0
- data/std/raylib/easing.mt +388 -0
- data/std/raylib/packed_assets.mt +255 -0
- data/std/raylib/runtime.mt +30 -0
- data/std/raylib/tracy_gpu.mt +37 -0
- data/std/raylib.mt +1510 -0
- data/std/raymath.mt +153 -0
- data/std/result.mt +89 -0
- data/std/rlgl.mt +268 -0
- data/std/rpng.mt +46 -0
- data/std/rres.mt +36 -0
- data/std/sdl3/runtime.mt +54 -0
- data/std/sdl3.mt +1731 -0
- data/std/serialize.mt +68 -0
- data/std/set.mt +124 -0
- data/std/spatial.mt +176 -0
- data/std/sqlite3.mt +151 -0
- data/std/stack.mt +55 -0
- data/std/stb_image.mt +47 -0
- data/std/stb_image_resize2.mt +41 -0
- data/std/stb_image_write.mt +17 -0
- data/std/stb_rect_pack.mt +15 -0
- data/std/stb_truetype.mt +77 -0
- data/std/stb_vorbis.mt +16 -0
- data/std/stdio.mt +88 -0
- data/std/steamworks.mt +1542 -0
- data/std/str.mt +293 -0
- data/std/string.mt +234 -0
- data/std/sync.mt +194 -0
- data/std/tar.mt +704 -0
- data/std/terminal.mt +1002 -0
- data/std/testing.mt +266 -0
- data/std/thread.mt +120 -0
- data/std/time.mt +105 -0
- data/std/tls.mt +616 -0
- data/std/toml.mt +1310 -0
- data/std/tracy.mt +42 -0
- data/std/uri.mt +118 -0
- data/std/url.mt +372 -0
- data/std/vec.mt +433 -0
- data/std/zstd.mt +94 -0
- metadata +187 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# generated by mtc imported-bindings from std.c.stb_image_write using bindings/imported/stb_image_write.binding.json
|
|
2
|
+
|
|
3
|
+
import std.c.stb_image_write as c
|
|
4
|
+
|
|
5
|
+
public type stbi_write_func = c.stbi_write_func
|
|
6
|
+
|
|
7
|
+
public foreign function write_png(filename: str as cstr, w: int, h: int, comp: int, data: const_ptr[void], stride_in_bytes: int) -> int = c.stbi_write_png
|
|
8
|
+
public foreign function write_bmp(filename: str as cstr, w: int, h: int, comp: int, data: const_ptr[void]) -> int = c.stbi_write_bmp
|
|
9
|
+
public foreign function write_tga(filename: str as cstr, w: int, h: int, comp: int, data: const_ptr[void]) -> int = c.stbi_write_tga
|
|
10
|
+
public foreign function write_hdr(filename: str as cstr, w: int, h: int, comp: int, data: const_ptr[float]) -> int = c.stbi_write_hdr
|
|
11
|
+
public foreign function write_jpg(filename: str as cstr, x: int, y: int, comp: int, data: const_ptr[void], quality: int) -> int = c.stbi_write_jpg
|
|
12
|
+
public foreign function 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 = c.stbi_write_png_to_func
|
|
13
|
+
public foreign function write_bmp_to_func(func: ptr[stbi_write_func], context: ptr[void], w: int, h: int, comp: int, data: const_ptr[void]) -> int = c.stbi_write_bmp_to_func
|
|
14
|
+
public foreign function write_tga_to_func(func: ptr[stbi_write_func], context: ptr[void], w: int, h: int, comp: int, data: const_ptr[void]) -> int = c.stbi_write_tga_to_func
|
|
15
|
+
public foreign function write_hdr_to_func(func: ptr[stbi_write_func], context: ptr[void], w: int, h: int, comp: int, data: const_ptr[float]) -> int = c.stbi_write_hdr_to_func
|
|
16
|
+
public foreign function 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 = c.stbi_write_jpg_to_func
|
|
17
|
+
public foreign function flip_vertically_on_write(flip_boolean: int) -> void = c.stbi_flip_vertically_on_write
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# generated by mtc imported-bindings from std.c.stb_rect_pack using bindings/imported/stb_rect_pack.binding.json
|
|
2
|
+
|
|
3
|
+
import std.c.stb_rect_pack as c
|
|
4
|
+
|
|
5
|
+
public type coord = c.stbrp_coord
|
|
6
|
+
public type rect = c.stbrp_rect
|
|
7
|
+
public type node = c.stbrp_node
|
|
8
|
+
public type context = c.stbrp_context
|
|
9
|
+
|
|
10
|
+
public const STBRP__MAXVAL: int = c.STBRP__MAXVAL
|
|
11
|
+
|
|
12
|
+
public foreign function pack_rects(context: ptr[context], rects: ptr[rect], num_rects: int) -> int = c.stbrp_pack_rects
|
|
13
|
+
public foreign function init_target(context: ptr[context], width: int, height: int, nodes: ptr[node], num_nodes: int) -> void = c.stbrp_init_target
|
|
14
|
+
public foreign function setup_allow_out_of_mem(context: ptr[context], allow_out_of_mem: int) -> void = c.stbrp_setup_allow_out_of_mem
|
|
15
|
+
public foreign function setup_heuristic(context: ptr[context], heuristic: int) -> void = c.stbrp_setup_heuristic
|
data/std/stb_truetype.mt
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# generated by mtc imported-bindings from std.c.stb_truetype using bindings/imported/stb_truetype.binding.json
|
|
2
|
+
|
|
3
|
+
import std.c.stb_truetype as c
|
|
4
|
+
|
|
5
|
+
public type _buf = c.stbtt__buf
|
|
6
|
+
public type bakedchar = c.stbtt_bakedchar
|
|
7
|
+
public type aligned_quad = c.stbtt_aligned_quad
|
|
8
|
+
public type packedchar = c.stbtt_packedchar
|
|
9
|
+
public type pack_range = c.stbtt_pack_range
|
|
10
|
+
public type pack_context = c.stbtt_pack_context
|
|
11
|
+
public type fontinfo = c.stbtt_fontinfo
|
|
12
|
+
public type kerningentry = c.stbtt_kerningentry
|
|
13
|
+
public type vertex = c.stbtt_vertex
|
|
14
|
+
public type _bitmap = c.stbtt__bitmap
|
|
15
|
+
|
|
16
|
+
public const MACSTYLE_DONTCARE: int = c.STBTT_MACSTYLE_DONTCARE
|
|
17
|
+
public const MACSTYLE_BOLD: int = c.STBTT_MACSTYLE_BOLD
|
|
18
|
+
public const MACSTYLE_ITALIC: int = c.STBTT_MACSTYLE_ITALIC
|
|
19
|
+
public const MACSTYLE_UNDERSCORE: int = c.STBTT_MACSTYLE_UNDERSCORE
|
|
20
|
+
public const MACSTYLE_NONE: int = c.STBTT_MACSTYLE_NONE
|
|
21
|
+
|
|
22
|
+
public foreign function bake_font_bitmap(data: const_ptr[ubyte], offset: int, pixel_height: float, pixels: ptr[ubyte], pw: int, ph: int, first_char: int, num_chars: int, chardata: ptr[bakedchar]) -> int = c.stbtt_BakeFontBitmap
|
|
23
|
+
public foreign function get_baked_quad(chardata: const_ptr[bakedchar], pw: int, ph: int, char_index: int, xpos: ptr[float], ypos: ptr[float], q: ptr[aligned_quad], opengl_fillrule: int) -> void = c.stbtt_GetBakedQuad
|
|
24
|
+
public foreign function get_scaled_font_v_metrics(fontdata: const_ptr[ubyte], index: int, size: float, ascent: ptr[float], descent: ptr[float], line_gap: ptr[float]) -> void = c.stbtt_GetScaledFontVMetrics
|
|
25
|
+
public foreign function pack_begin(spc: ptr[pack_context], pixels: ptr[ubyte], width: int, height: int, stride_in_bytes: int, padding: int, alloc_context: ptr[void]) -> int = c.stbtt_PackBegin
|
|
26
|
+
public foreign function pack_end(spc: ptr[pack_context]) -> void = c.stbtt_PackEnd
|
|
27
|
+
public foreign function pack_font_range(spc: ptr[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[packedchar]) -> int = c.stbtt_PackFontRange
|
|
28
|
+
public foreign function pack_font_ranges(spc: ptr[pack_context], fontdata: const_ptr[ubyte], font_index: int, ranges: ptr[pack_range], num_ranges: int) -> int = c.stbtt_PackFontRanges
|
|
29
|
+
public foreign function pack_set_oversampling(spc: ptr[pack_context], h_oversample: uint, v_oversample: uint) -> void = c.stbtt_PackSetOversampling
|
|
30
|
+
public foreign function pack_set_skip_missing_codepoints(spc: ptr[pack_context], skip: int) -> void = c.stbtt_PackSetSkipMissingCodepoints
|
|
31
|
+
public foreign function get_packed_quad(chardata: const_ptr[packedchar], pw: int, ph: int, char_index: int, xpos: ptr[float], ypos: ptr[float], q: ptr[aligned_quad], align_to_integer: int) -> void = c.stbtt_GetPackedQuad
|
|
32
|
+
public foreign function get_number_of_fonts(data: const_ptr[ubyte]) -> int = c.stbtt_GetNumberOfFonts
|
|
33
|
+
public foreign function get_font_offset_for_index(data: const_ptr[ubyte], index: int) -> int = c.stbtt_GetFontOffsetForIndex
|
|
34
|
+
public foreign function init_font(info: ptr[fontinfo], data: const_ptr[ubyte], offset: int) -> int = c.stbtt_InitFont
|
|
35
|
+
public foreign function find_glyph_index(info: const_ptr[fontinfo], unicode_codepoint: int) -> int = c.stbtt_FindGlyphIndex
|
|
36
|
+
public foreign function scale_for_pixel_height(info: const_ptr[fontinfo], pixels: float) -> float = c.stbtt_ScaleForPixelHeight
|
|
37
|
+
public foreign function scale_for_mapping_em_to_pixels(info: const_ptr[fontinfo], pixels: float) -> float = c.stbtt_ScaleForMappingEmToPixels
|
|
38
|
+
public foreign function get_font_v_metrics(info: const_ptr[fontinfo], ascent: ptr[int], descent: ptr[int], line_gap: ptr[int]) -> void = c.stbtt_GetFontVMetrics
|
|
39
|
+
public foreign function get_font_v_metrics_os2(info: const_ptr[fontinfo], typo_ascent: ptr[int], typo_descent: ptr[int], typo_line_gap: ptr[int]) -> int = c.stbtt_GetFontVMetricsOS2
|
|
40
|
+
public foreign function get_font_bounding_box(info: const_ptr[fontinfo], x0: ptr[int], y0: ptr[int], x1: ptr[int], y1: ptr[int]) -> void = c.stbtt_GetFontBoundingBox
|
|
41
|
+
public foreign function get_codepoint_h_metrics(info: const_ptr[fontinfo], codepoint: int, advance_width: ptr[int], left_side_bearing: ptr[int]) -> void = c.stbtt_GetCodepointHMetrics
|
|
42
|
+
public foreign function get_codepoint_kern_advance(info: const_ptr[fontinfo], ch1: int, ch2: int) -> int = c.stbtt_GetCodepointKernAdvance
|
|
43
|
+
public foreign function get_codepoint_box(info: const_ptr[fontinfo], codepoint: int, x0: ptr[int], y0: ptr[int], x1: ptr[int], y1: ptr[int]) -> int = c.stbtt_GetCodepointBox
|
|
44
|
+
public foreign function get_glyph_h_metrics(info: const_ptr[fontinfo], glyph_index: int, advance_width: ptr[int], left_side_bearing: ptr[int]) -> void = c.stbtt_GetGlyphHMetrics
|
|
45
|
+
public foreign function get_glyph_kern_advance(info: const_ptr[fontinfo], glyph1: int, glyph2: int) -> int = c.stbtt_GetGlyphKernAdvance
|
|
46
|
+
public foreign function get_glyph_box(info: const_ptr[fontinfo], glyph_index: int, x0: ptr[int], y0: ptr[int], x1: ptr[int], y1: ptr[int]) -> int = c.stbtt_GetGlyphBox
|
|
47
|
+
public foreign function get_kerning_table_length(info: const_ptr[fontinfo]) -> int = c.stbtt_GetKerningTableLength
|
|
48
|
+
public foreign function get_kerning_table(info: const_ptr[fontinfo], table: ptr[kerningentry], table_length: int) -> int = c.stbtt_GetKerningTable
|
|
49
|
+
public foreign function is_glyph_empty(info: const_ptr[fontinfo], glyph_index: int) -> int = c.stbtt_IsGlyphEmpty
|
|
50
|
+
public foreign function get_codepoint_shape(info: const_ptr[fontinfo], unicode_codepoint: int, vertices: ptr[ptr[vertex]]) -> int = c.stbtt_GetCodepointShape
|
|
51
|
+
public foreign function get_glyph_shape(info: const_ptr[fontinfo], glyph_index: int, vertices: ptr[ptr[vertex]]) -> int = c.stbtt_GetGlyphShape
|
|
52
|
+
public foreign function free_shape(info: const_ptr[fontinfo], vertices: ptr[vertex]) -> void = c.stbtt_FreeShape
|
|
53
|
+
public foreign function find_svg_doc(info: const_ptr[fontinfo], gl: int) -> ptr[ubyte] = c.stbtt_FindSVGDoc
|
|
54
|
+
public foreign function get_codepoint_svg(info: const_ptr[fontinfo], unicode_codepoint: int, svg: ptr[cstr]) -> int = c.stbtt_GetCodepointSVG
|
|
55
|
+
public foreign function get_glyph_svg(info: const_ptr[fontinfo], gl: int, svg: ptr[cstr]) -> int = c.stbtt_GetGlyphSVG
|
|
56
|
+
public foreign function free_bitmap(bitmap: ptr[ubyte], userdata: ptr[void]) -> void = c.stbtt_FreeBitmap
|
|
57
|
+
public foreign function get_codepoint_bitmap(info: const_ptr[fontinfo], scale_x: float, scale_y: float, codepoint: int, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte] = c.stbtt_GetCodepointBitmap
|
|
58
|
+
public foreign function get_codepoint_bitmap_subpixel(info: const_ptr[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] = c.stbtt_GetCodepointBitmapSubpixel
|
|
59
|
+
public foreign function make_codepoint_bitmap(info: const_ptr[fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, codepoint: int) -> void = c.stbtt_MakeCodepointBitmap
|
|
60
|
+
public foreign function make_codepoint_bitmap_subpixel(info: const_ptr[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 = c.stbtt_MakeCodepointBitmapSubpixel
|
|
61
|
+
public foreign function make_codepoint_bitmap_subpixel_prefilter(info: const_ptr[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 = c.stbtt_MakeCodepointBitmapSubpixelPrefilter
|
|
62
|
+
public foreign function get_codepoint_bitmap_box(font: const_ptr[fontinfo], codepoint: int, scale_x: float, scale_y: float, ix0: ptr[int], iy0: ptr[int], ix1: ptr[int], iy1: ptr[int]) -> void = c.stbtt_GetCodepointBitmapBox
|
|
63
|
+
public foreign function get_codepoint_bitmap_box_subpixel(font: const_ptr[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 = c.stbtt_GetCodepointBitmapBoxSubpixel
|
|
64
|
+
public foreign function get_glyph_bitmap(info: const_ptr[fontinfo], scale_x: float, scale_y: float, glyph: int, width: ptr[int], height: ptr[int], xoff: ptr[int], yoff: ptr[int]) -> ptr[ubyte] = c.stbtt_GetGlyphBitmap
|
|
65
|
+
public foreign function get_glyph_bitmap_subpixel(info: const_ptr[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] = c.stbtt_GetGlyphBitmapSubpixel
|
|
66
|
+
public foreign function make_glyph_bitmap(info: const_ptr[fontinfo], output: ptr[ubyte], out_w: int, out_h: int, out_stride: int, scale_x: float, scale_y: float, glyph: int) -> void = c.stbtt_MakeGlyphBitmap
|
|
67
|
+
public foreign function make_glyph_bitmap_subpixel(info: const_ptr[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 = c.stbtt_MakeGlyphBitmapSubpixel
|
|
68
|
+
public foreign function make_glyph_bitmap_subpixel_prefilter(info: const_ptr[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 = c.stbtt_MakeGlyphBitmapSubpixelPrefilter
|
|
69
|
+
public foreign function get_glyph_bitmap_box(font: const_ptr[fontinfo], glyph: int, scale_x: float, scale_y: float, ix0: ptr[int], iy0: ptr[int], ix1: ptr[int], iy1: ptr[int]) -> void = c.stbtt_GetGlyphBitmapBox
|
|
70
|
+
public foreign function get_glyph_bitmap_box_subpixel(font: const_ptr[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 = c.stbtt_GetGlyphBitmapBoxSubpixel
|
|
71
|
+
public foreign function rasterize(result: ptr[_bitmap], flatness_in_pixels: float, vertices: ptr[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 = c.stbtt_Rasterize
|
|
72
|
+
public foreign function free_sdf(bitmap: ptr[ubyte], userdata: ptr[void]) -> void = c.stbtt_FreeSDF
|
|
73
|
+
public foreign function get_glyph_sdf(info: const_ptr[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] = c.stbtt_GetGlyphSDF
|
|
74
|
+
public foreign function get_codepoint_sdf(info: const_ptr[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] = c.stbtt_GetCodepointSDF
|
|
75
|
+
public foreign function find_matching_font(fontdata: const_ptr[ubyte], name: str as cstr, flags_: int) -> int = c.stbtt_FindMatchingFont
|
|
76
|
+
public foreign function compare_utf8to_utf16_bigendian(s1: str as cstr, len1: int, s2: str as cstr, len2: int) -> int = c.stbtt_CompareUTF8toUTF16_bigendian
|
|
77
|
+
public foreign function get_font_name_string(font: const_ptr[fontinfo], length: ptr[int], platform_id: int, encoding_id: int, language_id: int, name_id: int) -> cstr = c.stbtt_GetFontNameString
|
data/std/stb_vorbis.mt
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# generated by mtc imported-bindings from std.c.stb_vorbis using bindings/imported/stb_vorbis.binding.json
|
|
2
|
+
|
|
3
|
+
import std.c.stb_vorbis as c
|
|
4
|
+
|
|
5
|
+
public type alloc = c.stb_vorbis_alloc
|
|
6
|
+
public type info = c.stb_vorbis_info
|
|
7
|
+
public type comment = c.stb_vorbis_comment
|
|
8
|
+
public type float_size_test = c.stb_vorbis_float_size_test
|
|
9
|
+
|
|
10
|
+
public const MAX_CHANNELS: int = c.STB_VORBIS_MAX_CHANNELS
|
|
11
|
+
public const PUSHDATA_CRC_COUNT: int = c.STB_VORBIS_PUSHDATA_CRC_COUNT
|
|
12
|
+
public const FAST_HUFFMAN_LENGTH: int = c.STB_VORBIS_FAST_HUFFMAN_LENGTH
|
|
13
|
+
public const ENDIAN: int = c.STB_VORBIS_ENDIAN
|
|
14
|
+
|
|
15
|
+
public foreign function decode_filename(filename: str as cstr, channels: ptr[int], sample_rate: ptr[int], output: ptr[ptr[short]]) -> int = c.stb_vorbis_decode_filename
|
|
16
|
+
public foreign function decode_memory(mem: const_ptr[ubyte], len: int, channels: ptr[int], sample_rate: ptr[int], output: ptr[ptr[short]]) -> int = c.stb_vorbis_decode_memory
|
data/std/stdio.mt
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import std.c.stdio as c
|
|
2
|
+
|
|
3
|
+
public type File = c.FILE
|
|
4
|
+
public type VaList = c.va_list
|
|
5
|
+
public type FilePos = c.fpos_t
|
|
6
|
+
|
|
7
|
+
public const EOF: int = c.EOF
|
|
8
|
+
public const SEEK_SET: int = c.SEEK_SET
|
|
9
|
+
public const SEEK_CUR: int = c.SEEK_CUR
|
|
10
|
+
public const SEEK_END: int = c.SEEK_END
|
|
11
|
+
|
|
12
|
+
public const IO_FULLY_BUFFERED: int = c._IOFBF
|
|
13
|
+
public const IO_LINE_BUFFERED: int = c._IOLBF
|
|
14
|
+
public const IO_UNBUFFERED: int = c._IONBF
|
|
15
|
+
|
|
16
|
+
public const BUFFER_SIZE: int = c.BUFSIZ
|
|
17
|
+
|
|
18
|
+
# File Access & Lifecycle
|
|
19
|
+
|
|
20
|
+
public foreign function file_open(path: str as cstr, mode: str as cstr) -> File? = c.fopen
|
|
21
|
+
public foreign function file_reopen(path: str as cstr, mode: str as cstr, stream: File?) -> File? = c.freopen
|
|
22
|
+
public foreign function file_close(stream: File?) -> int = c.fclose
|
|
23
|
+
public foreign function file_flush(stream: File?) -> int = c.fflush
|
|
24
|
+
public foreign function file_set_buffer(stream: File?, buffer: ptr[char]) -> void = c.setbuf
|
|
25
|
+
public foreign function file_set_buffer_mode(stream: File?, buffer: ptr[char], mode: int, size: ptr_uint) -> int = c.setvbuf
|
|
26
|
+
public foreign function create_temp_file() -> File? = c.tmpfile
|
|
27
|
+
public foreign function gen_temp_name(buffer: ptr[char]) -> cstr = c.tmpnam
|
|
28
|
+
public foreign function file_rename(from_path: str as cstr, to_path: str as cstr) -> int = c.rename
|
|
29
|
+
public foreign function file_delete(path: str as cstr) -> int = c.remove
|
|
30
|
+
|
|
31
|
+
# Formatted Output
|
|
32
|
+
|
|
33
|
+
public foreign function file_print(stream: File?, format: str as cstr, ...) -> int = c.fprintf
|
|
34
|
+
public foreign function print_format(format: str as cstr, ...) -> int = c.printf
|
|
35
|
+
public foreign function str_format(buffer: ptr[char], format: str as cstr, ...) -> int = c.sprintf
|
|
36
|
+
public foreign function str_format_bounded(buffer: ptr[char], maxlen: ptr_uint, format: str as cstr, ...) -> int = c.snprintf
|
|
37
|
+
|
|
38
|
+
# Variadic Formatted Output
|
|
39
|
+
|
|
40
|
+
public foreign function file_print_args(stream: File?, format: str as cstr, args: VaList) -> int = c.vfprintf
|
|
41
|
+
public foreign function print_format_args(format: str as cstr, args: VaList) -> int = c.vprintf
|
|
42
|
+
public foreign function str_format_args(buffer: ptr[char], format: str as cstr, args: VaList) -> int = c.vsprintf
|
|
43
|
+
public foreign function str_format_bounded_args(buffer: ptr[char], maxlen: ptr_uint, format: str as cstr, args: VaList) -> int = c.vsnprintf
|
|
44
|
+
|
|
45
|
+
# Formatted Input
|
|
46
|
+
|
|
47
|
+
public foreign function file_read_format(stream: File?, format: str as cstr, ...) -> int = c.fscanf
|
|
48
|
+
public foreign function read_format(format: str as cstr, ...) -> int = c.scanf
|
|
49
|
+
public foreign function str_parse(buffer: cstr, format: str as cstr, ...) -> int = c.sscanf
|
|
50
|
+
|
|
51
|
+
# Variadic Formatted Input
|
|
52
|
+
|
|
53
|
+
public foreign function file_read_format_args(stream: File?, format: str as cstr, args: VaList) -> int = c.vfscanf
|
|
54
|
+
public foreign function read_format_args(format: str as cstr, args: VaList) -> int = c.vscanf
|
|
55
|
+
public foreign function str_parse_args(buffer: cstr, format: str as cstr, args: VaList) -> int = c.vsscanf
|
|
56
|
+
|
|
57
|
+
# Character Input & Output
|
|
58
|
+
|
|
59
|
+
public foreign function file_read_char(stream: File?) -> int = c.fgetc
|
|
60
|
+
public foreign function file_read_line(buffer: ptr[char], max_count: int, stream: File?) -> ptr[char]? = c.fgets
|
|
61
|
+
public foreign function file_write_char(ch: int, stream: File?) -> int = c.fputc
|
|
62
|
+
public foreign function file_write_str(text: str as cstr, stream: File?) -> int = c.fputs
|
|
63
|
+
public foreign function stream_read_char(stream: File?) -> int = c.getc
|
|
64
|
+
public foreign function read_char() -> int = c.getchar
|
|
65
|
+
public foreign function stream_write_char(ch: int, stream: File?) -> int = c.putc
|
|
66
|
+
public foreign function print_char(ch: int) -> int = c.putchar
|
|
67
|
+
public foreign function print_line(text: str as cstr) -> int = c.puts
|
|
68
|
+
public foreign function unget_char(ch: int, stream: File?) -> int = c.ungetc
|
|
69
|
+
|
|
70
|
+
# Direct/Binary Input & Output
|
|
71
|
+
|
|
72
|
+
public foreign function file_read_bytes(buffer: ptr[void], element_size: ptr_uint, count: ptr_uint, stream: File?) -> ptr_uint = c.fread
|
|
73
|
+
public foreign function file_write_bytes(buffer: const_ptr[void], element_size: ptr_uint, count: ptr_uint, stream: File?) -> ptr_uint = c.fwrite
|
|
74
|
+
|
|
75
|
+
# File Positioning
|
|
76
|
+
|
|
77
|
+
public foreign function file_get_pos_object(stream: File?, pos: ptr[FilePos]) -> int = c.fgetpos
|
|
78
|
+
public foreign function file_seek(stream: File?, offset: ptr_int, whence: int) -> int = c.fseek
|
|
79
|
+
public foreign function file_set_pos_object(stream: File?, pos: ptr[FilePos]) -> int = c.fsetpos
|
|
80
|
+
public foreign function file_get_pos(stream: File?) -> ptr_int = c.ftell
|
|
81
|
+
public foreign function file_rewind(stream: File?) -> void = c.rewind
|
|
82
|
+
|
|
83
|
+
# Error Handling
|
|
84
|
+
|
|
85
|
+
public foreign function file_clear_errors(stream: File?) -> void = c.clearerr
|
|
86
|
+
public foreign function file_is_eof(stream: File?) -> int = c.feof
|
|
87
|
+
public foreign function file_has_error(stream: File?) -> int = c.ferror
|
|
88
|
+
public foreign function print_system_error(prefix: str as cstr) -> void = c.perror
|