mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Wrap parse procedures to allow for multiple return values
This commit is contained in:
Vendored
+30
-13
@@ -608,28 +608,45 @@ data :: struct {
|
|||||||
file: file_options,
|
file: file_options,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parse :: proc "c" (options: ^/*const*/options, data_ptr: rawptr, size: uint) -> (out_data: ^data, res: result) {
|
||||||
|
foreign lib {
|
||||||
|
cgltf_parse :: proc "c" (
|
||||||
|
options: ^/*const*/options,
|
||||||
|
data_ptr: rawptr,
|
||||||
|
size: uint,
|
||||||
|
out_data: ^^data) -> result ---
|
||||||
|
}
|
||||||
|
res = cgltf_parse(options, data_ptr, size, &out_data)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_file :: proc "c" (options: ^/*const*/options, path: cstring) -> (out_data: ^data, res: result) {
|
||||||
|
foreign lib {
|
||||||
|
cgltf_parse_file :: proc "c" (
|
||||||
|
options: ^/*const*/options,
|
||||||
|
path: cstring,
|
||||||
|
out_data: ^^data) -> result ---
|
||||||
|
}
|
||||||
|
res = cgltf_parse_file(options, path, &out_data)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
load_buffer_base64 :: proc "c" (options: ^/*const*/options, size: uint, base64: cstring) -> (out_data: rawptr, res: result) {
|
||||||
|
foreign lib {
|
||||||
|
cgltf_load_buffer_base64 :: proc "c" (options: ^/*const*/options, size: uint, base64: cstring, out_data: ^rawptr) -> result ---
|
||||||
|
}
|
||||||
|
res = cgltf_load_buffer_base64(options, size, base64, &out_data)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
@(default_calling_convention="c")
|
@(default_calling_convention="c")
|
||||||
@(link_prefix="cgltf_")
|
@(link_prefix="cgltf_")
|
||||||
foreign lib {
|
foreign lib {
|
||||||
cgltf_parse :: proc(
|
|
||||||
options: ^/*const*/options,
|
|
||||||
data_ptr: rawptr,
|
|
||||||
size: uint,
|
|
||||||
out_data: ^^data) -> result ---
|
|
||||||
|
|
||||||
parse_file :: proc(
|
|
||||||
options: ^/*const*/options,
|
|
||||||
path: cstring,
|
|
||||||
out_data: ^^data) -> result ---
|
|
||||||
|
|
||||||
load_buffers :: proc(
|
load_buffers :: proc(
|
||||||
options: ^/*const*/options,
|
options: ^/*const*/options,
|
||||||
data: ^data,
|
data: ^data,
|
||||||
gltf_path: cstring) -> result ---
|
gltf_path: cstring) -> result ---
|
||||||
|
|
||||||
load_buffer_base64 :: proc(options: ^/*const*/options, size: uint, base64: cstring, out_data: ^rawptr) -> result ---
|
|
||||||
|
|
||||||
decode_string :: proc(string: [^]byte) -> uint ---
|
decode_string :: proc(string: [^]byte) -> uint ---
|
||||||
decode_uri :: proc(uri: [^]byte) -> uint ---
|
decode_uri :: proc(uri: [^]byte) -> uint ---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user