mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Strip semicolons
This commit is contained in:
+47
-47
@@ -3,7 +3,7 @@ package os2
|
||||
import "core:io"
|
||||
import "core:time"
|
||||
|
||||
Handle :: distinct uintptr;
|
||||
Handle :: distinct uintptr
|
||||
|
||||
Seek_From :: enum {
|
||||
Start = 0, // seek relative to the origin of the file
|
||||
@@ -11,148 +11,148 @@ Seek_From :: enum {
|
||||
End = 2, // seek relative to the end
|
||||
}
|
||||
|
||||
File_Mode :: distinct u32;
|
||||
File_Mode_Dir :: File_Mode(1<<16);
|
||||
File_Mode_Named_Pipe :: File_Mode(1<<17);
|
||||
File_Mode_Device :: File_Mode(1<<18);
|
||||
File_Mode_Char_Device :: File_Mode(1<<19);
|
||||
File_Mode_Sym_Link :: File_Mode(1<<20);
|
||||
File_Mode :: distinct u32
|
||||
File_Mode_Dir :: File_Mode(1<<16)
|
||||
File_Mode_Named_Pipe :: File_Mode(1<<17)
|
||||
File_Mode_Device :: File_Mode(1<<18)
|
||||
File_Mode_Char_Device :: File_Mode(1<<19)
|
||||
File_Mode_Sym_Link :: File_Mode(1<<20)
|
||||
|
||||
|
||||
O_RDONLY :: int( 0);
|
||||
O_WRONLY :: int( 1);
|
||||
O_RDWR :: int( 2);
|
||||
O_APPEND :: int( 4);
|
||||
O_CREATE :: int( 8);
|
||||
O_EXCL :: int(16);
|
||||
O_SYNC :: int(32);
|
||||
O_TRUNC :: int(64);
|
||||
O_RDONLY :: int( 0)
|
||||
O_WRONLY :: int( 1)
|
||||
O_RDWR :: int( 2)
|
||||
O_APPEND :: int( 4)
|
||||
O_CREATE :: int( 8)
|
||||
O_EXCL :: int(16)
|
||||
O_SYNC :: int(32)
|
||||
O_TRUNC :: int(64)
|
||||
|
||||
|
||||
|
||||
stdin: Handle = 0; // OS-Specific
|
||||
stdout: Handle = 1; // OS-Specific
|
||||
stderr: Handle = 2; // OS-Specific
|
||||
stdin: Handle = 0 // OS-Specific
|
||||
stdout: Handle = 1 // OS-Specific
|
||||
stderr: Handle = 2 // OS-Specific
|
||||
|
||||
|
||||
create :: proc(name: string) -> (Handle, Error) {
|
||||
return _create(name);
|
||||
return _create(name)
|
||||
}
|
||||
|
||||
open :: proc(name: string) -> (Handle, Error) {
|
||||
return _open(name);
|
||||
return _open(name)
|
||||
}
|
||||
|
||||
open_file :: proc(name: string, flag: int, perm: File_Mode) -> (Handle, Error) {
|
||||
return _open_file(name, flag, perm);
|
||||
return _open_file(name, flag, perm)
|
||||
}
|
||||
|
||||
close :: proc(fd: Handle) -> Error {
|
||||
return _close(fd);
|
||||
return _close(fd)
|
||||
}
|
||||
|
||||
name :: proc(fd: Handle, allocator := context.allocator) -> string {
|
||||
return _name(fd);
|
||||
return _name(fd)
|
||||
}
|
||||
|
||||
seek :: proc(fd: Handle, offset: i64, whence: Seek_From) -> (ret: i64, err: Error) {
|
||||
return _seek(fd, offset, whence);
|
||||
return _seek(fd, offset, whence)
|
||||
}
|
||||
|
||||
read :: proc(fd: Handle, p: []byte) -> (n: int, err: Error) {
|
||||
return _read(fd, p);
|
||||
return _read(fd, p)
|
||||
}
|
||||
|
||||
read_at :: proc(fd: Handle, p: []byte, offset: i64) -> (n: int, err: Error) {
|
||||
return _read_at(fd, p, offset);
|
||||
return _read_at(fd, p, offset)
|
||||
}
|
||||
|
||||
read_from :: proc(fd: Handle, r: io.Reader) -> (n: i64, err: Error) {
|
||||
return _read_from(fd, r);
|
||||
return _read_from(fd, r)
|
||||
}
|
||||
|
||||
write :: proc(fd: Handle, p: []byte) -> (n: int, err: Error) {
|
||||
return _write(fd, p);
|
||||
return _write(fd, p)
|
||||
}
|
||||
|
||||
write_at :: proc(fd: Handle, p: []byte, offset: i64) -> (n: int, err: Error) {
|
||||
return _write_at(fd, p, offset);
|
||||
return _write_at(fd, p, offset)
|
||||
}
|
||||
|
||||
write_to :: proc(fd: Handle, w: io.Writer) -> (n: i64, err: Error) {
|
||||
return _write_to(fd, w);
|
||||
return _write_to(fd, w)
|
||||
}
|
||||
|
||||
file_size :: proc(fd: Handle) -> (n: i64, err: Error) {
|
||||
return _file_size(fd);
|
||||
return _file_size(fd)
|
||||
}
|
||||
|
||||
|
||||
sync :: proc(fd: Handle) -> Error {
|
||||
return _sync(fd);
|
||||
return _sync(fd)
|
||||
}
|
||||
|
||||
flush :: proc(fd: Handle) -> Error {
|
||||
return _flush(fd);
|
||||
return _flush(fd)
|
||||
}
|
||||
|
||||
truncate :: proc(fd: Handle, size: i64) -> Maybe(Path_Error) {
|
||||
return _truncate(fd, size);
|
||||
return _truncate(fd, size)
|
||||
}
|
||||
|
||||
remove :: proc(name: string) -> Maybe(Path_Error) {
|
||||
return _remove(name);
|
||||
return _remove(name)
|
||||
}
|
||||
|
||||
rename :: proc(old_path, new_path: string) -> Maybe(Path_Error) {
|
||||
return _rename(old_path, new_path);
|
||||
return _rename(old_path, new_path)
|
||||
}
|
||||
|
||||
|
||||
link :: proc(old_name, new_name: string) -> Maybe(Link_Error) {
|
||||
return _link(old_name, new_name);
|
||||
return _link(old_name, new_name)
|
||||
}
|
||||
|
||||
symlink :: proc(old_name, new_name: string) -> Maybe(Link_Error) {
|
||||
return _symlink(old_name, new_name);
|
||||
return _symlink(old_name, new_name)
|
||||
}
|
||||
|
||||
read_link :: proc(name: string) -> (string, Maybe(Path_Error)) {
|
||||
return _read_link(name);
|
||||
return _read_link(name)
|
||||
}
|
||||
|
||||
|
||||
chdir :: proc(fd: Handle) -> Error {
|
||||
return _chdir(fd);
|
||||
return _chdir(fd)
|
||||
}
|
||||
|
||||
chmod :: proc(fd: Handle, mode: File_Mode) -> Error {
|
||||
return _chmod(fd, mode);
|
||||
return _chmod(fd, mode)
|
||||
}
|
||||
|
||||
chown :: proc(fd: Handle, uid, gid: int) -> Error {
|
||||
return _chown(fd, uid, gid);
|
||||
return _chown(fd, uid, gid)
|
||||
}
|
||||
|
||||
|
||||
lchown :: proc(name: string, uid, gid: int) -> Error {
|
||||
return _lchown(name, uid, gid);
|
||||
return _lchown(name, uid, gid)
|
||||
}
|
||||
|
||||
|
||||
chtimes :: proc(name: string, atime, mtime: time.Time) -> Maybe(Path_Error) {
|
||||
return _chtimes(name, atime, mtime);
|
||||
return _chtimes(name, atime, mtime)
|
||||
}
|
||||
|
||||
exists :: proc(path: string) -> bool {
|
||||
return _exists(path);
|
||||
return _exists(path)
|
||||
}
|
||||
|
||||
is_file :: proc(path: string) -> bool {
|
||||
return _is_file(path);
|
||||
return _is_file(path)
|
||||
}
|
||||
|
||||
is_dir :: proc(path: string) -> bool {
|
||||
return _is_dir(path);
|
||||
return _is_dir(path)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user