package core:os

Index

Constants (54)
Variables (4)
Procedures (69)
Procedure Groups (1)

Types

Errno ¶

Errno :: distinct int

File_Info ¶

File_Info :: struct {
	fullpath:          string,
	name:              string,
	size:              i64,
	mode:              File_Mode,
	is_dir:            bool,
	creation_time:     time.Time,
	modification_time: time.Time,
	access_time:       time.Time,
}

File_Mode ¶

File_Mode :: distinct u32

File_Time ¶

File_Time :: distinct u64

Handle ¶

Handle :: distinct uintptr

Constants

ARCH ¶

ARCH: .Odin_Arch_Type : ODIN_ARCH

ENDIAN ¶

ENDIAN: .Odin_Endian_Type : ODIN_ENDIAN

ERROR_ACCESS_DENIED ¶

ERROR_ACCESS_DENIED: Errno : 5

ERROR_ALREADY_EXISTS ¶

ERROR_ALREADY_EXISTS: Errno : 183

ERROR_BROKEN_PIPE ¶

ERROR_BROKEN_PIPE: Errno : 109

ERROR_BUFFER_OVERFLOW ¶

ERROR_BUFFER_OVERFLOW: Errno : 111

ERROR_DIR_NOT_EMPTY ¶

ERROR_DIR_NOT_EMPTY: Errno : 145

ERROR_ENVVAR_NOT_FOUND ¶

ERROR_ENVVAR_NOT_FOUND: Errno : 203

ERROR_FILE_EXISTS ¶

ERROR_FILE_EXISTS: Errno : 80

ERROR_FILE_IS_NOT_DIR ¶

ERROR_FILE_IS_NOT_DIR: Errno : 1 << 29 + 1

ERROR_FILE_IS_PIPE ¶

ERROR_FILE_IS_PIPE: Errno : 1 << 29 + 0
 

Windows reserves errors >= 1<<29 for application use

ERROR_FILE_NOT_FOUND ¶

ERROR_FILE_NOT_FOUND: Errno : 2

ERROR_HANDLE_EOF ¶

ERROR_HANDLE_EOF: Errno : 38

ERROR_INSUFFICIENT_BUFFER ¶

ERROR_INSUFFICIENT_BUFFER: Errno : 122

ERROR_INVALID_HANDLE ¶

ERROR_INVALID_HANDLE: Errno : 6

ERROR_INVALID_PARAMETER ¶

ERROR_INVALID_PARAMETER: Errno : 87

ERROR_IO_PENDING ¶

ERROR_IO_PENDING: Errno : 997

ERROR_MOD_NOT_FOUND ¶

ERROR_MOD_NOT_FOUND: Errno : 126

ERROR_MORE_DATA ¶

ERROR_MORE_DATA: Errno : 234

ERROR_NEGATIVE_OFFSET ¶

ERROR_NEGATIVE_OFFSET: Errno : 1 << 29 + 2

ERROR_NETNAME_DELETED ¶

ERROR_NETNAME_DELETED: Errno : 64

ERROR_NONE ¶

ERROR_NONE: Errno : 0

ERROR_NOT_ENOUGH_MEMORY ¶

ERROR_NOT_ENOUGH_MEMORY: Errno : 8

ERROR_NOT_FOUND ¶

ERROR_NOT_FOUND: Errno : 1168

ERROR_NO_MORE_FILES ¶

ERROR_NO_MORE_FILES: Errno : 18

ERROR_OPERATION_ABORTED ¶

ERROR_OPERATION_ABORTED: Errno : 995

ERROR_PATH_NOT_FOUND ¶

ERROR_PATH_NOT_FOUND: Errno : 3

ERROR_PRIVILEGE_NOT_HELD ¶

ERROR_PRIVILEGE_NOT_HELD: Errno : 1314

ERROR_PROC_NOT_FOUND ¶

ERROR_PROC_NOT_FOUND: Errno : 127

File_Mode_Char_Device ¶

File_Mode_Char_Device :: File_Mode(1 << 19)

File_Mode_Device ¶

File_Mode_Device :: File_Mode(1 << 18)

File_Mode_Dir ¶

File_Mode_Dir :: File_Mode(1 << 16)

File_Mode_Named_Pipe ¶

File_Mode_Named_Pipe :: File_Mode(1 << 17)
File_Mode_Sym_Link :: File_Mode(1 << 20)

INVALID_HANDLE ¶

INVALID_HANDLE: Handle : ~Handle(0)

OS ¶

OS: .Odin_OS_Type : ODIN_OS

O_APPEND ¶

O_APPEND :: 0x00400

O_ASYNC ¶

O_ASYNC :: 0x02000

O_CLOEXEC ¶

O_CLOEXEC :: 0x80000

O_CREATE ¶

O_CREATE :: 0x00040

O_EXCL ¶

O_EXCL :: 0x00080

O_NOCTTY ¶

O_NOCTTY :: 0x00100

O_NONBLOCK ¶

