Reorganize fmt and strings; Replace fmt.String_Buffer with strings.Builder

This commit is contained in:
gingerBill
2019-01-06 14:41:42 +00:00
parent 5acea1bceb
commit 594238a86c
8 changed files with 1282 additions and 1229 deletions
+4
View File
@@ -71,6 +71,10 @@ stdin := Handle(-1); // Not implemented
stdout := Handle(0);
stderr := Handle(0);
is_path_separator :: proc(r: rune) -> bool {
return r == '/';
}
current_thread_id :: proc "contextless" () -> int {
return OSGetThreadID(Handle(0x1000));
}
+4
View File
@@ -203,6 +203,10 @@ foreign dl {
@(link_name="dlerror") _unix_dlerror :: proc() -> cstring ---;
}
is_path_separator :: proc(r: rune) -> bool {
return r == '/';
}
get_last_error :: proc() -> int {
return __errno_location()^;
}
+4
View File
@@ -215,6 +215,10 @@ last_write_time :: proc(fd: Handle) -> File_Time {}
last_write_time_by_name :: proc(name: string) -> File_Time {}
*/
is_path_separator :: proc(r: rune) -> bool {
return r == '/';
}
stat :: inline proc(path: string) -> (Stat, bool) {
s: Stat;
cstr := strings.new_cstring(path);
+4
View File
@@ -61,6 +61,10 @@ ERROR_FILE_IS_PIPE: Errno : 1<<29 + 0;
args := _alloc_command_line_arguments();
is_path_separator :: proc(r: rune) -> bool {
return r == '/' || r == '\\';
}
open :: proc(path: string, mode: int = O_RDONLY, perm: u32 = 0) -> (Handle, Errno) {
if len(path) == 0 do return INVALID_HANDLE, ERROR_FILE_NOT_FOUND;