Add runtime.print_strings

This commit is contained in:
gingerBill
2020-12-08 17:01:06 +00:00
parent d7a5767aa3
commit 168532ae8d

View File

@@ -42,6 +42,18 @@ print_string :: proc "contextless" (str: string) -> (int, _OS_Errno) {
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) {
return os_write([]byte{b});
}