mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Add runtime.print_strings
This commit is contained in:
@@ -42,6 +42,18 @@ print_string :: proc "contextless" (str: string) -> (int, _OS_Errno) {
|
|||||||
return os_write(transmute([]byte)str);
|
return os_write(transmute([]byte)str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print_strings :: proc "contextless" (args: ..string) -> (n: int, err: _OS_Errno) {
|
||||||
|
for str in args {
|
||||||
|
m: int;
|
||||||
|
m, err = os_write(transmute([]byte)str);
|
||||||
|
n += m;
|
||||||
|
if err != nil {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
print_byte :: proc "contextless" (b: byte) -> (int, _OS_Errno) {
|
print_byte :: proc "contextless" (b: byte) -> (int, _OS_Errno) {
|
||||||
return os_write([]byte{b});
|
return os_write([]byte{b});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user