O_NONBLOCK :: 0x00800

O_RDONLY ¶

O_RDONLY :: 0x00000

O_RDWR ¶

O_RDWR :: 0x00002

O_SYNC ¶

O_SYNC :: 0x01000

O_TRUNC ¶

O_TRUNC :: 0x00200

O_WRONLY ¶

O_WRONLY :: 0x00001

SEEK_CUR ¶

SEEK_CUR :: 1

SEEK_END ¶

SEEK_END :: 2

SEEK_SET ¶

SEEK_SET :: 0

WINDOWS_11_BUILD_CUTOFF ¶

WINDOWS_11_BUILD_CUTOFF :: 22_000
 

Windows 11 (preview) has the same major and minor version numbers

as Windows 10: 10 and 0 respectively.

To determine if you're on Windows 10 or 11, we need to look at
the build number. As far as we can tell right now, the cutoff is build 22_000.

TODO: Narrow down this range once Win 11 is published and the last Win 10 builds

become available.

WSAEACCES ¶

WSAEACCES: Errno : 10013

WSAECONNRESET ¶

WSAECONNRESET: Errno : 10054

Variables

args ¶

args: []string = …
 

"Argv" arguments converted to Odin strings

stderr ¶

stderr: Handle = …

stdin ¶

stdin: Handle = …
 

NOTE(bill): Uses startup to initialize it

stdout ¶

stdout: Handle = …

Procedures

change_directory ¶

change_directory :: proc "odin" (key: string) -> Errno {…}

clear_env ¶

clear_env :: proc "odin" () {…}
 

clear_env deletes all environment variables

close ¶

close :: proc "odin" (fd: Handle) -> Errno {…}

current_thread_id ¶

current_thread_id :: proc "contextless" () -> int {…}

environ ¶

environ :: proc "odin" (allocator := context.allocator) -> []string {…}
 

environ returns a copy of strings representing the environment, in the form "key=value" NOTE: the slice of strings and the strings with be allocated using the supplied allocator

exists ¶

exists :: proc "odin" (path: string) -> bool {…}

exit ¶

exit :: proc "contextless" (code: int) -> ! {…}

file_info_delete ¶

file_info_delete :: proc "odin" (fi: File_Info, allocator := context.allocator) {…}

file_info_slice_delete ¶

file_info_slice_delete :: proc "odin" (infos: []File_Info, allocator := context.allocator) {…}

file_size ¶

file_size :: proc "odin" (fd: Handle) -> (i64, Errno) {…}

file_size_from_path ¶

file_size_from_path :: proc "odin" (path: string) -> i64 {…}

flush ¶

flush :: proc "odin" (fd: Handle) -> Errno {…}

fstat ¶

fstat :: proc "odin" (fd: Handle, allocator := context.allocator) -> (fi: File_Info, errno: Errno) {…}

ftruncate ¶

ftruncate :: proc "odin" (fd: Handle, length: i64) -> (err: Errno) {…}

get_current_directory ¶

get_current_directory :: proc "odin" (allocator := context.allocator) -> string {…}

get_env ¶

get_env :: proc "odin" (path: string, allocator := context.allocator) -> string {…}
 

get_env retrieves the value of the environment variable named by the key It returns the value, which will be empty if the variable is not present To distinguish between an empty value and an unset value, use lookup_env NOTE: the value will be allocated with the supplied allocator

get_page_size ¶

get_page_size :: proc "odin" () -> (res: int) {…}

get_std_handle ¶

get_std_handle :: proc "contextless" (h: uint) -> Handle {…}

get_windows_version_w ¶

get_windows_version_w :: proc "odin" () -> sys_windows.OSVERSIONINFOEXW {…}

heap_alloc ¶

heap_alloc :: proc "odin" (size: int) -> rawptr {…}

heap_allocator ¶

heap_allocator :: proc "odin" () -> runtime.Allocator {…}

heap_allocator_proc ¶

heap_allocator_proc :: proc "odin" (
	allocator_data:  rawptr, 
	mode:            runtime.Allocator_Mode, 
	size, alignment: int, 
	old_memory:      rawptr, 
	old_size:        int, 
) -> ([]u8, runtime.Allocator_Error) {…}

heap_free ¶

heap_free :: proc "odin" (ptr: rawptr) {…}

heap_resize ¶

heap_resize :: proc "odin" (ptr: rawptr, new_size: int) -> rawptr {…}

is_dir ¶

is_dir :: proc "odin" (path: string) -> bool {…}

is_file ¶

is_file :: proc "odin" (path: string) -> bool {…}

is_path_separator ¶

is_path_separator :: proc "odin" (x: u8) -> bool {…}

is_windows_10 ¶

is_windows_10 :: proc "odin" () -> bool {…}

is_windows_11 ¶

is_windows_11 :: proc "odin" () -> bool {…}

is_windows_7 ¶

is_windows_7 :: proc "odin" () -> bool {…}

is_windows_8 ¶

