Skip to content

Standard Library Reference

alias WChar @if(env::WIN32) = Char16
alias WChar @if(!env::WIN32) = Char32
struct DivResult
struct LongDivResult
struct Fpos_t @if(!env::WIN32)
struct Mbstate_t @if(!env::WIN32)
fn Errno errno()
fn void errno_set(Errno e)
typedef Errno = inline CInt
alias TerminateFunction = fn void()
alias CompareFunction = fn int(void*, void*)
alias JmpBuf = uptr[$$JMP_BUF_SIZE]
alias Fd = CInt
alias Fpos_t @if(env::WIN32) = long
alias SignalFunction = fn void(CInt)
alias Time_t = $typefrom(env::WIN32 ? long.typeid : CLong.typeid)
alias Off_t = $typefrom(env::WIN32 ? int.typeid : usz.typeid)
alias CFile = void*
macro bool libc_S_ISTYPE(value, mask) @builtin
alias SeekIndex = CLong
struct Tm
struct TimeSpec
alias Clock_t @if(env::WIN32) = int
alias Clock_t @if(!env::WIN32) = CLong
alias TimeOffset @if(env::WASI) = int
alias TimeOffset @if(!env::WASI) = CLong
fn TimeSpec NanoDuration.to_timespec(self) @inline
fn TimeSpec Duration.to_timespec(self) @inline
fn TimeSpec Time.to_timespec(self) @inline
fn void longjmp(JmpBuf* buffer, CInt value) @weak @extern("longjmp") @nostrip
fn CInt setjmp(JmpBuf* buffer) @weak @extern("setjmp") @nostrip
fn void* malloc(usz size) @weak @extern("malloc") @nostrip
fn void* calloc(usz count, usz size) @weak @extern("calloc") @nostrip
fn void* free(void*) @weak @extern("free")
fn void* realloc(void* ptr, usz size) @weak @extern("realloc") @nostrip
fn void* memcpy(void* dest, void* src, usz n) @weak @extern("memcpy") @nostrip
fn void* memmove(void* dest, void* src, usz n) @weak @extern("memmove") @nostrip
fn void* memset(void* dest, CInt value, usz n) @weak @extern("memset") @nostrip
fn int fseek(CFile stream, SeekIndex offset, int whence) @weak @extern("fseek") @nostrip
fn CFile fopen(ZString filename, ZString mode) @weak @extern("fopen") @nostrip
fn CFile freopen(ZString filename, ZString mode, CFile stream) @weak @extern("fopen") @nostrip
fn usz fwrite(void* ptr, usz size, usz nmemb, CFile stream) @weak @extern("fwrite") @nostrip
fn usz fread(void* ptr, usz size, usz nmemb, CFile stream) @weak @extern("fread") @nostrip
fn CFile fclose(CFile) @weak @extern("fclose") @nostrip
fn int fflush(CFile stream) @weak @extern("fflush") @nostrip
fn int fputc(int c, CFile stream) @weak @extern("fputc") @nostrip
fn char* fgets(ZString str, int n, CFile stream) @weak @extern("fgets") @nostrip
fn int fgetc(CFile stream) @weak @extern("fgetc") @nostrip
fn int feof(CFile stream) @weak @extern("feof") @nostrip
fn int putc(int c, CFile stream) @weak @extern("putc") @nostrip
fn int putchar(int c) @weak @extern("putchar") @nostrip
fn int puts(ZString str) @weak @extern("puts") @nostrip
alias Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid)
alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid)
alias Blkcnt_t = long
alias Ino_t = ulong
alias Dev_t = ulong
alias Mode_t = uint
alias Ino64_t = ulong
alias Blkcnt64_t = long
struct Stat @if(env::X86_64)
struct Stat @if(!env::X86_64)
extern fn CInt stat(ZString path, Stat* stat)
extern fn usz malloc_size(void* ptr) @if(!env::FREEBSD)
macro CFile stdout()
macro CFile stderr()
alias Dev_t = int
alias Mode_t = ushort
alias Nlink_t = ushort
alias Blkcnt_t = long
alias Blksize_t = int
alias Ino_t = ulong
struct Stat
extern fn int stat(ZString str, Stat* stat) @extern("stat64")
alias Blksize_t = int
alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid)
alias Dev_t = ulong
alias Ino_t = ulong
alias Mode_t = ushort
alias Blkcnt_t = long
alias Fflags_t = uint
struct Stat @if(env::X86_64)
struct Stat @if(!env::X86_64)
extern fn CInt stat(ZString path, Stat* stat)
extern fn void abort()
macro CFile stdout()
macro CFile stderr()
alias Blksize_t = $typefrom(env::X86_64 ? long.typeid : CInt.typeid)
alias Nlink_t = $typefrom(env::X86_64 ? ulong.typeid : CUInt.typeid)
alias Blkcnt_t = long
alias Ino_t = ulong
alias Dev_t = ulong
alias Mode_t = uint
alias Ino64_t = ulong
alias Blkcnt64_t = long
struct Stat @if(env::X86_64)
struct Stat @if(!env::X86_64)
extern fn CInt stat(ZString path, Stat* stat)
alias Blksize_t = int
alias Nlink_t = $typefrom(env::X86_64 ? uint.typeid : CUInt.typeid)
alias Dev_t = int
alias Ino_t = ulong
alias Mode_t = uint
alias Blkcnt_t = long
alias Fflags_t = uint
struct Stat @if(env::X86_64)
struct Stat @if(!env::X86_64)
extern fn CInt stat(ZString path, Stat* stat)
extern fn CInt shutdown(Fd sockfd, CInt how)
struct Stack_t
extern fn CInt sigaltstack(Stack_t* ss, Stack_t* old_ss)
alias fdopen = _fdopen
alias close = _close
alias fileno = _fileno
alias isatty = _isatty
alias difftime = _difftime64
alias fseek = _fseeki64
alias ftell = _ftelli64
alias timegm = _mkgmtime64
alias mktime = _mktime64
extern fn CFile __acrt_iob_func(CInt c)
extern fn CInt get_system_info(SystemInfo*) @extern("GetSystemInfo")

libc::errno @if(!env::WIN32 && !env::DARWIN)

Section titled “libc::errno @if(!env::WIN32 && !env::DARWIN)”
extern fn int* __errno_location() @if(env::LINUX)
macro void errno_set(int err) @if(env::WIN32)
extern fn void _get_errno(int* result) @if(env::WIN32)

libc::termios @if(!env::LIBC ||| !env::POSIX)

Section titled “libc::termios @if(!env::LIBC ||| !env::POSIX)”
typedef Cc = char
typedef Speed = CUInt
typedef Tcflags = CUInt
struct Termios
fn CInt tcgetattr(Fd fd, Termios* self)
fn CInt tcsetattr(Fd fd, CInt optional_actions, Termios* self)
fn CInt tcsendbreak(Fd fd, CInt duration)
fn CInt tcdrain(Fd fd)
fn CInt tcflush(Fd fd, CInt queue_selector)
fn CInt tcflow(Fd fd, CInt action)
fn Speed cfgetospeed(Termios* self)
fn Speed cfgetispeed(Termios* self)
fn CInt cfsetospeed(Termios* self, Speed speed)
fn CInt cfsetispeed(Termios* self, Speed speed)
fn int sendBreak(Fd fd, int duration)
fn int drain(Fd fd)
fn int flush(Fd fd, int queue_selector)
fn int flow(Fd fd, int action)
fn Speed Termios.getOSpeed(Termios* self)
fn Speed Termios.getISpeed(Termios* self)
fn int Termios.setOSpeed(Termios* self, Speed speed)
fn int Termios.setISpeed(Termios* self, Speed speed)
fn int Termios.getAttr(Termios* self, Fd fd)
fn int Termios.setAttr(Termios* self, Fd fd, int optional_actions)

libc::termios @if(env::LIBC &&& env::POSIX)

Section titled “libc::termios @if(env::LIBC &&& env::POSIX)”
fn int sendBreak(Fd fd, int duration)
fn int drain(Fd fd)
fn int flush(Fd fd, int queue_selector)
fn int flow(Fd fd, int action)
fn Speed Termios.getOSpeed(Termios* self)
fn Speed Termios.getISpeed(Termios* self)
fn int Termios.setOSpeed(Termios* self, Speed speed)
fn int Termios.setISpeed(Termios* self, Speed speed)
fn int Termios.getAttr(Termios* self, Fd fd)
fn int Termios.setAttr(Termios* self, Fd fd, Tcactions optional_actions)
macro bool in_range_m(c, start, len)
macro bool is_lower_m(c)
macro bool is_upper_m(c)
macro bool is_digit_m(c)
macro bool is_bdigit_m(c)
macro bool is_odigit_m(c)
macro bool is_xdigit_m(c)
macro bool is_alpha_m(c)
macro bool is_print_m(c)
macro bool is_graph_m(c)
macro bool is_space_m(c)
macro bool is_alnum_m(c)
macro bool is_punct_m(c)
macro bool is_blank_m(c)
macro bool is_cntrl_m(c)
macro to_lower_m(c)
macro to_upper_m(c)
fn bool in_range(char c, char start, char len)
fn bool char.in_range(char c, char start, char len)
fn bool uint.in_range(uint c, uint start, uint len)
fn bool uint.is_lower(uint c) @deprecated
fn bool uint.is_upper(uint c) @deprecated
fn bool uint.is_digit(uint c) @deprecated
fn bool uint.is_bdigit(uint c) @deprecated
fn bool uint.is_odigit(uint c) @deprecated
fn bool uint.is_xdigit(uint c) @deprecated
fn bool uint.is_alpha(uint c) @deprecated
fn bool uint.is_print(uint c) @deprecated
fn bool uint.is_graph(uint c) @deprecated
fn bool uint.is_space(uint c) @deprecated
fn bool uint.is_alnum(uint c) @deprecated
fn bool uint.is_punct(uint c) @deprecated
fn bool uint.is_blank(uint c) @deprecated
fn bool uint.is_cntrl(uint c) @deprecated
fn uint uint.to_lower(uint c) @deprecated
fn uint uint.to_upper(uint c) @deprecated
macro bool is_native_atomic_type($Type)
macro fetch_add(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)
macro fetch_sub(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)
macro fetch_mul(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)
macro fetch_div(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)
macro fetch_or(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)
macro fetch_xor(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)
macro fetch_and(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)
macro fetch_shift_right(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)
macro fetch_shift_left(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT)
macro flag_set(ptr, AtomicOrdering $ordering = SEQ_CONSISTENT)
macro flag_clear(ptr, AtomicOrdering $ordering = SEQ_CONSISTENT)
macro fetch_max(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)
macro fetch_min(ptr, y, AtomicOrdering $ordering = SEQ_CONSISTENT, bool $volatile = false, usz $alignment = 0)
macro @__atomic_compare_exchange_ordering_failure(ptr, expected, desired, $success, failure, $alignment)
macro @__atomic_compare_exchange_ordering_success(ptr, expected, desired, success, failure, $alignment)
fn CInt __atomic_compare_exchange(CInt size, any ptr, any expected, any desired, CInt success, CInt failure) @weak @export("__atomic_compare_exchange")
struct Atomic
macro Type Atomic.load(&self, AtomicOrdering ordering = SEQ_CONSISTENT)
macro void Atomic.store(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)
macro Type Atomic.add(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)
macro Type Atomic.sub(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)
macro Type Atomic.mul(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)
macro Type Atomic.div(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)
macro Type Atomic.max(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)
macro Type Atomic.min(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT)
macro Type Atomic.or(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)
macro Type Atomic.xor(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)
macro Type Atomic.and(&self, Type value, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)
macro Type Atomic.shr(&self, Type amount, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)
macro Type Atomic.shl(&self, Type amount, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) != FLOAT)
macro Type Atomic.set(&self, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) == BOOL)
macro Type Atomic.clear(&self, AtomicOrdering ordering = SEQ_CONSISTENT) @if(types::flat_kind(Type) == BOOL)
macro reverse(i)
macro bswap(i) @builtin
macro uint[<*>].popcount(self)
macro uint[<*>].ctz(self)
macro uint[<*>].clz(self)
macro uint[<*>] uint[<*>].fshl(hi, uint[<*>] lo, uint[<*>] shift)
macro uint[<*>] uint[<*>].fshr(hi, uint[<*>] lo, uint[<*>] shift)
macro uint[<*>] uint[<*>].rotl(self, uint[<*>] shift)
macro uint[<*>] uint[<*>].rotr(self, uint[<*>] shift)
macro int[<*>].popcount(self)
macro int[<*>].ctz(self)
macro int[<*>].clz(self)
macro int[<*>] int[<*>].fshl(hi, int[<*>] lo, int[<*>] shift)
macro int[<*>] int[<*>].fshr(hi, int[<*>] lo, int[<*>] shift)
macro int[<*>] int[<*>].rotl(self, int[<*>] shift)
macro int[<*>] int[<*>].rotr(self, int[<*>] shift)
macro ushort[<*>].popcount(self)
macro ushort[<*>].ctz(self)
macro ushort[<*>].clz(self)
macro ushort[<*>] ushort[<*>].fshl(hi, ushort[<*>] lo, ushort[<*>] shift)
macro ushort[<*>] ushort[<*>].fshr(hi, ushort[<*>] lo, ushort[<*>] shift)
macro ushort[<*>] ushort[<*>].rotl(self, ushort[<*>] shift)
macro ushort[<*>] ushort[<*>].rotr(self, ushort[<*>] shift)
macro short[<*>].popcount(self)
macro short[<*>].ctz(self)
macro short[<*>].clz(self)
macro short[<*>] short[<*>].fshl(hi, short[<*>] lo, short[<*>] shift)
macro short[<*>] short[<*>].fshr(hi, short[<*>] lo, short[<*>] shift)
macro short[<*>] short[<*>].rotl(self, short[<*>] shift)
macro short[<*>] short[<*>].rotr(self, short[<*>] shift)
macro char[<*>].popcount(self)
macro char[<*>].ctz(self)
macro char[<*>].clz(self)
macro char[<*>] char[<*>].fshl(hi, char[<*>] lo, char[<*>] shift)
macro char[<*>] char[<*>].fshr(hi, char[<*>] lo, char[<*>] shift)
macro char[<*>] char[<*>].rotl(self, char[<*>] shift)
macro char[<*>] char[<*>].rotr(self, char[<*>] shift)
macro ichar[<*>].popcount(self)
macro ichar[<*>].ctz(self)
macro ichar[<*>].clz(self)
macro ichar[<*>] ichar[<*>].fshl(hi, ichar[<*>] lo, ichar[<*>] shift)
macro ichar[<*>] ichar[<*>].fshr(hi, ichar[<*>] lo, ichar[<*>] shift)
macro ichar[<*>] ichar[<*>].rotl(self, ichar[<*>] shift)
macro ichar[<*>] ichar[<*>].rotr(self, ichar[<*>] shift)
macro ulong[<*>].popcount(self)
macro ulong[<*>].ctz(self)
macro ulong[<*>].clz(self)
macro ulong[<*>] ulong[<*>].fshl(hi, ulong[<*>] lo, ulong[<*>] shift)
macro ulong[<*>] ulong[<*>].fshr(hi, ulong[<*>] lo, ulong[<*>] shift)
macro ulong[<*>] ulong[<*>].rotl(self, ulong[<*>] shift)
macro ulong[<*>] ulong[<*>].rotr(self, ulong[<*>] shift)
macro long[<*>].popcount(self)
macro long[<*>].ctz(self)
macro long[<*>].clz(self)
macro long[<*>] long[<*>].fshl(hi, long[<*>] lo, long[<*>] shift)
macro long[<*>] long[<*>].fshr(hi, long[<*>] lo, long[<*>] shift)
macro long[<*>] long[<*>].rotl(self, long[<*>] shift)
macro long[<*>] long[<*>].rotr(self, long[<*>] shift)
macro uint128[<*>].popcount(self)
macro uint128[<*>].ctz(self)
macro uint128[<*>].clz(self)
macro uint128[<*>] uint128[<*>].fshl(hi, uint128[<*>] lo, uint128[<*>] shift)
macro uint128[<*>] uint128[<*>].fshr(hi, uint128[<*>] lo, uint128[<*>] shift)
macro uint128[<*>] uint128[<*>].rotl(self, uint128[<*>] shift)
macro uint128[<*>] uint128[<*>].rotr(self, uint128[<*>] shift)
macro int128[<*>].popcount(self)
macro int128[<*>].ctz(self)
macro int128[<*>].clz(self)
macro int128[<*>] int128[<*>].fshl(hi, int128[<*>] lo, int128[<*>] shift)
macro int128[<*>] int128[<*>].fshr(hi, int128[<*>] lo, int128[<*>] shift)
macro int128[<*>] int128[<*>].rotl(self, int128[<*>] shift)
macro int128[<*>] int128[<*>].rotr(self, int128[<*>] shift)
macro uint.popcount(self)
macro uint.ctz(self)
macro uint.clz(self)
macro uint uint.fshl(hi, uint lo, uint shift)
macro uint uint.fshr(hi, uint lo, uint shift)
macro uint uint.rotl(self, uint shift)
macro uint uint.rotr(self, uint shift)
macro int.popcount(self)
macro int.ctz(self)
macro int.clz(self)
macro int int.fshl(hi, int lo, int shift)
macro int int.fshr(hi, int lo, int shift)
macro int int.rotl(self, int shift)
macro int int.rotr(self, int shift)
macro ushort.popcount(self)
macro ushort.ctz(self)
macro ushort.clz(self)
macro ushort ushort.fshl(hi, ushort lo, ushort shift)
macro ushort ushort.fshr(hi, ushort lo, ushort shift)
macro ushort ushort.rotl(self, ushort shift)
macro ushort ushort.rotr(self, ushort shift)
macro short.popcount(self)
macro short.ctz(self)
macro short.clz(self)
macro short short.fshl(hi, short lo, short shift)
macro short short.fshr(hi, short lo, short shift)
macro short short.rotl(self, short shift)
macro short short.rotr(self, short shift)
macro char.popcount(self)
macro char.ctz(self)
macro char.clz(self)
macro char char.fshl(hi, char lo, char shift)
macro char char.fshr(hi, char lo, char shift)
macro char char.rotl(self, char shift)
macro char char.rotr(self, char shift)
macro ichar.popcount(self)
macro ichar.ctz(self)
macro ichar.clz(self)
macro ichar ichar.fshl(hi, ichar lo, ichar shift)
macro ichar ichar.fshr(hi, ichar lo, ichar shift)
macro ichar ichar.rotl(self, ichar shift)
macro ichar ichar.rotr(self, ichar shift)
macro ulong.popcount(self)
macro ulong.ctz(self)
macro ulong.clz(self)
macro ulong ulong.fshl(hi, ulong lo, ulong shift)
macro ulong ulong.fshr(hi, ulong lo, ulong shift)
macro ulong ulong.rotl(self, ulong shift)
macro ulong ulong.rotr(self, ulong shift)
macro long.popcount(self)
macro long.ctz(self)
macro long.clz(self)
macro long long.fshl(hi, long lo, long shift)
macro long long.fshr(hi, long lo, long shift)
macro long long.rotl(self, long shift)
macro long long.rotr(self, long shift)
macro uint128.popcount(self)
macro uint128.ctz(self)
macro uint128.clz(self)
macro uint128 uint128.fshl(hi, uint128 lo, uint128 shift)
macro uint128 uint128.fshr(hi, uint128 lo, uint128 shift)
macro uint128 uint128.rotl(self, uint128 shift)
macro uint128 uint128.rotr(self, uint128 shift)
macro int128.popcount(self)
macro int128.ctz(self)
macro int128.clz(self)
macro int128 int128.fshl(hi, int128 lo, int128 shift)
macro int128 int128.fshr(hi, int128 lo, int128 shift)
macro int128 int128.rotl(self, int128 shift)
macro int128 int128.rotr(self, int128 shift)
alias AnyPredicate = fn bool(any value)
alias AnyTest = fn bool(any type, any context)
struct AnyList (Printable)
fn AnyList* AnyList.init(&self, Allocator allocator, usz initial_capacity = 16)
fn AnyList* AnyList.tinit(&self, usz initial_capacity = 16)
fn bool AnyList.is_initialized(&self) @inline
macro void AnyList.push(&self, element)
fn void AnyList.free_element(&self, any element) @inline
macro AnyList.pop(&self, $Type)
fn any? AnyList.copy_pop(&self, Allocator allocator)
fn any? AnyList.tcopy_pop(&self)
fn any? AnyList.pop_retained(&self)
fn void AnyList.clear(&self)
macro AnyList.pop_first(&self, $Type)
fn any? AnyList.pop_first_retained(&self)
fn any? AnyList.copy_pop_first(&self, Allocator allocator)
fn any? AnyList.tcopy_pop_first(&self)
fn void AnyList.remove_at(&self, usz index)
fn void AnyList.add_all(&self, AnyList* other_list)
fn void AnyList.reverse(&self)
fn any[] AnyList.array_view(&self)
macro void AnyList.push_front(&self, value)
macro void AnyList.insert_at(&self, usz index, type)
fn void AnyList.remove_last(&self)
fn void AnyList.remove_first(&self)
macro AnyList.first(&self, $Type)
fn any? AnyList.first_any(&self) @inline
macro AnyList.last(&self, $Type)
fn any? AnyList.last_any(&self) @inline
fn bool AnyList.is_empty(&self) @inline
fn usz AnyList.len(&self) @operator(len) @inline
macro AnyList.get(&self, usz index, $Type)
fn any AnyList.get_any(&self, usz index) @inline @operator([])
fn void AnyList.free(&self)
fn void AnyList.swap(&self, usz i, usz j)
fn usz? AnyList.to_format(&self, Formatter* formatter) @dynamic
fn usz AnyList.remove_if(&self, AnyPredicate filter)
fn usz AnyList.retain_if(&self, AnyPredicate selection)
fn usz AnyList.remove_using_test(&self, AnyTest filter, any context)
fn usz AnyList.retain_using_test(&self, AnyTest selection, any context)
fn void AnyList.reserve(&self, usz min_capacity)
macro void AnyList.set(&self, usz index, value)
struct BitSet
fn usz BitSet.cardinality(&self)
fn void BitSet.set(&self, usz i)
macro BitSet BitSet.xor_self(&self, BitSet set) @operator(^=)
fn BitSet BitSet.xor(&self, BitSet set) @operator(^)
fn BitSet BitSet.or(&self, BitSet set) @operator(|)
macro BitSet BitSet.or_self(&self, BitSet set) @operator(|=)
fn BitSet BitSet.and(&self, BitSet set) @operator(&)
macro BitSet BitSet.and_self(&self, BitSet set) @operator(&=)
fn void BitSet.unset(&self, usz i)
fn bool BitSet.get(&self, usz i) @operator([]) @inline
fn usz BitSet.len(&self) @operator(len) @inline
fn void BitSet.set_bool(&self, usz i, bool value) @operator([]=) @inline

std::collections::elastic_array {Type, MAX_SIZE}

