mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Reorganize fmt and strings; Replace fmt.String_Buffer with strings.Builder
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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()^;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user