is_windows_8 :: proc "odin" () -> bool {…}

is_windows_8_1 ¶

is_windows_8_1 :: proc "odin" () -> bool {…}

is_windows_vista ¶

is_windows_vista :: proc "odin" () -> bool {…}

is_windows_xp ¶

is_windows_xp :: proc "odin" () -> bool {…}

last_write_time ¶

last_write_time :: proc "odin" (fd: Handle) -> (File_Time, Errno) {…}

last_write_time_by_name ¶

last_write_time_by_name :: proc "odin" (name: string) -> (File_Time, Errno) {…}
link :: proc "odin" (key, value: string) -> Errno {…}

lookup_env ¶

lookup_env :: proc "odin" (path: string, allocator := context.allocator) -> (new_path: string, new_allocation: bool) {…}
 

lookup_env gets the value of the environment variable named by the key If the variable is found in the environment the value (which can be empty) is returned and the boolean is true Otherwise the returned value will be empty and the boolean will be false NOTE: the value will be allocated with the supplied allocator

lstat ¶

lstat :: proc "odin" (name: string, allocator := context.allocator) -> (File_Info, Errno) {…}

make_directory ¶

make_directory :: proc "odin" (path: string, mode: u32 = 0) -> (err: Errno) {…}

open ¶

open :: proc "odin" (path: string, mode: int = O_RDONLY, perm: int = 0) -> (Handle, Errno) {…}

pipe ¶

pipe :: proc "odin" () -> (r, w: Handle, err: Errno) {…}

read ¶

read :: proc "odin" (fd: Handle, data: []u8) -> (int, Errno) {…}

read_at ¶

read_at :: proc "odin" (fd: Handle, data: []u8, offset: i64) -> (n: int, err: Errno) {…}

read_at_least ¶

read_at_least :: proc "odin" (fd: Handle, buf: []u8, min: int) -> (n: int, err: Errno) {…}

read_dir ¶

read_dir :: proc "odin" (fd: Handle, n: int, allocator := context.allocator) -> (fi: []File_Info, err: Errno) {…}

read_entire_file_from_filename ¶

read_entire_file_from_filename :: proc "odin" (name: string, allocator := context.allocator) -> (data: []u8, success: bool) {…}

read_entire_file_from_handle ¶

read_entire_file_from_handle :: proc "odin" (fd: Handle, allocator := context.allocator) -> (data: []u8, success: bool) {…}

read_full ¶

read_full :: proc "odin" (fd: Handle, data: []u8) -> (int, Errno) {…}

read_ptr ¶

read_ptr :: proc "odin" (fd: Handle, data: rawptr, len: int) -> (int, Errno) {…}

remove ¶

remove :: proc "odin" (key: string) -> Errno {…}

remove_directory ¶

remove_directory :: proc "odin" (key: string) -> Errno {…}

rename ¶

rename :: proc "odin" (key, value: string) -> Errno {…}

seek ¶

seek :: proc "odin" (fd: Handle, offset: i64, whence: int) -> (i64, Errno) {…}

set_current_directory ¶

set_current_directory :: proc "odin" (key: string) -> Errno {…}

set_env ¶

set_env :: proc "odin" (key, value: string) -> Errno {…}
 

set_env sets the value of the environment variable named by the key

stat ¶

stat :: proc "odin" (name: string, allocator := context.allocator) -> (File_Info, Errno) {…}

stream_from_handle ¶

stream_from_handle :: proc "odin" (fd: Handle) -> io.Stream {…}

truncate ¶

truncate :: proc "odin" (path: string, length: i64) -> (err: Errno) {…}
unlink :: proc "odin" (key: string) -> Errno {…}

unset_env ¶

unset_env :: proc "odin" (key: string) -> Errno {…}
 

unset_env unsets a single environment variable

write ¶

write :: proc "odin" (fd: Handle, data: []u8) -> (int, Errno) {…}

write_at ¶

write_at :: proc "odin" (fd: Handle, data: []u8, offset: i64) -> (n: int, err: Errno) {…}

write_byte ¶

write_byte :: proc "odin" (fd: Handle, b: u8) -> (int, Errno) {…}

write_encoded_rune ¶

write_encoded_rune :: proc "odin" (fd: Handle, r: rune) {…}

write_entire_file ¶

write_entire_file :: proc "odin" (name: string, data: []u8, truncate: bool = true) -> (success: bool) {…}

write_ptr ¶

write_ptr :: proc "odin" (fd: Handle, data: rawptr, len: int) -> (int, Errno) {…}

write_rune ¶

write_rune :: proc "odin" (fd: Handle, r: rune) -> (int, Errno) {…}

write_string ¶

write_string :: proc "odin" (fd: Handle, str: string) -> (int, Errno) {…}

Procedure Groups

Source Files

Generation Information

Generated with odin version dev-2022-10 (vendor "odin") Windows_amd64 @ 2022-10-05 21:11:47.476800300 +0000 UTC