Section titled “std::collections::elastic_array {Type, MAX_SIZE}”
alias ElementPredicate = fn bool(Type *type)
alias ElementTest = fn bool(Type *type, any context)
macro type_is_overaligned()
struct ElasticArray (Printable)
fn usz? ElasticArray.to_format(&self, Formatter* formatter) @dynamic
fn String ElasticArray.to_tstring(&self)
fn void? ElasticArray.push_try(&self, Type element) @inline
fn void ElasticArray.push(&self, Type element) @inline
fn Type? ElasticArray.pop(&self)
fn void ElasticArray.clear(&self)
fn Type? ElasticArray.pop_first(&self)
fn void ElasticArray.remove_at(&self, usz index)
fn void ElasticArray.add_all(&self, ElasticArray* other_list)
fn usz ElasticArray.add_all_to_limit(&self, ElasticArray* other_list)
fn usz ElasticArray.add_array_to_limit(&self, Type[] array)
fn void ElasticArray.add_array(&self, Type[] array)
fn Type[] ElasticArray.to_aligned_array(&self, Allocator allocator)
macro Type[] ElasticArray.to_array(&self, Allocator allocator)
fn Type[] ElasticArray.to_tarray(&self)
fn void ElasticArray.reverse(&self)
fn Type[] ElasticArray.array_view(&self)
fn void ElasticArray.push_front(&self, Type type) @inline
fn void? ElasticArray.push_front_try(&self, Type type) @inline
fn void? ElasticArray.insert_at_try(&self, usz index, Type value)
fn void ElasticArray.insert_at(&self, usz index, Type type)
fn void ElasticArray.set_at(&self, usz index, Type type)
fn void? ElasticArray.remove_last(&self) @maydiscard
fn void? ElasticArray.remove_first(&self) @maydiscard
fn Type? ElasticArray.first(&self)
fn Type? ElasticArray.last(&self)
fn bool ElasticArray.is_empty(&self) @inline
fn usz ElasticArray.byte_size(&self) @inline
fn usz ElasticArray.len(&self) @operator(len) @inline
fn Type ElasticArray.get(&self, usz index) @inline
fn void ElasticArray.swap(&self, usz i, usz j)
fn usz ElasticArray.remove_if(&self, ElementPredicate filter)
fn usz ElasticArray.retain_if(&self, ElementPredicate selection)
fn usz ElasticArray.remove_using_test(&self, ElementTest filter, any context)
fn usz ElasticArray.retain_using_test(&self, ElementTest filter, any context)
macro Type ElasticArray.@item_at(&self, usz index) @operator([])
fn Type* ElasticArray.get_ref(&self, usz index) @operator(&[]) @inline
fn void ElasticArray.set(&self, usz index, Type value) @operator([]=)
fn usz? ElasticArray.index_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)
fn usz? ElasticArray.rindex_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)
fn bool ElasticArray.equals(&self, ElasticArray other_list) @if(ELEMENT_IS_EQUATABLE)
fn bool ElasticArray.contains(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn bool ElasticArray.remove_last_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn bool ElasticArray.remove_first_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn usz ElasticArray.remove_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn void ElasticArray.remove_all_from(&self, ElasticArray* other_list) @if(ELEMENT_IS_EQUATABLE)
fn usz ElasticArray.compact_count(&self) @if(ELEMENT_IS_POINTER)
fn usz ElasticArray.compact(&self) @if(ELEMENT_IS_POINTER)

std::collections::enummap{Enum, ValueType}

Section titled “std::collections::enummap{Enum, ValueType}”
struct EnumMap (Printable)
fn void EnumMap.init(&self, ValueType init_value)
fn usz? EnumMap.to_format(&self, Formatter* formatter) @dynamic
fn usz EnumMap.len(&self) @operator(len) @inline
fn ValueType EnumMap.get(&self, Enum key) @operator([]) @inline
fn ValueType* EnumMap.get_ref(&self, Enum key) @operator(&[]) @inline
fn void EnumMap.set(&self, Enum key, ValueType value) @operator([]=) @inline
typedef EnumSet (Printable) = EnumSetType
fn void EnumSet.add(&self, Enum v)
fn void EnumSet.clear(&self)
fn bool EnumSet.remove(&self, Enum v)
fn bool EnumSet.has(&self, Enum v)
fn void EnumSet.add_all(&self, EnumSet s)
fn void EnumSet.retain_all(&self, EnumSet s)
fn void EnumSet.remove_all(&self, EnumSet s)
fn EnumSet EnumSet.and_of(&self, EnumSet s)
fn EnumSet EnumSet.or_of(&self, EnumSet s)
fn EnumSet EnumSet.diff_of(&self, EnumSet s)
fn EnumSet EnumSet.xor_of(&self, EnumSet s)
fn usz? EnumSet.to_format(&set, Formatter* formatter) @dynamic
alias GrowableBitSetList = List{Type}
struct GrowableBitSet
fn GrowableBitSet* GrowableBitSet.init(&self, Allocator allocator, usz initial_capacity = 1)
fn GrowableBitSet* GrowableBitSet.tinit(&self, usz initial_capacity = 1)
fn void GrowableBitSet.free(&self)
fn usz GrowableBitSet.cardinality(&self)
fn void GrowableBitSet.set(&self, usz i)
fn void GrowableBitSet.unset(&self, usz i)
fn bool GrowableBitSet.get(&self, usz i) @operator([]) @inline
fn usz GrowableBitSet.len(&self) @operator(len)
fn void GrowableBitSet.set_bool(&self, usz i, bool value) @operator([]=) @inline
struct LinkedList
fn LinkedList* LinkedList.init(&self, Allocator allocator)
fn LinkedList* LinkedList.tinit(&self)
fn bool LinkedList.is_initialized(&self) @inline
fn void LinkedList.push_front(&self, Type value)
fn void LinkedList.push(&self, Type value)
fn Type? LinkedList.peek(&self)
fn Type? LinkedList.peek_last(&self)
fn Type? LinkedList.first(&self)
fn Type? LinkedList.last(&self)
fn void LinkedList.free(&self)
fn void LinkedList.clear(&self)
fn usz LinkedList.len(&self) @inline
macro Node* LinkedList.node_at_index(&self, usz index)
fn Type LinkedList.get(&self, usz index)
fn void LinkedList.set(&self, usz index, Type element)
fn void LinkedList.remove_at(&self, usz index)
fn void LinkedList.insert_at(&self, usz index, Type element)
fn usz LinkedList.remove(&self, Type t) @if(ELEMENT_IS_EQUATABLE)
fn Type? LinkedList.pop(&self)
fn bool LinkedList.is_empty(&self)
fn Type? LinkedList.pop_front(&self)
fn void? LinkedList.remove_last(&self) @maydiscard
fn void? LinkedList.remove_first(&self) @maydiscard
fn bool LinkedList.remove_first_match(&self, Type t) @if(ELEMENT_IS_EQUATABLE)
fn bool LinkedList.remove_last_match(&self, Type t) @if(ELEMENT_IS_EQUATABLE)
macro list_to_aligned_array($Type, self, Allocator allocator)
macro list_to_array($Type, self, Allocator allocator)
macro void list_reverse(self)
macro usz list_remove_using_test(self, filter, bool $invert, ctx)
macro usz list_compact(self)
macro usz list_remove_item(self, value)
macro usz list_remove_if(self, filter, bool $invert)
alias ElementPredicate = fn bool(Type *type)
alias ElementTest = fn bool(Type *type, any context)
macro type_is_overaligned()
struct List (Printable)
fn List* List.init(&self, Allocator allocator, usz initial_capacity = 16)
fn List* List.tinit(&self, usz initial_capacity = 16)
fn List* List.init_with_array(&self, Allocator allocator, Type[] values)
fn List* List.tinit_with_array(&self, Type[] values)
fn void List.init_wrapping_array(&self, Allocator allocator, Type[] types)
fn bool List.is_initialized(&self) @inline
fn usz? List.to_format(&self, Formatter* formatter) @dynamic
fn void List.push(&self, Type element) @inline
fn Type? List.pop(&self)
fn void List.clear(&self)
fn Type? List.pop_first(&self)
fn void List.remove_at(&self, usz index)
fn void List.add_all(&self, List* other_list)
fn Type[] List.to_aligned_array(&self, Allocator allocator)
macro Type[] List.to_array(&self, Allocator allocator)
fn Type[] List.to_tarray(&self)
fn void List.reverse(&self)
fn Type[] List.array_view(&self)
fn void List.add_array(&self, Type[] array)
fn void List.push_front(&self, Type type) @inline
fn void List.insert_at(&self, usz index, Type type)
fn void List.set_at(&self, usz index, Type type)
fn void? List.remove_last(&self) @maydiscard
fn void? List.remove_first(&self) @maydiscard
fn Type? List.first(&self)
fn Type? List.last(&self)
fn bool List.is_empty(&self) @inline
fn usz List.byte_size(&self) @inline
fn usz List.len(&self) @operator(len) @inline
fn Type List.get(&self, usz index) @inline
fn void List.free(&self)
fn void List.swap(&self, usz i, usz j)
fn usz List.remove_if(&self, ElementPredicate filter)
fn usz List.retain_if(&self, ElementPredicate selection)
fn usz List.remove_using_test(&self, ElementTest filter, any context)
fn usz List.retain_using_test(&self, ElementTest filter, any context)
macro Type List.@item_at(&self, usz index) @operator([])
fn Type* List.get_ref(&self, usz index) @operator(&[]) @inline
fn void List.set(&self, usz index, Type value) @operator([]=)
fn void List.reserve(&self, usz added)
fn void List._update_size_change(&self,usz old_size, usz new_size)
fn usz? List.index_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)
fn usz? List.rindex_of(&self, Type type) @if(ELEMENT_IS_EQUATABLE)
fn bool List.equals(&self, List other_list) @if(ELEMENT_IS_EQUATABLE)
fn bool List.contains(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn bool List.remove_last_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn bool List.remove_first_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn usz List.remove_item(&self, Type value) @if(ELEMENT_IS_EQUATABLE)
fn void List.remove_all_from(&self, List* other_list) @if(ELEMENT_IS_EQUATABLE)
fn usz List.compact_count(&self) @if(ELEMENT_IS_POINTER)
fn usz List.compact(&self) @if(ELEMENT_IS_POINTER)
struct Entry
struct HashMap (Printable)
fn HashMap* HashMap.init(&self, Allocator allocator, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn HashMap* HashMap.tinit(&self, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro HashMap* HashMap.init_with_key_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro HashMap* HashMap.tinit_with_key_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn HashMap* HashMap.init_from_keys_and_values(&self, Allocator allocator, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn HashMap* HashMap.tinit_from_keys_and_values(&self, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn bool HashMap.is_initialized(&map)
fn HashMap* HashMap.init_from_map(&self, Allocator allocator, HashMap* other_map)
fn HashMap* HashMap.tinit_from_map(&map, HashMap* other_map)
fn bool HashMap.is_empty(&map) @inline
fn usz HashMap.len(&map) @inline
fn Value*? HashMap.get_ref(&map, Key key)
fn Entry*? HashMap.get_entry(&map, Key key)
macro Value HashMap.@get_or_set(&map, Key key, Value #expr)
fn Value? HashMap.get(&map, Key key) @operator([])
fn bool HashMap.has_key(&map, Key key)
fn bool HashMap.set(&map, Key key, Value value) @operator([]=)
fn void? HashMap.remove(&map, Key key) @maydiscard
fn void HashMap.clear(&map)
fn void HashMap.free(&map)
fn Key[] HashMap.tkeys(&self)
fn Key[] HashMap.keys(&self, Allocator allocator)
macro HashMap.@each(map; @body(key, value))
macro HashMap.@each_entry(map; @body(entry))
fn Value[] HashMap.tvalues(&map)
fn Value[] HashMap.values(&self, Allocator allocator)
fn bool HashMap.has_value(&map, Value v) @if(VALUE_IS_EQUATABLE)
fn HashMapIterator HashMap.iter(&self)
fn HashMapValueIterator HashMap.value_iter(&self)
fn HashMapKeyIterator HashMap.key_iter(&self)
fn usz? HashMap.to_format(&self, Formatter* f) @dynamic
struct HashMapIterator
typedef HashMapValueIterator = HashMapIterator
typedef HashMapKeyIterator = HashMapIterator
fn Entry HashMapIterator.get(&self, usz idx) @operator([])
fn Value HashMapValueIterator.get(&self, usz idx) @operator([])
fn Key HashMapKeyIterator.get(&self, usz idx) @operator([])
fn usz HashMapValueIterator.len(self) @operator(len)
fn usz HashMapKeyIterator.len(self) @operator(len)
fn usz HashMapIterator.len(self) @operator(len)
struct LinkedEntry
struct LinkedHashMap (Printable)
fn LinkedHashMap* LinkedHashMap.init(&self, Allocator allocator, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn LinkedHashMap* LinkedHashMap.tinit(&self, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro LinkedHashMap* LinkedHashMap.init_with_key_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro LinkedHashMap* LinkedHashMap.tinit_with_key_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn LinkedHashMap* LinkedHashMap.init_from_keys_and_values(&self, Allocator allocator, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn LinkedHashMap* LinkedHashMap.tinit_from_keys_and_values(&self, Key[] keys, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn bool LinkedHashMap.is_initialized(&map)
fn LinkedHashMap* LinkedHashMap.init_from_map(&self, Allocator allocator, LinkedHashMap* other_map)
fn LinkedHashMap* LinkedHashMap.tinit_from_map(&map, LinkedHashMap* other_map)
fn bool LinkedHashMap.is_empty(&map) @inline
fn usz LinkedHashMap.len(&map) @inline
fn Value*? LinkedHashMap.get_ref(&map, Key key)
fn LinkedEntry*? LinkedHashMap.get_entry(&map, Key key)
macro Value LinkedHashMap.@get_or_set(&map, Key key, Value #expr)
fn Value? LinkedHashMap.get(&map, Key key) @operator([])
fn bool LinkedHashMap.has_key(&map, Key key)
fn bool LinkedHashMap.set(&map, Key key, Value value) @operator([]=)
fn void? LinkedHashMap.remove(&map, Key key) @maydiscard
fn void LinkedHashMap.clear(&map)
fn void LinkedHashMap.free(&map)
fn Key[] LinkedHashMap.tkeys(&self)
fn Key[] LinkedHashMap.keys(&self, Allocator allocator)
macro LinkedHashMap.@each(map; @body(key, value))
macro LinkedHashMap.@each_entry(map; @body(entry))
fn Value[] LinkedHashMap.tvalues(&map)
fn Value[] LinkedHashMap.values(&self, Allocator allocator)
fn bool LinkedHashMap.has_value(&map, Value v) @if(VALUE_IS_EQUATABLE)
fn LinkedHashMapIterator LinkedHashMap.iter(&self)
fn LinkedHashMapValueIterator LinkedHashMap.value_iter(&self)
fn LinkedHashMapKeyIterator LinkedHashMap.key_iter(&self)
fn bool LinkedHashMapIterator.next(&self)
fn LinkedEntry*? LinkedHashMapIterator.get(&self)
fn Value*? LinkedHashMapValueIterator.get(&self)
fn Key*? LinkedHashMapKeyIterator.get(&self)
fn bool LinkedHashMapIterator.has_next(&self)
fn usz? LinkedHashMap.to_format(&self, Formatter* f) @dynamic
struct LinkedHashMapIterator
typedef LinkedHashMapValueIterator = inline LinkedHashMapIterator
typedef LinkedHashMapKeyIterator = inline LinkedHashMapIterator
fn usz LinkedHashMapValueIterator.len(self) @operator(len)
fn usz LinkedHashMapKeyIterator.len(self) @operator(len)
fn usz LinkedHashMapIterator.len(self) @operator(len)
struct Maybe (Printable)
fn usz? Maybe.to_format(&self, Formatter* f) @dynamic
fn void Maybe.set(&self, Type val)
fn void Maybe.reset(&self)
fn Maybe value(Type val)
macro Type? Maybe.get(self)
fn bool Maybe.equals(self, Maybe other) @operator(==) @if(types::is_equatable_type(Type))
struct Object (Printable)
fn usz? Object.to_format(&self, Formatter* formatter) @dynamic
fn Object* new_obj(Allocator allocator)
fn Object* new_null()
fn Object* new_int(int128 i, Allocator allocator)
macro Object* new_enum(e, Allocator allocator)
fn Object* new_float(double f, Allocator allocator)
fn Object* new_string(String s, Allocator allocator)
fn Object* new_bool(bool b)
fn void Object.free(&self)
fn bool Object.is_null(&self) @inline
fn bool Object.is_empty(&self) @inline
fn bool Object.is_map(&self) @inline
fn bool Object.is_array(&self) @inline
fn bool Object.is_bool(&self) @inline
fn bool Object.is_string(&self) @inline
fn bool Object.is_float(&self) @inline
fn bool Object.is_int(&self) @inline
fn bool Object.is_keyable(&self)
fn bool Object.is_indexable(&self)
macro Object* Object.set(&self, String key, value)
macro Object* Object.set_at(&self, usz index, String key, value)
macro Object* Object.push(&self, value)
fn Object*? Object.get(&self, String key)
fn bool Object.has_key(&self, String key)
fn Object* Object.get_at(&self, usz index)
fn usz Object.get_len(&self)
fn void Object.push_object(&self, Object* to_append)
fn void Object.set_object_at(&self, usz index, Object* to_set)
macro get_integer_value(Object* value, $Type)
fn ichar? Object.get_ichar(&self, String key)
fn short? Object.get_short(&self, String key)
fn int? Object.get_int(&self, String key)
fn long? Object.get_long(&self, String key)
fn int128? Object.get_int128(&self, String key)
fn ichar? Object.get_ichar_at(&self, usz index)
fn short? Object.get_short_at(&self, usz index)
fn int? Object.get_int_at(&self, usz index)
fn long? Object.get_long_at(&self, usz index)
fn int128? Object.get_int128_at(&self, usz index)
fn char? Object.get_char(&self, String key)
fn short? Object.get_ushort(&self, String key)
fn uint? Object.get_uint(&self, String key)
fn ulong? Object.get_ulong(&self, String key)
fn uint128? Object.get_uint128(&self, String key)
fn char? Object.get_char_at(&self, usz index)
fn ushort? Object.get_ushort_at(&self, usz index)
fn uint? Object.get_uint_at(&self, usz index)
fn ulong? Object.get_ulong_at(&self, usz index)
fn uint128? Object.get_uint128_at(&self, usz index)
fn String? Object.get_string(&self, String key)
fn String? Object.get_string_at(&self, usz index)
macro String? Object.get_enum(&self, $EnumType, String key)
macro String? Object.get_enum_at(&self, $EnumType, usz index)
fn bool? Object.get_bool(&self, String key)
fn bool? Object.get_bool_at(&self, usz index)
fn double? Object.get_float(&self, String key)
fn double? Object.get_float_at(&self, usz index)
fn Object* Object.get_or_create_obj(&self, String key)
struct Pair
macro void Pair.unpack(&self, a, b)

std::collections::priorityqueue::private{Type, MAX}

Section titled “std::collections::priorityqueue::private{Type, MAX}”
struct PrivatePriorityQueue (Printable)
fn PrivatePriorityQueue* PrivatePriorityQueue.init(&self, Allocator allocator, usz initial_capacity = 16, ) @inline
fn PrivatePriorityQueue* PrivatePriorityQueue.tinit(&self, usz initial_capacity = 16) @inline
fn void PrivatePriorityQueue.push(&self, Type element)
fn void PrivatePriorityQueue.remove_at(&self, usz index)
fn Type? PrivatePriorityQueue.pop(&self)
fn Type? PrivatePriorityQueue.first(&self)
fn void PrivatePriorityQueue.free(&self)
fn usz PrivatePriorityQueue.len(&self) @operator(len)
fn bool PrivatePriorityQueue.is_empty(&self)
fn Type PrivatePriorityQueue.get(&self, usz index) @operator([])
fn usz? PrivatePriorityQueue.to_format(&self, Formatter* formatter) @dynamic
typedef PriorityQueue = inline PrivatePriorityQueue{Type, false}
typedef PriorityQueueMax = inline PrivatePriorityQueue{Type, true}
struct Range (Printable)
fn usz Range.len(&self) @operator(len)
fn bool Range.contains(&self, Type value) @inline
fn Type Range.get(&self, usz index) @operator([])
fn usz? Range.to_format(&self, Formatter* formatter) @dynamic
struct ExclusiveRange (Printable)
fn usz ExclusiveRange.len(&self) @operator(len)
fn bool ExclusiveRange.contains(&self, Type value) @inline
fn usz? ExclusiveRange.to_format(&self, Formatter* formatter) @dynamic
fn Type ExclusiveRange.get(&self, usz index) @operator([])
alias Element = $typeof((Type){}[0])
struct RingBuffer (Printable)
fn void RingBuffer.init(&self) @inline
fn void RingBuffer.push(&self, Element c)
fn Element RingBuffer.get(&self, usz index) @operator([])
fn Element? RingBuffer.pop(&self)
fn usz? RingBuffer.to_format(&self, Formatter* format) @dynamic
fn usz RingBuffer.read(&self, usz index, Element[] buffer)
fn void RingBuffer.write(&self, Element[] buffer)
struct Entry
struct HashSet (Printable)
fn int HashSet.len(&self) @operator(len)
fn HashSet* HashSet.init(&self, Allocator allocator, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn HashSet* HashSet.tinit(&self, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro HashSet* HashSet.init_with_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro HashSet* HashSet.tinit_with_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn HashSet* HashSet.init_from_values(&self, Allocator allocator, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn HashSet* HashSet.tinit_from_values(&self, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn bool HashSet.is_initialized(&set)
fn HashSet* HashSet.init_from_set(&self, Allocator allocator, HashSet* other_set)
fn HashSet* HashSet.tinit_from_set(&set, HashSet* other_set)
fn bool HashSet.is_empty(&set) @inline
fn usz HashSet.add_all(&set, Value[] list)
fn usz HashSet.add_all_from(&set, HashSet* other)
fn bool HashSet.add(&set, Value value)
macro HashSet.@each(set; @body(value))
fn bool HashSet.contains(&set, Value value)
fn void? HashSet.remove(&set, Value value) @maydiscard
fn usz HashSet.remove_all(&set, Value[] values)
fn usz HashSet.remove_all_from(&set, HashSet* other)
fn void HashSet.free(&set)
fn void HashSet.clear(&set)
fn void HashSet.reserve(&set, usz capacity)
fn HashSet HashSet.set_union(&self, Allocator allocator, HashSet* other)
fn HashSet HashSet.tset_union(&self, HashSet* other)
fn HashSet HashSet.intersection(&self, Allocator allocator, HashSet* other)
fn HashSet HashSet.tintersection(&self, HashSet* other)
fn HashSet HashSet.difference(&self, Allocator allocator, HashSet* other)
fn HashSet HashSet.tdifference(&self, HashSet* other)
fn HashSet HashSet.symmetric_difference(&self, Allocator allocator, HashSet* other)
fn HashSet HashSet.tsymmetric_difference(&self, HashSet* other)
fn bool HashSet.is_subset(&self, HashSet* other)
fn usz? HashSet.to_format(&self, Formatter* f) @dynamic
struct HashSetIterator
fn HashSetIterator HashSet.iter(&set)
fn Value? HashSetIterator.next(&self)
fn usz HashSetIterator.len(&self) @operator(len)
struct LinkedEntry
struct LinkedHashSet (Printable)
fn int LinkedHashSet.len(&self) @operator(len)
fn LinkedHashSet* LinkedHashSet.init(&self, Allocator allocator, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn LinkedHashSet* LinkedHashSet.tinit(&self, usz capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro LinkedHashSet* LinkedHashSet.init_with_values(&self, Allocator allocator, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
macro LinkedHashSet* LinkedHashSet.tinit_with_values(&self, ..., uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn LinkedHashSet* LinkedHashSet.init_from_values(&self, Allocator allocator, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn LinkedHashSet* LinkedHashSet.tinit_from_values(&self, Value[] values, uint capacity = DEFAULT_INITIAL_CAPACITY, float load_factor = DEFAULT_LOAD_FACTOR)
fn bool LinkedHashSet.is_initialized(&set)
fn LinkedHashSet* LinkedHashSet.init_from_set(&self, Allocator allocator, LinkedHashSet* other_set)
fn LinkedHashSet* LinkedHashSet.tinit_from_set(&set, LinkedHashSet* other_set)
fn bool LinkedHashSet.is_empty(&set) @inline
fn usz LinkedHashSet.add_all(&set, Value[] list)
fn usz LinkedHashSet.add_all_from(&set, LinkedHashSet* other)
fn bool LinkedHashSet.add(&set, Value value)
macro LinkedHashSet.@each(set; @body(value))
fn bool LinkedHashSet.contains(&set, Value value)
fn void? LinkedHashSet.remove(&set, Value value) @maydiscard
fn usz LinkedHashSet.remove_all(&set, Value[] values)
fn usz LinkedHashSet.remove_all_from(&set, LinkedHashSet* other)
fn void LinkedHashSet.free(&set)
fn void LinkedHashSet.clear(&set)
fn void LinkedHashSet.reserve(&set, usz capacity)
fn LinkedHashSet LinkedHashSet.set_union(&self, Allocator allocator, LinkedHashSet* other)
fn LinkedHashSet LinkedHashSet.tset_union(&self, LinkedHashSet* other)
fn LinkedHashSet LinkedHashSet.intersection(&self, Allocator allocator, LinkedHashSet* other)
fn LinkedHashSet LinkedHashSet.tintersection(&self, LinkedHashSet* other)
fn LinkedHashSet LinkedHashSet.difference(&self, Allocator allocator, LinkedHashSet* other)
fn LinkedHashSet LinkedHashSet.tdifference(&self, LinkedHashSet* other)
fn LinkedHashSet LinkedHashSet.symmetric_difference(&self, Allocator allocator, LinkedHashSet* other)
fn LinkedHashSet LinkedHashSet.tsymmetric_difference(&self, LinkedHashSet* other)
fn bool LinkedHashSet.is_subset(&self, LinkedHashSet* other)
fn usz? LinkedHashSet.to_format(&self, Formatter* f) @dynamic
struct LinkedHashSetIterator
fn LinkedHashSetIterator LinkedHashSet.iter(&set)
fn bool LinkedHashSetIterator.next(&self)
fn Value*? LinkedHashSetIterator.get(&self)
fn bool LinkedHashSetIterator.has_next(&self)
fn usz LinkedHashSetIterator.len(&self) @operator(len)

std::collections::triple{Type1, Type2, Type3}

Section titled “std::collections::triple{Type1, Type2, Type3}”
struct Triple
macro void Triple.unpack(&self, a, b, c)
struct Tuple @deprecated("Use 'Pair' instead")
enum QOIColorspace : char (char id)
enum QOIChannels : char (char id)
struct QOIDesc
faultdef INVALID_PARAMETERS, FILE_OPEN_FAILED, FILE_WRITE_FAILED, INVALID_DATA, TOO_MANY_PIXELS
fn char[]? encode(Allocator allocator, char[] input, QOIDesc* desc) @nodiscard
fn char[]? decode(Allocator allocator, char[] data, QOIDesc* desc, QOIChannels channels = AUTO) @nodiscard

std::compression::qoi @if(!$feature(QOI_NO_STDIO))

Section titled “std::compression::qoi @if(!$feature(QOI_NO_STDIO))”
fn usz? write(String filename, char[] input, QOIDesc* desc)
fn char[]? read(Allocator allocator, String filename, QOIDesc* desc, QOIChannels channels = AUTO)
macro bool contains(array, element)
macro index_of(array, element)
macro slice2d(array_ptr, x = 0, xlen = 0, y = 0, ylen = 0)
macro rindex_of(array, element)
macro concat(Allocator allocator, arr1, arr2) @nodiscard
macro tconcat(arr1, arr2) @nodiscard
struct Slice2d
fn usz Slice2d.len(&self) @operator(len)
fn usz Slice2d.count(&self)
macro void Slice2d.@each(&self; @body(usz[<2>], Type))
macro void Slice2d.@each_ref(&self; @body(usz[<2>], Type*))
macro Type[] Slice2d.get_row(self, usz idy) @operator([])
macro Type Slice2d.get_coord(self, usz[<2>] coord)
macro Type* Slice2d.get_coord_ref(self, usz[<2>] coord)
macro Type Slice2d.get_xy(self, x, y)
macro Type* Slice2d.get_xy_ref(self, x, y)
macro void Slice2d.set_coord(self, usz[<2>] coord, Type value)
macro void Slice2d.set_xy(self, x, y, Type value)
fn Slice2d Slice2d.slice(&self, isz x = 0, isz xlen = 0, isz y = 0, isz ylen = 0)
macro bool @is_lower(c)
macro bool @is_upper(c)
macro bool @is_digit(c)
macro bool @is_bdigit(c)
macro bool @is_odigit(c)
macro bool @is_xdigit(c)
macro bool @is_alpha(c)
macro bool @is_print(c)
macro bool @is_graph(c)
macro bool @is_space(c)
macro bool @is_alnum(c)
macro bool @is_punct(c)
macro bool @is_blank(c)
macro bool @is_cntrl(c)
macro char @to_lower(c)
macro char @to_upper(c)
fn bool is_lower(char c)
fn bool is_upper(char c)
fn bool is_digit(char c)
fn bool is_bdigit(char c)
fn bool is_odigit(char c)
fn bool is_xdigit(char c)
fn bool is_alpha(char c)
fn bool is_print(char c)
fn bool is_graph(char c)
fn bool is_space(char c)
fn bool is_alnum(char c)
fn bool is_punct(char c)
fn bool is_blank(char c)
fn bool is_cntrl(char c)
fn char to_lower(char c)
fn char to_upper(char c)
macro bool char.is_lower(char c)
macro bool char.is_upper(char c)
macro bool char.is_digit(char c)
macro bool char.is_bdigit(char c)
macro bool char.is_odigit(char c)
macro bool char.is_xdigit(char c)
macro bool char.is_alpha(char c)
macro bool char.is_print(char c)
macro bool char.is_graph(char c)
macro bool char.is_space(char c)
macro bool char.is_alnum(char c)
macro bool char.is_punct(char c)
macro bool char.is_blank(char c)
macro bool char.is_cntrl(char c)
macro char char.to_lower(char c)
macro char char.to_upper(char c)
macro char char.from_hex(char c)
bitstruct ShortBE : short @bigendian
bitstruct UShortBE : ushort @bigendian
bitstruct IntBE : int @bigendian
bitstruct UIntBE : int @bigendian
bitstruct LongBE : long @bigendian
bitstruct ULongBE : ulong @bigendian
bitstruct Int128BE : int128 @bigendian
bitstruct UInt128BE : uint128 @bigendian
bitstruct ShortLE : short @littleendian
bitstruct UShortLE : ushort @littleendian
bitstruct IntLE : int @littleendian
bitstruct UIntLE : int @littleendian
bitstruct LongLE : long @littleendian
bitstruct ULongLE : ulong @littleendian
bitstruct Int128LE : int128 @littleendian
bitstruct UInt128LE : uint128 @littleendian
macro read(bytes, $Type)
macro write(x, bytes, $Type)
macro is_bitorder($Type)
macro bool is_array_or_slice_of_char(bytes) @deprecated("Use @is_array_or_slice_of_char")
macro bool @is_array_or_slice_of_char(#bytes) @const
macro bool is_arrayptr_or_slice_of_char(bytes) @deprecated("Use @is_arrayptr_or_slice_of_char")
macro bool @is_arrayptr_or_slice_of_char(#bytes) @const
typedef EmptySlot = void*
macro @is_empty_macro_slot(#arg) @const @builtin
macro @is_valid_macro_slot(#arg) @const @builtin
macro @rnd() @const @builtin
faultdef NO_MORE_ELEMENT @builtin
faultdef NOT_FOUND @builtin
faultdef TYPE_MISMATCH @builtin
alias VoidFn = fn void()
macro void @scope(#variable; @body) @builtin
macro void @swap(#a, #b) @builtin
macro anycast(any v, $Type) @builtin
macro bool @assignable_to(#foo, $Type) @const @builtin
macro @addr(#val) @builtin
macro typeid @typeid(#value) @const @builtin
macro TypeKind @typekind(#value) @const @builtin
macro bool @typeis(#value, $Type) @const @builtin
fn bool print_backtrace(String message, int backtraces_to_ignore) @if
fn void default_panic(String message, String file, String function, uint line) @if(env::NATIVE_STACKTRACE)
macro void abort(String string = "Unrecoverable error reached", ...) @format(0) @builtin @noreturn
fn void default_panic(String message, String file, String function, uint line) @if
alias PanicFn = fn void(String message, String file, String function, uint line)
fn void panicf(String fmt, String file, String function, uint line, args...)
macro void unreachable(String string = "Unreachable statement reached.", ...) @builtin @noreturn
macro void unsupported(String string = "Unsupported function invoked") @builtin @noreturn
macro void breakpoint() @builtin
macro any_make(void* ptr, typeid type) @builtin
macro any.retype_to(&self, typeid type)
macro any.as_inner(&self)
macro bitcast(expr, $Type) @builtin
macro enum_by_name($Type, String enum_name) @builtin
macro @enum_from_value($Type, #value, value) @builtin @deprecated("Use Enum.lookup_field and Enum.lookup")
macro bool @likely(bool #value, $probability = 1.0) @builtin
macro bool @unlikely(bool #value, $probability = 1.0) @builtin
macro @expect(#value, expected, $probability = 1.0) @builtin
enum PrefetchLocality
macro @prefetch(void* ptr, PrefetchLocality $locality = VERY_NEAR, bool $write = false) @builtin
macro swizzle(v, ...) @builtin
macro swizzle2(v, v2, ...) @builtin
macro fault @catch(#expr) @builtin
macro bool @ok(#expr) @builtin
macro void? @try(#v, #expr) @builtin
macro bool? @try_catch(#v, #expr, fault expected_fault) @builtin
macro char[] @as_char_view(#value) @builtin
macro isz @str_find(String $string, String $needle) @builtin
macro String @str_upper(String $str) @builtin
macro String @str_lower(String $str) @builtin
macro uint @str_hash(String $str) @builtin
macro @generic_hash_core(h, value)
macro @generic_hash(value)
macro uint int128.hash(self)
macro uint uint128.hash(self)
macro uint long.hash(self)
macro uint ulong.hash(self)
macro uint int.hash(self)
macro uint uint.hash(self)
macro uint short.hash(self)
macro uint ushort.hash(self)
macro uint ichar.hash(self)
macro uint char.hash(self)
macro uint bool.hash(self)
macro uint int128[*].hash(&self)
macro uint uint128[*].hash(&self)
macro uint long[*].hash(&self)
macro uint ulong[*].hash(&self)
macro uint int[*].hash(&self)
macro uint uint[*].hash(&self)
macro uint short[*].hash(&self)
macro uint ushort[*].hash(&self)
macro uint char[*].hash(&self)
macro uint ichar[*].hash(&self)
macro uint bool[*].hash(&self)
macro uint int128[<*>].hash(self)
macro uint uint128[<*>].hash(self)
macro uint long[<*>].hash(self)
macro uint ulong[<*>].hash(self)
macro uint int[<*>].hash(self)
macro uint uint[<*>].hash(self)
macro uint short[<*>].hash(self)
macro uint ushort[<*>].hash(self)
macro uint char[<*>].hash(self)
macro uint ichar[<*>].hash(self)
macro uint bool[<*>].hash(self)
macro uint typeid.hash(typeid t)
macro uint String.hash(String c)
macro uint char[].hash(char[] c)
macro uint void*.hash(void* ptr)
macro void* get_frameaddress(int n)
macro void* get_returnaddress(int n)
macro less(a, b) @builtin
macro less_eq(a, b) @builtin
macro greater(a, b) @builtin
macro int compare_to(a, b) @builtin
macro greater_eq(a, b) @builtin
macro bool equals(a, b) @builtin
macro min(x, ...) @builtin
macro max(x, ...) @builtin

std::core::builtin @if((env::LINUX || env::ANDROID || env::DARWIN) && env::COMPILER_SAFE_MODE && env::DEBUG_SYMBOLS)

Section titled “std::core::builtin @if((env::LINUX || env::ANDROID || env::DARWIN) && env::COMPILER_SAFE_MODE && env::DEBUG_SYMBOLS)”
fn void sig_panic(String message)
fn void sig_bus_error(CInt i)
fn void sig_segmentation_fault(CInt i)
alias CShort = $typefrom(signed_int_from_bitsize($$C_SHORT_SIZE))
alias CUShort = $typefrom(unsigned_int_from_bitsize($$C_SHORT_SIZE))
alias CInt = $typefrom(signed_int_from_bitsize($$C_INT_SIZE))
alias CUInt = $typefrom(unsigned_int_from_bitsize($$C_INT_SIZE))
alias CLong = $typefrom(signed_int_from_bitsize($$C_LONG_SIZE))
alias CULong = $typefrom(unsigned_int_from_bitsize($$C_LONG_SIZE))
alias CLongLong = $typefrom(signed_int_from_bitsize($$C_LONG_LONG_SIZE))
alias CULongLong = $typefrom(unsigned_int_from_bitsize($$C_LONG_LONG_SIZE))
alias CSChar = ichar
alias CUChar = char
alias CChar = $typefrom($$C_CHAR_IS_SIGNED ? ichar.typeid : char.typeid)
enum CBool : char

std::core::cpudetect @if(env::X86 || env::X86_64)

Section titled “std::core::cpudetect @if(env::X86 || env::X86_64)”
struct CpuId
fn CpuId x86_cpuid(uint eax, uint ecx = 0)
enum X86Feature
fn void add_feature_if_bit(X86Feature feature, uint register, int bit)
fn void x86_initialize_cpu_features()
typedef DString (OutStream) = DStringOpaque*
typedef DStringOpaque = void
fn DString DString.init(&self, Allocator allocator, usz capacity = MIN_CAPACITY)
fn DString DString.tinit(&self, usz capacity = MIN_CAPACITY)
fn DString new_with_capacity(Allocator allocator, usz capacity)
fn DString temp_with_capacity(usz capacity)
fn DString new(Allocator allocator, String c = "")
fn DString temp(String s = "")
fn void DString.replace_char(self, char ch, char replacement)
fn void DString.replace(&self, String needle, String replacement)
fn DString DString.concat(self, Allocator allocator, DString b) @nodiscard
fn DString DString.tconcat(self, DString b)
fn ZString DString.zstr_view(&self)
fn usz DString.capacity(self)
fn usz DString.len(&self) @dynamic @operator(len)
fn void DString.chop(self, usz new_size)
fn String DString.str_view(self)
fn char DString.char_at(self, usz index) @operator([])
fn char* DString.char_ref(&self, usz index) @operator(&[])
fn usz DString.append_utf32(&self, Char32[] chars)
fn void DString.set(self, usz index, char c) @operator([]=)
fn void DString.append_repeat(&self, char c, usz times)
fn usz DString.append_char32(&self, Char32 c)
fn DString DString.tcopy(&self)
fn DString DString.copy(self, Allocator allocator) @nodiscard
fn ZString DString.copy_zstr(self, Allocator allocator) @nodiscard
fn String DString.copy_str(self, Allocator allocator) @nodiscard
fn String DString.tcopy_str(self) @nodiscard
fn bool DString.equals(self, DString other_string)
fn void DString.free(&self)
fn bool DString.less(self, DString other_string)
fn void DString.append_chars(&self, String str)
fn Char32[] DString.copy_utf32(&self, Allocator allocator)
fn void DString.append_string(&self, DString str)
fn void DString.clear(self)
fn usz? DString.write(&self, char[] buffer) @dynamic
fn void? DString.write_byte(&self, char c) @dynamic
fn void DString.append_char(&self, char c)
fn void DString.delete_range(&self, usz start, usz end)
fn void DString.delete(&self, usz start, usz len = 1)
macro void DString.append(&self, value)
fn void DString.insert_chars_at(&self, usz index, String s)
fn void DString.insert_string_at(&self, usz index, DString str)
fn void DString.insert_char_at(&self, usz index, char c)
fn usz DString.insert_char32_at(&self, usz index, Char32 c)
fn usz DString.insert_utf32_at(&self, usz index, Char32[] chars)
macro void DString.insert_at(&self, usz index, value)
fn usz? DString.appendf(&self, String format, args...) @maydiscard
fn usz? DString.appendfn(&self, String format, args...) @maydiscard
fn DString join(Allocator allocator, String[] s, String joiner) @nodiscard
fn void DString.reverse(self)
fn void DString.reserve(&self, usz addition)
fn usz? DString.read_from_stream(&self, InStream reader)
enum CompilerOptLevel
enum MemoryEnvironment
enum OsType
enum ArchType
macro bool os_is_darwin() @const
macro bool os_is_posix() @const
macro int @main_to_err_main(#m, int, char**)
macro int @main_to_int_main(#m, int, char**)
macro int @main_to_void_main(#m, int, char**)
macro int @main_to_err_main_args(#m, int argc, char** argv)
macro int @main_to_int_main_args(#m, int argc, char** argv)
macro int @_main_runner(#m, int argc, char** argv)
macro int @main_to_void_main_args(#m, int argc, char** argv)
extern fn Char16** _win_command_line_to_argv_w(ushort* cmd_line, int* argc_ptr) @extern("CommandLineToArgvW")
macro int @win_to_err_main_noargs(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_int_main_noargs(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_void_main_noargs(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_err_main_args(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_int_main_args(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_void_main_args(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_err_main(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_int_main(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @win_to_void_main(#m, void* handle, void* prev_handle, Char16* cmd_line, int show_cmd)
macro int @wmain_to_err_main_args(#m, int argc, Char16** argv)
macro int @wmain_to_int_main_args(#m, int argc, Char16** argv)
macro int @_wmain_runner(#m, int argc, Char16** argv)
macro int @wmain_to_void_main_args(#m, int argc, Char16** argv)
faultdef OUT_OF_MEMORY, INVALID_ALLOC_SIZE
fn usz os_pagesize()
macro masked_load(ptr, bool[<*>] mask, passthru)
macro @masked_load_aligned(ptr, bool[<*>] mask, passthru, usz $alignment)
macro gather(ptrvec, bool[<*>] mask, passthru)
macro @gather_aligned(ptrvec, bool[<*>] mask, passthru, usz $alignment)
macro masked_store(ptr, value, bool[<*>] mask)
macro @masked_store_aligned(ptr, value, bool[<*>] mask, usz $alignment)
macro scatter(ptrvec, value, bool[<*>] mask)
macro @scatter_aligned(ptrvec, value, bool[<*>] mask, usz $alignment)
macro @unaligned_load(#x, usz $alignment) @builtin
macro @unaligned_store(#x, value, usz $alignment) @builtin
macro @volatile_load(#x) @builtin
macro @volatile_store(#x, value) @builtin
enum AtomicOrdering : int
macro @atomic_load(#x, AtomicOrdering $ordering = SEQ_CONSISTENT, $volatile = false) @builtin
macro void @atomic_store(#x, value, AtomicOrdering $ordering = SEQ_CONSISTENT, $volatile = false) @builtin
macro compare_exchange(ptr, compare, value, AtomicOrdering $success = SEQ_CONSISTENT, AtomicOrdering $failure = SEQ_CONSISTENT, bool $volatile = true, bool $weak = false, usz $alignment = 0)
macro compare_exchange_volatile(ptr, compare, value, AtomicOrdering $success = SEQ_CONSISTENT, AtomicOrdering $failure = SEQ_CONSISTENT)
fn usz aligned_offset(usz offset, usz alignment)
macro void* aligned_pointer(void* ptr, usz alignment)
fn bool ptr_is_aligned(void* ptr, usz alignment) @inline
fn bool ptr_is_page_aligned(void* ptr) @inline
macro void zero_volatile(char[] data)
macro void clear(void* dst, usz len, usz $dst_align = 0, bool $is_volatile = false)
macro void clear_inline(void* dst, usz $len, usz $dst_align = 0, bool $is_volatile = false)
macro void copy(void* dst, void* src, usz len, usz $dst_align = 0, usz $src_align = 0, bool $is_volatile = false)
macro void copy_inline(void* dst, void* src, usz $len, usz $dst_align = 0, usz $src_align = 0, bool $is_volatile = false)
macro void move(void* dst, void* src, usz len, usz $dst_align = 0, usz $src_align = 0, bool $is_volatile = false)
macro void set(void* dst, char val, usz len, usz $dst_align = 0, bool $is_volatile = false)
macro void set_inline(void* dst, char val, usz $len, usz $dst_align = 0, bool $is_volatile = false)
macro bool equals(a, b, isz len = -1, usz $align = 0)
macro bool type_alloc_must_be_aligned($Type)
macro void @scoped(Allocator allocator; @body())
macro void @report_heap_allocs_in_scope($enabled = true; @body())
macro void @assert_leak($report = true; @body()) @builtin
macro void @stack_mem(usz $size; @body(Allocator mem)) @builtin
macro void @stack_pool(usz $size; @body) @builtin
fn PoolState temp_push()
fn void temp_pop(PoolState old_state)
macro void @pool_init(Allocator allocator, usz pool_size,
usz reserve_size = allocator::temp_allocator_reserve_size,
usz min_size = allocator::temp_allocator_min_size,
usz realloc_size = allocator::temp_allocator_realloc_size; @body) @builtin
macro void @pool(usz reserve = 0; @body) @builtin
macro TrackingEnv* get_tracking_env()
macro @clone(value) @builtin @nodiscard
macro @clone_aligned(value) @builtin @nodiscard
macro @tclone(value) @builtin @nodiscard
fn void* malloc(usz size) @builtin @inline @nodiscard
fn void* malloc_aligned(usz size, usz alignment) @builtin @inline @nodiscard
fn void* tmalloc(usz size, usz alignment = 0) @builtin @inline @nodiscard
macro new($Type, ...) @nodiscard
macro new_with_padding($Type, usz padding, ...) @nodiscard
macro new_aligned($Type, ...) @nodiscard
macro alloc($Type) @nodiscard
macro alloc_with_padding($Type, usz padding) @nodiscard
macro alloc_aligned($Type) @nodiscard
macro tnew($Type, ...) @nodiscard
macro temp_with_padding($Type, usz padding, ...) @nodiscard
macro talloc($Type) @nodiscard
macro talloc_with_padding($Type, usz padding) @nodiscard
macro new_array($Type, usz elements) @nodiscard
macro new_array_aligned($Type, usz elements) @nodiscard
macro alloc_array($Type, usz elements) @nodiscard
macro alloc_array_aligned($Type, usz elements) @nodiscard
macro talloc_array($Type, usz elements) @nodiscard
macro temp_array($Type, usz elements) @nodiscard
fn void* calloc(usz size) @builtin @inline @nodiscard
fn void* calloc_aligned(usz size, usz alignment) @builtin @inline @nodiscard
fn void* tcalloc(usz size, usz alignment = 0) @builtin @inline @nodiscard
fn void* realloc(void *ptr, usz new_size) @builtin @inline @nodiscard
fn void* realloc_aligned(void *ptr, usz new_size, usz alignment) @builtin @inline @nodiscard
fn void free(void* ptr) @builtin @inline
fn void free_aligned(void* ptr) @builtin @inline
fn void* trealloc(void* ptr, usz size, usz alignment = mem::DEFAULT_MEM_ALIGNMENT) @builtin @inline @nodiscard
macro @unaligned_addr(#arg) @builtin
fn CInt __memcmp(void* s1, void* s2, usz n) @weak @export("memcmp")
fn void* __memset(void* str, CInt c, usz n) @weak @export("memset")
fn void* __memcpy(void* dst, void* src, usz n) @weak @export("memcpy")

std::core::mem::alignment { Type, ALIGNMENT }

Section titled “std::core::mem::alignment { Type, ALIGNMENT }”
typedef UnalignedRef = Type*
macro Type UnalignedRef.get(self)
macro Type UnalignedRef.set(&self, Type val)
struct ArenaAllocator (Allocator)
fn ArenaAllocator* ArenaAllocator.init(&self, char[] data)
fn void ArenaAllocator.clear(&self)
macro ArenaAllocator* wrap(char[] bytes)
fn usz ArenaAllocator.mark(&self)
fn void ArenaAllocator.reset(&self, usz mark)
fn void ArenaAllocator.release(&self, void* ptr, bool) @dynamic
fn void*? ArenaAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
fn void*? ArenaAllocator.resize(&self, void *old_pointer, usz size, usz alignment) @dynamic
struct BackedArenaAllocator (Allocator)
macro usz ExtraPage.pagesize(&self)
macro bool ExtraPage.is_aligned(&self)
fn BackedArenaAllocator*? new_backed_allocator(usz size, Allocator allocator)
fn void BackedArenaAllocator.destroy(&self)
fn usz BackedArenaAllocator.mark(&self)
fn void BackedArenaAllocator.release(&self, void* old_pointer, bool) @dynamic
fn void BackedArenaAllocator.reset(&self, usz mark)
fn void*? BackedArenaAllocator.resize(&self, void* pointer, usz size, usz alignment) @dynamic
fn void*? BackedArenaAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
struct DynamicArenaAllocator (Allocator)
fn void DynamicArenaAllocator.init(&self, Allocator allocator, usz page_size)
fn void DynamicArenaAllocator.free(&self)
fn void DynamicArenaAllocator.release(&self, void* ptr, bool) @dynamic
fn void*? DynamicArenaAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamic
fn void DynamicArenaAllocator.reset(&self)
fn void*? DynamicArenaAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
struct SimpleHeapAllocator (Allocator)
fn void SimpleHeapAllocator.init(&self, MemoryAllocFn allocator)
fn void*? SimpleHeapAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
fn void*? SimpleHeapAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamic
fn void SimpleHeapAllocator.release(&self, void* old_pointer, bool aligned) @dynamic
struct OnStackAllocator (Allocator)
fn void OnStackAllocator.init(&self, char[] data, Allocator allocator)
fn void OnStackAllocator.free(&self)
struct OnStackAllocatorHeader
fn void OnStackAllocator.release(&self, void* old_pointer, bool aligned) @dynamic
fn void*? OnStackAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamic
fn void*? OnStackAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
struct Allocation
alias AllocMap = HashMap { uptr, Allocation }
struct TrackingAllocator (Allocator)
fn void TrackingAllocator.init(&self, Allocator allocator)
fn void TrackingAllocator.free(&self)
fn usz TrackingAllocator.allocated(&self)
fn usz TrackingAllocator.total_allocated(&self)
fn usz TrackingAllocator.total_allocation_count(&self)
fn Allocation[] TrackingAllocator.allocations_tlist(&self, Allocator allocator)
fn usz TrackingAllocator.allocation_count(&self)
fn void*? TrackingAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
fn void*? TrackingAllocator.resize(&self, void* old_pointer, usz size, usz alignment) @dynamic
fn void TrackingAllocator.release(&self, void* old_pointer, bool is_aligned) @dynamic
fn void TrackingAllocator.clear(&self)
fn bool TrackingAllocator.has_leaks(&self)
fn void TrackingAllocator.print_report(&self)
fn void? TrackingAllocator.fprint_report(&self, OutStream out)
struct TrackingEnv
enum AllocInitType
alias MemoryAllocFn = fn char[]?(usz)
macro void* malloc(Allocator allocator, usz size) @nodiscard
macro void*? malloc_try(Allocator allocator, usz size) @nodiscard
macro void* calloc(Allocator allocator, usz size) @nodiscard
macro void*? calloc_try(Allocator allocator, usz size) @nodiscard
macro void* realloc(Allocator allocator, void* ptr, usz new_size) @nodiscard
macro void*? realloc_try(Allocator allocator, void* ptr, usz new_size) @nodiscard
macro void free(Allocator allocator, void* ptr)
macro void*? malloc_aligned(Allocator allocator, usz size, usz alignment) @nodiscard
macro void*? calloc_aligned(Allocator allocator, usz size, usz alignment) @nodiscard
macro void*? realloc_aligned(Allocator allocator, void* ptr, usz new_size, usz alignment) @nodiscard
macro void free_aligned(Allocator allocator, void* ptr)
macro new(Allocator allocator, $Type, ...) @nodiscard
macro new_try(Allocator allocator, $Type, ...) @nodiscard
macro new_aligned(Allocator allocator, $Type, ...) @nodiscard
macro new_with_padding(Allocator allocator, $Type, usz padding) @nodiscard
macro alloc(Allocator allocator, $Type) @nodiscard
macro alloc_try(Allocator allocator, $Type) @nodiscard
macro alloc_aligned(Allocator allocator, $Type) @nodiscard
macro alloc_with_padding(Allocator allocator, $Type, usz padding) @nodiscard
macro new_array(Allocator allocator, $Type, usz elements) @nodiscard
macro new_array_try(Allocator allocator, $Type, usz elements) @nodiscard
macro new_array_aligned(Allocator allocator, $Type, usz elements) @nodiscard
macro alloc_array(Allocator allocator, $Type, usz elements) @nodiscard
macro alloc_array_aligned(Allocator allocator, $Type, usz elements) @nodiscard
macro alloc_array_try(Allocator allocator, $Type, usz elements) @nodiscard
macro clone(Allocator allocator, value) @nodiscard
macro clone_aligned(Allocator allocator, value) @nodiscard
fn any clone_any(Allocator allocator, any value) @nodiscard
macro void*? @aligned_alloc(#alloc_fn, usz bytes, usz alignment)
struct AlignedBlock
macro void? @aligned_free(#free_fn, void* old_pointer)
macro void*? @aligned_realloc(#calloc_fn, #free_fn, void* old_pointer, usz bytes, usz alignment)
alias mem @builtin = thread_allocator
typedef PoolState = TempAllocator*
fn PoolState push_pool(usz reserve = 0)
fn void pop_pool(PoolState old)
macro Allocator heap() @deprecated("Use 'mem' instead.")
macro Allocator temp() @deprecated("Use 'tmem' instead")
alias tmem @builtin = current_temp
fn void destroy_temp_allocators()
fn void*? LazyTempAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamic
fn void*? LazyTempAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamic
fn void LazyTempAllocator.release(&self, void* old_ptr, bool aligned) @dynamic
typedef NullAllocator (Allocator) = uptr
fn void*? NullAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamic
fn void*? NullAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamic
fn void NullAllocator.release(&self, void* old_ptr, bool aligned) @dynamic
struct WasmMemory
fn char[]? WasmMemory.allocate_block(&self, usz bytes)

std::core::mem::allocator @if(!(env::POSIX || env::WIN32) || !$feature(VMEM_TEMP))

Section titled “std::core::mem::allocator @if(!(env::POSIX || env::WIN32) || !$feature(VMEM_TEMP))”
struct TempAllocator (Allocator)
struct TempAllocatorPage
macro usz TempAllocatorPage.pagesize(&self)
macro bool TempAllocatorPage.is_aligned(&self)
fn TempAllocator*? new_temp_allocator(Allocator allocator, usz size, usz reserve = temp_allocator_reserve_size, usz min_size = temp_allocator_min_size, usz realloc_size = temp_allocator_realloc_size)
fn TempAllocator*? TempAllocator.derive_allocator(&self, usz reserve = 0)
fn void TempAllocator.reset(&self)
fn void TempAllocator.free(&self)
fn void TempAllocator.release(&self, void* old_pointer, bool) @dynamic
fn void*? TempAllocator.resize(&self, void* pointer, usz size, usz alignment) @dynamic
fn void*? TempAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic

std::core::mem::allocator @if(!env::WIN32 && !env::POSIX && env::LIBC)

Section titled “std::core::mem::allocator @if(!env::WIN32 && !env::POSIX && env::LIBC)”
fn void*? LibcAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamic
fn void*? LibcAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamic
fn void LibcAllocator.release(&self, void* old_ptr, bool aligned) @dynamic

std::core::mem::allocator @if((env::POSIX || env::WIN32) && $feature(VMEM_TEMP))

Section titled “std::core::mem::allocator @if((env::POSIX || env::WIN32) && $feature(VMEM_TEMP))”
fn TempAllocator*? new_temp_allocator(Allocator allocator, usz size, usz reserve = temp_allocator_reserve_size, usz min_size = temp_allocator_min_size, usz realloc_size = temp_allocator_realloc_size)
struct TempAllocator (Allocator)
fn void*? TempAllocator.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
fn TempAllocator*? TempAllocator.derive_allocator(&self, usz reserve = 0)
fn void TempAllocator.reset(&self)
fn void TempAllocator.free(&self)
fn void*? TempAllocator.resize(&self, void* pointer, usz size, usz alignment) @dynamic
fn void TempAllocator.release(&self, void* old_pointer, bool b) @dynamic
typedef LibcAllocator (Allocator) = uptr

std::core::mem::allocator @if(env::POSIX || env::WIN32)

Section titled “std::core::mem::allocator @if(env::POSIX || env::WIN32)”
faultdef VMEM_RESERVE_FAILED
struct Vmem (Allocator)
bitstruct VmemOptions : int
fn void? Vmem.init(&self, usz preferred_size, usz reserve_page_size = 0, VmemOptions options = { true, true, env::COMPILER_SAFE_MODE }, usz min_size = 0)
fn void*? Vmem.acquire(&self, usz size, AllocInitType init_type, usz alignment) @dynamic
fn bool Vmem.owns_pointer(&self, void* ptr) @inline
fn void*? Vmem.resize(&self, void *old_pointer, usz size, usz alignment) @dynamic
fn void Vmem.release(&self, void* ptr, bool) @dynamic
fn usz Vmem.mark(&self)
fn void Vmem.reset(&self, usz mark)
fn void Vmem.free(&self)
fn void*? LibcAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamic
fn void*? LibcAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamic
fn void LibcAllocator.release(&self, void* old_ptr, bool aligned) @dynamic
fn void*? LibcAllocator.acquire(&self, usz bytes, AllocInitType init_type, usz alignment) @dynamic
fn void*? LibcAllocator.resize(&self, void* old_ptr, usz new_bytes, usz alignment) @dynamic
fn void LibcAllocator.release(&self, void* old_ptr, bool aligned) @dynamic
struct RefCounted
macro retain(refcounted)
macro void release(refcounted)
alias DeallocFn = fn void(void*)
fn Ref wrap(Type* ptr, Allocator allocator = mem)
macro Ref new(..., Allocator allocator = mem)
struct Ref
fn Ref* Ref.retain(&self)
fn void Ref.release(&self)
struct VirtualMemory
faultdef RANGE_OVERFLOW, UNKNOWN_ERROR, ACCESS_DENIED, UNMAPPED_ACCESS, UNALIGNED_ADDRESS, RELEASE_FAILED, UPDATE_FAILED, INVALID_ARGS
enum VirtualMemoryAccess
fn usz aligned_alloc_size(usz size)
fn void*? alloc(usz size, VirtualMemoryAccess access)
fn void? release(void* ptr, usz size)
fn void? protect(void* ptr, usz len, VirtualMemoryAccess access)
fn void? commit(void* ptr, usz len, VirtualMemoryAccess access = READWRITE)
fn void? decommit(void* ptr, usz len, bool block = true)
fn VirtualMemory? virtual_alloc(usz size, VirtualMemoryAccess access = PROTECTED)
macro void? VirtualMemory.commit(self, usz offset, usz len)
macro void? VirtualMemory.protect(self, usz offset, usz len, VirtualMemoryAccess access)
fn void? VirtualMemory.decommit(self, usz offset, usz len, bool block = true)
fn void? VirtualMemory.destroy(&self)
typedef Volatile @structlike = Type
macro Type Volatile.get(&self)
macro Type Volatile.set(&self, Type val)
struct ReflectedParam (Printable) @if(!$defined(ReflectedParam))
struct AnyRaw
struct SliceRaw
macro @enum_lookup($Type, #value, value)
macro @enum_lookup_new($Type, $name, value)
alias BenchmarkFn = fn void()
struct BenchmarkUnit
fn BenchmarkUnit[] benchmark_collection_create(Allocator allocator)
fn void set_benchmark_warmup_iterations(uint value) @builtin
fn void set_benchmark_max_iterations(uint value) @builtin
fn bool run_benchmarks(BenchmarkUnit[] benchmarks)
fn bool default_benchmark_runner(String[] args)
alias TestFn = fn void()
struct TestContext
struct TestUnit
fn TestUnit[] test_collection_create(Allocator allocator)
fn int cmp_test_unit(TestUnit a, TestUnit b)
fn bool default_test_runner(String[] args)
extern fn void __wasm_call_ctors()
macro void annotate_contiguous_container(void* beg, void* end, void* old_mid, void* new_mid)
macro void annotate_double_ended_contiguous_container(void* storage_beg, void* storage_end, void* old_container_beg, void* old_container_end, void* new_container_beg, void* new_container_end)
macro void print_stack_trace()
fn void set_death_callback(VoidFn callback)

std::core::sanitizer @if (env::ANY_SANITIZER)

Section titled “std::core::sanitizer @if (env::ANY_SANITIZER)”
struct __Sanitizer_sandbox_arguments
extern fn void __sanitizer_set_report_path(ZString path)
alias ErrorCallback = fn void (ZString)
macro poison_memory_region(void* addr, usz size)
macro unpoison_memory_region(void* addr, usz size)
macro bool address_is_poisoned(void* addr)
macro void* region_is_poisoned(void* beg, usz size)
fn void set_error_report_callback(ErrorCallback callback)

std::core::sanitizer::asan @if(env::ADDRESS_SANITIZER)

Section titled “std::core::sanitizer::asan @if(env::ADDRESS_SANITIZER)”
extern fn void __asan_poison_memory_region(void* addr, usz size)
typedef MutexFlags = inline CUInt
macro void mutex_create(void* addr, MutexFlags flags)
macro void mutex_destroy(void* addr, MutexFlags flags)
macro void mutex_pre_lock(void* addr, MutexFlags flags)
macro void mutex_post_lock(void* addr, MutexFlags flags, CInt recursion)
macro CInt mutex_pre_unlock(void* addr, MutexFlags flags)
macro void mutex_post_unlock(void* addr, MutexFlags flags)
macro void mutex_pre_signal(void* addr, MutexFlags flags)
macro void mutex_post_signal(void* addr, MutexFlags flags)
macro void mutex_pre_divert(void* addr, MutexFlags flags)
macro void mutex_post_divert(void* addr, MutexFlags flags)
typedef String @if(!$defined(String)) = inline char[]
typedef ZString = inline char*
typedef WString = inline Char16*
alias Char32 = uint
alias Char16 = ushort
faultdef INVALID_UTF8, INVALID_UTF16, CONVERSION_FAILED,
EMPTY_STRING, NEGATIVE_VALUE, MALFORMED_INTEGER,
INTEGER_OVERFLOW, MALFORMED_FLOAT, FLOAT_OUT_OF_RANGE
macro Char32* @wstring32(String $string) @builtin
macro Char32[] @char32(String $string) @builtin
macro WString @wstring(String $string) @builtin
macro Char16[] @char16(String $string) @builtin
macro String @sprintf(String $format, ...) @builtin @const
fn ZString tformat_zstr(String fmt, args...) @format(0)
fn String format(Allocator allocator, String fmt, args...) @format(1)
fn String bformat(char[] buffer, String fmt, args...) @format(1)
fn String tformat(String fmt, args...) @format(0)
macro bool char_in_set(char c, String set)
fn String join(Allocator allocator, String[] s, String joiner)
fn String String.replace(self, Allocator allocator, String needle, String new_str) @nodiscard
fn String String.treplace(self, String needle, String new_str)
fn String String.trim(self, String to_trim = "\t\n\r ")
fn String String.trim_left(self, String to_trim = "\t\n\r ")
fn String String.trim_right(self, String to_trim = "\t\n\r ")
fn bool String.starts_with(self, String prefix)
fn bool String.ends_with(self, String suffix)
fn String String.strip(self, String prefix)
fn String String.strip_end(self, String suffix)
fn String[] String.split(self, Allocator allocator, String delimiter, usz max = 0, bool skip_empty = false)
fn String[] String.tsplit(s, String delimiter, usz max = 0, bool skip_empty = false)
faultdef BUFFER_EXCEEDED
fn String[]? String.split_to_buffer(s, String delimiter, String[] buffer, usz max = 0, bool skip_empty = false)
fn bool String.contains(s, String substr)
fn usz String.count(self, String substr)
fn usz? String.index_of_char(self, char character)
fn usz? String.index_of_chars(String self, char[] characters)
fn usz? String.index_of_char_from(self, char character, usz start_index)
fn usz? String.rindex_of_char(self, char character)
fn usz? String.index_of(self, String substr)
fn usz? String.rindex_of(self, String substr)
fn bool ZString.eq(self, ZString other) @operator(==)
fn String ZString.str_view(self)
fn usz ZString.char_len(str)
fn usz ZString.len(self)
fn usz WString.len(self)
fn ZString String.zstr_copy(self, Allocator allocator)
fn String String.concat(self, Allocator allocator, String s2)
fn String String.tconcat(self, String s2)
fn ZString String.zstr_tcopy(self)
fn String String.copy(self, Allocator allocator)
fn void String.free(&self, Allocator allocator)
fn String String.tcopy(self)
fn String ZString.copy(self, Allocator allocator)
fn String ZString.tcopy(self)
fn Char16[]? String.to_utf16(self, Allocator allocator)
fn Char16[]? String.to_temp_utf16(self)
fn WString? String.to_wstring(self, Allocator allocator)
fn WString? String.to_temp_wstring(self)
fn Char32[]? String.to_utf32(self, Allocator allocator)
fn Char32[]? String.to_temp_utf32(self)
fn void String.convert_to_lower(self)
fn String String.to_lower_copy(self, Allocator allocator)
fn String String.to_lower_tcopy(self)
fn void String.convert_to_upper(self)
fn String String.to_upper_copy(self, Allocator allocator)
fn String String.capitalize_copy(self, Allocator allocator)
fn String String.snake_to_pascal_copy(self, Allocator allocator)
fn void String.convert_snake_to_pascal(&self)
fn String String.pascal_to_snake_copy(self, Allocator allocator)
fn StringIterator String.iterator(self)
fn String String.to_upper_tcopy(self)
fn String? from_utf32(Allocator allocator, Char32[] utf32)
fn String? from_utf16(Allocator allocator, Char16[] utf16)
fn String? from_wstring(Allocator allocator, WString wstring)
fn String? tfrom_wstring(WString wstring)
fn String? tfrom_utf16(Char16[] utf16)
fn usz String.utf8_codepoints(s)
fn bool String.is_zstr(self) @deprecated("Unsafe, use copy instead")
fn ZString String.quick_zstr(self) @deprecated("Unsafe, use zstr_tcopy instead")
macro String.to_integer(self, $Type, int base = 10)
fn int128? String.to_int128(self, int base = 10)
fn long? String.to_long(self, int base = 10)
fn int? String.to_int(self, int base = 10)
fn short? String.to_short(self, int base = 10)
fn ichar? String.to_ichar(self, int base = 10)
fn uint128? String.to_uint128(self, int base = 10)
fn ulong? String.to_ulong(self, int base = 10)
fn uint? String.to_uint(self, int base = 10)
fn ushort? String.to_ushort(self, int base = 10)
fn char? String.to_uchar(self, int base = 10)
fn double? String.to_double(self)
fn float? String.to_float(self)
fn Splitter String.tokenize(self, String split)
fn Splitter String.tokenize_all(self, String split, bool skip_last = false)
fn Splitter String.splitter(self, String split) @deprecated("Use tokenize_all instead")
macro String from_struct(Allocator allocator, x)
macro String tfrom_struct(x)
enum SplitterType
struct Splitter
fn void Splitter.reset(&self)
fn String? Splitter.next(&self)
faultdef INVALID_ESCAPE_SEQUENCE, UNTERMINATED_STRING, INVALID_HEX_ESCAPE, INVALID_UNICODE_ESCAPE
fn String String.escape(String s, Allocator allocator, bool strip_quotes = true)
fn String String.tescape(String s, bool strip_quotes = false)
fn usz escape_len(String s)
fn String? String.unescape(String s, Allocator allocator, bool allow_unquoted = false)
fn String? String.tunescape(String s, bool allow_unquoted = false)
fn bool needs_escape(char c)
macro double? decfloat(char[] chars, int $bits, int $emin, int sign)
macro double? hexfloat(char[] chars, int $bits, int $emin, int sign)
enum Ansi : const inline String
macro String color_8bit(char $index, bool $bg = false) @const
macro String color_rgb(char $r, char $g, char $b, bool $bg = false) @const
macro String color(uint $rgb, bool $bg = false) @const
fn String make_color(Allocator mem, uint rgb, bool bg = false)
fn String make_tcolor(uint rgb, bool bg = false)
fn String make_color_rgb(Allocator mem, char r, char g, char b, bool bg = false)
fn String make_tcolor_rgb(char r, char g, char b, bool bg = false)
fn usz? char32_to_utf8(Char32 c, char[] output)
fn void char32_to_utf16_unsafe(Char32 c, Char16** output)
fn void? char16_to_utf8_unsafe(Char16 *ptr, usz *available, char** output)
fn usz char32_to_utf8_unsafe(Char32 c, char** output)
fn Char32? utf8_to_char32(char* ptr, usz* size)
fn usz utf8_codepoints(String utf8)
fn usz utf8len_for_utf32(Char32[] utf32)
fn usz utf8len_for_utf16(Char16[] utf16)
fn usz utf16len_for_utf8(String utf8)
fn usz utf16len_for_utf32(Char32[] utf32)
fn usz? utf32to8(Char32[] utf32, char[] utf8_buffer)
fn usz? utf8to32(String utf8, Char32[] utf32_buffer)
fn void? utf16to8_unsafe(Char16[] utf16, char* utf8_buffer)
fn void? utf8to32_unsafe(String utf8, Char32* utf32_buffer)
fn void? utf8to16_unsafe(String utf8, Char16* utf16_buffer)
fn void utf32to8_unsafe(Char32[] utf32, char* utf8_buffer)
struct StringIterator
fn void StringIterator.reset(&self)
fn Char32? StringIterator.next(&self)
fn Char32? StringIterator.peek(&self)
fn bool StringIterator.has_next(&self)
fn Char32? StringIterator.get(&self)
macro @setup(TestFn setup_fn, TestFn teardown_fn = null)
macro @check(#condition, String format = "", args...)
macro @error(#funcresult, fault error_expected)
macro eq(left, right)
macro void eq_approx(double left, double right, uint places = 7, double delta = 0, bool equal_nan = true)
macro void ne(left, right)
macro gt(left, right)
macro ge(left, right)
macro lt(left, right)
macro le(left, right)
faultdef VALUE_OUT_OF_RANGE, VALUE_OUT_OF_UNSIGNED_RANGE
macro any_to_enum_ordinal(any v, $Type)
macro any_to_int(any v, $Type)
fn bool typeid.is_subtype_of(self, typeid other)
macro bool is_subtype_of($Type, $OtherType)
macro bool is_numerical($Type)
fn bool TypeKind.is_int(kind) @inline
macro bool is_slice_convertable($Type)
macro bool is_bool($Type) @const
macro bool is_int($Type) @const
macro bool is_signed($Type) @const
macro bool is_unsigned($Type) @const
macro typeid flat_type($Type) @const
macro TypeKind flat_kind($Type) @const
macro bool is_indexable($Type) @const
macro bool is_ref_indexable($Type) @const
macro bool is_flat_intlike($Type) @const
macro bool is_intlike($Type) @const
macro bool is_underlying_int($Type) @const
macro bool is_float($Type) @const
macro bool is_floatlike($Type) @const
macro bool is_vector($Type) @const
macro typeid inner_type($Type) @const
macro TypeKind inner_kind($Type) @const
macro bool is_same($TypeA, $TypeB) @const
macro bool @has_same(#a, #b, ...) @const
macro bool may_load_atomic($Type) @const
macro lower_to_atomic_compatible_type($Type) @const
macro bool is_promotable_to_floatlike($Type) @const
macro bool is_promotable_to_float($Type) @const
macro bool is_same_vector_type($Type1, $Type2) @const
macro bool is_equatable_type($Type) @const
macro bool implements_copy($Type) @const
macro bool @equatable_value(#value) @const
macro bool @comparable_value(#value) @const
enum TypeKind : char
struct TypeEnum
macro bool @is_same_type(#value1, #value2) @const
macro bool @is_bool(#value) @const
macro bool @is_int(#value) @const
macro bool @is_flat_intlike(#value) @const
macro bool @is_floatlike(#value) @const
macro bool @is_float(#value) @const
macro bool @is_promotable_to_floatlike(#value) @const
macro bool @is_promotable_to_float(#value) @const
macro bool @is_vector(#value) @const
macro bool @is_same_vector_type(#value1, #value2) @const
macro bool @assign_to(#value1, #value2) @const
macro bool @is_lvalue(#value)
macro bool @is_const(#foo) @const @builtin
macro promote_int(x)
macro @select(bool $bool, #value_1, #value_2) @builtin
macro promote_int_same(x, y)
macro TypeKind @inner_kind(#value) @const
fn bool safe_compare(void* data1, void* data2, usz len)
fn BigInt generate_secret(BigInt p, BigInt x, BigInt y)
fn BigInt public_key(BigInt p, BigInt g, BigInt x)
alias Ed25519PrivateKey = char[32]
alias Ed25519PublicKey = char[Ed25519PrivateKey.len]
alias Ed25519Signature = char[2 * Ed25519PublicKey.len]
fn Ed25519PublicKey public_keygen(char[] private_key)
fn Ed25519Signature sign(char[] message, char[] private_key, char[] public_key)
fn bool verify(char[] message, char[] signature, char[] public_key)
struct Rc4
fn void Rc4.init(&self, char[] key)
fn void crypt(char[] key, char[] data)
fn void Rc4.crypt(&self, char[] in, char[] out)
fn void Rc4.destroy(&self)
faultdef INVALID_CHARACTER, INVALID_PADDING
struct Base32Alphabet
fn String? encode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)
fn char[]? decode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)
fn String? tencode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inline
fn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD) @inline
fn usz decode_len(usz n, char padding)
fn usz encode_len(usz n, char padding)
fn char[]? decode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)
fn String encode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base32Alphabet* alphabet = &STANDARD)
typedef Alphabet = char[32]
struct Base64Alphabet
fn String encode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)
fn char[]? decode(Allocator allocator, char[] src, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)
fn String tencode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inline
fn char[]? tdecode(char[] code, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD) @inline
fn usz encode_len(usz n, char padding)
fn usz? decode_len(usz n, char padding)
fn String encode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)
fn char[]? decode_buffer(char[] src, char[] dst, char padding = DEFAULT_PAD, Base64Alphabet* alphabet = &STANDARD)
struct CsvReader
struct CsvRow (Printable)
fn usz? CsvRow.to_format(&self, Formatter* f) @dynamic
fn usz CsvRow.len(&self) @operator(len)
fn String CsvRow.get_col(&self, usz col) @operator([])
fn void CsvReader.init(&self, InStream stream, String separator = ",")
fn CsvRow? CsvReader.read_row(self, Allocator allocator)
fn CsvRow? CsvReader.tread_row(self)
fn void CsvRow.free(&self)
fn void? CsvReader.skip_row(self) @maydiscard
macro void? @each_row(InStream stream, String separator = ",", int max_rows = int.max; @body(String[] row)) @maydiscard
macro void? CsvReader.@each_row(self, int rows = int.max; @body(String[] row)) @maydiscard
fn String encode_buffer(char[] code, char[] buffer)
fn char[]? decode_buffer(char[] code, char[] buffer)
fn String encode(Allocator allocator, char[] code)
fn char[]? decode(Allocator allocator, char[] code)
fn String tencode(char[] code) @inline
fn char[]? tdecode(char[] code) @inline
fn usz encode_len(usz n)
fn usz encode_bytes(char[] src, char[] dst)
macro usz decode_len(usz n)
fn usz? decode_bytes(char[] src, char[] dst)
faultdef UNEXPECTED_CHARACTER, INVALID_ESCAPE_SEQUENCE, INVALID_NUMBER, MAX_DEPTH_REACHED
fn Object*? parse_string(Allocator allocator, String s)
fn Object*? tparse_string(String s)
fn Object*? parse(Allocator allocator, InStream s)
fn Object*? tparse(InStream s)
fn JsonTokenType? lex_string(JsonContext* context)
struct FrameScheduler
fn void FrameScheduler.init(&self)
macro void FrameScheduler.@destroy(&self; @destruct(Event e))
fn void FrameScheduler.queue_delayed_event(&self, Event event, Duration delay)
fn bool FrameScheduler.has_delayed(&self)
fn void FrameScheduler.queue_event(&self, Event event)
fn Event? FrameScheduler.pop_event(&self)
fn ulong hash(char[] data, ulong seed = 0)
struct Adler32
fn void Adler32.init(&self)
fn void Adler32.updatec(&self, char c)
fn void Adler32.update(&self, char[] data)
fn uint Adler32.final(&self)
fn uint hash(char[] data)
struct Crc32
fn void Crc32.init(&self, uint seed = 0)
fn void Crc32.updatec(&self, char c)
fn void Crc32.update(&self, char[] data)
fn uint Crc32.final(&self)
fn uint hash(char[] data)
struct Crc64
fn void Crc64.init(&self, uint seed = 0)
fn void Crc64.updatec(&self, char c)
fn void Crc64.update(&self, char[] data)
fn ulong Crc64.final(&self)
fn ulong hash(char[] data)
typedef Fnv32a = uint
fn void Fnv32a.init(&self)
fn void Fnv32a.update(&self, char[] data)
macro void Fnv32a.update_char(&self, char c)
fn uint hash(char[] data)
typedef Fnv64a = ulong
fn void Fnv64a.init(&self)
fn void Fnv64a.update(&self, char[] data)
macro void Fnv64a.update_char(&self, char c)
fn ulong hash(char[] data)

std::hash::hmac{HashAlg, HASH_BYTES, BLOCK_BYTES}

Section titled “std::hash::hmac{HashAlg, HASH_BYTES, BLOCK_BYTES}”
struct Hmac
fn char[HASH_BYTES] hash(char[] key, char[] message)
fn void pbkdf2(char[] pw, char[] salt, uint iterations, char[] output)
fn void Hmac.init(&self, char[] key)
fn void Hmac.update(&self, char[] data)
fn char[HASH_BYTES] Hmac.final(&self)
macro @derive(Hmac *hmac_start, char[] salt, uint iterations, usz index, char[] out)
fn ulong hash(char[] data, ulong seed = 0)
struct Md5
alias HmacMd5 = Hmac{Md5, HASH_BYTES, BLOCK_BYTES}
alias hmac = hmac::hash{Md5, HASH_BYTES, BLOCK_BYTES}
alias pbkdf2 = hmac::pbkdf2{Md5, HASH_BYTES, BLOCK_BYTES}
fn char[HASH_BYTES] hash(char[] data)
fn void Md5.init(&self)
fn void Md5.update(&ctx, char[] data)
fn char[HASH_BYTES] Md5.final(&ctx)
struct MetroHash128
fn uint128 hash(char[] data, ulong seed = 0)
fn void MetroHash128.init(&self, ulong seed = 0)
fn void MetroHash128.update(&self, char[] data)
fn uint128 MetroHash128.final(&self)
struct MetroHash64
fn ulong hash(char[] data, ulong seed = 0)
fn void MetroHash64.init(&self, ulong seed = 0)
fn void MetroHash64.update(&self, char[] data)
fn ulong MetroHash64.final(&self)
struct Sha1
alias HmacSha1 = Hmac{Sha1, HASH_BYTES, BLOCK_BYTES}
alias hmac = hmac::hash{Sha1, HASH_BYTES, BLOCK_BYTES}
alias pbkdf2 = hmac::pbkdf2{Sha1, HASH_BYTES, BLOCK_BYTES}
fn char[HASH_BYTES] hash(char[] data)
fn void Sha1.init(&self)
fn void Sha1.update(&self, char[] data)
fn char[HASH_BYTES] Sha1.final(&self)
struct Sha256
alias HmacSha256 = Hmac{Sha256, HASH_SIZE, BLOCK_SIZE}
alias hmac = hmac::hash{Sha256, HASH_SIZE, BLOCK_SIZE}
alias pbkdf2 = hmac::pbkdf2{Sha256, HASH_SIZE, BLOCK_SIZE}
fn char[HASH_SIZE] hash(char[] data)
fn void Sha256.init(&self)
fn void Sha256.update(&self, char[] data)
fn char[HASH_SIZE] Sha256.final(&self)
struct Sha512
alias HmacSha512 = Hmac{Sha512, HASH_SIZE, BLOCK_SIZE}
alias hmac = hmac::hash{Sha512, HASH_SIZE, BLOCK_SIZE}
alias pbkdf2 = hmac::pbkdf2{Sha512, HASH_SIZE, BLOCK_SIZE}
enum HashTruncationType : uint (uint truncation_width, ulong[8] initial_state)
fn char[HASH_SIZE] hash(char[] data)
fn void Sha512.init(&self)
fn void Sha512.update(&self, char[] data)
fn char[HASH_SIZE] Sha512.final(&self)

std::hash::siphash { OutType, BLOCK_ROUNDS, FINALIZE_ROUNDS }

Section titled “std::hash::siphash { OutType, BLOCK_ROUNDS, FINALIZE_ROUNDS }”
struct SipHash
fn OutType hash(char[] data, uint128 key)
fn void SipHash.init(&self, uint128 key)
fn void SipHash.update(&self, char[] data)
fn OutType SipHash.final(&self)
alias SipHash24 = SipHash { ulong, 2, 4 }
alias hash = siphash::hash { ulong, 2, 4 }
alias SipHash24_128 = SipHash { uint128, 2, 4 }
alias hash = siphash::hash { uint128, 2, 4 }
alias SipHash48 = SipHash { ulong, 4, 8 }
alias hash = siphash::hash { ulong, 4, 8 }
alias SipHash48_128 = SipHash { uint128, 4, 8 }
alias hash = siphash::hash { uint128, 4, 8 }
struct Whirlpool
alias HmacWhirlpool = Hmac { Whirlpool, HASH_SIZE, BLOCK_SIZE }
alias hmac = hmac::hash { Whirlpool, HASH_SIZE, BLOCK_SIZE }
alias pbkdf2 = hmac::pbkdf2 { Whirlpool, HASH_SIZE, BLOCK_SIZE }
fn char[HASH_SIZE] hash(char[] data)
macro void Whirlpool.init(&self)
fn void Whirlpool.update(&self, char[] data)
fn char[HASH_SIZE] Whirlpool.final(&self)
fn ulong wyr3(char* in, usz len) @inline
fn ulong hash(char[] input, ulong seed = 0)
struct BitReader
fn void BitReader.init(&self, InStream byte_reader)
fn void BitReader.clear(&self) @inline
fn char? BitReader.read_bits(&self, uint nbits)
struct BitWriter
fn void BitWriter.init(&self, OutStream byte_writer)
fn void? BitWriter.flush(&self)
fn void? BitWriter.write_bits(&self, uint bits, uint nbits)
struct File (InStream, OutStream)
faultdef BUFFER_EXCEEDED, INTERNAL_BUFFER_EXCEEDED, INVALID_FORMAT,
NOT_ENOUGH_ARGUMENTS, INVALID_ARGUMENT
alias OutputFn = fn void?(void* buffer, char c)
alias FloatType = double
macro bool is_struct_with_default_print($Type)
macro usz? struct_to_format(value, Formatter* f, bool $force_dump)
fn usz? ReflectedParam.to_format(&self, Formatter* f) @dynamic
fn usz? Formatter.printf(&self, String format, args...)
struct Formatter
bitstruct PrintFlags : uint
fn void Formatter.init(&self, OutputFn out_fn, void* data = null)
fn usz? Formatter.print_with_function(&self, Printable arg)
macro usz? @report_fault(Formatter* f, $fault)
macro usz? @wrap_bad(Formatter* f, #action)
fn usz? Formatter.vprintf(&self, String format, any[] anys)
fn usz? Formatter.print(&self, String str)
faultdef BAD_FORMAT
fn usz? print_hex_chars(Formatter* f, char[] out, bool uppercase) @inline
macro Formatter.first_err(&self, fault f)
fn usz? Formatter.pad(&self, char c, isz width, isz len) @inline
fn char* fmt_u(uint128 x, char* s)
fn usz? Formatter.out_chars(&self, char[] s)
enum FloatFormatting
fn usz? Formatter.etoa(&self, double y)
fn usz? Formatter.ftoa(&self, double y)
fn usz? Formatter.gtoa(&self, double y)
fn usz? Formatter.atoa(&self, double y)
enum Seek
faultdef
ALREADY_EXISTS,
BUSY,
CANNOT_READ_DIR,
DIR_NOT_EMPTY,
PARENT_DIR_MISSING,
EOF,
FILE_CANNOT_DELETE,
FILE_IS_DIR,
FILE_IS_PIPE,
FILE_NOT_DIR,
FILE_NOT_FOUND,
FILE_NOT_VALID,
GENERAL_ERROR,
ILLEGAL_ARGUMENT,
INCOMPLETE_WRITE,
INTERRUPTED,
INVALID_POSITION,
INVALID_PUSHBACK,
NAME_TOO_LONG,
NOT_SEEKABLE,
NO_PERMISSION,
OUT_OF_SPACE,
OVERFLOW,
READ_ONLY,
SYMLINK_FAILED,
TOO_MANY_DESCRIPTORS,
UNEXPECTED_EOF,
UNKNOWN_ERROR,
UNSUPPORTED_OPERATION,
WOULD_BLOCK
macro String? readline(Allocator allocator, stream = io::stdin())
macro String? treadline(stream = io::stdin())
macro usz? readline_to_stream(out_stream, in_stream = io::stdin())
macro usz? fprint(out, x)
fn usz? fprintf(OutStream out, String format, args...) @format(1)
fn usz? fprintfn(OutStream out, String format, args...) @format(1) @maydiscard
macro usz? fprintn(out, x = "")
macro void print(x)
macro void printn(x = "")
macro void eprint(x)
macro void eprintn(x)
fn usz? printf(String format, args...) @format(0) @maydiscard
fn usz? printfn(String format, args...) @format(0) @maydiscard
fn usz? eprintf(String format, args...) @maydiscard
fn usz? eprintfn(String format, args...) @maydiscard
fn char[]? bprintf(char[] buffer, String format, args...) @maydiscard
fn usz? available(InStream s)
macro bool @is_instream(#expr)
macro bool @is_outstream(#expr)
macro usz? read_any(stream, any ref)
macro usz? write_any(stream, any ref)
macro usz? read_all(stream, char[] buffer)
macro char[]? read_fully(Allocator allocator, stream)
macro usz? write_all(stream, char[] buffer)
macro usz? read_using_read_byte(s, char[] buffer)
macro void? write_byte_using_write(s, char c)
macro char? read_byte_using_read(s)
alias ReadByteFn = fn char?()
macro usz? write_using_write_byte(s, char[] bytes)
macro void? pushback_using_seek(s)
fn usz? copy_to(InStream in, OutStream dst, char[] buffer = {})
macro usz? read_varint(stream, x_ptr)
macro usz? write_varint(stream, x)
macro ushort? read_be_ushort(stream)
macro short? read_be_short(stream)
macro void? write_be_short(stream, ushort s)
macro uint? read_be_uint(stream)
macro int? read_be_int(stream)
macro void? write_be_int(stream, uint s)
macro ulong? read_be_ulong(stream)
macro long? read_be_long(stream)
macro void? write_be_long(stream, ulong s)
macro uint128? read_be_uint128(stream)
macro int128? read_be_int128(stream)
macro void? write_be_int128(stream, uint128 s)
macro usz? write_tiny_bytearray(stream, char[] data)
macro char[]? read_tiny_bytearray(stream, Allocator allocator)
macro usz? write_short_bytearray(stream, char[] data)
macro char[]? read_short_bytearray(stream, Allocator allocator)
fn ByteReader wrap_bytes(char[] bytes)
struct ReadBuffer (InStream)
fn ReadBuffer* ReadBuffer.init(&self, InStream wrapped_stream, char[] bytes)
fn String ReadBuffer.str_view(&self) @inline
fn void? ReadBuffer.close(&self) @dynamic
fn usz? ReadBuffer.read(&self, char[] bytes) @dynamic
fn char? ReadBuffer.read_byte(&self) @dynamic
struct WriteBuffer (OutStream)
fn WriteBuffer* WriteBuffer.init(&self, OutStream wrapped_stream, char[] bytes)
fn String WriteBuffer.str_view(&self) @inline
fn void? WriteBuffer.close(&self) @dynamic
fn void? WriteBuffer.flush(&self) @dynamic
fn usz? WriteBuffer.write(&self, char[] bytes) @dynamic
fn void? WriteBuffer.write_byte(&self, char c) @dynamic
struct ByteBuffer (InStream, OutStream)
fn ByteBuffer* ByteBuffer.init(&self, Allocator allocator, usz max_read, usz initial_capacity = 16)
fn ByteBuffer* ByteBuffer.tinit(&self, usz max_read, usz initial_capacity = 16)
fn ByteBuffer* ByteBuffer.init_with_buffer(&self, char[] buf)
fn void ByteBuffer.free(&self)
fn usz? ByteBuffer.write(&self, char[] bytes) @dynamic
fn void? ByteBuffer.write_byte(&self, char c) @dynamic
fn usz? ByteBuffer.read(&self, char[] bytes) @dynamic
fn char? ByteBuffer.read_byte(&self) @dynamic
fn void? ByteBuffer.pushback_byte(&self) @dynamic
fn usz? ByteBuffer.seek(&self, isz offset, Seek seek) @dynamic
fn usz? ByteBuffer.available(&self) @inline @dynamic
fn void ByteBuffer.grow(&self, usz n)
macro ByteBuffer.shrink(&self)
struct ByteReader (InStream)
fn usz ByteReader.len(&self) @dynamic
fn ByteReader* ByteReader.init(&self, char[] bytes)
fn usz? ByteReader.read(&self, char[] bytes) @dynamic
fn char? ByteReader.read_byte(&self) @dynamic
fn void? ByteReader.pushback_byte(&self) @dynamic
fn usz? ByteReader.seek(&self, isz offset, Seek seek) @dynamic
fn usz? ByteReader.write_to(&self, OutStream writer) @dynamic
fn usz? ByteReader.available(&self) @inline @dynamic
struct ByteWriter (OutStream)
fn ByteWriter* ByteWriter.init(&self, Allocator allocator)
fn ByteWriter* ByteWriter.tinit(&self)
fn ByteWriter* ByteWriter.init_with_buffer(&self, char[] data)
fn void? ByteWriter.destroy(&self) @dynamic
fn String ByteWriter.str_view(&self) @inline
fn void? ByteWriter.ensure_capacity(&self, usz len) @inline
fn usz? ByteWriter.write(&self, char[] bytes) @dynamic
fn void? ByteWriter.write_byte(&self, char c) @dynamic
fn usz? ByteWriter.read_from(&self, InStream reader) @dynamic
struct LimitReader (InStream)
fn LimitReader* LimitReader.init(&self, InStream wrapped_stream, usz limit)
fn void? LimitReader.close(&self) @dynamic
fn usz? LimitReader.read(&self, char[] bytes) @dynamic
fn char? LimitReader.read_byte(&self) @dynamic
fn usz? LimitReader.available(&self) @inline @dynamic
struct MultiReader (InStream)
fn MultiReader* MultiReader.init(&self, Allocator allocator, InStream... readers)
fn MultiReader* MultiReader.tinit(&self, InStream... readers)
fn void MultiReader.free(&self)
fn usz? MultiReader.read(&self, char[] bytes) @dynamic
fn char? MultiReader.read_byte(&self) @dynamic
struct MultiWriter (OutStream)
fn MultiWriter* MultiWriter.init(&self, Allocator allocator, OutStream... writers)
fn MultiWriter* MultiWriter.tinit(&self, OutStream... writers)
fn void MultiWriter.free(&self)
fn usz? MultiWriter.write(&self, char[] bytes) @dynamic
fn void? MultiWriter.write_byte(&self, char c) @dynamic
struct Scanner (InStream)
fn void Scanner.init(&self, InStream stream, char[] buffer)
fn char[] Scanner.flush(&self) @dynamic
fn void? Scanner.close(&self) @dynamic
fn char[]? Scanner.scan(&self, String pattern = "\n")
fn usz? Scanner.read(&self, char[] bytes) @dynamic
fn char? Scanner.read_byte(&self) @dynamic
struct TeeReader (InStream)
macro TeeReader tee_reader(InStream r, OutStream w)
fn TeeReader* TeeReader.init(&self, InStream r, OutStream w)
fn usz? TeeReader.read(&self, char[] bytes) @dynamic
fn char? TeeReader.read_byte(&self) @dynamic
fn void putchar(char c) @inline
fn File* stdout()
fn File* stderr()
fn File* stdin()
fn void putchar(char c) @inline
fn File* stdout()
fn File* stderr()
fn File* stdin()
fn File? open(String filename, String mode)
fn File? open_path(Path path, String mode)
fn bool exists(String file)
fn File from_handle(CFile file)
fn bool is_file(String path)
fn bool is_dir(String path)
fn usz? get_size(String path)
fn void? delete(String filename)
fn void? File.reopen(&self, String filename, String mode)
fn usz? File.seek(&self, isz offset, Seek seek_mode = Seek.SET) @dynamic
fn void? File.write_byte(&self, char c) @dynamic
fn void? File.close(&self) @inline @dynamic
fn bool File.eof(&self) @inline
fn usz? File.read(&self, char[] buffer) @dynamic
fn usz? File.write(&self, char[] buffer) @dynamic
fn Fd File.fd(self) @if(env::LIBC)
fn bool File.isatty(self) @if(env::LIBC)
fn char? File.read_byte(&self) @dynamic
fn char[]? load_buffer(String filename, char[] buffer)
fn char[]? load(Allocator allocator, String filename)
fn char[]? load_path(Allocator allocator, Path path)
fn char[]? load_temp(String filename)
fn char[]? load_path_temp(Path path)
fn void? save(String filename, char[] data)
fn void? File.flush(&self) @dynamic
macro void? native_chdir(Path path)
fn void? native_stat(Stat* stat, String path) @if(env::DARWIN || env::LINUX || env::ANDROID || env::BSD_FAMILY)
fn usz? native_file_size(String path) @if(env::WIN32)
fn usz? native_file_size(String path) @if(!env::WIN32 && !env::DARWIN)
fn usz? native_file_size(String path) @if(env::DARWIN)
fn bool native_file_or_dir_exists(String path)
fn bool native_is_file(String path)
fn bool native_is_dir(String path)
macro String? getcwd(Allocator allocator)
macro bool? native_mkdir(Path path, MkdirPermissions permissions)
macro bool? native_rmdir(Path path)
fn void*? native_fopen(String filename, String mode) @inline
fn void? native_remove(String filename)
fn void*? native_freopen(void* file, String filename, String mode) @inline
fn void? native_fseek(void* file, isz offset, Seek seek_mode) @inline
fn usz? native_ftell(CFile file) @inline
fn usz? native_fwrite(CFile file, char[] buffer) @inline
fn void? native_fputc(CInt c, CFile stream) @inline
fn usz? native_fread(CFile file, char[] buffer) @inline
fn Path? native_temp_directory(Allocator allocator) @if(!env::WIN32)
fn Path? native_temp_directory(Allocator allocator) @if(env::WIN32)
alias FopenFn = fn void*?(String, String)
alias FreopenFn = fn void*?(void*, String, String)
alias FcloseFn = fn void?(void*)
alias FseekFn = fn void?(void*, isz, Seek)
alias FtellFn = fn usz?(void*)
alias FwriteFn = fn usz?(void*, char[] buffer)
alias FreadFn = fn usz?(void*, char[] buffer)
alias RemoveFn = fn void?(String)
alias FputcFn = fn void?(int, void*)
fn @weak @if(!$defined(native_fopen_fn))
fn void? native_remove(String filename) @inline
fn void*? native_freopen(void* file, String filename, String mode) @inline
fn void? native_fseek(void* file, isz offset, Seek seek_mode) @inline
fn usz? native_ftell(CFile file) @inline
fn usz? native_fwrite(CFile file, char[] buffer) @inline
fn usz? native_fread(CFile file, char[] buffer) @inline
fn void? native_fputc(CInt c, CFile stream) @inline
macro Path? native_temp_directory(Allocator allocator)
fn PathList? native_ls(Path dir, bool no_dirs, bool no_symlinks, String mask, Allocator allocator)
fn void? native_rmtree(Path dir)
fn PathList? native_ls(Path dir, bool no_dirs, bool no_symlinks, String mask, Allocator allocator)
fn void? native_rmtree(Path path)
alias PathList = List { Path }
faultdef INVALID_PATH, NO_PARENT
alias Path = PathImp
struct PathImp (Printable)
enum PathEnv
fn Path? cwd(Allocator allocator)
fn bool is_dir(Path path)
fn bool is_file(Path path)
fn usz? file_size(Path path)
fn bool exists(Path path)
fn Path? tcwd()
macro void? chdir(path)
fn Path? temp_directory(Allocator allocator)
fn void? delete(Path path)
macro bool @is_pathlike(#path)
macro bool is_separator(char c, PathEnv path_env = DEFAULT_ENV)
macro bool is_posix_separator(char c)
macro bool is_win32_separator(char c)
fn PathList? ls(Allocator allocator, Path dir, bool no_dirs = false, bool no_symlinks = false, String mask = "")
enum MkdirPermissions
macro bool? mkdir(path, bool recursive = false, MkdirPermissions permissions = NORMAL)
macro bool? rmdir(path)
fn void? rmtree(Path path)
fn Path? new(Allocator allocator, String path, PathEnv path_env = DEFAULT_ENV)
fn Path? temp(String path, PathEnv path_env = DEFAULT_ENV)
fn Path? from_wstring(Allocator allocator, WString path)
fn Path? from_win32_wstring(Allocator allocator, WString path) @deprecated("Use 'from_wstring' instead")
fn Path? for_windows(Allocator allocator, String path)
fn Path? for_posix(Allocator allocator, String path)
fn bool Path.equals(self, Path p2) @operator(==)
fn Path? Path.append(self, Allocator allocator, String filename)
fn Path? Path.tappend(self, String filename)
fn bool? String.is_absolute_path(self)
fn bool? Path.is_absolute(self)
fn Path? String.to_absolute_path(self, Allocator allocator)
fn Path? Path.absolute(self, Allocator allocator)
fn String? String.file_basename(self, Allocator allocator)
fn String? String.file_tbasename(self)
fn String Path.basename(self)
fn String? String.path_tdirname(self)
fn String? String.path_dirname(self, Allocator allocator)
fn String Path.dirname(self)
fn bool Path.has_extension(self, String extension)
fn String? Path.extension(self)
fn String Path.volume_name(self)
fn Path? String.to_path(self, Allocator allocator)
fn Path? String.to_tpath(self)
fn Path? Path.parent(self)
fn String? normalize(String path_str, PathEnv path_env = DEFAULT_ENV)
fn ZString Path.as_zstr(self) @deprecated
fn String Path.root_directory(self)
alias PathWalker = fn bool? (Path, bool is_dir, void*)
fn bool? Path.walk(self, PathWalker w, void* data)
alias TraverseCallback = fn bool? (Path, bool is_dir, any data)
fn bool? traverse(Path path, TraverseCallback callback, any data)
fn String Path.str_view(self) @inline
fn bool Path.has_suffix(self, String str)
fn void Path.free(self)
fn usz? Path.to_format(&self, Formatter* formatter) @dynamic
macro bool is_reserved_win32_path_char(char c)
macro bool is_reserved_path_char(char c, PathEnv path_env = DEFAULT_ENV)
alias Complexf = Complex {float}
alias Complex = Complex {double}
alias COMPLEX_IDENTITY @builtin = complex::IDENTITY {double}
alias COMPLEXF_IDENTITY @builtin = complex::IDENTITY {float}
alias IMAGINARY @builtin @deprecated("Use I") = complex::IMAGINARY { double }
alias IMAGINARYF @builtin @deprecated("Use I_F") = complex::IMAGINARY { float }
alias I @builtin = complex::IMAGINARY { double }
alias I_F @builtin = complex::IMAGINARY { float }
enum RoundingMode : int
faultdef OVERFLOW, MATRIX_INVERSE_DOESNT_EXIST
macro deg_to_rad(x)
macro abs(x)
macro is_approx(x, y, eps)
macro is_approx_rel(x, y, eps)
macro sign(x)
macro atan2(x, y)
macro sincos_ref(x, sinp, cosp)
macro sincos(x)
macro atan(x)
macro atanh(x)
macro acos(x)
macro acosh(x)
macro asin(x)
macro asinh(x)
macro ceil(x)
macro @ceil($input) @const
macro clamp(x, lower, upper)
macro copysign(mag, sgn)
macro cos(x)
macro cosec(x)
macro cosech(x)
macro cosh(x)
macro cotan(x)
macro cotanh(x)
macro exp(x)
macro exp2(x)
macro floor(x)
macro fma(a, b, c)
macro hypot(x, y)
macro ln(x)
macro log(x, base)
macro log2(x)
macro log10(x)
macro max(x, y, ...)
macro min(x, y, ...)
macro muladd(a, b, c)
macro nearbyint(x)
macro pow(x, exp)
macro frexp(x, int* e)
macro int signbit(x)
macro rint(x)
macro round(x)
macro round_to_decimals(x, int decimal_places)
macro roundeven(x)
macro sec(x)
macro sech(x)
macro sin(x)
macro sinh(x)
macro sqr(x)
macro sqrt(x)
macro tan(x)
macro bool is_finite(x)
macro is_nan(x)
macro is_inf(x)
macro tanh(x)
macro trunc(x)
macro select(bool[<*>] mask, then_value, else_value)
macro float float.ceil(float x)
macro float float.clamp(float x, float lower, float upper)
macro float float.copysign(float mag, float sgn)
macro float float.floor(float x)
macro float float.fma(float a, float b, float c)
macro float float.muladd(float a, float b, float c)
macro float float.nearbyint(float x)
macro float float.pow(float x, exp)
macro float float.rint(float x)
macro float float.round(float x)
macro float float.roundeven(float x)
macro float float.trunc(float x)
macro float float[<*>].sum(float[<*>] x, float start = 0.0)
macro float float[<*>].product(float[<*>] x, float start = 1.0)
macro float float[<*>].max(float[<*>] x)
macro float float[<*>].min(float[<*>] x)
macro float[<*>] float[<*>].ceil(float[<*>] x)
macro float[<*>] float[<*>].clamp(float[<*>] x, float[<*>] lower, float[<*>] upper)
macro float[<*>] float[<*>].copysign(float[<*>] mag, float[<*>] sgn)
macro float[<*>] float[<*>].fma(float[<*>] a, float[<*>] b, float[<*>] c)
macro float[<*>] float[<*>].floor(float[<*>] x)
macro float[<*>] float[<*>].nearbyint(float[<*>] x)
macro float[<*>] float[<*>].pow(float[<*>] x, exp)
macro float[<*>] float[<*>].rint(float[<*>] x)
macro float[<*>] float[<*>].round(float[<*>] x)
macro float[<*>] float[<*>].roundeven(float[<*>] x)
macro float[<*>] float[<*>].trunc(float[<*>] x)
macro float float[<*>].dot(float[<*>] x, float[<*>] y)
macro float float[<*>].length(float[<*>] x)
macro float float[<*>].distance(float[<*>] x, float[<*>] y)
macro float[<*>] float[<*>].normalize(float[<*>] x)
macro float[<*>] float[<*>].lerp(float[<*>] x, float[<*>] y, float amount)
macro float[<*>] float[<*>].reflect(float[<*>] x, float[<*>] y)
macro bool float[<*>].equals(float[<*>] x, float[<*>] y)
macro bool[<*>] float[<*>].comp_lt(float[<*>] x, float[<*>] y)
macro bool[<*>] float[<*>].comp_le(float[<*>] x, float[<*>] y)
macro bool[<*>] float[<*>].comp_eq(float[<*>] x, float[<*>] y)
macro bool[<*>] float[<*>].comp_gt(float[<*>] x, float[<*>] y)
macro bool[<*>] float[<*>].comp_ge(float[<*>] x, float[<*>] y)
macro bool[<*>] float[<*>].comp_ne(float[<*>] x, float[<*>] y)
macro double double.ceil(double x)
macro double double.clamp(double x, double lower, double upper)
macro double double.copysign(double mag, double sgn)
macro double double.floor(double x)
macro double double.fma(double a, double b, double c)
macro double double.muladd(double a, double b, double c)
macro double double.nearbyint(double x)
macro double double.pow(double x, exp)
macro double double.rint(double x)
macro double double.round(double x)
macro double double.roundeven(double x)
macro double double.trunc(double x)
macro double double[<*>].sum(double[<*>] x, double start = 0.0)
macro double double[<*>].product(double[<*>] x, double start = 1.0)
macro double double[<*>].max(double[<*>] x)
macro double double[<*>].min(double[<*>] x)
macro double[<*>] double[<*>].ceil(double[<*>] x)
macro double[<*>] double[<*>].clamp(double[<*>] x, double[<*>] lower, double[<*>] upper)
macro double[<*>] double[<*>].copysign(double[<*>] mag, double[<*>] sgn)
macro double[<*>] double[<*>].floor(double[<*>] x)
macro double[<*>] double[<*>].fma(double[<*>] a, double[<*>] b, double[<*>] c)
macro double[<*>] double[<*>].nearbyint(double[<*>] x)
macro double[<*>] double[<*>].pow(double[<*>] x, exp)
macro double[<*>] double[<*>].rint(double[<*>] x)
macro double[<*>] double[<*>].round(double[<*>] x)
macro double[<*>] double[<*>].roundeven(double[<*>] x)
macro double[<*>] double[<*>].trunc(double[<*>] x)
macro double double[<*>].dot(double[<*>] x, double[<*>] y)
macro double double[<*>].length(double[<*>] x)
macro double double[<*>].distance(double[<*>] x, double[<*>] y)
macro double[<*>] double[<*>].normalize(double[<*>] x)
macro double[<*>] double[<*>].reflect(double[<*>] x, double[<*>] y)
macro double[<*>] double[<*>].lerp(double[<*>] x, double[<*>] y, double amount)
macro bool double[<*>].equals(double[<*>] x, double[<*>] y)
macro bool[<*>] double[<*>].comp_lt(double[<*>] x, double[<*>] y)
macro bool[<*>] double[<*>].comp_le(double[<*>] x, double[<*>] y)
macro bool[<*>] double[<*>].comp_eq(double[<*>] x, double[<*>] y)
macro bool[<*>] double[<*>].comp_gt(double[<*>] x, double[<*>] y)
macro bool[<*>] double[<*>].comp_ge(double[<*>] x, double[<*>] y)
macro bool[<*>] double[<*>].comp_ne(double[<*>] x, double[<*>] y)
macro bool[<*>] ichar[<*>].comp_lt(ichar[<*>] x, ichar[<*>] y)
macro bool[<*>] ichar[<*>].comp_le(ichar[<*>] x, ichar[<*>] y)
macro bool[<*>] ichar[<*>].comp_eq(ichar[<*>] x, ichar[<*>] y)
macro bool[<*>] ichar[<*>].comp_gt(ichar[<*>] x, ichar[<*>] y)
macro bool[<*>] ichar[<*>].comp_ge(ichar[<*>] x, ichar[<*>] y)
macro bool[<*>] ichar[<*>].comp_ne(ichar[<*>] x, ichar[<*>] y)
macro ichar ichar[<*>].sum(ichar[<*>] x)
macro ichar ichar[<*>].product(ichar[<*>] x)
macro ichar ichar[<*>].and(ichar[<*>] x)
macro ichar ichar[<*>].or(ichar[<*>] x)
macro ichar ichar[<*>].xor(ichar[<*>] x)
macro ichar ichar[<*>].max(ichar[<*>] x)
macro ichar ichar[<*>].min(ichar[<*>] x)
macro ichar ichar[<*>].dot(ichar[<*>] x, ichar[<*>] y)
macro bool[<*>] short[<*>].comp_lt(short[<*>] x, short[<*>] y)
macro bool[<*>] short[<*>].comp_le(short[<*>] x, short[<*>] y)
macro bool[<*>] short[<*>].comp_eq(short[<*>] x, short[<*>] y)
macro bool[<*>] short[<*>].comp_gt(short[<*>] x, short[<*>] y)
macro bool[<*>] short[<*>].comp_ge(short[<*>] x, short[<*>] y)
macro bool[<*>] short[<*>].comp_ne(short[<*>] x, short[<*>] y)
macro short short[<*>].sum(short[<*>] x)
macro short short[<*>].product(short[<*>] x)
macro short short[<*>].and(short[<*>] x)
macro short short[<*>].or(short[<*>] x)
macro short short[<*>].xor(short[<*>] x)
macro short short[<*>].max(short[<*>] x)
macro short short[<*>].min(short[<*>] x)
macro short short[<*>].dot(short[<*>] x, short[<*>] y)
macro bool[<*>] int[<*>].comp_lt(int[<*>] x, int[<*>] y)
macro bool[<*>] int[<*>].comp_le(int[<*>] x, int[<*>] y)
macro bool[<*>] int[<*>].comp_eq(int[<*>] x, int[<*>] y)
macro bool[<*>] int[<*>].comp_gt(int[<*>] x, int[<*>] y)
macro bool[<*>] int[<*>].comp_ge(int[<*>] x, int[<*>] y)
macro bool[<*>] int[<*>].comp_ne(int[<*>] x, int[<*>] y)
macro int int[<*>].sum(int[<*>] x)
macro int int[<*>].product(int[<*>] x)
macro int int[<*>].and(int[<*>] x)
macro int int[<*>].or(int[<*>] x)
macro int int[<*>].xor(int[<*>] x)
macro int int[<*>].max(int[<*>] x)
macro int int[<*>].min(int[<*>] x)
macro int int[<*>].dot(int[<*>] x, int[<*>] y)
macro bool[<*>] long[<*>].comp_lt(long[<*>] x, long[<*>] y)
macro bool[<*>] long[<*>].comp_le(long[<*>] x, long[<*>] y)
macro bool[<*>] long[<*>].comp_eq(long[<*>] x, long[<*>] y)
macro bool[<*>] long[<*>].comp_gt(long[<*>] x, long[<*>] y)
macro bool[<*>] long[<*>].comp_ge(long[<*>] x, long[<*>] y)
macro bool[<*>] long[<*>].comp_ne(long[<*>] x, long[<*>] y)
macro long long[<*>].sum(long[<*>] x)
macro long long[<*>].product(long[<*>] x)
macro long long[<*>].and(long[<*>] x)
macro long long[<*>].or(long[<*>] x)
macro long long[<*>].xor(long[<*>] x)
macro long long[<*>].max(long[<*>] x)
macro long long[<*>].min(long[<*>] x)
macro long long[<*>].dot(long[<*>] x, long[<*>] y)
macro bool[<*>] int128[<*>].comp_lt(int128[<*>] x, int128[<*>] y)
macro bool[<*>] int128[<*>].comp_le(int128[<*>] x, int128[<*>] y)
macro bool[<*>] int128[<*>].comp_eq(int128[<*>] x, int128[<*>] y)
macro bool[<*>] int128[<*>].comp_gt(int128[<*>] x, int128[<*>] y)
macro bool[<*>] int128[<*>].comp_ge(int128[<*>] x, int128[<*>] y)
macro bool[<*>] int128[<*>].comp_ne(int128[<*>] x, int128[<*>] y)
macro int128 int128[<*>].sum(int128[<*>] x)
macro int128 int128[<*>].product(int128[<*>] x)
macro int128 int128[<*>].and(int128[<*>] x)
macro int128 int128[<*>].or(int128[<*>] x)
macro int128 int128[<*>].xor(int128[<*>] x)
macro int128 int128[<*>].max(int128[<*>] x)
macro int128 int128[<*>].min(int128[<*>] x)
macro int128 int128[<*>].dot(int128[<*>] x, int128[<*>] y)
macro bool[<*>] bool[<*>].comp_lt(bool[<*>] x, bool[<*>] y)
macro bool[<*>] bool[<*>].comp_le(bool[<*>] x, bool[<*>] y)
macro bool[<*>] bool[<*>].comp_eq(bool[<*>] x, bool[<*>] y)
macro bool[<*>] bool[<*>].comp_gt(bool[<*>] x, bool[<*>] y)
macro bool[<*>] bool[<*>].comp_ge(bool[<*>] x, bool[<*>] y)
macro bool[<*>] bool[<*>].comp_ne(bool[<*>] x, bool[<*>] y)
macro bool bool[<*>].sum(bool[<*>] x)
macro bool bool[<*>].product(bool[<*>] x)
macro bool bool[<*>].and(bool[<*>] x)
macro bool bool[<*>].or(bool[<*>] x)
macro bool bool[<*>].xor(bool[<*>] x)
macro bool bool[<*>].max(bool[<*>] x)
macro bool bool[<*>].min(bool[<*>] x)
macro bool[<*>] char[<*>].comp_lt(char[<*>] x, char[<*>] y)
macro bool[<*>] char[<*>].comp_le(char[<*>] x, char[<*>] y)
macro bool[<*>] char[<*>].comp_eq(char[<*>] x, char[<*>] y)
macro bool[<*>] char[<*>].comp_gt(char[<*>] x, char[<*>] y)
macro bool[<*>] char[<*>].comp_ge(char[<*>] x, char[<*>] y)
macro bool[<*>] char[<*>].comp_ne(char[<*>] x, char[<*>] y)
macro char char[<*>].sum(char[<*>] x)
macro char char[<*>].product(char[<*>] x)
macro char char[<*>].and(char[<*>] x)
macro char char[<*>].or(char[<*>] x)
macro char char[<*>].xor(char[<*>] x)
macro char char[<*>].max(char[<*>] x)
macro char char[<*>].min(char[<*>] x)
macro char char[<*>].dot(char[<*>] x, char[<*>] y)
macro bool[<*>] ushort[<*>].comp_lt(ushort[<*>] x, ushort[<*>] y)
macro bool[<*>] ushort[<*>].comp_le(ushort[<*>] x, ushort[<*>] y)
macro bool[<*>] ushort[<*>].comp_eq(ushort[<*>] x, ushort[<*>] y)
macro bool[<*>] ushort[<*>].comp_gt(ushort[<*>] x, ushort[<*>] y)
macro bool[<*>] ushort[<*>].comp_ge(ushort[<*>] x, ushort[<*>] y)
macro bool[<*>] ushort[<*>].comp_ne(ushort[<*>] x, ushort[<*>] y)
macro ushort ushort[<*>].sum(ushort[<*>] x)
macro ushort ushort[<*>].product(ushort[<*>] x)
macro ushort ushort[<*>].and(ushort[<*>] x)
macro ushort ushort[<*>].or(ushort[<*>] x)
macro ushort ushort[<*>].xor(ushort[<*>] x)
macro ushort ushort[<*>].max(ushort[<*>] x)
macro ushort ushort[<*>].min(ushort[<*>] x)
macro ushort ushort[<*>].dot(ushort[<*>] x, ushort[<*>] y)
macro bool[<*>] uint[<*>].comp_lt(uint[<*>] x, uint[<*>] y)
macro bool[<*>] uint[<*>].comp_le(uint[<*>] x, uint[<*>] y)
macro bool[<*>] uint[<*>].comp_eq(uint[<*>] x, uint[<*>] y)
macro bool[<*>] uint[<*>].comp_gt(uint[<*>] x, uint[<*>] y)
macro bool[<*>] uint[<*>].comp_ge(uint[<*>] x, uint[<*>] y)
macro bool[<*>] uint[<*>].comp_ne(uint[<*>] x, uint[<*>] y)
macro uint uint[<*>].sum(uint[<*>] x)
macro uint uint[<*>].product(uint[<*>] x)
macro uint uint[<*>].and(uint[<*>] x)
macro uint uint[<*>].or(uint[<*>] x)
macro uint uint[<*>].xor(uint[<*>] x)
macro uint uint[<*>].max(uint[<*>] x)
macro uint uint[<*>].min(uint[<*>] x)
macro uint uint[<*>].dot(uint[<*>] x, uint[<*>] y)
macro bool[<*>] ulong[<*>].comp_lt(ulong[<*>] x, ulong[<*>] y)
macro bool[<*>] ulong[<*>].comp_le(ulong[<*>] x, ulong[<*>] y)
macro bool[<*>] ulong[<*>].comp_eq(ulong[<*>] x, ulong[<*>] y)
macro bool[<*>] ulong[<*>].comp_gt(ulong[<*>] x, ulong[<*>] y)
macro bool[<*>] ulong[<*>].comp_ge(ulong[<*>] x, ulong[<*>] y)
macro bool[<*>] ulong[<*>].comp_ne(ulong[<*>] x, ulong[<*>] y)
macro ulong ulong[<*>].sum(ulong[<*>] x)
macro ulong ulong[<*>].product(ulong[<*>] x)
macro ulong ulong[<*>].and(ulong[<*>] x)
macro ulong ulong[<*>].or(ulong[<*>] x)
macro ulong ulong[<*>].xor(ulong[<*>] x)
macro ulong ulong[<*>].max(ulong[<*>] x)
macro ulong ulong[<*>].min(ulong[<*>] x)
macro ulong ulong[<*>].dot(ulong[<*>] x, ulong[<*>] y)
macro bool[<*>] uint128[<*>].comp_lt(uint128[<*>] x, uint128[<*>] y)
macro bool[<*>] uint128[<*>].comp_le(uint128[<*>] x, uint128[<*>] y)
macro bool[<*>] uint128[<*>].comp_eq(uint128[<*>] x, uint128[<*>] y)
macro bool[<*>] uint128[<*>].comp_gt(uint128[<*>] x, uint128[<*>] y)
macro bool[<*>] uint128[<*>].comp_ge(uint128[<*>] x, uint128[<*>] y)
macro bool[<*>] uint128[<*>].comp_ne(uint128[<*>] x, uint128[<*>] y)
macro uint128 uint128[<*>].sum(uint128[<*>] x)
macro uint128 uint128[<*>].product(uint128[<*>] x)
macro uint128 uint128[<*>].and(uint128[<*>] x)
macro uint128 uint128[<*>].or(uint128[<*>] x)
macro uint128 uint128[<*>].xor(uint128[<*>] x)
macro uint128 uint128[<*>].max(uint128[<*>] x)
macro uint128 uint128[<*>].min(uint128[<*>] x)
macro uint128 uint128[<*>].dot(uint128[<*>] x, uint128[<*>] y)
macro char char.sat_add(char x, char y)
macro char char.sat_sub(char x, char y)
macro char char.sat_mul(char x, char y)
macro char char.sat_shl(char x, char y)
macro char? char.overflow_add(char x, char y)
macro char? char.overflow_sub(char x, char y)
macro char? char.overflow_mul(char x, char y)
macro ichar ichar.sat_add(ichar x, ichar y)
macro ichar ichar.sat_sub(ichar x, ichar y)
macro ichar ichar.sat_mul(ichar x, ichar y)
macro ichar ichar.sat_shl(ichar x, ichar y)
macro ichar? ichar.overflow_add(ichar x, ichar y)
macro ichar? ichar.overflow_sub(ichar x, ichar y)
macro ichar? ichar.overflow_mul(ichar x, ichar y)
macro ushort ushort.sat_add(ushort x, ushort y)
macro ushort ushort.sat_sub(ushort x, ushort y)
macro ushort ushort.sat_mul(ushort x, ushort y)
macro ushort ushort.sat_shl(ushort x, ushort y)
macro ushort? ushort.overflow_add(ushort x, ushort y)
macro ushort? ushort.overflow_sub(ushort x, ushort y)
macro ushort? ushort.overflow_mul(ushort x, ushort y)
macro short short.sat_add(short x, short y)
macro short short.sat_sub(short x, short y)
macro short short.sat_mul(short x, short y)
macro short short.sat_shl(short x, short y)
macro short? short.overflow_add(short x, short y)
macro short? short.overflow_sub(short x, short y)
macro short? short.overflow_mul(short x, short y)
macro uint uint.sat_add(uint x, uint y)
macro uint uint.sat_sub(uint x, uint y)
macro uint uint.sat_mul(uint x, uint y)
macro uint uint.sat_shl(uint x, uint y)
macro uint? uint.overflow_add(uint x, uint y)
macro uint? uint.overflow_sub(uint x, uint y)
macro uint? uint.overflow_mul(uint x, uint y)
macro int int.sat_add(int x, int y)
macro int int.sat_sub(int x, int y)
macro int int.sat_mul(int x, int y)
macro int int.sat_shl(int x, int y)
macro int? int.overflow_add(int x, int y)
macro int? int.overflow_sub(int x, int y)
macro int? int.overflow_mul(int x, int y)
macro ulong ulong.sat_add(ulong x, ulong y)
macro ulong ulong.sat_sub(ulong x, ulong y)
macro ulong ulong.sat_mul(ulong x, ulong y)
macro ulong ulong.sat_shl(ulong x, ulong y)
macro ulong? ulong.overflow_add(ulong x, ulong y)
macro ulong? ulong.overflow_sub(ulong x, ulong y)
macro ulong? ulong.overflow_mul(ulong x, ulong y)
macro long long.sat_add(long x, long y)
macro long long.sat_sub(long x, long y)
macro long long.sat_mul(long x, long y)
macro long long.sat_shl(long x, long y)
macro long? long.overflow_add(long x, long y)
macro long? long.overflow_sub(long x, long y)
macro long? long.overflow_mul(long x, long y)
macro uint128 uint128.sat_add(uint128 x, uint128 y)
macro uint128 uint128.sat_sub(uint128 x, uint128 y)
macro uint128 uint128.sat_mul(uint128 x, uint128 y)
macro uint128 uint128.sat_shl(uint128 x, uint128 y)
macro uint128? uint128.overflow_add(uint128 x, uint128 y)
macro uint128? uint128.overflow_sub(uint128 x, uint128 y)
macro uint128? uint128.overflow_mul(uint128 x, uint128 y)
macro int128 int128.sat_add(int128 x, int128 y)
macro int128 int128.sat_sub(int128 x, int128 y)
macro int128 int128.sat_mul(int128 x, int128 y)
macro int128 int128.sat_shl(int128 x, int128 y)
macro int128? int128.overflow_add(int128 x, int128 y)
macro int128? int128.overflow_sub(int128 x, int128 y)
macro int128? int128.overflow_mul(int128 x, int128 y)
macro bool is_odd(x)
macro bool is_even(x)
macro bool char.is_even(char x)
macro bool char.is_odd(char x)
macro bool ichar.is_even(ichar x)
macro bool ichar.is_odd(ichar x)
macro bool ushort.is_even(ushort x)
macro bool ushort.is_odd(ushort x)
macro bool short.is_even(short x)
macro bool short.is_odd(short x)
macro bool uint.is_even(uint x)
macro bool uint.is_odd(uint x)
macro bool int.is_even(int x)
macro bool int.is_odd(int x)
macro bool ulong.is_even(ulong x)
macro bool ulong.is_odd(ulong x)
macro bool long.is_even(long x)
macro bool long.is_odd(long x)
macro bool uint128.is_even(uint128 x)
macro bool uint128.is_odd(uint128 x)
macro bool int128.is_even(int128 x)
macro bool int128.is_odd(int128 x)
macro bool is_power_of_2(x)
macro next_power_of_2(x)
macro uint double.high_word(double d)
macro uint double.low_word(double d)
macro uint float.word(float d)
macro void double.set_high_word(double* d, uint u)
macro void double.set_low_word(double* d, uint u)
macro void float.set_word(float* f, uint u)
macro double scalbn(double x, int n)
extern fn double _atan(double x) @MathLibc("atan")
fn void _sincosf(float a, float* s, float* c) @extern("sincosf") @if(env::WIN32)
extern fn double _tan(double x) @MathLibc("tan")
fn float _frexpf(float x, int* e)
macro bool overflow_add(a, b, out)
macro bool overflow_sub(a, b, out)
macro bool overflow_mul(a, b, out)
macro iota($Type)
macro char char.muldiv(self, char mul, char div)
macro ichar ichar.muldiv(self, ichar mul, ichar div)
macro short short.muldiv(self, short mul, short div)
macro ushort ushort.muldiv(self, ushort mul, ushort div)
macro int int.muldiv(self, int mul, int div)
macro uint uint.muldiv(self, uint mul, uint div)
macro long long.muldiv(self, long mul, long div)
macro ulong ulong.muldiv(self, ulong mul, ulong div)
macro char[<*>] char[<*>].muldiv(self, mul, div)
macro ichar[<*>] ichar[<*>].muldiv(self, mul, div)
macro short[<*>] short[<*>].muldiv(self, mul, div)
macro ushort[<*>] ushort[<*>].muldiv(self, mul, div)
macro int[<*>] int[<*>].muldiv(self, mul, div)
macro uint[<*>] uint[<*>].muldiv(self, mul, div)
macro long[<*>] long[<*>].muldiv(self, mul, div)
macro ulong[<*>] ulong[<*>].muldiv(self, mul, div)
macro lcm(...)
macro gcd(...)
alias Matrix2f = Matrix2x2 {float}
alias Matrix2 = Matrix2x2 {double}
alias Matrix3f = Matrix3x3 {float}
alias Matrix3 = Matrix3x3 {double}
alias Matrix4f = Matrix4x4 {float}
alias Matrix4 = Matrix4x4 {double}
alias matrix4_ortho @builtin = matrix::ortho {double}
alias matrix4f_ortho @builtin = matrix::ortho {float}
alias matrix4_perspective @builtin = matrix::perspective {double}
alias matrix4f_perspective @builtin = matrix::perspective {float}
alias MATRIX2_IDENTITY @builtin = matrix::IDENTITY2 {double}
alias MATRIX2F_IDENTITY @builtin = matrix::IDENTITY2 {float}
alias MATRIX3_IDENTITY @builtin = matrix::IDENTITY3 {double}
alias MATRIX3F_IDENTITY @builtin = matrix::IDENTITY3 {float}
alias MATRIX4_IDENTITY @builtin = matrix::IDENTITY4 {double}
alias MATRIX4F_IDENTITY @builtin = matrix::IDENTITY4 {float}
alias Quaternionf = Quaternion {float}
alias Quaternion = Quaternion {double}
alias QUATERNION_IDENTITY @builtin = quaternion::IDENTITY {double}
alias QUATERNIONF_IDENTITY @builtin = quaternion::IDENTITY {float}
struct BigInt (Printable)
fn BigInt from_int(int128 val)
fn BigInt* BigInt.init(&self, int128 value)
fn BigInt* BigInt.init_with_u128(&self, uint128 value)
fn BigInt* BigInt.init_with_array(&self, uint[] values)
fn BigInt*? BigInt.init_string_radix(&self, String value, int radix)
fn bool BigInt.is_negative(&self)
fn BigInt BigInt.add(self, BigInt other) @operator(+)
fn void BigInt.add_this(&self, BigInt other) @operator(+=)
macro uint find_length(uint* data, uint length)
fn BigInt BigInt.mult(self, BigInt bi2) @operator(*)
fn void BigInt.mult_this(&self, BigInt bi2) @operator(*=)
fn void BigInt.negate(&self)
macro bool BigInt.is_zero(&self)
fn BigInt BigInt.sub(self, BigInt other) @operator(-)
fn BigInt* BigInt.sub_this(&self, BigInt other) @operator(-=)
fn int BigInt.bitcount(&self)
fn BigInt BigInt.unary_minus(&self) @operator(-)
macro BigInt BigInt.div(self, BigInt other) @operator(/)
fn void BigInt.div_this(&self, BigInt other) @operator(/=)
fn BigInt BigInt.mod(self, BigInt bi2) @operator(%)
fn void BigInt.mod_this(&self, BigInt bi2) @operator(%=)
fn void BigInt.bit_negate_this(&self)
fn BigInt BigInt.bit_negate(self) @operator(~)
fn BigInt BigInt.shr(self, int shift) @operator(>>)
fn void BigInt.shr_this(self, int shift) @operator(>>=)
fn BigInt BigInt.shl(self, int shift) @operator(<<)
macro bool BigInt.equals(&self, BigInt other) @operator(==)
macro bool BigInt.greater_than(&self, BigInt other)
macro bool BigInt.less_than(&self, BigInt other)
fn bool BigInt.is_odd(&self)
fn bool BigInt.is_one(&self)
macro bool BigInt.greater_or_equal(&self, BigInt other)
macro bool BigInt.less_or_equal(&self, BigInt)
fn BigInt BigInt.abs(&self)
fn usz? BigInt.to_format(&self, Formatter* format) @dynamic
fn String BigInt.to_string(&self, Allocator allocator) @dynamic
fn String BigInt.to_string_with_radix(&self, int radix, Allocator allocator)
fn BigInt BigInt.mod_pow(&self, BigInt exp, BigInt mod)
fn BigInt barrett_reduction(BigInt x, BigInt n, BigInt constant)
fn BigInt BigInt.sqrt(&self)
fn BigInt BigInt.bit_and(self, BigInt bi2) @operator(&)
fn void BigInt.bit_and_this(&self, BigInt bi2)
fn BigInt BigInt.bit_or(self, BigInt bi2) @operator(|)
fn void BigInt.bit_or_this(&self, BigInt bi2)
fn BigInt BigInt.bit_xor(self, BigInt bi2) @operator(^)
fn void BigInt.bit_xor_this(&self, BigInt bi2)
fn void BigInt.shl_this(&self, int shift) @operator(<<=)
fn BigInt BigInt.gcd(&self, BigInt other)
fn BigInt BigInt.lcm(&self, BigInt other)
fn void BigInt.randomize_bits(&self, Random random, int bits)
macro Complex Complex.add(self, Complex b) @operator(+)
macro Complex Complex.add_this(&self, Complex b) @operator(+=)
macro Complex Complex.add_real(self, Real r) @operator_s(+)
macro Complex Complex.add_each(self, Real b)
macro Complex Complex.sub(self, Complex b) @operator(-)
macro Complex Complex.sub_this(&self, Complex b) @operator(-=)
macro Complex Complex.sub_real(self, Real r) @operator(-)
macro Complex Complex.sub_real_inverse(self, Real r) @operator_r(-)
macro Complex Complex.sub_each(self, Real b)
macro Complex Complex.scale(self, Real r) @operator_s(*)
macro Complex Complex.mul(self, Complex b)@operator(*)
macro Complex Complex.div_real(self, Real r) @operator(/)
macro Complex Complex.div_real_inverse(Complex c, Real r) @operator_r(/)
macro Complex Complex.div(self, Complex b) @operator(/)
macro Complex Complex.inverse(self)
macro Complex Complex.conjugate(self)
macro Complex Complex.negate(self) @operator(-)
macro bool Complex.equals(self, Complex b) @operator(==)
macro bool Complex.equals_real(self, Real r) @operator_s(==)
macro bool Complex.not_equals(self, Complex b) @operator(!=)
fn usz? Complex.to_format(&self, Formatter* f) @dynamic
fn float linear_none(float t, float b, float c, float d) @inline
fn float linear_in(float t, float b, float c, float d) @inline
fn float linear_out(float t, float b, float c, float d) @inline
fn float linear_inout(float t, float b, float c, float d) @inline
fn float sine_in(float t, float b, float c, float d) @inline
fn float sine_out(float t, float b, float c, float d) @inline
fn float sine_inout(float t, float b, float c, float d) @inline
fn float circ_in(float t, float b, float c, float d) @inline
fn float circ_out(float t, float b, float c, float d) @inline
fn float circ_inout(float t, float b, float c, float d) @inline
fn float cubic_in(float t, float b, float c, float d) @inline
fn float cubic_out(float t, float b, float c, float d) @inline
fn float cubic_inout(float t, float b, float c, float d) @inline
fn float quad_in(float t, float b, float c, float d) @inline
fn float quad_out(float t, float b, float c, float d) @inline
fn float quad_inout(float t, float b, float c, float d) @inline
fn float expo_in(float t, float b, float c, float d) @inline
fn float expo_out(float t, float b, float c, float d) @inline
fn float expo_inout(float t, float b, float c, float d) @inline
fn float back_in(float t, float b, float c, float d, float s = 1.70158f) @inline
fn float back_out(float t, float b, float c, float d, float s = 1.70158f) @inline
fn float back_inout(float t, float b, float c, float d, float s = 1.70158f) @inline
fn float bounce_out(float t, float b, float c, float d) @inline
fn float bounce_in(float t, float b, float c, float d) @inline
fn float bounce_inout(float t, float b, float c, float d) @inline
fn float elastic_in(float t, float b, float c, float d) @inline
fn float elastic_out(float t, float b, float c, float d) @inline
fn float elastic_inout(float t, float b, float c, float d) @inline
fn int128 __divti3(int128 a, int128 b) @extern("__divti3") @weak @nostrip
macro uint128 @__udivmodti4(uint128 a, uint128 b, bool $return_rem)
fn uint128 __umodti3(uint128 n, uint128 d) @extern("__umodti3") @weak @nostrip
fn uint128 __udivti3(uint128 n, uint128 d) @extern("__udivti3") @weak @nostrip
fn int128 __modti3(int128 a, int128 b) @extern("__modti3") @weak @nostrip
fn uint128 __lshrti3(uint128 a, uint b) @extern("__lshrti3") @weak @nostrip
fn int128 __ashrti3(int128 a, uint b) @extern("__ashrti3") @weak @nostrip
fn int128 __ashlti3(int128 a, uint b) @extern("__ashlti3") @weak @nostrip
fn int128 __multi3(int128 a, int128 b) @extern("__multi3") @weak @nostrip
fn float __floattisf(int128 a) @extern("__floattisf") @weak @nostrip
fn double __floattidf(int128 a) @extern("__floattidf") @weak @nostrip
fn float __floatuntisf(uint128 a) @extern("__floatuntisf") @weak @nostrip
fn double __floatuntidf(uint128 a) @extern("__floatuntidf") @weak @nostrip
fn uint128 __fixunsdfti(double a) @weak @extern("__fixunsdfti") @nostrip
fn uint128 __fixunssfti(float a) @weak @extern("__fixunssfti") @nostrip
fn int128 __fixdfti(double a) @weak @extern("__fixdfti") @nostrip
fn int128 __fixsfti(float a) @weak @extern("__fixsfti") @nostrip
fn float __roundevenf(float f) @extern("roundevenf") @weak @nostrip
fn double __roundeven(double d) @extern("roundeven") @weak @nostrip
fn double __powidf2(double a, int b) @extern("__powidf2") @weak @nostrip
struct Matrix2x2
struct Matrix3x3
struct Matrix4x4
fn Real[<2>] Matrix2x2.apply(&self, Real[<2>] vec) @operator(*)
fn Real[<3>] Matrix3x3.apply(&self, Real[<3>] vec) @operator(*)
fn Real[<4>] Matrix4x4.apply(&self, Real[<4>] vec) @operator(*)
fn Matrix2x2 Matrix2x2.mul(&self, Matrix2x2 b) @operator(*)
fn Matrix3x3 Matrix3x3.mul(&self, Matrix3x3 b) @operator(*)
fn Matrix4x4 Matrix4x4.mul(Matrix4x4* self, Matrix4x4 b) @operator(*)
fn Matrix2x2 Matrix2x2.component_mul(&self, Real s)
fn Matrix3x3 Matrix3x3.component_mul(&self, Real s)
fn Matrix4x4 Matrix4x4.component_mul(&self, Real s)
fn Matrix2x2 Matrix2x2.add(&self, Matrix2x2 mat2) @operator(+)
fn Matrix3x3 Matrix3x3.add(&self, Matrix3x3 mat2) @operator(+)
fn Matrix4x4 Matrix4x4.add(&self, Matrix4x4 mat2) @operator(+)
fn Matrix2x2 Matrix2x2.sub(&self, Matrix2x2 mat2) @operator(-)
fn Matrix3x3 Matrix3x3.sub(&self, Matrix3x3 mat2) @operator(-)
fn Matrix4x4 Matrix4x4.sub(&self, Matrix4x4 mat2) @operator(-)
fn Matrix2x2 Matrix2x2.negate(&self) @operator(-)
fn Matrix3x3 Matrix3x3.negate(&self) @operator(-)
fn Matrix4x4 Matrix4x4.negate(&self) @operator(-)
fn bool Matrix2x2.eq(&self, Matrix2x2 mat2) @operator(==)
fn bool Matrix3x3.eq(&self, Matrix3x3 mat2) @operator(==)
fn bool Matrix4x4.eq(&self, Matrix4x4 mat2) @operator(==)
fn bool Matrix2x2.neq(&self, Matrix2x2 mat2) @operator(!=)
fn bool Matrix3x3.neq(&self, Matrix3x3 mat2) @operator(!=)
fn bool Matrix4x4.neq(&self, Matrix4x4 mat2) @operator(!=)
fn Matrix4x4 look_at(Real[<3>] eye, Real[<3>] target, Real[<3>] up)
fn Matrix2x2 Matrix2x2.transpose(&self)
fn Matrix3x3 Matrix3x3.transpose(&self)
fn Matrix4x4 Matrix4x4.transpose(&self)
fn Real Matrix2x2.determinant(&self)
fn Real Matrix3x3.determinant(&self)
fn Real Matrix4x4.determinant(&self)
fn Matrix2x2 Matrix2x2.adjoint(&self)
fn Matrix3x3 Matrix3x3.adjoint(&self)
fn Matrix4x4 Matrix4x4.adjoint(&self)
fn Matrix2x2? Matrix2x2.inverse(&self)
fn Matrix3x3? Matrix3x3.inverse(&self)
fn Matrix4x4? Matrix4x4.inverse(&self)
fn Matrix3x3 Matrix3x3.translate(&self, Real[<2>] v)
fn Matrix4x4 Matrix4x4.translate(&self, Real[<3>] v)
fn Matrix3x3 Matrix3x3.rotate(&self, Real r)
fn Matrix4x4 Matrix4x4.rotate_z(&self, Real r)
fn Matrix4x4 Matrix4x4.rotate_y(&self, Real r)
fn Matrix4x4 Matrix4x4.rotate_x(&self, Real r)
fn Matrix3x3 Matrix3x3.scale(&self, Real[<2>] v)
fn Real Matrix2x2.trace(&self)
fn Real Matrix3x3.trace(&self)
fn Real Matrix4x4.trace(&self)
fn Matrix4x4 Matrix4x4.scale(&self, Real[<3>] v)
fn Matrix4x4 ortho(Real left, Real right, Real top, Real bottom, Real near, Real far)
fn Matrix4x4 perspective(Real fov, Real aspect_ratio, Real near, Real far)

std::math::nolibc @if(env::NO_LIBC || $feature(C3_MATH))

Section titled “std::math::nolibc @if(env::NO_LIBC || $feature(C3_MATH))”
fn double __cos(double x, double y) @extern("__cos") @weak @nostrip
fn float __cosdf(double x) @extern("__cosdf") @weak @nostrip
fn double fmod(double x, double y) @extern("fmod") @weak @nostrip
fn float fmodf(float x, float y) @extern("fmodf") @weak @nostrip
fn double __sin(double x, double y, int iy) @extern("__sin") @weak @nostrip
fn float __sindf(double x) @extern("__sindf") @weak @nostrip
fn double __tan(double x, double y, int odd) @extern("__tan") @weak @nostrip
fn float __tandf(double x, int odd) @extern("__tandf") @weak @nostrip
fn double _acos(double x) @weak @extern("acos") @nostrip
fn float _acosf(float x) @weak @extern("acosf") @nostrip
fn double _asin(double x) @weak @extern("asin") @nostrip
fn float _asinf(float x) @weak @extern("asinf") @nostrip
fn double _atan(double x) @weak @extern("atan") @nostrip
fn float _atanf(float x) @weak @extern("atanf") @nostrip
fn double _atan2(double y, double x) @weak @extern("atan2") @nostrip
fn float _atan2f(float y, float x) @weak @extern("atan2f") @nostrip
fn double _atanh(double x) @weak @extern("atanh") @nostrip
fn float _atanhf(float x) @weak @extern("atanhf") @nostrip
fn double _ceil(double x) @weak @extern("ceil") @nostrip
fn float _ceilf(float x) @weak @extern("ceilf") @nostrip
fn float _cosf(float x) @extern("cosf") @weak @nostrip
fn double _cos(double x) @extern("cos") @weak @nostrip
fn double exp(double x) @extern("exp")
fn float expf(float x) @extern("expf")
fn float _exp2f(float x) @extern("exp2f") @weak @nostrip
fn double _exp2(double x) @extern("exp2") @weak @nostrip
fn double _fabs(double x) @weak @extern("fabs") @nostrip
fn float _fabsf(float x) @weak @extern("fabsf") @nostrip
fn double _floor(double x) @weak @extern("floor") @nostrip
fn float _floorf(float x) @weak @extern("floorf") @nostrip
fn double frexp(double x, int* exp) @extern("frexp")
fn float frexpf(float x, int* exp) @extern("frexpf")
fn double ldexp(double x, int exp) @extern("ldexp")
fn float ldexpf(float x, int exp) @extern("ldexpf")
fn double log(double x) @extern("log")
fn float logf(float x) @extern("logf")
fn double _log1p(double x) @weak @extern("log1p") @nostrip
fn float _log1pf(float x) @weak @extern("log1pf") @nostrip
macro float __math_uflowf(uint sign)
macro double __math_uflow(ulong sign)
macro float __math_oflowf(uint sign)
macro double __math_oflow(ulong sign)
macro __math_xflow(sign, v)
macro force_eval_add(x, v)
fn double pow(double x, double y) @extern("pow")
fn float powf(float x, float y) @extern("powf")
fn int __rem_pio2f(float x, double *y)
fn int __rem_pio2_large(double* x, double* y, int e0, int nx, int prec)
fn int __rem_pio2(double x, double *y)
fn double _round(double x) @extern("round") @weak @nostrip
fn float _roundf(float x) @extern("roundf") @weak @nostrip
fn double _scalbn(double x, int n) @weak @extern("scalbn") @nostrip
fn float _sinf(float x) @weak @extern("sinf") @nostrip
fn double sin(double x) @extern("sin") @weak @nostrip
fn void sincosf(float x, float *sin, float *cos) @extern("__sincosf") @weak @nostrip
fn void sincos(double x, double *sin, double *cos) @extern("__sincos") @weak @nostrip
fn double tan(double x) @extern("tan") @weak @nostrip
fn float tanf(float x) @extern("tanf") @weak @nostrip
fn double sincos_broken(double x) @extern("sincos") @weak @nostrip
fn double _trunc(double x) @weak @extern("trunc") @nostrip
fn float _truncf(float x) @weak @extern("truncf") @nostrip
macro Quaternion Quaternion.add(self, Quaternion b) @operator(+)
macro Quaternion Quaternion.add_each(self, Real b)
macro Quaternion Quaternion.sub(self, Quaternion b) @operator(-)
macro Quaternion Quaternion.negate(self) @operator(-)
macro Quaternion Quaternion.sub_each(self, Real b)
macro Quaternion Quaternion.scale(self, Real s) @operator_s(*)
macro Quaternion Quaternion.normalize(self)
macro Real Quaternion.length(self)
macro Quaternion Quaternion.lerp(self, Quaternion q2, Real amount)
macro Matrix4f Quaternion.to_matrixf(&self)
macro Matrix4 Quaternion.to_matrix(&self)
fn Quaternion Quaternion.nlerp(self, Quaternion q2, Real amount)
fn Quaternion Quaternion.invert(self)
fn Quaternion Quaternion.slerp(self, Quaternion q2, Real amount)
fn Quaternion Quaternion.mul(self, Quaternion b) @operator(*)
macro void seed(random, seed)
macro void seed_entropy(random)
macro int next(random, uint range)
macro int next_in_range(random, int min, int max)
alias DefaultRandom = Sfc64Random
fn void srand(ulong seed) @builtin
fn int rand(int range) @builtin
fn int rand_in_range(int min, int max) @builtin
fn double rnd() @builtin
macro bool next_bool(random)
macro float next_float(random)
macro double next_double(random)
macro bool is_random(random)
macro uint128 @long_to_int128(#function)
macro ulong @int_to_long(#function)
macro uint @short_to_int(#function)
macro ushort @char_to_short(#function)
macro @random_value_to_bytes(#function, char[] bytes)
typedef Lcg128Random (Random) = uint128
fn void Lcg128Random.set_seed(&self, char[] input) @dynamic
fn ulong Lcg128Random.next_long(&self) @dynamic
fn void Lcg128Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Lcg128Random.next_int128(&self) @dynamic
fn uint Lcg128Random.next_int(&self) @dynamic
fn ushort Lcg128Random.next_short(&self) @dynamic
fn char Lcg128Random.next_byte(&self) @dynamic
typedef Lcg64Random (Random) = ulong
fn void Lcg64Random.set_seed(&self, char[] seed) @dynamic
fn uint Lcg64Random.next_int(&self) @dynamic
fn void Lcg64Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Lcg64Random.next_int128(&self) @dynamic
fn ulong Lcg64Random.next_long(&self) @dynamic
fn ushort Lcg64Random.next_short(&self) @dynamic
fn char Lcg64Random.next_byte(&self) @dynamic
typedef Lcg32Random (Random) = uint
fn void Lcg32Random.set_seed(&self, char[] seed) @dynamic
fn ushort Lcg32Random.next_short(&self) @dynamic
fn void Lcg32Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Lcg32Random.next_int128(&self) @dynamic
fn ulong Lcg32Random.next_long(&self) @dynamic
fn uint Lcg32Random.next_int(&self) @dynamic
fn char Lcg32Random.next_byte(&self) @dynamic
typedef Lcg16Random (Random) = ushort
fn void Lcg16Random.set_seed(&self, char[] seed) @dynamic
fn char Lcg16Random.next_byte(&self) @dynamic
fn void Lcg16Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Lcg16Random.next_int128(&self) @dynamic
fn ulong Lcg16Random.next_long(&self) @dynamic
fn uint Lcg16Random.next_int(&self) @dynamic
fn ushort Lcg16Random.next_short(&self) @dynamic
typedef Mcg128Random (Random) = uint128
fn void Mcg128Random.set_seed(&self, char[] seed) @dynamic
fn void Mcg128Random.next_bytes(&self, char[] bytes) @dynamic
fn ulong Mcg128Random.next_long(&self) @dynamic
fn uint128 Mcg128Random.next_int128(&self) @dynamic
fn uint Mcg128Random.next_int(&self) @dynamic
fn ushort Mcg128Random.next_short(&self) @dynamic
fn char Mcg128Random.next_byte(&self) @dynamic
typedef Mcg64Random (Random) = ulong
fn void Mcg64Random.set_seed(&self, char[] seed) @dynamic
fn void Mcg64Random.next_bytes(&self, char[] bytes) @dynamic
fn uint Mcg64Random.next_int(&self) @dynamic
fn uint128 Mcg64Random.next_int128(&self) @dynamic
fn ulong Mcg64Random.next_long(&self) @dynamic
fn ushort Mcg64Random.next_short(&self) @dynamic
fn char Mcg64Random.next_byte(&self) @dynamic
typedef Mcg32Random (Random) = uint
fn void Mcg32Random.set_seed(&self, char[] seed) @dynamic
fn ushort Mcg32Random.next_short(&self) @dynamic
fn void Mcg32Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Mcg32Random.next_int128(&self) @dynamic
fn ulong Mcg32Random.next_long(&self) @dynamic
fn uint Mcg32Random.next_int(&self) @dynamic
fn char Mcg32Random.next_byte(&self) @dynamic
typedef Mcg16Random (Random) = ushort
fn void Mcg16Random.set_seed(&self, char[] seed) @dynamic
fn char Mcg16Random.next_byte(&self) @dynamic
fn void Mcg16Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Mcg16Random.next_int128(&self) @dynamic
fn ulong Mcg16Random.next_long(&self) @dynamic
fn uint Mcg16Random.next_int(&self) @dynamic
fn ushort Mcg16Random.next_short(&self) @dynamic
struct Msws128Random (Random)
fn void Msws128Random.set_seed(&self, char[] input) @dynamic
fn uint128 Msws128Random.next_int128(&self) @dynamic
fn void Msws128Random.next_bytes(&self, char[] bytes) @dynamic
fn ulong Msws128Random.next_long(&self) @dynamic
fn uint Msws128Random.next_int(&self) @dynamic
fn ushort Msws128Random.next_short(&self) @dynamic
fn char Msws128Random.next_byte(&self) @dynamic
struct Msws64Random (Random)
fn void Msws64Random.set_seed(&self, char[] input) @dynamic
fn ulong Msws64Random.next_long(&self) @dynamic
fn void Msws64Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Msws64Random.next_int128(&self) @dynamic
fn uint Msws64Random.next_int(&self) @dynamic
fn ushort Msws64Random.next_short(&self) @dynamic
fn char Msws64Random.next_byte(&self) @dynamic
struct Msws32Random (Random)
fn void Msws32Random.set_seed(&self, char[] input) @dynamic
fn uint Msws32Random.next_int(&self) @dynamic
fn void Msws32Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Msws32Random.next_int128(&self) @dynamic
fn ulong Msws32Random.next_long(&self) @dynamic
fn ushort Msws32Random.next_short(&self) @dynamic
fn char Msws32Random.next_byte(&self) @dynamic
struct Msws16Random (Random)
fn void Msws16Random.set_seed(&self, char[] input) @dynamic
fn ushort Msws16Random.next_short(&self) @dynamic
fn void Msws16Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Msws16Random.next_int128(&self) @dynamic
fn ulong Msws16Random.next_long(&self) @dynamic
fn uint Msws16Random.next_int(&self) @dynamic
fn char Msws16Random.next_byte(&self) @dynamic
struct Msws8Random (Random)
fn void Msws8Random.set_seed(&self, char[] input) @dynamic
fn char Msws8Random.next_byte(&self) @dynamic
fn void Msws8Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Msws8Random.next_int128(&self) @dynamic
fn ulong Msws8Random.next_long(&self) @dynamic
fn uint Msws8Random.next_int(&self) @dynamic
fn ushort Msws8Random.next_short(&self) @dynamic
typedef Pcg128Random (Random) = uint128
fn void Pcg128Random.set_seed(&self, char[] input) @dynamic
fn ulong Pcg128Random.next_long(&self) @dynamic
fn void Pcg128Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Pcg128Random.next_int128(&self) @dynamic
fn uint Pcg128Random.next_int(&self) @dynamic
fn ushort Pcg128Random.next_short(&self) @dynamic
fn char Pcg128Random.next_byte(&self) @dynamic
typedef Pcg64Random (Random) = ulong
fn void Pcg64Random.set_seed(&self, char[] input) @dynamic
fn uint Pcg64Random.next_int(&self) @dynamic
fn void Pcg64Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Pcg64Random.next_int128(&self) @dynamic
fn ulong Pcg64Random.next_long(&self) @dynamic
fn ushort Pcg64Random.next_short(&self) @dynamic
fn char Pcg64Random.next_byte(&self) @dynamic
typedef Pcg32Random (Random) = uint
fn void Pcg32Random.set_seed(&self, char[] input) @dynamic
fn ushort Pcg32Random.next_short(&self) @dynamic
fn void Pcg32Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Pcg32Random.next_int128(&self) @dynamic
fn ulong Pcg32Random.next_long(&self) @dynamic
fn uint Pcg32Random.next_int(&self) @dynamic
fn char Pcg32Random.next_byte(&self) @dynamic
typedef Pcg16Random (Random) = ushort
fn void Pcg16Random.set_seed(&self, char[] input) @dynamic
fn char Pcg16Random.next_byte(&self) @dynamic
fn void Pcg16Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Pcg16Random.next_int128(&self) @dynamic
fn ulong Pcg16Random.next_long(&self) @dynamic
fn uint Pcg16Random.next_int(&self) @dynamic
fn ushort Pcg16Random.next_short(&self) @dynamic
fn void seeder(char[] input, char[] out_buffer)
fn char[8 * 4] entropy() @if(!env::WASM_NOLIBC)
fn char[8 * 4] entropy() @if(env::WASM_NOLIBC)
typedef Sfc128Random (Random) = uint128[4]
fn void Sfc128Random.set_seed(&self, char[] input) @dynamic
fn uint128 Sfc128Random.next_int128(&self) @dynamic
fn void Sfc128Random.next_bytes(&self, char[] bytes) @dynamic
fn ulong Sfc128Random.next_long(&self) @dynamic
fn uint Sfc128Random.next_int(&self) @dynamic
fn ushort Sfc128Random.next_short(&self) @dynamic
fn char Sfc128Random.next_byte(&self) @dynamic
typedef Sfc64Random (Random) = ulong[4]
fn void Sfc64Random.set_seed(&self, char[] input) @dynamic
fn ulong Sfc64Random.next_long(&self) @dynamic
fn void Sfc64Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Sfc64Random.next_int128(&self) @dynamic
fn uint Sfc64Random.next_int(&self) @dynamic
fn ushort Sfc64Random.next_short(&self) @dynamic
fn char Sfc64Random.next_byte(&self) @dynamic
typedef Sfc32Random (Random) = uint[4]
fn void Sfc32Random.set_seed(&self, char[] input) @dynamic
fn uint Sfc32Random.next_int(&sfc) @dynamic
fn void Sfc32Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Sfc32Random.next_int128(&self) @dynamic
fn ulong Sfc32Random.next_long(&self) @dynamic
fn ushort Sfc32Random.next_short(&self) @dynamic
fn char Sfc32Random.next_byte(&self) @dynamic
typedef Sfc16Random (Random) = ushort[4]
fn void Sfc16Random.set_seed(&self, char[] input) @dynamic
fn ushort Sfc16Random.next_short(&seed) @dynamic
fn void Sfc16Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Sfc16Random.next_int128(&self) @dynamic
fn ulong Sfc16Random.next_long(&self) @dynamic
fn uint Sfc16Random.next_int(&self) @dynamic
fn char Sfc16Random.next_byte(&self) @dynamic
typedef Sfc8Random (Random) = char[4]
fn void Sfc8Random.set_seed(&self, char[] input) @dynamic
fn char Sfc8Random.next_byte(&self) @dynamic
fn void Sfc8Random.next_bytes(&self, char[] bytes) @dynamic
fn uint128 Sfc8Random.next_int128(&self) @dynamic
fn ulong Sfc8Random.next_long(&self) @dynamic
fn uint Sfc8Random.next_int(&self) @dynamic
fn ushort Sfc8Random.next_short(&self) @dynamic
typedef SimpleRandom (Random) = ulong
fn void SimpleRandom.set_seed(&self, char[] seed) @dynamic
fn uint SimpleRandom.next_int(&self) @dynamic
fn void SimpleRandom.next_bytes(&self, char[] bytes) @dynamic
fn uint128 SimpleRandom.next_int128(&self) @dynamic
fn ulong SimpleRandom.next_long(&self) @dynamic
fn ushort SimpleRandom.next_short(&self) @dynamic
fn char SimpleRandom.next_byte(&self) @dynamic
typedef Uuid (Printable) = char[16]
fn Uuid generate()
fn Uuid generate_from_random(Random random)
fn usz? Uuid.to_format(&self, Formatter* formatter) @dynamic
fn String Uuid.to_string(&self, Allocator allocator)
macro double[<*>].sq_magnitude(self)
macro float[<*>].sq_magnitude(self)
macro double[<*>].distance_sq(self, double[<*>] v2)
macro float[<*>].distance_sq(self, float[<*>] v2)
macro float[<2>].transform(self, Matrix4f mat)
macro float[<2>].rotate(self, float angle)
macro float[<2>].angle(self, float[<2>] v2)
macro double[<2>].transform(self, Matrix4 mat)
macro double[<2>].rotate(self, double angle)
macro double[<2>].angle(self, double[<2>] v2)
macro float[<*>].clamp_mag(self, float min, float max)
macro double[<*>].clamp_mag(self, double min, double max)
macro float[<*>].towards(self, float[<*>] target, float max_distance)
macro double[<*>].towards(self, double[<*>] target, double max_distance)
fn float[<3>] float[<3>].cross(self, float[<3>] v2)
fn double[<3>] double[<3>].cross(self, double[<3>] v2)
fn float[<3>] float[<3>].perpendicular(self)
fn double[<3>] double[<3>].perpendicular(self)
fn float[<3>] float[<3>].barycenter(self, float[<3>] a, float[<3>] b, float[<3>] c)
fn double[<3>] double[<3>].barycenter(self, double[<3>] a, double[<3>] b, double[<3>] c)
fn float[<3>] float[<3>].transform(self, Matrix4f mat)
fn double[<3>] double[<3>].transform(self, Matrix4 mat)
fn float float[<3>].angle(self, float[<3>] v2)
fn double double[<3>].angle(self, double[<3>] v2)
fn float[<3>] float[<3>].refract(self, float[<3>] n, float r)
fn double[<3>] double[<3>].refract(self, double[<3>] n, double r)
fn float[<3>] float[<3>].rotate_quat(self, Quaternionf q)
fn double[<3>] double[<3>].rotate_quat(self, Quaternion q)
fn float[<3>] float[<3>].rotate_axis(self, float[<3>] axis, float angle)
fn double[<3>] double[<3>].rotate_axis(self, double[<3>] axis, double angle)
fn float[<3>] float[<3>].unproject(self, Matrix4f projection, Matrix4f view)
fn double[<3>] double[<3>].unproject(self, Matrix4 projection, Matrix4 view)
fn void ortho_normalize(float[<3>]* v1, float[<3>]* v2)
fn void ortho_normalized(double[<3>]* v1, double[<3>]* v2)
enum IpProtocol : char (AIFamily ai_family)
struct InetAddress (Printable)
fn usz? InetAddress.to_format(InetAddress* addr, Formatter* formatter) @dynamic
fn String InetAddress.to_string(&self, Allocator allocator)
fn String InetAddress.to_tstring(&self)
fn InetAddress? ipv6_from_str(String s)
fn InetAddress? ipv4_from_str(String s)
fn bool InetAddress.is_loopback(InetAddress* addr)
fn bool InetAddress.is_any_local(InetAddress* addr)
fn bool InetAddress.is_link_local(InetAddress* addr)
fn bool InetAddress.is_site_local(InetAddress* addr)
fn bool InetAddress.is_multicast(InetAddress* addr)
fn bool InetAddress.is_multicast_global(InetAddress* addr)
fn bool InetAddress.is_multicast_node_local(InetAddress* addr)
fn bool InetAddress.is_multicast_site_local(InetAddress* addr)
fn bool InetAddress.is_multicast_org_local(InetAddress* addr)
fn bool InetAddress.is_multicast_link_local(InetAddress* addr)
fn AddrInfo*? addrinfo(String host, uint port, AIFamily ai_family, AISockType ai_socktype) @if(os::SUPPORTS_INET)
faultdef
INVALID_URL,
URL_TOO_LONG,
INVALID_SOCKET,
GENERAL_ERROR,
INVALID_IP_STRING,
ADDRINFO_FAILED,
CONNECT_FAILED,
LISTEN_FAILED,
ACCEPT_FAILED,
WRITE_FAILED,
READ_FAILED,
SOCKOPT_FAILED,
SOCKETS_NOT_INITIALIZED,
STILL_PROCESSING_CALLBACK,
BAD_SOCKET_DESCRIPTOR,
NOT_A_SOCKET,
CONNECTION_REFUSED,
CONNECTION_TIMED_OUT,
ADDRESS_IN_USE,
CONNECTION_ALREADY_IN_PROGRESS,
ALREADY_CONNECTED,
NETWORK_UNREACHABLE,
OPERATION_NOT_SUPPORTED_ON_SOCKET,
CONNECTION_RESET
fn uint? ipv4toint(String s)
fn String? int_to_ipv4(uint val, Allocator allocator)
struct Socket (InStream, OutStream)
macro void @loop_over_ai(AddrInfo* ai; @body(NativeSocket fd, AddrInfo* ai))
typedef PollSubscribes = ushort
typedef PollEvents = ushort
struct Poll
fn ulong? poll(Poll[] polls, Duration timeout)
fn ulong? poll_ms(Poll[] polls, long timeout_ms)
macro Socket new_socket(fd, ai)
enum SocketOption : char (CInt value)
fn bool? Socket.get_broadcast(&self)
fn bool? Socket.get_keepalive(&self)
fn bool? Socket.get_reuseaddr(&self)
fn bool? Socket.get_dontroute(&self)
fn bool? Socket.get_oobinline(&self)
fn void? Socket.set_broadcast(&self, bool value)
fn void? Socket.set_keepalive(&self, bool value)
fn void? Socket.set_reuseaddr(&self, bool value)
fn void? Socket.set_dontroute(&self, bool value)
fn void? Socket.set_oobinline(&self, bool value)
fn void? Socket.set_option(&self, SocketOption option, bool value)
fn bool? Socket.get_option(&self, SocketOption option)
fn usz? Socket.read(&self, char[] bytes) @dynamic
fn char? Socket.read_byte(&self) @dynamic
fn usz? Socket.write(&self, char[] bytes) @dynamic
fn void? Socket.write_byte(&self, char byte) @dynamic
fn void? Socket.destroy(&self) @dynamic
fn void? Socket.close(&self) @inline @dynamic
fn usz? Socket.peek(&self, char[] bytes) @dynamic
enum SocketShutdownHow : (CInt native_value)
fn void? Socket.shutdown(&self, SocketShutdownHow how)
fn bool last_error_is_delayed_connect()
typedef AIFamily = CInt
typedef AIProtocol = CInt
typedef AISockType = CInt
typedef AIFlags = CInt
alias Socklen_t @if(!env::WIN32) = CUInt
alias Socklen_t @if(env::WIN32) = usz
typedef SockAddrPtr = void*
struct AddrInfo
extern fn CInt getaddrinfo(ZString nodename, ZString servname, AddrInfo* hints, AddrInfo** res) @if(SUPPORTS_INET)

std::net::os @if(env::POSIX && SUPPORTS_INET)

Section titled “std::net::os @if(env::POSIX && SUPPORTS_INET)”
typedef NativeSocket = inline Fd
struct Posix_pollfd
alias Posix_nfds_t = CUInt
extern fn CInt connect(NativeSocket socket, SockAddrPtr address, Socklen_t address_len)
fn fault socket_error()
macro bool NativeSocket.is_valid(self)
macro void? NativeSocket.close(self)
macro void? NativeSocket.set_non_blocking(self, bool non_blocking)
macro bool NativeSocket.is_non_blocking(self)
typedef NativeSocket = inline Win32_SOCKET
extern fn CInt ioctlsocket(NativeSocket, CLong cmd, CULong *argp)
fn void? NativeSocket.set_non_blocking(self, bool non_blocking)
macro void? NativeSocket.close(self)
fn fault convert_error(WSAError error)
fn fault socket_error()
typedef TcpSocket = inline Socket
typedef TcpServerSocket = inline Socket
fn TcpSocket? connect(String host, uint port, Duration timeout = time::DURATION_ZERO, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)
fn TcpSocket? connect_async(String host, uint port, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)
fn TcpSocket? connect_to(AddrInfo* ai, SocketOption... options)
fn TcpSocket? connect_async_to(AddrInfo* ai, SocketOption... options)
fn TcpServerSocket? listen(String host, uint port, uint backlog, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)
fn TcpSocket? accept(TcpServerSocket* server_socket)
fn TcpServerSocket? listen_to(AddrInfo* ai, uint backlog, SocketOption... options)
typedef UdpSocket = inline Socket
fn UdpSocket? connect(String host, uint port, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)
fn UdpSocket? connect_to(AddrInfo* ai, SocketOption... options)
fn UdpSocket? connect_async(String host, uint port, SocketOption... options, IpProtocol ip_protocol = UNSPECIFIED)
fn UdpSocket? connect_async_to(AddrInfo* ai, SocketOption... options)
faultdef
EMPTY,
INVALID_SCHEME,
INVALID_USER,
INVALID_PASSWORD,
INVALID_HOST,
INVALID_PATH,
INVALID_FRAGMENT
struct Url(Printable)
fn Url? tparse(String url_string)
fn Url? parse(Allocator allocator, String url_string)
fn usz? Url.to_format(&self, Formatter* f) @dynamic
fn String Url.to_string(&self, Allocator allocator)
alias UrlQueryValueList = List{String}
struct UrlQueryValues
fn UrlQueryValues parse_query_to_temp(String query)
fn UrlQueryValues parse_query(Allocator allocator, String query)
fn UrlQueryValues* UrlQueryValues.add(&self, String key, String value)
fn usz? UrlQueryValues.to_format(&self, Formatter* f) @dynamic
fn void UrlQueryValues.free(&self)
fn void Url.free(&self)
enum UrlEncodingMode : char (String allowed)
faultdef INVALID_HEX
fn usz encode_len(String s, UrlEncodingMode mode) @inline
fn String encode(Allocator allocator, String s, UrlEncodingMode mode)
fn String tencode(String s, UrlEncodingMode mode)
fn usz? decode_len(String s, UrlEncodingMode mode) @inline
fn String? decode(Allocator allocator, String s, UrlEncodingMode mode)
fn String? tdecode(String s, UrlEncodingMode mode)
fn void exit(int result) @weak @noreturn
fn void fastexit(int result) @weak @noreturn
fn uint num_cpu()
fn uint num_cpu()
fn uint num_cpu()
enum LogPriority : (CInt val)
enum LogId : (CInt val)
struct LogMessage @packed
extern fn CInt log_write(LogPriority prio, ZString tag, ZString text) @extern("__android_log_write")
extern fn CInt log_buf_write(CInt bufID, CInt prio, ZString tag, ZString text) @extern("__android_log_buf_write")
faultdef SEGMENT_NOT_FOUND, EXECUTABLE_PATH_NOT_FOUND, IMAGE_NOT_FOUND, NO_BACKTRACE_SYMBOLS,
RESOLUTION_FAILED
struct Backtrace (Printable)
fn bool Backtrace.has_file(&self)
fn bool Backtrace.is_unknown(&self)
fn usz? Backtrace.to_format(&self, Formatter* formatter) @dynamic
fn void Backtrace.free(&self)
fn Backtrace* Backtrace.init(&self, Allocator allocator, uptr offset, String function, String object_file, String file = "", uint line = 0)
fn void*[] capture_current(void*[] buffer)
alias BacktraceList = List{Backtrace}
alias symbolize_backtrace @if(env::LINUX) = linux::symbolize_backtrace
alias symbolize_backtrace @if(env::WIN32) = win32::symbolize_backtrace
alias symbolize_backtrace @if(env::DARWIN) = darwin::symbolize_backtrace
alias symbolize_backtrace @if(env::OPENBSD) = openbsd::symbolize_backtrace
fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace) @if(!env::NATIVE_STACKTRACE)
extern fn CInt sysctl(CInt *name, CUInt namelen, void *oldp, usz *oldlenp, void *newp, usz newlen)
struct Darwin_segment_command_64
struct Darwin_mach_timebase_info
alias Darwin_mach_timebase_info_t = Darwin_mach_timebase_info
alias Darwin_mach_timebase_info_data_t = Darwin_mach_timebase_info
extern fn void mach_timebase_info(Darwin_mach_timebase_info_data_t* timebase)
fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)
extern fn usz malloc_size(void* ptr)

std::os::darwin::cocoa @if(env::OS_TYPE == MACOS) @link("Cocoa.framework")

Section titled “std::os::darwin::cocoa @if(env::OS_TYPE == MACOS) @link("Cocoa.framework")”
extern fn int nsApplicationMain(int argc, char **argv) @extern("NSApplicationMain")
fn String? get_var(Allocator allocator, String name)
fn String? tget_var(String name)
fn bool set_var(String name, String value, bool overwrite = true)
fn String? get_home_dir(Allocator allocator)
fn Path? get_config_dir(Allocator allocator)
fn bool clear_var(String name)
fn String? executable_path()
extern fn usz malloc_usable_size(void* ptr)
extern fn isz readlink(ZString path, char* buf, usz bufsize)
struct Elf32_Phdr
alias Elf64_Addr = ulong
alias Elf64_Half = ushort
alias Elf64_Off = ulong
alias Elf64_Word = uint
alias Elf64_Sword = int
alias Elf64_Sxword = long
alias Elf64_Lword = ulong
alias Elf64_Xword = ulong
struct Elf64_Ehdr
struct Elf64_Phdr
extern fn CInt dladdr(void* addr, Linux_Dl_info* info)
fn Backtrace? backtrace_line_parse(Allocator allocator, String string, String obj_name, String func_name, bool is_inlined)
fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)

std::os::macos::cf @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")

Section titled “std::os::macos::cf @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")”
typedef CFAllocatorRef = void*
typedef CFAllocatorContextRef = void*
alias CFOptionFlags = usz
macro CFAllocatorRef default_allocator()
macro void CFAllocatorRef.dealloc(CFAllocatorRef allocator, void* ptr)
macro void* CFAllocatorRef.alloc(CFAllocatorRef allocator, usz size)
macro usz CFAllocatorRef.get_preferred_size(CFAllocatorRef allocator, usz req_size)
macro void CFAllocatorRef.set_default(CFAllocatorRef allocator)
extern fn CFAllocatorRef macos_CFAllocatorCreate(CFAllocatorRef allocator, CFAllocatorContextRef context) @extern("CFAllocatorCreate") @builtin
typedef CFArrayRef = void*
typedef CFArrayCallBacksRef = void*
typedef CFMutableArrayRef = void*
extern fn CFArrayRef macos_CFArrayCreate(CFAllocatorRef allocator, void** values, CFIndex num_values, CFArrayCallBacksRef callBacks) @extern("CFArrayCreate") @builtin
typedef CFTypeRef = void*
alias CFIndex = isz
struct CFRange
extern fn CFTypeRef macos_CFRetain(CFTypeRef cf) @extern("CFRetain") @builtin

std::os::macos::objc @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")

Section titled “std::os::macos::objc @if(env::DARWIN) @link(env::DARWIN, "CoreFoundation.framework")”
typedef ObjcClass = void*
typedef ObjcMethod = void*
typedef ObjcIvar = void*
typedef ObjcSelector = void*
alias ObjcId = void*
alias SendVoid = fn void*(void*, ObjcSelector)
faultdef CLASS_NOT_FOUND, UNKNOWN_EVENT
macro ZString ObjcClass.name(ObjcClass cls)
macro ObjcClass ObjcClass.superclass(ObjcClass cls)
macro bool ObjcClass.responds_to(ObjcClass cls, ObjcSelector sel)
macro ObjcMethod ObjcClass.method(ObjcClass cls, ObjcSelector name)
macro bool ObjcSelector.equals(ObjcSelector a, ObjcSelector b)
macro bool ObjcClass.equals(ObjcClass a, ObjcClass b)
fn ObjcId alloc(ObjcClass cls)
fn void release(ObjcId id)
macro ObjcClass? class_by_name(ZString c)
macro ObjcClass[] class_get_list(Allocator allocator)
extern fn void msgSend(...) @extern("objc_msgSend") @builtin
extern fn ObjcClass getClass(ZString name) @extern("objc_getClass")
enum ApplicationActivationPolicy : (int val)
enum WindowStyleMask : (int val)
enum BackingStore : (int val)
enum EventType : (long val)
fn EventType? event_type_from(int val)
enum EventMask : (long val)
enum EventModifierFlag : (int val)
extern fn ZString* backtrace_symbols_fmt(void **addrlist, usz len, ZString fmt)
fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)
extern fn CInt clock_gettime(int type, TimeSpec *time)
alias Mode_t = uint
typedef DIRPtr = void*
struct Posix_dirent
extern fn int rmdir(ZString)
extern fn CLong sysconf(CInt name)
extern fn CInt posix_memalign(void **memptr, usz alignment, usz size)
extern fn void* mmap(void*, usz, CInt, CInt, CInt, Off_t)
struct Posix_spawn_file_actions_t
struct Posix_spawnattr_t
extern fn CInt posix_spawn_file_actions_init(Posix_spawn_file_actions_t *file_actions)
alias PosixThreadFn = fn void*(void*)
typedef Pthread_t = void*
extern fn CInt pthread_create(Pthread_t*, Pthread_attr_t*, PosixThreadFn, void*)

std::os::process @if(env::WIN32 || env::POSIX)

Section titled “std::os::process @if(env::WIN32 || env::POSIX)”
faultdef
FAILED_TO_CREATE_PIPE,
FAILED_TO_OPEN_STDIN,
FAILED_TO_OPEN_STDOUT,
FAILED_TO_OPEN_STDERR,
FAILED_TO_START_PROCESS,
FAILED_TO_INITIALIZE_ACTIONS,
PROCESS_JOIN_FAILED,
PROCESS_TERMINATION_FAILED,
READ_FAILED
struct SubProcess
bitstruct SubProcessOptions : int
fn SubProcess? create(String[] command_line, SubProcessOptions options = {}, String[] environment = {}) @if(env::WIN32)
fn String? execute_stdout_to_buffer(char[] buffer, String[] command_line, SubProcessOptions options = {}, String[] environment = {})
fn SubProcess? create(String[] command_line, SubProcessOptions options = {}, String[] environment = {}) @if(env::POSIX)
fn CInt? SubProcess.join(&self) @if(env::POSIX)
fn File SubProcess.stdout(&self)
fn File SubProcess.stderr(&self)
fn CInt? SubProcess.join(&self) @if(env::WIN32)
fn bool SubProcess.destroy(&self)
fn void? SubProcess.terminate(&self)
fn usz? SubProcess.read_stdout(&self, char* buffer, usz size)
fn usz? SubProcess.read_stderr(&self, char* buffer, usz size)
fn bool? SubProcess.is_running(&self)
alias Win32_BOOL = int
alias Win32_BOOLEAN = Win32_BYTE
alias Win32_BYTE = char
alias Win32_CCHAR = cinterop::CChar
alias Win32_CHAR = cinterop::CChar
alias Win32_COLORREF = Win32_DWORD
alias Win32_DWORD = uint
alias Win32_DWORDLONG = ulong
alias Win32_DWORD_PTR = Win32_ULONG_PTR
alias Win32_DWORD32 = uint
alias Win32_DWORD64 = ulong
alias Win32_FLOAT = float
alias Win32_HACCEL = Win32_HANDLE
alias Win32_HALF_PTR = int
alias Win32_HANDLE = Win32_PVOID
alias Win32_HBITMAP = Win32_HANDLE
alias Win32_HBRUSH = Win32_HANDLE
alias Win32_HCOLORSPACE = Win32_HANDLE
alias Win32_HCONV = Win32_HANDLE
alias Win32_HCONVLIST = Win32_HANDLE
alias Win32_HCURSOR = Win32_HICON
alias Win32_HDC = Win32_HANDLE
alias Win32_HDDEDATA = Win32_HANDLE
alias Win32_HDESK = Win32_HANDLE
alias Win32_HDROP = Win32_HANDLE
alias Win32_HDWP = Win32_HANDLE
alias Win32_HFILE = int
alias Win32_HFONT = Win32_HANDLE
alias Win32_HGDIOBJ = Win32_HANDLE
alias Win32_HGLOBAL = Win32_HANDLE
alias Win32_HHOOK = Win32_HANDLE
alias Win32_HICON = Win32_HANDLE
alias Win32_HINSTANCE = Win32_HANDLE
alias Win32_HKEY = Win32_HANDLE
alias Win32_HKL = Win32_HANDLE
alias Win32_HLOCAL = Win32_HANDLE
alias Win32_HMENU = Win32_HANDLE
alias Win32_HMETAFILE = Win32_HANDLE
alias Win32_HMODULE = Win32_HANDLE
alias Win32_HMONITOR = Win32_HANDLE
alias Win32_HPALETTE = Win32_HANDLE
alias Win32_HPEN = Win32_HANDLE
alias Win32_HRESULT = Win32_LONG
alias Win32_HRGN = Win32_HANDLE
alias Win32_HRSRC = Win32_HANDLE
alias Win32_HSZ = Win32_HANDLE
alias Win32_HWINSTA = Win32_HANDLE
alias Win32_HWND = Win32_HANDLE
alias Win32_INT = int
alias Win32_INT_PTR = iptr
alias Win32_INT8 = ichar
alias Win32_INT16 = short
alias Win32_INT32 = int
alias Win32_INT64 = long
alias Win32_LANGID = Win32_WORD
alias Win32_LCID = Win32_DWORD
alias Win32_LCTYPE = Win32_DWORD
alias Win32_LGRPID = Win32_DWORD
alias Win32_LONG = int
alias Win32_LONGLONG = long
alias Win32_LONG_PTR = iptr
alias Win32_LONG32 = int
alias Win32_LONG64 = long
alias Win32_LPARAM = Win32_LONG_PTR
alias Win32_LPBOOL = Win32_BOOL*
alias Win32_LPBYTE = Win32_BYTE*
alias Win32_LPCOLORREF = Win32_DWORD*
alias Win32_LPCSTR = Win32_CCHAR*
alias Win32_LPCTSTR = Win32_LPCWSTR
alias Win32_LPCVOID = void*
alias Win32_LPCWSTR = Win32_WCHAR*
alias Win32_LPDWORD = Win32_DWORD*
alias Win32_LPHANDLE = Win32_HANDLE*
alias Win32_LPINT = int*
alias Win32_LPLONG = int*
alias Win32_LPSTR = Win32_CCHAR*
alias Win32_LPTSTR = Win32_LPWSTR
alias Win32_LPVOID = void*
alias Win32_LPWORD = Win32_WORD*
alias Win32_LPWSTR = Win32_WCHAR*
alias Win32_LRESULT = Win32_LONG_PTR
alias Win32_NTSTATUS = Win32_LONG
alias Win32_PBOOL = Win32_BOOL*
alias Win32_PBOOLEAN = Win32_BOOLEAN*
alias Win32_PBYTE = Win32_BYTE*
alias Win32_PCHAR = Win32_CHAR*
alias Win32_PCSTR = Win32_CHAR*
alias Win32_PCTSTR = Win32_LPCWSTR
alias Win32_PCUNICODE_STRING = Win32_UNICODE_STRING*
alias Win32_PCWSTR = WString
alias Win32_PDWORD = Win32_DWORD*
alias Win32_PDWORDLONG = Win32_DWORDLONG*
alias Win32_PDWORDPTR = Win32_DWORD_PTR*
alias Win32_PDWORD32 = Win32_DWORD32*
alias Win32_PDWORD64 = Win32_DWORD64*
alias Win32_PFLOAT = Win32_FLOAT*
alias Win32_PHALFPTR = Win32_HALF_PTR*
alias Win32_PHANDLE = Win32_HANDLE*
alias Win32_PHKEY = Win32_HKEY*
alias Win32_PINT = int*
alias Win32_PINTPTR = Win32_INT_PTR*
alias Win32_PINT8 = Win32_INT8*
alias Win32_PINT16 = Win32_INT16*
alias Win32_PINT32 = Win32_INT32*
alias Win32_PINT64 = Win32_INT64*
alias Win32_PLCID = Win32_PDWORD
alias Win32_PLONG = Win32_LONG*
alias Win32_PLONGLONG = Win32_LONGLONG*
alias Win32_PLONG_PTR = Win32_LONG_PTR*
alias Win32_PLONG32 = Win32_LONG32*
alias Win32_PLONG64 = Win32_LONG64*
alias Win32_POINTER_32 = uint
alias Win32_POINTER_64 = uptr
alias Win32_POINTER_SIGNED = iptr
alias Win32_POINTER_UNSIGNED = uptr
alias Win32_PSHORT = Win32_SHORT*
alias Win32_PSIZE_T = usz*
alias Win32_PSSIZE_T = isz*
alias Win32_PSTR = Win32_CHAR*
alias Win32_PTBYTE = Win32_TBYTE*
alias Win32_PTCHAR = Win32_TCHAR*
alias Win32_PTSTR = Win32_LPWSTR
alias Win32_PUCHAR = Win32_UCHAR*
alias Win32_PUHALFPTR = Win32_UHALF_PTR*
alias Win32_PUINT = Win32_UINT*
alias Win32_PUINTPTR = Win32_UINT_PTR*
alias Win32_PUINT8 = Win32_UINT8*
alias Win32_PUINT16 = Win32_UINT16*
alias Win32_PUINT32 = Win32_UINT32*
alias Win32_PUINT64 = Win32_UINT64*
alias Win32_PULONG = Win32_ULONG*
alias Win32_PULONGLONG = Win32_ULONGLONG*
alias Win32_PULONG_PTR = Win32_ULONG_PTR*
alias Win32_PULONG32 = Win32_ULONG32*
alias Win32_PULONG64 = Win32_ULONG64*
alias Win32_PUNICODE_STRING = Win32_UNICODE_STRING*
alias Win32_PUSHORT = Win32_USHORT*
alias Win32_PVOID = void*
alias Win32_PWCHAR = Win32_WCHAR*
alias Win32_PWORD = Win32_WORD*
alias Win32_PWSTR = Win32_WCHAR*
alias Win32_QWORD = ulong
alias Win32_SC_HANDLE = Win32_HANDLE
alias Win32_SC_LOCK = Win32_LPVOID
alias Win32_SERVICE_STATUS_HANDLE = Win32_HANDLE
alias Win32_SHORT = short
alias Win32_SIZE_T = usz
alias Win32_SOCKET = Win32_HANDLE
alias Win32_SSIZE_T = isz
alias Win32_TBYTE = Win32_WCHAR
alias Win32_TCHAR = Win32_WCHAR
alias Win32_UCHAR = char
alias Win32_UHALF_PTR = uint
alias Win32_UINT = uint
alias Win32_UINT_PTR = uptr
alias Win32_UINT8 = char
alias Win32_UINT16 = ushort
alias Win32_UINT32 = uint
alias Win32_UINT64 = ulong
alias Win32_ULONG = uint
alias Win32_ULONGLONG = ulong
alias Win32_ULONG_PTR = ulong
alias Win32_ULONG32 = uint
alias Win32_ULONG64 = ulong
alias Win32_USHORT = ushort
alias Win32_USN = Win32_LONGLONG
alias Win32_WCHAR = Char16
alias Win32_WORD = ushort
alias Win32_WPARAM = Win32_UINT_PTR
struct Win32_UNICODE_STRING
typedef Win32_CRITICAL_SECTION = ulong[5]
typedef Win32_CONDITION_VARIABLE = void*
typedef Win32_SRWLOCK = void*
typedef Win32_INIT_ONCE = void*
struct Win32_SECURITY_ATTRIBUTES
alias Win32_LPSECURITY_ATTRIBUTES = Win32_SECURITY_ATTRIBUTES*
alias Win32_PSECURITY_ATTRIBUTES = Win32_SECURITY_ATTRIBUTES*
struct Win32_STARTUPINFOW
struct Win32_OVERLAPPED
alias Win32_LPOVERLAPPED = Win32_OVERLAPPED*
alias Win32_LPSTARTUPINFOW = Win32_STARTUPINFOW*
struct Win32_STARTUPINFOEXW
alias Win32_LPPROC_THREAD_ATTRIBUTE_LIST = void*
alias Win32_LPSTARTUPINFOEXW = Win32_STARTUPINFOEXW*
struct Win32_FILETIME
struct Win32_PROCESS_INFORMATION
alias Win32_PPROCESS_INFORMATION = Win32_PROCESS_INFORMATION*
alias Win32_LPPROCESS_INFORMATION = Win32_PROCESS_INFORMATION*
struct Win32_SYSTEM_INFO
alias Win32_LPSYSTEM_INFO = Win32_SYSTEM_INFO*
struct Win32_MODULEINFO
struct Win32_IMAGEHLP_LINE64
enum Win32_SYM_TYPE
struct Win32_GUID
struct Win32_IMAGEHLP_MODULE64
alias Win32_PIMAGEHLP_MODULE64 = Win32_IMAGEHLP_MODULE64*
struct Win32_ARM64_NT_CONTEXT @align(16)
struct Win32_ARM64_NT_NEON128
struct Win32_XMM_SAVE_AREA32
struct Win32_AMD64_CONTEXT @align(16)
alias CONTEXT_CONTROL = CONTEXT_AMD64_CONTROL
alias CONTEXT_FULL = CONTEXT_AMD64_FULL
alias CONTEXT_ALL = CONTEXT_AMD64_ALL
alias Win32_CONTEXT = Win32_AMD64_CONTEXT
alias Win32_PCONTEXT = Win32_CONTEXT*
struct Win32_M128A @align(16)
struct Win32_IMAGE_DATA_DIRECTORY
struct Win32_IMAGE_OPTIONAL_HEADER64
alias Win32_PIMAGE_OPTIONAL_HEADER64 = Win32_IMAGE_OPTIONAL_HEADER64*
struct Win32_IMAGE_FILE_HEADER
alias Win32_PIMAGE_FILE_HEADER = Win32_IMAGE_FILE_HEADER*
struct Win32_IMAGE_NT_HEADERS
alias Win32_PIMAGE_NT_HEADERS = Win32_IMAGE_NT_HEADERS*
struct Win32_SYMBOL_INFO
alias Win32_PSYMBOL_INFO = Win32_SYMBOL_INFO*
struct Win32_MODLOAD_DATA
enum Win32_ADDRESS_MODE
struct Win32_ADDRESS64
struct Win32_KDHELP64
struct Win32_STACKFRAME64
alias Win32_PREAD_PROCESS_MEMORY_ROUTINE64 = fn Win32_BOOL(Win32_HANDLE hProcess, Win32_DWORD64 qwBaseAddress, Win32_PVOID lpBuffer, Win32_DWORD nSize, Win32_LPDWORD lpNumberOfBytesRead)
alias Win32_PFUNCTION_TABLE_ACCESS_ROUTINE64 = fn Win32_PVOID(Win32_HANDLE ahProcess, Win32_DWORD64 addrBase)
alias Win32_PGET_MODULE_BASE_ROUTINE64 = fn Win32_DWORD64(Win32_HANDLE hProcess, Win32_DWORD64 address)
alias Win32_PTRANSLATE_ADDRESS_ROUTINE64 = fn Win32_DWORD64(Win32_HANDLE hProcess, Win32_HANDLE hThread, Win32_LPADDRESS64 lpaddr)
alias Win32_PKDHELP64 = Win32_KDHELP64*
alias Win32_LPADDRESS64 = Win32_ADDRESS64*
alias Win32_LPSTACKFRAME64 = Win32_STACKFRAME64*
alias Win32_PMODLOAD_DATA = Win32_MODLOAD_DATA*
alias Win32_PIMAGEHLP_LINE64 = Win32_IMAGEHLP_LINE64*
alias Win32_LPMODULEINFO = Win32_MODULEINFO*
extern fn void getSystemTimeAsFileTime(Win32_FILETIME* time) @extern("GetSystemTimeAsFileTime")
enum Win32_GET_FILEEX_INFO_LEVELS
struct Win32_FILE_ATTRIBUTE_DATA
struct Win32_WIN32_FIND_DATAW
alias Win32_LPWIN32_FIND_DATAW = Win32_WIN32_FIND_DATAW*
extern fn Win32_BOOL closeHandle(Win32_HANDLE) @extern("CloseHandle")
extern fn Win32_HBRUSH createSolidBrush(Win32_COLORREF) @extern("CreateSolidBrush")
extern fn Win32_DWORD getLastError() @extern("GetLastError")
extern fn void* _aligned_malloc(usz size, usz alignment)
enum Win32_AllocationType : const Win32_DWORD
enum Win32_Protect : const Win32_DWORD
enum Win32_FreeType : const Win32_DWORD
extern fn Win32_LPVOID virtualAlloc(Win32_LPVOID lpAddres, Win32_SIZE_T dwSize, Win32_AllocationType flAllocationType, Win32_Protect flProtect) @extern("VirtualAlloc")
alias Win32_INIT_ONCE_FN = fn Win32_BOOL(Win32_INIT_ONCE* initOnce, void* parameter, void** context)
extern fn void initializeCriticalSection(Win32_CRITICAL_SECTION* section) @extern("InitializeCriticalSection")
struct Symbol
fn BacktraceList? symbolize_backtrace(Allocator allocator, void*[] backtrace)
fn Backtrace? resolve_backtrace(Allocator allocator, void* addr, Win32_HANDLE process)
struct Win32_KEY_EVENT_RECORD
struct Win32_COORD
struct Win32_MOUSE_EVENT_RECORD
struct Win32_WINDOW_BUFFER_SIZE_RECORD
struct Win32_MENU_EVENT_RECORD
struct Win32_FOCUS_EVENT_RECORD
struct Win32_INPUT_RECORD
alias Win32_PCOORD = Win32_COORD*
struct Win32_RECT
struct Win32_POINT
struct Win32_SIZE
struct Win32_WSABUF
struct Win32_SOCKADDR
alias Win32_PSIZE = Win32_SIZE*
alias Win32_NPSIZE = Win32_SIZE*
alias Win32_LPSIZE = Win32_SIZE*
alias Win32_PPOINT = Win32_POINT*
alias Win32_NPOINT = Win32_POINT*
alias Win32_LPOINT = Win32_POINT*
alias Win32_PRECT = Win32_RECT*
alias Win32_NPRECT = Win32_RECT*
alias Win32_LPRECT = Win32_RECT*
alias Win32_PWSABUF = Win32_WSABUF*
alias Win32_LPWSABUF = Win32_WSABUF*
alias Win32_PSOCKADDR = Win32_SOCKADDR*
alias Win32_LPSOCKADDR = Win32_SOCKADDR*
enum Win32_MEM_EXTENDED_PARAMETER_TYPE : CInt
alias Win32_PMEM_EXTENDED_PARAMETER_TYPE = Win32_MEM_EXTENDED_PARAMETER_TYPE
enum Win32_MEM_EXTENDED_PARAMETER_ATTRIBUTE : const Win32_DWORD64
struct Win32_MEM_EXTENDED_PARAMETER
alias Win32_PMEM_EXTENDED_PARAMETER = Win32_MEM_EXTENDED_PARAMETER*
alias Win32_WNDPROC = fn Win32_LRESULT(Win32_HWND, Win32_UINT, Win32_WPARAM, Win32_LPARAM)
struct Win32_WNDCLASSEXW
struct Win32_MSG
struct Win32_PAINTSTRUCT
alias Win32_PWNDCLASSEXW = Win32_WNDCLASSEXW*
alias Win32_LPWNDCLASSEXW = Win32_WNDCLASSEXW*
alias Win32_NPWNDCLASSEXW = Win32_WNDCLASSEXW*
alias Win32_PPAINTSTRUCT = Win32_PAINTSTRUCT*
alias Win32_LPPAINTSTRUCT = Win32_PAINTSTRUCT*
alias Win32_NPPAINTSTRUCT = Win32_PAINTSTRUCT*
alias Win32_PMSG = Win32_MSG*
alias Win32_LPMSG = Win32_MSG*
alias Win32_NPMSG = Win32_MSG*
alias Win32_ATOM = ushort
extern fn Win32_HDC beginPaint(Win32_HWND, Win32_LPPAINTSTRUCT) @extern("BeginPaint")
macro setWindowLongPtr(Win32_HWND hWnd, CInt nIndex, dwNewLong)
struct Win32_addrinfo
alias Win32_ADDRINFO = Win32_addrinfo
alias Win32_ADDRINFOA = Win32_ADDRINFO
alias Win32_PADDRINFOA = Win32_ADDRINFO*
struct Win32_addrinfoW
alias Win32_ADDRINFOW = Win32_addrinfoW
alias Win32_PADDRINFOW = Win32_addrinfoW*
typedef WSAError = int
struct Win32_pollfd
alias Win32_WSAPOLLFD = Win32_pollfd
alias Win32_PWSAPOLLFD = Win32_WSAPOLLFD*
alias Win32_LPWSAPOLLFD = Win32_WSAPOLLFD*
struct Win32_InAddr
struct Win32_SOCKADDR_IN
struct Win32_SOCKADDR_STORAGE
alias Win32_WSAOVERLAPPED = Win32_OVERLAPPED
alias Win32_LPWSAOVERLAPPED = Win32_WSAOVERLAPPED*
alias Win32_LPWSAOVERLAPPED_COMPLETION_ROUTINE = fn void (
Win32_DWORD dwError,
Win32_DWORD cbTransferred,
Win32_LPWSAOVERLAPPED
lpOverlapped,
Win32_DWORD dwFlags
)
alias Win32_LPFN_WSARECV = fn CInt(
Win32_SOCKET socket,
Win32_LPWSABUF buffers,
Win32_DWORD buffer_count,
Win32_LPDWORD bytes,
Win32_LPDWORD flags,
Win32_LPWSAOVERLAPPED overlapped,
Win32_LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine
)
alias Win32_LPFN_WSARECVFROM = fn CInt(
Win32_SOCKET socket,
Win32_LPWSABUF buffers,
Win32_DWORD buffer_count,
Win32_LPDWORD bytes,
Win32_LPDWORD flags,
Win32_SOCKADDR* addr,
Win32_LPINT addr_len,
Win32_LPWSAOVERLAPPED overlapped,
Win32_LPWSAOVERLAPPED_COMPLETION_ROUTINE completion_routine
)
alias Win32_LPFn_CONNECTEX = fn bool(
Win32_SOCKET,
Win32_SOCKADDR*,
Win32_INT,
Win32_PVOID,
Win32_DWORD,
Win32_LPDWORD,
void*
)
alias Win32_LPFn_ACCEPTEX = fn bool(
Win32_SOCKET,
Win32_SOCKET,
Win32_PVOID,
Win32_DWORD,
Win32_DWORD,
Win32_DWORD,
Win32_LPDWORD,
void*
)
extern fn CInt wsaPoll(Win32_LPWSAPOLLFD fdArray, Win32_ULONG fds, Win32_INT timeout) @extern("WSAPoll")
macro usz binarysearch(list, x, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
macro countingsort(list, key_fn = EMPTY_MACRO_SLOT) @builtin
macro insertionsort_indexed(list, start, end, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
macro quicksort_indexed(list, start, end, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
macro insertionsort(list, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin @safemacro
macro quicksort(list, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
macro quickselect(list, isz k, cmp = EMPTY_MACRO_SLOT, context = EMPTY_MACRO_SLOT) @builtin
macro usz len_from_list(list)
macro bool @is_sortable(#list)
macro bool @is_valid_context(#cmp, #context)
macro bool @is_valid_cmp_fn(#cmp, #list, #context)
macro bool @is_cmp_key_fn(#key_fn, #list)
macro bool is_sorted(list, cmp = EMPTY_MACRO_SLOT, ctx = EMPTY_MACRO_SLOT) @builtin
alias ElementType = $typeof((Type){}[0])
alias KeyFnReturnType @if(!NO_KEY_FN) = $typefrom(KeyFn.returns)
alias KeyFnReturnType @if(NO_KEY_FN) = ElementType
alias CmpCallback @if(KEY_BY_VALUE && NO_KEY_FN) = fn int(ElementType, ElementType)
alias CmpCallback @if(!KEY_BY_VALUE && NO_KEY_FN) = fn int(ElementType*, ElementType*)
alias CmpCallback @if(KEY_BY_VALUE && !NO_KEY_FN) = fn int(ElementType, ElementType, KeyFn)
alias CmpCallback @if(!KEY_BY_VALUE && !NO_KEY_FN) = fn int(ElementType*, ElementType*, KeyFn)
fn void csort(Type list, usz low, usz high, KeyFn key_fn, uint byte_idx)
alias ElementType = $typeof(((Type){})[0])
fn void isort(Type list, usz low, usz high, CmpFn comp, Context context)
alias ElementType = $typeof(((Type){})[0])
fn void qsort(Type list, isz low, isz high, CmpFn cmp, Context context)
fn ElementType? qselect(Type list, isz low, isz high, isz k, CmpFn cmp, Context context)
macro @partition(Type list, isz l, isz h, CmpFn cmp, Context context)
faultdef THREAD_QUEUE_FULL
bitstruct MutexType : int
typedef Mutex = NativeMutex
typedef RecursiveMutex = inline Mutex
typedef TimedMutex = NativeTimedMutex
typedef TimedRecursiveMutex = inline TimedMutex
typedef ConditionVariable = NativeConditionVariable
typedef Thread = inline NativeThread
typedef OnceFlag = NativeOnceFlag
alias OnceFn = fn void()
alias ThreadFn = fn int(void* arg)
faultdef
INIT_FAILED,
DESTROY_FAILED,
LOCK_FAILED,
LOCK_TIMEOUT,
UNLOCK_FAILED,
SIGNAL_FAILED,
WAIT_FAILED,
WAIT_TIMEOUT,
DETACH_FAILED,
JOIN_FAILED,
INTERRUPTED,
CHANNEL_CLOSED
macro void? Mutex.init(&mutex)
macro void? RecursiveMutex.init(&mutex)
macro void? Mutex.destroy(&mutex)
macro void? Mutex.lock(&mutex)
macro bool Mutex.try_lock(&mutex)
macro void? Mutex.unlock(&mutex)
macro void? TimedMutex.init(&mutex)
macro void? TimedRecursiveMutex.init(&mutex)
macro void? TimedMutex.destroy(&mutex)
macro void? TimedMutex.lock(&mutex)
macro void? TimedMutex.lock_timeout(&mutex, ulong ms)
macro bool TimedMutex.try_lock(&mutex)
macro void? TimedMutex.unlock(&mutex)
macro void fence(AtomicOrdering $ordering) @safemacro
macro void Mutex.@in_lock(&mutex; @body)
macro void? ConditionVariable.init(&cond)
macro void? ConditionVariable.destroy(&cond)
macro void? ConditionVariable.signal(&cond)
macro void? ConditionVariable.broadcast(&cond)
macro void? ConditionVariable.wait(&cond, Mutex* mutex)
macro void? ConditionVariable.wait_timeout(&cond, Mutex* mutex, #ms_or_duration) @safemacro
macro void? ConditionVariable.wait_until(&cond, Mutex* mutex, Time time)
macro void? Thread.create(&thread, ThreadFn thread_fn, void* arg)
macro void? Thread.detach(thread)
macro int? Thread.join(thread)
macro bool Thread.equals(thread, Thread other)
macro void OnceFlag.call(&flag, OnceFn func)
macro void yield()
macro Thread current()
macro void exit(int result)
macro void? sleep(Duration d) @maydiscard
macro void? sleep_ms(ulong ms) @maydiscard
macro void? sleep_ns(NanoDuration ns) @maydiscard
typedef UnbufferedChannel = void*
fn void? UnbufferedChannel.init(&self, Allocator allocator)
fn void? UnbufferedChannel.destroy(&self)
fn void? UnbufferedChannel.push(self, Type val)
fn Type? UnbufferedChannel.pop(self)
fn void? UnbufferedChannel.close(self)
typedef BufferedChannel = void*
fn void? BufferedChannel.init(&self, Allocator allocator, usz size = 1)
fn void? BufferedChannel.destroy(&self)
fn void? BufferedChannel.push(self, Type val)
fn Type? BufferedChannel.pop(self)
fn void? BufferedChannel.close(self)
fn uint native_cpu()
fn uint native_cpu()
fn uint native_cpu()

std::thread::os @if (!env::POSIX && !env::WIN32)

Section titled “std::thread::os @if (!env::POSIX && !env::WIN32)”
typedef NativeMutex = int
typedef NativeTimedMutex = int
typedef NativeConditionVariable = int
typedef NativeOnceFlag = int
typedef NativeThread = int
struct NativeMutex
alias NativeTimedMutex = NativeMutex
alias NativeConditionVariable = Pthread_cond_t
struct NativeThread
alias NativeOnceFlag = Pthread_once_t
fn void? NativeMutex.init(&self, MutexType type)
fn bool NativeMutex.is_initialized(&self)
fn void? NativeMutex.destroy(&self)
fn void? NativeMutex.lock(&self)
fn void? NativeMutex.lock_timeout(&self, ulong ms)
fn bool NativeMutex.try_lock(&self)
fn void? NativeMutex.unlock(&self)
fn void? NativeConditionVariable.init(&cond)
fn void? NativeConditionVariable.destroy(&cond)
fn void? NativeConditionVariable.signal(&cond)
fn void? NativeConditionVariable.broadcast(&cond)
fn void? NativeConditionVariable.wait(&cond, NativeMutex* mtx)
fn void? NativeConditionVariable.wait_timeout(&cond, NativeMutex* mtx, ulong ms)
fn void? NativeConditionVariable.wait_timeout_duration(&cond, NativeMutex* mtx, Duration duration)
fn void? NativeConditionVariable.wait_until(&cond, NativeMutex* mtx, Time time)
fn void? NativeThread.create(&thread, ThreadFn thread_fn, void* arg)
fn void? NativeThread.detach(thread)
fn void native_thread_exit(int result)
fn NativeThread native_thread_current()
fn bool NativeThread.equals(thread, NativeThread other)
fn int? NativeThread.join(thread)
fn void NativeOnceFlag.call_once(&flag, OnceFn func)
fn void native_thread_yield()
fn void? native_sleep_nano(NanoDuration nano)
typedef NativeThread = inline Win32_HANDLE
struct NativeMutex
struct NativeTimedMutex
struct NativeConditionVariable
struct NativeOnceFlag
fn void? NativeMutex.init(&mtx, MutexType type)
fn void? NativeMutex.destroy(&mtx)
fn void? NativeMutex.lock(&mtx)
fn bool NativeMutex.try_lock(&mtx)
fn void? NativeMutex.unlock(&mtx)
fn void? NativeTimedMutex.init(&mtx, MutexType type)
fn void? NativeTimedMutex.destroy(&mtx)
fn void? NativeTimedMutex.lock(&mtx)
fn void? NativeTimedMutex.lock_timeout(&mtx, ulong ms)
fn bool NativeTimedMutex.try_lock(&mtx)
fn void? NativeTimedMutex.unlock(&mtx)
fn void? NativeConditionVariable.init(&cond)
fn void? NativeConditionVariable.destroy(&cond) @maydiscard
fn void? NativeConditionVariable.signal(&cond)
fn void? NativeConditionVariable.broadcast(&cond)
fn void? NativeConditionVariable.wait(&cond, NativeMutex* mtx) @inline
fn void? NativeConditionVariable.wait_timeout(&cond, NativeMutex* mtx, ulong ms) @inline
fn void? NativeConditionVariable.wait_timeout_duration(&cond, NativeMutex* mtx, Duration duration) @inline
fn void? NativeConditionVariable.wait_until(&cond, NativeMutex* mtx, Time time) @inline
fn void? NativeThread.create(&thread, ThreadFn func, void* args)
fn void? NativeThread.detach(thread) @inline
fn void native_thread_exit(int result) @inline
fn void native_thread_yield()
fn void NativeOnceFlag.call_once(&flag, OnceFn func)
fn int? NativeThread.join(thread)
fn NativeThread native_thread_current()
fn bool NativeThread.equals(thread, NativeThread other)
fn void? native_sleep_nano(NanoDuration ns)
struct ThreadPool
fn void? ThreadPool.init(&self)
fn void? ThreadPool.destroy(&self)
fn void? ThreadPool.stop_and_destroy(&self)
fn void? ThreadPool.push(&self, ThreadFn func, void* arg)

std::thread::threadpool @if (env::POSIX || env::WIN32)

Section titled “std::thread::threadpool @if (env::POSIX || env::WIN32)”
alias ThreadPoolFn = fn void(any[] args)
struct FixedThreadPool
fn void? FixedThreadPool.init(&self, usz threads, usz queue_size = 0)
fn void? FixedThreadPool.destroy(&self)
fn void? FixedThreadPool.stop_and_destroy(&self)
fn void? FixedThreadPool.push(&self, ThreadPoolFn func, args...)
typedef Time @structlike = long
typedef Duration @structlike = long
typedef Clock @structlike = ulong
typedef NanoDuration (Printable) @structlike = long
fn Duration us(long l) @inline
fn Duration ms(long l) @inline
fn Duration sec(long l) @inline
fn Duration min(long l) @inline
fn Duration hour(long l) @inline
fn Duration from_float(double s) @inline
struct DateTime
struct TzDateTime
enum Weekday : char (String name, String abbrev)
enum Month : char (String name, String abbrev, int days, bool leap)
fn Time now()
fn Time Time.add_seconds(time, long seconds)
fn Time Time.add_minutes(time, long minutes)
fn Time Time.add_hours(time, long hours)
fn Time Time.add_days(time, long days)
fn Time Time.add_weeks(time, long weeks)
fn Time Time.add_duration(time, Duration duration) @operator_s(+) @inline
fn Time Time.sub_duration(time, Duration duration) @operator(-) @inline
fn int Time.compare_to(time, Time other)
fn double Time.to_seconds(time)
fn Duration Time.diff_us(time, Time other) @operator(-)
fn double Time.diff_sec(time, Time other)
fn double Time.diff_min(time, Time other)
fn double Time.diff_hour(time, Time other)
fn double Time.diff_days(time, Time other)
fn double Time.diff_weeks(time, Time other)
fn double NanoDuration.to_sec(nd)
fn long NanoDuration.to_ms(nd)
fn Duration NanoDuration.to_duration(nd)
fn NanoDuration Duration.to_nano(td)
fn long Duration.to_ms(td)
macro Duration Duration.mult(#td, long #val) @operator_s(*) @safemacro
fn usz? NanoDuration.to_format(&self, Formatter* formatter) @dynamic
fn Clock now()
fn NanoDuration Clock.mark(&self)
fn Clock Clock.add_nano_duration(self, NanoDuration nano) @operator_s(+) @inline
fn Clock Clock.sub_nano_duration(self, NanoDuration nano) @operator(-) @inline
fn Clock Clock.add_duration(self, Duration duration) @operator_s(+) @inline
fn Clock Clock.sub_duration(self, Duration duration) @operator(-) @inline
fn NanoDuration Clock.nano_diff(self, Clock other) @operator(-) @inline
fn NanoDuration Clock.to_now(self) @inline
fn DateTime now()
fn DateTime from_date(int year, Month month = JANUARY, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0)
fn TzDateTime from_date_tz(int year, Month month = JANUARY, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0, int gmt_offset = 0)
fn TzDateTime DateTime.to_local(&self)
fn TzDateTime DateTime.with_gmt_offset(self, int gmt_offset)
fn TzDateTime TzDateTime.with_gmt_offset(self, int gmt_offset)
fn TzDateTime DateTime.to_gmt_offset(self, int gmt_offset)
fn TzDateTime TzDateTime.to_gmt_offset(self, int gmt_offset)
fn void DateTime.set_date(&self, int year, Month month = JANUARY, int day = 1, int hour = 0, int min = 0, int sec = 0, int us = 0)
fn void DateTime.set_time(&self, Time time)
fn DateTime DateTime.add_us(&self, Duration d) @operator_s(+)
fn DateTime DateTime.sub_us(&self, Duration d) @operator(-)
fn DateTime DateTime.add_seconds(&self, int seconds)
fn DateTime DateTime.add_minutes(&self, int minutes)
fn DateTime DateTime.add_hours(&self, int hours)
fn DateTime DateTime.add_days(&self, int days)
fn DateTime DateTime.add_weeks(&self, int weeks)
fn DateTime DateTime.add_years(&self, int years)
fn DateTime DateTime.add_months(&self, int months)
fn TzDateTime TzDateTime.add_us(&self, Duration d) @operator_s(+)
fn TzDateTime TzDateTime.sub_us(&self, Duration d) @operator(-)
fn TzDateTime TzDateTime.add_seconds(&self, int seconds)
fn TzDateTime TzDateTime.add_minutes(&self, int minutes)
fn TzDateTime TzDateTime.add_hours(&self, int hours)
fn TzDateTime TzDateTime.add_days(&self, int days)
fn TzDateTime TzDateTime.add_weeks(&self, int weeks)
fn TzDateTime TzDateTime.add_years(&self, int years)
fn TzDateTime TzDateTime.add_months(&self, int months)
fn DateTime from_time(Time time)
fn TzDateTime from_time_tz(Time time, int gmt_offset)
fn Time DateTime.to_time(&self) @inline
fn bool DateTime.after(&self, DateTime compare) @inline
fn bool DateTime.before(&self, DateTime compare) @inline
fn int DateTime.compare_to(&self, DateTime compare)
fn int DateTime.diff_years(&self, DateTime from)
fn double DateTime.diff_sec(self, DateTime from)
fn Duration DateTime.diff_us(self, DateTime from) @operator(-)
enum DateTimeFormat
fn String format(Allocator allocator, DateTimeFormat type, TzDateTime dt)
fn String tformat(DateTimeFormat dt_format, TzDateTime dt)
fn String TzDateTime.format(self, Allocator allocator, DateTimeFormat dt_format)
fn String DateTime.format(self, Allocator allocator, DateTimeFormat dt_format)
fn Clock native_clock()
fn Time native_timestamp()
fn Clock native_clock() @if(!env::DARWIN)
fn Clock native_clock()
fn Time native_timestamp()