package core:c/libc

⌘K
Ctrl+K
or
/

    Index

    Types (117)
    Constants (96)
    Variables (4)
    Procedures (329)

    Types

    Locale_Category ¶

    Locale_Category :: enum i32 {
    	ALL      = 0, 
    	COLLATE  = 1, 
    	CTYPE    = 2, 
    	MESSAGES = 6, 
    	MONETARY = 3, 
    	NUMERIC  = 4, 
    	TIME     = 5, 
    }
    Related Procedures With Parameters

    Whence ¶

    Whence :: enum i32 {
    	SET = 0, 
    	CUR = 1, 
    	END = 2, 
    }
    Related Procedures With Parameters

    atomic_bool ¶

    atomic_bool :: distinct bool
     

    7.17.6 Atomic integer types

    atomic_char ¶

    atomic_char :: distinct u8

    atomic_char16_t ¶

    atomic_char16_t :: distinct u16

    atomic_char32_t ¶

    atomic_char32_t :: distinct u32

    atomic_flag ¶

    atomic_flag :: distinct bool
     

    7.17.8 Atomic flag type and operations

    Related Procedures With Parameters

    atomic_int ¶

    atomic_int :: distinct i32

    atomic_int_fast16_t ¶

    atomic_int_fast16_t :: distinct i32

    atomic_int_fast32_t ¶

    atomic_int_fast32_t :: distinct i32

    atomic_int_fast64_t ¶

    atomic_int_fast64_t :: distinct i64

    atomic_int_fast8_t ¶

    atomic_int_fast8_t :: distinct i8

    atomic_int_least16_t ¶

    atomic_int_least16_t :: distinct i16

    atomic_int_least32_t ¶

    atomic_int_least32_t :: distinct i32

    atomic_int_least64_t ¶

    atomic_int_least64_t :: distinct i64

    atomic_int_least8_t ¶

    atomic_int_least8_t :: distinct i8

    atomic_intmax_t ¶

    atomic_intmax_t :: distinct i64

    atomic_intptr_t ¶

    atomic_intptr_t :: distinct int

    atomic_llong ¶

    atomic_llong :: distinct i64

    atomic_long ¶

    atomic_long :: distinct i32

    atomic_ptrdiff_t ¶

    atomic_ptrdiff_t :: distinct int

    atomic_schar ¶

    atomic_schar :: distinct u8

    atomic_short ¶

    atomic_short :: distinct i16

    atomic_size_t ¶

    atomic_size_t :: distinct uint

    atomic_uchar ¶

    atomic_uchar :: distinct u8

    atomic_uint ¶

    atomic_uint :: distinct u32

    atomic_uint_fast16_t ¶

    atomic_uint_fast16_t :: distinct u32

    atomic_uint_fast32_t ¶

    atomic_uint_fast32_t :: distinct u32

    atomic_uint_fast64_t ¶

    atomic_uint_fast64_t :: distinct u64

    atomic_uint_fast8_t ¶

    atomic_uint_fast8_t :: distinct u8

    atomic_uint_least16_t ¶

    atomic_uint_least16_t :: distinct u16

    atomic_uint_least32_t ¶

    atomic_uint_least32_t :: distinct u32

    atomic_uint_least64_t ¶

    atomic_uint_least64_t :: distinct u64

    atomic_uint_least8_t ¶

    atomic_uint_least8_t :: distinct u8

    atomic_uintmax_t ¶

    atomic_uintmax_t :: distinct u64

    atomic_uintptr_t ¶

    atomic_uintptr_t :: distinct uintptr

    atomic_ullong ¶

    atomic_ullong :: distinct u64

    atomic_ulong ¶

    atomic_ulong :: distinct u32

    atomic_ushort ¶

    atomic_ushort :: distinct u16

    atomic_wchar_t ¶

    atomic_wchar_t :: distinct u16

    char ¶

    char :: u8
     

    assuming -funsigned-char

    char16_t ¶

    char16_t :: u16

    char32_t ¶

    char32_t :: u32

    clock_t ¶

    clock_t :: distinct i32
    Related Procedures With Returns

    cnd_t ¶

    cnd_t :: distinct rawptr
     

    _Cnd_imp_t

    Related Procedures With Parameters

    complex_double ¶

    complex_double :: distinct complex128
    Related Procedures With Parameters
    Related Procedures With Returns

    complex_float ¶

    complex_float :: distinct complex64
    Related Procedures With Parameters
    Related Procedures With Returns

    div_t ¶

    div_t :: struct {
    	quot: i32,
    	rem:  i32,
    }
     

    C does not declare which order 'quot' and 'rem' should be for the divide structures. An implementation could put 'rem' first. However, nobody actually does and everyone appears to have agreed upon this layout.

    Related Procedures With Returns

    double ¶

    double :: f64

    double_t ¶

    double_t :: f64

    float ¶

    float :: f32

    float_t ¶

    float_t :: f32
     

    On amd64 Windows and Linux, float_t and double_t are respectively both their usual types. On x86 it's not possible to define these types correctly since they would be long double which Odin does have support for.

    fpos_t ¶

    fpos_t :: distinct i64
    Related Procedures With Parameters

    int16_t ¶

    int16_t :: i16

    int32_t ¶

    int32_t :: i32

    int64_t ¶

    int64_t :: i64

    int8_t ¶

    int8_t :: i8

    int_fast16_t ¶

    int_fast16_t :: i32

    int_fast32_t ¶

    int_fast32_t :: i32

    int_fast64_t ¶

    int_fast64_t :: i64

    int_fast8_t ¶

    int_fast8_t :: i8

    int_least16_t ¶

    int_least16_t :: i16

    int_least32_t ¶

    int_least32_t :: i32

    int_least64_t ¶

    int_least64_t :: i64

    int_least8_t ¶

    int_least8_t :: i8

    intmax_t ¶

    intmax_t :: i64

    intptr_t ¶

    intptr_t :: int

    jmp_buf ¶

    jmp_buf :: struct #align (16) {
    	_: [4096]u8,
    }
     

    The C99 Rationale describes jmp_buf as being an array type for backward compatibility. Odin does not need to honor this and couldn't as arrays in Odin don't decay to pointers. It is somewhat easy for us to bind this, we just need to ensure the structure contains enough storage with appropriate alignment. Since there are no types in C with an alignment larger than that of max_align_t, which cannot be larger than sizeof(long double) as any other exposed type wouldn't be valid C, the maximum alignment possible in a strictly conformant C implementation is 16 on the platforms we care about. The choice of 4096 bytes for storage of this type is more than enough on all relevant platforms.

    Related Procedures With Parameters

    lconv ¶

    lconv :: struct {
    	decimal_point:        cstring,
    	thousand_sep:         cstring,
    	grouping:             cstring,
    	int_curr_symbol:      cstring,
    	currency_symbol:      cstring,
    	mon_decimal_points:   cstring,
    	mon_thousands_sep:    cstring,
    	mon_grouping:         cstring,
    	positive_sign:        cstring,
    	negative_sign:        cstring,
    	int_frac_digits:      u8,
    	frac_digits:          u8,
    	p_cs_precedes:        u8,
    	p_sep_by_space:       u8,
    	n_cs_precedes:        u8,
    	n_sep_by_space:       u8,
    	p_sign_posn:          u8,
    	n_sign_posn:          u8,
    	_W_decimal_point:     [^]u16 `fmt:"s,0"`,
    	_W_thousands_sep:     [^]u16 `fmt:"s,0"`,
    	_W_int_curr_symbol:   [^]u16 `fmt:"s,0"`,
    	_W_currency_symbol:   [^]u16 `fmt:"s,0"`,
    	_W_mon_decimal_point: [^]u16 `fmt:"s,0"`,
    	_W_mon_thousands_sep: [^]u16 `fmt:"s,0"`,
    	_W_positive_sign:     [^]u16 `fmt:"s,0"`,
    	_W_negative_sign:     [^]u16 `fmt:"s,0"`,
    }
    Related Procedures With Returns

    ldiv_t ¶

    ldiv_t :: struct {
    	quot: i32,
    	rem:  i32,
    }
    Related Procedures With Returns

    lldiv_t ¶

    lldiv_t :: struct {
    	quot: i64,
    	rem:  i64,
    }
    Related Procedures With Returns

    longlong ¶

    longlong :: i64

    mbstate_t ¶

    mbstate_t :: struct #align (16) {
    	_: [32]u8,
    }
     

    Large enough and aligned enough for any wide-spread in-use libc.

    Related Procedures With Parameters

    mtx_t ¶

    mtx_t :: distinct rawptr
     

    _Mtx_imp_t

    Related Procedures With Parameters

    once_flag ¶

    once_flag :: distinct i8
     

    _Once_flag_imp_t

    Related Procedures With Parameters

    ptrdiff_t ¶

    ptrdiff_t :: c.ptrdiff_t
    Related Constants

    schar ¶

    schar :: i8

    short ¶

    short :: i16

    sig_atomic_t ¶

    sig_atomic_t :: distinct i32
    Related Constants

    ssize_t ¶

    ssize_t :: int

    thrd_start_t ¶

    thrd_start_t :: proc "c" (rawptr) -> i32
    Related Procedures With Parameters

    thrd_t ¶

    thrd_t :: struct {
    	_: rawptr,
    	_: u32,
    }
     

    _Thrd_t

    Related Procedures With Parameters
    Related Procedures With Returns

    time_t ¶

    time_t :: distinct i64
    Related Procedures With Parameters
    Related Procedures With Returns

    timespec ¶

    timespec :: struct #align (8) {
    	tv_sec:  time_t,
    	tv_nsec: i32,
    }
    Related Procedures With Parameters

    tm ¶

    tm :: struct #align (8) {
    	tm_sec:   i32,
    	tm_min:   i32,
    	tm_hour:  i32,
    	tm_mday:  i32,
    	tm_mon:   i32,
    	tm_year:  i32,
    	tm_wday:  i32,
    	tm_yday:  i32,
    	tm_isdst: i32,
    }
    Related Procedures With Parameters
    Related Procedures With Returns

    tss_dtor_t ¶

    tss_dtor_t :: proc "c" (rawptr)
    Related Procedures With Parameters

    tss_t ¶

    tss_t :: distinct i32
     

    _Tss_imp_t

    Related Procedures With Parameters

    uchar ¶

    uchar :: u8

    uint16_t ¶

    uint16_t :: u16

    uint32_t ¶

    uint32_t :: u32

    uint64_t ¶

    uint64_t :: u64

    uint8_t ¶

    uint8_t :: u8

    uint_fast16_t ¶

    uint_fast16_t :: u32

    uint_fast32_t ¶

    uint_fast32_t :: u32

    uint_fast64_t ¶

    uint_fast64_t :: u64

    uint_fast8_t ¶

    uint_fast8_t :: u8

    uint_least16_t ¶

    uint_least16_t :: u16

    uint_least32_t ¶

    uint_least32_t :: u32

    uint_least64_t ¶

    uint_least64_t :: u64

    uint_least8_t ¶

    uint_least8_t :: u8

    uintmax_t ¶

    uintmax_t :: u64

    ulong ¶

    ulong :: u32

    ulonglong ¶

    ulonglong :: u64

    ushort ¶

    ushort :: u16

    va_list ¶

    va_list :: c.va_list

    wchar_t ¶

    wchar_t :: u16

    wctrans_t ¶

    wctrans_t :: distinct u16
    Related Procedures With Parameters
    Related Procedures With Returns

    wctype_t ¶

    wctype_t :: distinct u16
    Related Procedures With Parameters
    Related Procedures With Returns

    wint_t ¶

    wint_t :: distinct u16
     

    Odin does not have default argument promotion so the need for a separate type here isn't necessary, though make it distinct just to be safe.

    Related Procedures With Parameters
    Related Procedures With Returns
    Related Constants

    Constants

    ATOMIC_BOOL_LOCK_FREE ¶

    ATOMIC_BOOL_LOCK_FREE :: true

    ATOMIC_CHAR16_T_LOCK_FREE ¶

    ATOMIC_CHAR16_T_LOCK_FREE :: true

    ATOMIC_CHAR32_T_LOCK_FREE ¶

    ATOMIC_CHAR32_T_LOCK_FREE :: true

    ATOMIC_CHAR_LOCK_FREE ¶

    ATOMIC_CHAR_LOCK_FREE :: true

    ATOMIC_INT_LOCK_FREE ¶

    ATOMIC_INT_LOCK_FREE :: true

    ATOMIC_LLONG_LOCK_FREE ¶

    ATOMIC_LLONG_LOCK_FREE :: true

    ATOMIC_LONG_LOCK_FREE ¶

    ATOMIC_LONG_LOCK_FREE :: true

    ATOMIC_POINTER_LOCK_FREE ¶

    ATOMIC_POINTER_LOCK_FREE :: true

    ATOMIC_SHORT_LOCK_FREE ¶

    ATOMIC_SHORT_LOCK_FREE :: true

    ATOMIC_WCHAR_T_LOCK_FREE ¶

    ATOMIC_WCHAR_T_LOCK_FREE :: true

    BUFSIZ ¶

    BUFSIZ :: 512

    CHAR_BIT ¶

    CHAR_BIT :: 8

    CLOCKS_PER_SEC ¶

    CLOCKS_PER_SEC :: 1000

    EDOM ¶

    EDOM :: 33

    EILSEQ ¶

    EILSEQ :: 42

    EOF ¶

    EOF: i32 : int(-1)

    ERANGE ¶

    ERANGE :: 34

    EXIT_FAILURE ¶

    EXIT_FAILURE :: 1

    EXIT_SUCCESS ¶

    EXIT_SUCCESS :: 0
     

    C does not declare what these values should be, as an implementation is free to use any two distinct values it wants to indicate success or failure. However, nobody actually does and everyone appears to have agreed upon these values.

    FILENAME_MAX ¶

    FILENAME_MAX :: 260

    FOPEN_MAX ¶

    FOPEN_MAX :: 20

    FP_ILOGB0 ¶

    FP_ILOGB0: i32 : FP_ILOGBNAN

    FP_ILOGBNAN ¶

    FP_ILOGBNAN: i32 : -1 - int((~uint(0)) >> 1)

    FP_INFINITE ¶

    FP_INFINITE :: 1

    FP_NAN ¶

    FP_NAN :: 0
     

    Number classification constants. These do not have to match libc since we implement our own classification functions as libc requires they be macros, which means libc does not export standard functions for them.

    FP_NORMAL ¶

    FP_NORMAL :: 3

    FP_SUBNORMAL ¶

    FP_SUBNORMAL :: 4

    FP_ZERO ¶

    FP_ZERO :: 2

    HUGE_VAL ¶

    HUGE_VAL: f64 : double(INFINITY)

    HUGE_VALF ¶

    HUGE_VALF :: INFINITY

    INFINITY ¶

    INFINITY :: 1e5000

    INT16_MAX ¶

    INT16_MAX: i32 : c.INT16_MAX

    INT16_MIN ¶

    INT16_MIN: i32 : c.INT16_MIN

    INT32_MAX ¶

    INT32_MAX: i32 : c.INT32_MAX

    INT32_MIN ¶

    INT32_MIN: i32 : c.INT32_MIN

    INT64_MAX ¶

    INT64_MAX: i64 : c.INT64_MAX

    INT64_MIN ¶

    INT64_MIN: i64 : c.INT64_MIN

    INT8_MAX ¶

    INT8_MAX: i32 : c.INT8_MAX
     

    Copy C's rules for type promotion here by forcing the type on the literals.

    INT8_MIN ¶

    INT8_MIN: i32 : c.INT8_MIN

    LC_ALL ¶

    LC_ALL :: 0

    LC_COLLATE ¶

    LC_COLLATE :: 1

    LC_CTYPE ¶

    LC_CTYPE :: 2

    LC_MESSAGES ¶

    LC_MESSAGES :: 6

    LC_MONETARY ¶

    LC_MONETARY :: 3

    LC_NUMERIC ¶

    LC_NUMERIC :: 4

    LC_TIME ¶

    LC_TIME :: 5

    L_tmpnam ¶

    L_tmpnam :: 15
     

    "\\" + 12 + NUL

    MATH_ERREXCEPT ¶

    MATH_ERREXCEPT :: 2

    MATH_ERRNO ¶

    MATH_ERRNO :: 1

    NDEBUG ¶

    NDEBUG :: !ODIN_DEBUG

    NULL ¶

    NULL :: rawptr(uintptr(0))

    PTRDIFF_MAX ¶

    PTRDIFF_MAX: c.ptrdiff_t : c.PTRDIFF_MAX

    PTRDIFF_MIN ¶

    PTRDIFF_MIN: c.ptrdiff_t : c.PTRDIFF_MIN

    RAND_MAX ¶

    RAND_MAX :: 0x7fff

    SEEK_CUR ¶

    SEEK_CUR :: 1

    SEEK_END ¶

    SEEK_END :: 2

    SEEK_SET ¶

    SEEK_SET :: 0

    SIGABRT ¶

    SIGABRT :: 22

    SIGFPE ¶

    SIGFPE :: 8

    SIGILL ¶

    SIGILL :: 4

    SIGINT ¶

    SIGINT :: 2

    SIGSEGV ¶

    SIGSEGV :: 11

    SIGTERM ¶

    SIGTERM :: 15

    SIG_ATOMIC_MAX ¶

    SIG_ATOMIC_MAX: sig_atomic_t : max(sig_atomic_t)

    SIG_ATOMIC_MIN ¶

    SIG_ATOMIC_MIN: sig_atomic_t : min(sig_atomic_t)

    SIG_DFL ¶

    SIG_DFL :: rawptr(uintptr(0))

    SIG_ERR ¶

    SIG_ERR :: rawptr(~uintptr(0))

    SIG_IGN ¶

    SIG_IGN :: rawptr(uintptr(1))

    SIZE_MAX ¶

    SIZE_MAX: uint : c.SIZE_MAX

    TIME_UTC ¶

    TIME_UTC :: 1

    TMP_MAX ¶

    TMP_MAX :: 32767
     

    SHRT_MAX

    TSS_DTOR_ITERATIONS ¶

    TSS_DTOR_ITERATIONS :: 4
     

    _TSS_DTOR_ITERATIONS_IMP

    UINT16_MAX ¶

    UINT16_MAX: i32 : c.UINT16_MAX

    UINT32_MAX ¶

    UINT32_MAX: u32 : c.UINT32_MAX

    UINT64_MAX ¶

    UINT64_MAX: u64 : c.UINT64_MAX

    UINT8_MAX ¶

    UINT8_MAX: i32 : c.UINT8_MAX

    WCHAR_MAX ¶

    WCHAR_MAX: u16 : c.WCHAR_MAX

    WCHAR_MIN ¶

    WCHAR_MIN: u16 : c.WCHAR_MIN

    WEOF ¶

    WEOF: wint_t : ~wint_t(0)

    WINT_MAX ¶

    WINT_MAX :: 1 << (size_of(wint_t) * 8)

    WINT_MIN ¶

    WINT_MIN :: 0
     

    Calculate these values correctly regardless of what type wchar_t actually is.

    math_errhandling ¶

    math_errhandling :: 2
     

    Windows, Linux, macOS all use this mode.

    memory_order_acq_rel ¶

    memory_order_acq_rel :: memory_order.acq_rel

    memory_order_acquire ¶

    memory_order_acquire :: memory_order.acquire

    memory_order_consume ¶

    memory_order_consume :: memory_order.consume

    memory_order_relaxed ¶

    memory_order_relaxed :: memory_order.relaxed

    memory_order_release ¶

    memory_order_release :: memory_order.release

    memory_order_seq_cst ¶

    memory_order_seq_cst :: memory_order.seq_cst

    mtx_plain ¶

    mtx_plain :: 1
     

    _Mtx_plain

    mtx_recursive ¶

    mtx_recursive :: 0x100
     

    _Mtx_recursive

    mtx_timed ¶

    mtx_timed :: 4
     

    _Mtx_timed

    thrd_busy ¶

    thrd_busy :: 3
     

    _Thrd_busy

    thrd_error ¶

    thrd_error :: 4
     

    _Thrd_error

    thrd_nomem ¶

    thrd_nomem :: 1
     

    _Thrd_nomem

    thrd_success ¶

    thrd_success :: 0
     

    _Thrd_success

    thrd_timedout ¶

    thrd_timedout :: 2
     

    _Thrd_timedout

    Variables

    NAN ¶

    NAN: f64 = …

    stderr ¶

    stderr: ^FILE = …

    stdin ¶

    stdin: ^FILE = …

    stdout ¶

    stdout: ^FILE = …

    Procedures

    ATOMIC_VAR_INIT ¶

    ATOMIC_VAR_INIT :: proc(value: $T) -> $T {…}
     

    7.17.2 Initialization

    CMPLX ¶

    CMPLX :: proc(x, y: f64) -> complex_double {…}

    CMPLXF ¶

    CMPLXF :: proc(x, y: f32) -> complex_float {…}

    MB_CUR_MAX ¶

    MB_CUR_MAX :: proc() -> uint {…}

    abort ¶

    abort :: proc "c" () -> ! ---
     

    7.22.4 Communication with the environment

    abs ¶

    abs :: proc "c" (j: i32) -> i32 ---
     

    7.22.6 Integer arithmetic functions

    aligned_alloc ¶

    aligned_alloc :: proc "c" (alignment, size: uint) -> rawptr {…}

    aligned_free ¶

    aligned_free :: proc "c" (ptr: rawptr) {…}

    asctime ¶

    asctime :: proc "c" (timeptr: ^tm) -> [^]u8 ---
     

    7.27.3 Time conversion functions

    at_quick_exit ¶

    at_quick_exit :: proc "c" (func: proc "c" ()) -> i32 ---

    atexit ¶

    atexit :: proc "c" (func: proc "c" ()) -> i32 ---

    atof ¶

    atof :: proc "c" (nptr: cstring) -> f64 ---
     

    7.22.1 Numeric conversion functions

    atoi ¶

    atoi :: proc "c" (nptr: cstring) -> i32 ---

    atol ¶

    atol :: proc "c" (nptr: cstring) -> i32 ---

    atoll ¶

    atoll :: proc "c" (nptr: cstring) -> i64 ---

    atomic_compare_exchange_strong ¶

    atomic_compare_exchange_strong :: proc(object, expected: ^$T, desired: $T) -> bool {…}
     

    C does not allow failure memory order to be order_release or acq_rel. Similarly, it does not allow the failure order to be stronger than success order. Since consume and acquire are both monotonic, we can count them as one, for a total of three memory orders that are relevant in compare exchange.

    relaxed, acquire (consume), seq_cst.
    

    The requirement that the failure order cannot be stronger than success limits the valid combinations for the failure order to this table:

    [success = seq_cst, failure = seq_cst] => _
    [success = acquire, failure = seq_cst] => acq
    [success = release, failure = seq_cst] => rel
    [success = acq_rel, failure = seq_cst] => acqrel
    [success = relaxed, failure = relaxed] => relaxed
    [success = seq_cst, failure = relaxed] => failrelaxed
    [success = seq_cst, failure = acquire] => failacq
    [success = acquire, failure = relaxed] => acq_failrelaxed
    [success = acq_rel, failure = relaxed] => acqrel_failrelaxed
    

    atomic_compare_exchange_strong_explicit ¶

    atomic_compare_exchange_strong_explicit :: proc(object, expected: ^$T, desired: $T, success, failure: memory_order) -> bool {…}

    atomic_compare_exchange_weak ¶

    atomic_compare_exchange_weak :: proc(object, expected: ^$T, desired: $T) -> bool {…}

    atomic_compare_exchange_weak_explicit ¶

    atomic_compare_exchange_weak_explicit :: proc(object, expected: ^$T, desired: $T, success, failure: memory_order) -> bool {…}

    atomic_exchange ¶

    atomic_exchange :: proc(object: ^$T, desired: $T) -> $T {…}

    atomic_exchange_explicit ¶

    atomic_exchange_explicit :: proc(object: ^$T, desired: $T, order: memory_order) -> $T {…}

    atomic_fetch_add ¶

    atomic_fetch_add :: proc(object: ^$T, operand: $T) -> $T {…}
     

    7.17.7.5 The atomic_fetch and modify generic functions

    atomic_fetch_add_explicit ¶

    atomic_fetch_add_explicit :: proc(object: ^$T, operand: $T, order: memory_order) -> $T {…}

    atomic_fetch_and ¶

    atomic_fetch_and :: proc(object: ^$T, operand: $T) -> $T {…}

    atomic_fetch_and_explicit ¶

    atomic_fetch_and_explicit :: proc(object: ^$T, operand: $T, order: memory_order) -> $T {…}

    atomic_fetch_or ¶

    atomic_fetch_or :: proc(object: ^$T, operand: $T) -> $T {…}

    atomic_fetch_or_explicit ¶

    atomic_fetch_or_explicit :: proc(object: ^$T, operand: $T, order: memory_order) -> $T {…}

    atomic_fetch_sub ¶

    atomic_fetch_sub :: proc(object: ^$T, operand: $T) -> $T {…}

    atomic_fetch_sub_explicit ¶

    atomic_fetch_sub_explicit :: proc(object: ^$T, operand: $T, order: memory_order) -> $T {…}

    atomic_fetch_xor ¶

    atomic_fetch_xor :: proc(object: ^$T, operand: $T) -> $T {…}

    atomic_fetch_xor_explicit ¶

    atomic_fetch_xor_explicit :: proc(object: ^$T, operand: $T, order: memory_order) -> $T {…}

    atomic_flag_clear ¶

    atomic_flag_clear :: proc(flag: ^atomic_flag) {…}

    atomic_flag_clear_explicit ¶

    atomic_flag_clear_explicit :: proc(flag: ^atomic_flag, order: memory_order) {…}

    atomic_flag_test_and_set ¶

    atomic_flag_test_and_set :: proc(flag: ^atomic_flag) -> bool {…}

    atomic_flag_test_and_set_explicit ¶

    atomic_flag_test_and_set_explicit :: proc(flag: ^atomic_flag, order: memory_order) -> bool {…}

    atomic_init ¶

    atomic_init :: proc(obj: ^$T, value: $T) {…}

    atomic_is_lock_free ¶

    atomic_is_lock_free :: proc(obj: ^$T) -> bool {…}
     

    7.17.5 Lock-free property

    atomic_load ¶

    atomic_load :: proc(object: ^$T) -> $T {…}

    atomic_load_explicit ¶

    atomic_load_explicit :: proc(object: ^$T, order: memory_order) {…}

    atomic_signal_fence ¶

    atomic_signal_fence :: proc(order: memory_order) {…}

    atomic_store ¶

    atomic_store :: proc(object: ^$T, desired: $T) {…}
     

    7.17.7 Operations on atomic types

    atomic_store_explicit ¶

    atomic_store_explicit :: proc(object: ^$T, desired: $T, order: memory_order) {…}

    atomic_thread_fence ¶

    atomic_thread_fence :: proc(order: memory_order) {…}
     

    7.17.4 Fences

    bsearch ¶

    bsearch :: proc "c" (key, base: rawptr, nmemb, size: uint, compar: proc "c" (lhs, rhs: rawptr) -> i32) -> rawptr ---
     

    7.22.5 Searching and sorting utilities

    btowc ¶

    btowc :: proc "c" (c: i32) -> wint_t ---
     

    7.29.6.1 Single-byte/wide character conversion functions

    c16rtomb ¶

    c16rtomb :: proc "c" (s: ^u8, c16: u16, ps: ^mbstate_t) -> uint ---

    c32rtomb ¶

    c32rtomb :: proc "c" (s: ^u8, c32: u32, ps: ^mbstate_t) -> uint ---

    cabs ¶

    cabs :: proc "c" (z: complex_double) -> f64 ---
     

    7.3.8 Power and absolute-value functions

    cabsf ¶

    cabsf :: proc "c" (z: complex_float) -> f32 ---

    cacos ¶

    cacos :: proc "c" (z: complex_double) -> complex_double ---
     

    7.3.5 Trigonometric functions

    cacosf ¶

    cacosf :: proc "c" (z: complex_float) -> complex_float ---

    cacosh ¶

    cacosh :: proc "c" (z: complex_double) -> complex_double ---
     

    7.3.6 Hyperbolic functions

    cacoshf ¶

    cacoshf :: proc "c" (z: complex_float) -> complex_float ---

    call_once ¶

    call_once :: proc "c" (flag: ^once_flag, func: proc "c" ()) ---
     

    7.26.2 Initialization functions

    calloc ¶

    calloc :: proc "c" (nmemb, size: uint) -> rawptr ---
     

    7.22.3 Memory management functions

    carg ¶

    carg :: proc "c" (z: complex_double) -> f64 ---
     

    7.3.9 Manipulation functions

    cargf ¶

    cargf :: proc "c" (z: complex_float) -> f32 ---

    casin ¶

    casin :: proc "c" (z: complex_double) -> complex_double ---

    casinf ¶

    casinf :: proc "c" (z: complex_float) -> complex_float ---

    casinh ¶

    casinh :: proc "c" (z: complex_double) -> complex_double ---

    casinhf ¶

    casinhf :: proc "c" (z: complex_float) -> complex_float ---

    catan ¶

    catan :: proc "c" (z: complex_double) -> complex_double ---

    catanf ¶

    catanf :: proc "c" (z: complex_float) -> complex_float ---

    catanh ¶

    catanh :: proc "c" (z: complex_double) -> complex_double ---

    catanhf ¶

    catanhf :: proc "c" (z: complex_float) -> complex_float ---

    ccos ¶

    ccos :: proc "c" (z: complex_double) -> complex_double ---

    ccosf ¶

    ccosf :: proc "c" (z: complex_float) -> complex_float ---

    ccosh ¶

    ccosh :: proc "c" (z: complex_double) -> complex_double ---

    ccoshf ¶

    ccoshf :: proc "c" (z: complex_float) -> complex_float ---

    cexp ¶

    cexp :: proc "c" (z: complex_double) -> complex_double ---
     

    7.3.7 Exponential and logarithmic functions

    cexpf ¶

    cexpf :: proc "c" (z: complex_float) -> complex_float ---

    cimag ¶

    cimag :: proc "c" (z: complex_double) -> f64 ---

    cimagf ¶

    cimagf :: proc "c" (z: complex_float) -> f32 ---

    clearerr ¶

    clearerr :: proc "c" (stream: ^FILE) ---
     

    7.21.10 Error-handling functions

    clock ¶

    clock :: proc "c" () -> clock_t ---
     

    7.27.2 Time manipulation functions

    clog ¶

    clog :: proc "c" (z: complex_double) -> complex_double ---

    clogf ¶

    clogf :: proc "c" (z: complex_float) -> complex_float ---

    cnd_broadcast ¶

    cnd_broadcast :: proc "c" (cond: ^cnd_t) -> i32 ---
     

    7.26.3 Condition variable functions

    cnd_destroy ¶

    cnd_destroy :: proc "c" (cond: ^cnd_t) ---

    cnd_init ¶

    cnd_init :: proc "c" (cond: ^cnd_t) -> i32 ---

    cnd_signal ¶

    cnd_signal :: proc "c" (cond: ^cnd_t) -> i32 ---

    cnd_timedwait ¶

    cnd_timedwait :: proc "c" (cond: ^cnd_t, mtx: ^mtx_t, ts: ^timespec) -> i32 ---

    cnd_wait ¶

    cnd_wait :: proc "c" (cond: ^cnd_t, mtx: ^mtx_t) -> i32 ---

    conj ¶

    conj :: proc "c" (z: complex_double) -> complex_double ---

    conjf ¶

    conjf :: proc "c" (z: complex_float) -> complex_float ---

    cpow ¶

    cpow :: proc "c" (x, y: complex_double) -> complex_double ---

    cpowf ¶

    cpowf :: proc "c" (x, y: complex_float) -> complex_float ---

    cproj ¶

    cproj :: proc "c" (z: complex_double) -> complex_double ---

    cprojf ¶

    cprojf :: proc "c" (z: complex_float) -> complex_float ---

    creal ¶

    creal :: proc "c" (z: complex_double) -> f64 ---

    crealf ¶

    crealf :: proc "c" (z: complex_float) -> f32 ---

    csin ¶

    csin :: proc "c" (z: complex_double) -> complex_double ---

    csinf ¶

    csinf :: proc "c" (z: complex_float) -> complex_float ---

    csinh ¶

    csinh :: proc "c" (z: complex_double) -> complex_double ---

    csinhf ¶

    csinhf :: proc "c" (z: complex_float) -> complex_float ---

    csqrt ¶

    csqrt :: proc "c" (z: complex_double) -> complex_double ---

    csqrtf ¶

    csqrtf :: proc "c" (z: complex_float) -> complex_float ---

    ctan ¶

    ctan :: proc "c" (z: complex_double) -> complex_double ---

    ctanf ¶

    ctanf :: proc "c" (z: complex_float) -> complex_float ---

    ctanh ¶

    ctanh :: proc "c" (z: complex_double) -> complex_double ---

    ctanhf ¶

    ctanhf :: proc "c" (z: complex_float) -> complex_float ---

    ctime ¶

    ctime :: proc "c" (timer: ^time_t) -> [^]u8 ---

    difftime ¶

    difftime :: proc "c" (time1, time2: time_t) -> f64 ---

    div ¶

    div :: proc "c" (numer, denom: i32) -> div_t ---

    errno ¶

    errno :: proc "contextless" () -> ^i32 {…}
     

    Odin has no way to make an identifier "errno" behave as a function call to read the value, or to produce an lvalue such that you can assign a different error value to errno. To work around this, just expose it as a function like it actually is.

    exit ¶

    exit :: proc "c" (status: i32) -> ! ---

    fclose ¶

    fclose :: proc "c" (stream: ^FILE) -> i32 ---
     

    7.21.5 File access functions

    feof ¶

    feof :: proc "c" (stream: ^FILE) -> i32 ---

    ferror ¶

    ferror :: proc "c" (stream: ^FILE) -> i32 ---

    fflush ¶

    fflush :: proc "c" (stream: ^FILE) -> i32 ---

    fgetc ¶

    fgetc :: proc "c" (stream: ^FILE) -> i32 ---
     

    7.21.7 Character input/output functions

    fgetpos ¶

    fgetpos :: proc "c" (stream: ^FILE, pos: ^fpos_t) -> i32 ---
     

    7.21.9 File positioning functions

    fgets ¶

    fgets :: proc "c" (s: [^]u8, n: i32, stream: ^FILE) -> [^]u8 ---

    fgetws ¶

    fgetws :: proc "c" (s: [^]u16, n: i32, stream: ^FILE) -> u16 ---

    fopen ¶

    fopen :: proc "c" (filename, mode: cstring) -> ^FILE ---

    fprintf ¶

    fprintf :: proc "c" (stream: ^FILE, format: cstring, .. args: ..any) -> i32 ---
     

    7.21.6 Formatted input/output functions

    fputc ¶

    fputc :: proc "c" (s: cstring, stream: ^FILE) -> i32 ---

    fputwc ¶

    fputwc :: proc "c" (c: u16, stream: ^FILE) -> wint_t ---

    fputws ¶

    fputws :: proc "c" (s: [^]u16, stream: ^FILE) -> i32 ---

    fread ¶

    fread :: proc "c" (ptr: rawptr, size: uint, nmemb: uint, stream: ^FILE) -> uint ---

    free ¶

    free :: proc "c" (ptr: rawptr) ---

    freopen ¶

    freopen :: proc "c" (filename, mode: cstring, stream: ^FILE) -> ^FILE ---

    fscanf ¶

    fscanf :: proc "c" (stream: ^FILE, format: cstring, .. args: ..any) -> i32 ---

    fseek ¶

    fseek :: proc "c" (stream: ^FILE, offset: i32, whence: Whence) -> i32 ---

    fsetpos ¶

    fsetpos :: proc "c" (stream: ^FILE, pos: ^fpos_t) -> i32 ---

    ftell ¶

    ftell :: proc "c" (stream: ^FILE) -> i32 ---

    fwgetc ¶

    fwgetc :: proc "c" (stream: ^FILE) -> wint_t ---
     

    7.29.3 Wide character input/output functions

    fwide ¶

    fwide :: proc "c" (stream: ^FILE, mode: i32) -> i32 ---

    fwprintf ¶

    fwprintf :: proc "c" (stream: ^FILE, format: [^]u16, .. arg: ..any) -> i32 ---
     

    7.29.2 Formatted wide character input/output functions

    fwrite ¶

    fwrite :: proc "c" (ptr: rawptr, size: uint, nmemb: uint, stream: ^FILE) -> uint ---

    fwscanf ¶

    fwscanf :: proc "c" (stream: ^FILE, format: [^]u16, .. arg: ..any) -> i32 ---

    getc ¶

    getc :: proc "c" (stream: ^FILE) -> i32 ---

    getchar ¶

    getchar :: proc "c" () -> i32 ---

    getenv ¶

    getenv :: proc "c" (name: cstring) -> cstring ---

    getwc ¶

    getwc :: proc "c" (stream: ^FILE) -> wint_t ---

    getwchar ¶

    getwchar :: proc "c" () -> wint_t ---

    gmtime ¶

    gmtime :: proc "c" (timer: ^time_t) -> ^tm ---

    isalnum ¶

    isalnum :: proc "c" (c: i32) -> i32 ---
     

    7.4.1 Character classification functions

    isalpha ¶

    isalpha :: proc "c" (c: i32) -> i32 ---

    isblank ¶

    isblank :: proc "c" (c: i32) -> i32 ---

    iscntrl ¶

    iscntrl :: proc "c" (c: i32) -> i32 ---

    isdigit ¶

    isdigit :: proc "c" (c: i32) -> i32 ---

    isfinite ¶

    isfinite :: proc(x: $T) -> bool {…}

    isgraph ¶

    isgraph :: proc "c" (c: i32) -> i32 ---

    isgreater ¶

    isgreater :: proc(x, y: $T) -> bool {…}
     

    These are special in that they avoid float exceptions. They cannot just be implemented as the relational comparisons, as that would produce an invalid "sticky" state that propagates and affects maths results. These need to be implemented natively in Odin assuming isunordered to prevent that.

    isgreaterequal ¶

    isgreaterequal :: proc(x, y: $T) -> bool {…}

    isinf ¶

    isinf :: proc(x: $T) -> bool {…}

    isless ¶

    isless :: proc(x, y: $T) -> bool {…}

    islessequal ¶

    islessequal :: proc(x, y: $T) -> bool {…}

    islessgreater ¶

    islessgreater :: proc(x, y: $T) -> bool {…}

    islower ¶

    islower :: proc "c" (c: i32) -> i32 ---

    isnan ¶

    isnan :: proc(x: $T) -> bool {…}

    isnormal ¶

    isnormal :: proc(x: $T) -> bool {…}

    isprint ¶

    isprint :: proc "c" (c: i32) -> i32 ---

    ispunct ¶

    ispunct :: proc "c" (c: i32) -> i32 ---

    isspace ¶

    isspace :: proc "c" (c: i32) -> i32 ---

    isunordered ¶

    isunordered :: proc(x, y: $T) -> bool {…}

    isupper ¶

    isupper :: proc "c" (c: i32) -> i32 ---

    iswalnum ¶

    iswalnum :: proc "c" (wc: wint_t) -> i32 ---
     

    7.30.2.1 Wide character classification functions

    iswalpha ¶

    iswalpha :: proc "c" (wc: wint_t) -> i32 ---

    iswblank ¶

    iswblank :: proc "c" (wc: wint_t) -> i32 ---

    iswcntrl ¶

    iswcntrl :: proc "c" (wc: wint_t) -> i32 ---

    iswctype ¶

    iswctype :: proc "c" (wc: wint_t, desc: wctype_t) -> i32 ---
     

    7.30.2.2 Extensible wide character classification functions

    iswdigit ¶

    iswdigit :: proc "c" (wc: wint_t) -> i32 ---

    iswgraph ¶

    iswgraph :: proc "c" (wc: wint_t) -> i32 ---

    iswlower ¶

    iswlower :: proc "c" (wc: wint_t) -> i32 ---

    iswprint ¶

    iswprint :: proc "c" (wc: wint_t) -> i32 ---

    iswpunct ¶

    iswpunct :: proc "c" (wc: wint_t) -> i32 ---

    iswspace ¶

    iswspace :: proc "c" (wc: wint_t) -> i32 ---

    iswupper ¶

    iswupper :: proc "c" (wc: wint_t) -> i32 ---

    iswxdigit ¶

    iswxdigit :: proc "c" (wc: wint_t) -> i32 ---

    isxdigit ¶

    isxdigit :: proc "c" (c: i32) -> i32 ---

    kill_dependency ¶

    kill_dependency :: proc(value: $T) -> $T {…}

    labs ¶

    labs :: proc "c" (j: i32) -> i32 ---

    ldiv ¶

    ldiv :: proc "c" (numer, denom: i32) -> ldiv_t ---

    llabs ¶

    llabs :: proc "c" (j: i64) -> i64 ---

    lldiv ¶

    lldiv :: proc "c" (numer, denom: i64) -> lldiv_t ---

    localeconv ¶

    localeconv :: proc "c" () -> ^lconv ---
     

    Sets the components of an object with the type lconv with the values appropriate for the formatting of numeric quantities (monetary and otherwise) according to the rules of the current locale.

    Returns:
    a pointer to the lconv structure, might be invalidated by subsequent calls to localeconv() and setlocale()

    More

    localtime ¶

    localtime :: proc "c" (timer: ^time_t) -> ^tm ---

    longjmp ¶

    longjmp :: proc "c" (env: ^jmp_buf, val: i32) -> ! ---
     

    7.13.2 Restore calling environment

    malloc ¶

    malloc :: proc "c" (size: uint) -> rawptr ---

    mblen ¶

    mblen :: proc "c" (s: cstring, n: uint) -> i32 ---
     

    7.22.7 Multibyte/wide character conversion functions

    mbrlen ¶

    mbrlen :: proc "c" (s: cstring, n: uint, ps: ^mbstate_t) -> uint ---
     

    7.29.6.3 Restartable multibyte/wide character conversion functions

    mbrtoc16 ¶

    mbrtoc16 :: proc "c" (pc16: [^]u16, s: cstring, n: uint, ps: ^mbstate_t) -> uint ---
     

    7.28.1 Restartable multibyte/wide character conversion functions

    mbrtoc32 ¶

    mbrtoc32 :: proc "c" (pc32: [^]u32, s: cstring, n: uint, ps: ^mbstate_t) -> uint ---

    mbrtowc ¶

    mbrtowc :: proc "c" (pwc: [^]u16, s: cstring, n: uint, ps: ^mbstate_t) -> uint ---

    mbsinit ¶

    mbsinit :: proc "c" (ps: ^mbstate_t) -> i32 ---
     

    7.29.6.2 Conversion state functions

    mbsrtowcs ¶

    mbsrtowcs :: proc "c" (dst: [^]u16, src: ^cstring, len: uint, ps: ^mbstate_t) -> uint ---
     

    7.29.6.4 Restartable multibyte/wide string conversion functions

    mbstowcs ¶

    mbstowcs :: proc "c" (pwcs: ^u16, s: cstring, n: uint) -> uint ---
     

    7.22.8 Multibyte/wide string conversion functions

    mbtowc ¶

    mbtowc :: proc "c" (pwc: ^u16, s: cstring, n: uint) -> i32 ---

    memchr ¶

    memchr :: proc "c" (s: rawptr, c: i32, n: uint) -> rawptr ---
     

    7.24.5 Search functions

    memcmp ¶

    memcmp :: proc "c" (s1, s2: rawptr, n: uint) -> i32 ---
     

    7.24.4 Comparison functions

    memcpy ¶

    memcpy :: proc "c" (s1, s2: rawptr, n: uint) -> rawptr ---
     

    7.24.2 Copying functions

    memmove ¶

    memmove :: proc "c" (s1, s2: rawptr, n: uint) -> rawptr ---

    memset ¶

    memset :: proc "c" (s: rawptr, c: i32, n: uint) -> rawptr {…}

    mktime ¶

    mktime :: proc "c" (timeptr: ^tm) -> time_t ---

    mtx_destroy ¶

    mtx_destroy :: proc "c" (mtx: ^mtx_t) ---
     

    7.26.4 Mutex functions

    mtx_init ¶

    mtx_init :: proc "c" (mtx: ^mtx_t, type: i32) -> i32 ---

    mtx_lock ¶

    mtx_lock :: proc "c" (mtx: ^mtx_t) -> i32 ---

    mtx_timedlock ¶

    mtx_timedlock :: proc "c" (mtx: ^mtx_t, ts: ^timespec) -> i32 ---

    mtx_trylock ¶

    mtx_trylock :: proc "c" (mtx: ^mtx_t) -> i32 ---

    mtx_unlock ¶

    mtx_unlock :: proc "c" (mtx: ^mtx_t) -> i32 ---

    perror ¶

    perror :: proc "c" (s: cstring) ---

    printf ¶

    printf :: proc "c" (format: cstring, .. args: ..any) -> i32 ---

    putc ¶

    putc :: proc "c" (c: i32, stream: ^FILE) -> i32 ---

    putchar ¶

    putchar :: proc "c" (c: i32) -> i32 ---

    puts ¶

    puts :: proc "c" (s: cstring) -> i32 ---

    putwc ¶

    putwc :: proc "c" (c: u16, stream: ^FILE) -> wint_t ---

    putwchar ¶

    putwchar :: proc "c" (c: u16) -> wint_t ---

    qsort ¶

    qsort :: proc "c" (base: rawptr, nmemb, size: uint, compar: proc "c" (lhs, rhs: rawptr) -> i32) ---

    quick_exit ¶

    quick_exit :: proc "c" (status: i32) -> ! ---

    raise ¶

    raise :: proc "c" (sig: i32) -> i32 ---

    rand ¶

    rand :: proc "c" () -> i32 ---
     

    7.22.2 Pseudo-random sequence generation functions

    realloc ¶

    realloc :: proc "c" (ptr: rawptr, size: uint) -> rawptr ---

    remove ¶

    remove :: proc "c" (filename: cstring) -> i32 ---
     

    7.21.4 Operations on files

    rename ¶

    rename :: proc "c" (old, new: cstring) -> i32 ---

    rewind ¶

    rewind :: proc "c" (stream: ^FILE) ---

    scanf ¶

    scanf :: proc "c" (format: cstring, .. args: ..any) -> i32 ---

    setbuf ¶

    setbuf :: proc "c" (stream: ^FILE, buf: [^]u8) ---

    setjmp ¶

    setjmp :: proc "c" (env: ^jmp_buf, hack: rawptr = nil) -> i32 ---
     

    7.13.1 Save calling environment

    NOTE(dweiler): C11 requires setjmp be a macro, which means it won't necessarily export a symbol named setjmp but rather _setjmp in the case of musl, glibc, BSD libc, and msvcrt.

    / NOTE(dweiler): UCRT has two implementations of longjmp. One that performs stack unwinding and one that doesn't. The choice of which to use depends on a flag which is set inside the jmp_buf structure given to setjmp. The default behavior is to unwind the stack. Within Odin, we cannot use the stack unwinding version as the unwinding information isn't present. To opt-in to the regular non-unwinding version we need a way to set this flag. Since the location of the flag within the struct is not defined or part of the ABI and can change between versions of UCRT, we must rely on setjmp to set it. It turns out that setjmp receives this flag in the RDX register on Win64, this just so happens to coincide with the second argument of a function in the Win64 ABI. By giving our setjmp a second argument with the value of zero, the RDX register will contain zero and correctly set the flag to disable stack unwinding.

    setlocale ¶

    setlocale :: proc "c" (category: Locale_Category, locale: cstring) -> cstring ---
     

    Selects the appropriate piece of the global locale, as specified by the category and locale arguments, and can be used to change or query the entire global locale or portions thereof.

    Returns:
    the current locale if locale is nil, the set locale otherwise

    More

    setvbuf ¶

    setvbuf :: proc "c" (stream: ^FILE, buf: [^]u8, mode: i32, size: uint) -> i32 ---

    signal ¶

    signal :: proc "c" (sig: i32, func: proc "c" (i32)) -> proc "c" (i32) ---

    snprintf ¶

    snprintf :: proc "c" (s: [^]u8, n: uint, format: cstring, .. args: ..any) -> i32 ---

    srand ¶

    srand :: proc "c" (seed: u32) ---

    sscanf ¶

    sscanf :: proc "c" (s, format: cstring, .. args: ..any) -> i32 ---

    strcat ¶

    strcat :: proc "c" (s1: [^]u8, s2: cstring) -> [^]u8 ---
     

    7.24.3 Concatenation functions

    strchr ¶

    strchr :: proc "c" (s: cstring, c: i32) -> [^]u8 ---

    strcmp ¶

    strcmp :: proc "c" (s1, s2: cstring) -> i32 ---

    strcoll ¶

    strcoll :: proc "c" (s1, s2: cstring) -> i32 ---

    strcpn ¶

    strcpn :: proc "c" (s1, s2: cstring) -> [^]u8 ---

    strcpy ¶

    strcpy :: proc "c" (s1: [^]u8, s2: cstring) -> [^]u8 ---

    strcspn ¶

    strcspn :: proc "c" (s1, s2: cstring) -> uint ---

    strerror ¶

    strerror :: proc "c" (errnum: i32) -> cstring ---
     

    7.24.6 Miscellaneous functions

    strftime ¶

    strftime :: proc "c" (s: [^]u8, maxsize: uint, format: cstring, timeptr: ^tm) -> uint ---

    strlen ¶

    strlen :: proc "c" (s: cstring) -> uint ---

    strncat ¶

    strncat :: proc "c" (s1: [^]u8, s2: cstring, n: uint) -> [^]u8 ---

    strncmp ¶

    strncmp :: proc "c" (s1, s2: cstring, n: uint) -> i32 ---

    strncpy ¶

    strncpy :: proc "c" (s1: [^]u8, s2: cstring, n: uint) -> [^]u8 ---

    strpbrk ¶

    strpbrk :: proc "c" (s1, s2: cstring) -> [^]u8 ---

    strrchr ¶

    strrchr :: proc "c" (s: [^]u8, c: i32) -> [^]u8 ---

    strtod ¶

    strtod :: proc "c" (nptr: cstring, endptr: ^[^]u8) -> f64 ---

    strtof ¶

    strtof :: proc "c" (nptr: cstring, endptr: ^[^]u8) -> f32 ---

    strtok ¶

    strtok :: proc "c" (s1: [^]u8, s2: cstring) -> [^]u8 ---

    strtol ¶

    strtol :: proc "c" (nptr: cstring, endptr: ^[^]u8, base: i32) -> i32 ---

    strtoll ¶

    strtoll :: proc "c" (nptr: cstring, endptr: ^[^]u8, base: i32) -> i64 ---

    strtoul ¶

    strtoul :: proc "c" (nptr: cstring, endptr: ^[^]u8, base: i32) -> u32 ---

    strtoull ¶

    strtoull :: proc "c" (nptr: cstring, endptr: ^[^]u8, base: i32) -> u64 ---

    strxfrm ¶

    strxfrm :: proc "c" (s1: [^]u8, s2: cstring, n: uint) -> uint ---

    swprintf ¶

    swprintf :: proc "c" (stream: ^FILE, n: uint, format: [^]u16, .. arg: ..any) -> i32 ---

    swscanf ¶

    swscanf :: proc "c" (s, format: [^]u16, .. arg: ..any) -> i32 ---

    system ¶

    system :: proc "c" (cmd: cstring) -> i32 ---

    thrd_create ¶

    thrd_create :: proc "c" (thr: ^thrd_t, func: thrd_start_t, arg: rawptr) -> i32 ---
     

    7.26.5 Thread functions

    thrd_current ¶

    thrd_current :: proc "c" () -> thrd_t ---

    thrd_detach ¶

    thrd_detach :: proc "c" (thr: thrd_t) -> i32 ---

    thrd_equal ¶

    thrd_equal :: proc "c" (lhs, rhs: thrd_t) -> i32 ---

    thrd_exit ¶

    thrd_exit :: proc "c" (res: i32) -> ! ---

    thrd_join ¶

    thrd_join :: proc "c" (thr: thrd_t, res: ^i32) -> i32 ---

    thrd_sleep ¶

    thrd_sleep :: proc "c" (duration, remaining: ^timespec) -> i32 ---

    thrd_yield ¶

    thrd_yield :: proc "c" () ---

    time ¶

    time :: proc "c" (timer: ^time_t) -> time_t ---

    timespec_get ¶

    timespec_get :: proc "c" (ts: ^timespec, base: i32) -> i32 ---

    tmpfile ¶

    tmpfile :: proc "c" () -> ^FILE ---

    tmpnam ¶

    tmpnam :: proc "c" (s: [^]u8) -> [^]u8 ---

    to_stream ¶

    to_stream :: proc(file: ^FILE) -> io.Stream {…}

    tolower ¶

    tolower :: proc "c" (c: i32) -> i32 ---
     

    7.4.2 Character case mapping functions

    toupper ¶

    toupper :: proc "c" (c: i32) -> i32 ---

    towctrans ¶

    towctrans :: proc "c" (wc: wint_t, desc: wctrans_t) -> wint_t ---
     

    7.30.3.2 Extensible wide character case mapping functions

    towlower ¶

    towlower :: proc "c" (wc: wint_t) -> wint_t ---
     

    7.30.3 Wide character case mapping utilities

    towupper ¶

    towupper :: proc "c" (wc: wint_t) -> wint_t ---

    tss_create ¶

    tss_create :: proc "c" (key: ^tss_t, dtor: tss_dtor_t) -> i32 ---
     

    7.26.6 Thread-specific storage functions

    tss_delete ¶

    tss_delete :: proc "c" (key: tss_t) ---

    tss_get ¶

    tss_get :: proc "c" (key: tss_t) -> rawptr ---

    tss_set ¶

    tss_set :: proc "c" (key: tss_t, val: rawptr) -> i32 ---

    ungetc ¶

    ungetc :: proc "c" (c: i32, stream: ^FILE) -> i32 ---

    ungetwc ¶

    ungetwc :: proc "c" (c: u16, stream: ^FILE) -> wint_t ---

    va_copy ¶

    va_copy :: proc(dst, src: ^c.va_list) {…}

    va_end ¶

    va_end :: proc(ap: ^c.va_list) {…}

    va_start ¶

    va_start :: proc(ap: ^c.va_list, _: any) {…}

    vfprintf ¶

    vfprintf :: proc "c" (stream: ^FILE, format: cstring, arg: ^c.va_list) -> i32 ---

    vfscanf ¶

    vfscanf :: proc "c" (stream: ^FILE, format: cstring, arg: ^c.va_list) -> i32 ---

    vfwprintf ¶

    vfwprintf :: proc "c" (stream: ^FILE, format: [^]u16, arg: c.va_list) -> i32 ---

    vfwscanf ¶

    vfwscanf :: proc "c" (stream: ^FILE, format: [^]u16, arg: c.va_list) -> i32 ---

    vprintf ¶

    vprintf :: proc "c" (format: cstring, arg: ^c.va_list) -> i32 ---

    vscanf ¶

    vscanf :: proc "c" (format: cstring, arg: ^c.va_list) -> i32 ---

    vsnprintf ¶

    vsnprintf :: proc "c" (s: [^]u8, n: uint, format: cstring, arg: ^c.va_list) -> i32 ---

    vsprintf ¶

    vsprintf :: proc "c" (s: [^]u8, format: cstring, arg: ^c.va_list) -> i32 ---

    vsscanf ¶

    vsscanf :: proc "c" (s, format: cstring, arg: ^c.va_list) -> i32 ---

    vswprintf ¶

    vswprintf :: proc "c" (s: [^]u16, n: uint, format: [^]u16, arg: c.va_list) -> i32 ---

    vswscanf ¶

    vswscanf :: proc "c" (s, format: [^]u16, arg: c.va_list) -> i32 ---

    vwprintf ¶

    vwprintf :: proc "c" (format: [^]u16, arg: c.va_list) -> i32 ---

    vwscanf ¶

    vwscanf :: proc "c" (format: [^]u16, arg: c.va_list) -> i32 ---

    wcrtomb ¶

    wcrtomb :: proc "c" (s: ^u8, wc: u16, ps: ^mbstate_t) -> uint ---

    wcscat ¶

    wcscat :: proc "c" (s1, s2: [^]u16) -> [^]u16 ---
     

    7.29.4.3 Wide string concatenation functions

    wcschr ¶

    wcschr :: proc "c" (s: [^]u16, c: u16) -> [^]u16 ---
     

    7.29.4.5 Wide string search functions

    wcscmp ¶

    wcscmp :: proc "c" (s1, s2: [^]u16) -> i32 ---
     

    7.29.4.4 Wide string comparison functions

    wcscoll ¶

    wcscoll :: proc "c" (s1, s2: [^]u16) -> i32 ---

    wcscpy ¶

    wcscpy :: proc "c" (s1, s2: [^]u16) -> [^]u16 ---
     

    7.29.4.2 Wide string copying functions

    wcscspn ¶

    wcscspn :: proc "c" (s1, s2: [^]u16) -> uint ---

    wcsftime ¶

    wcsftime :: proc "c" (s: [^]u16, maxsize: uint, format: [^]u16, timeptr: ^tm) -> uint ---
     

    7.29.5 Wide character time conversion functions

    wcslen ¶

    wcslen :: proc "c" (s: [^]u16) -> uint ---
     

    7.29.4.6 Miscellaneous functions

    wcsncat ¶

    wcsncat :: proc "c" (s1, s2: [^]u16, n: uint) -> [^]u16 ---

    wcsncmp ¶

    wcsncmp :: proc "c" (s1, s2: [^]u16, n: uint) -> i32 ---

    wcsncpy ¶

    wcsncpy :: proc "c" (s1, s2: [^]u16, n: uint) -> [^]u16 ---

    wcspbrk ¶

    wcspbrk :: proc "c" (s1, s2: [^]u16) -> [^]u16 ---

    wcsrchr ¶

    wcsrchr :: proc "c" (s: [^]u16, c: u16) -> [^]u16 ---

    wcsrtombs ¶

    wcsrtombs :: proc "c" (dst: ^u8, src: ^[^]u16, len: uint, ps: ^mbstate_t) -> uint ---

    wcsspn ¶

    wcsspn :: proc "c" (s1, s2: [^]u16) -> uint ---

    wcsstr ¶

    wcsstr :: proc "c" (s1, s2: [^]u16) -> [^]u16 ---

    wcstod ¶

    wcstod :: proc "c" (nptr: [^]u16, endptr: ^[^]u16) -> f64 ---
     

    7.29.4 General wide string utilities

    wcstof ¶

    wcstof :: proc "c" (nptr: [^]u16, endptr: ^[^]u16) -> f32 ---

    wcstok ¶

    wcstok :: proc "c" (s1, s2: [^]u16, ptr: ^[^]u16) -> [^]u16 ---

    wcstol ¶

    wcstol :: proc "c" (nptr: [^]u16, endptr: ^[^]u16, base: i32) -> i32 ---

    wcstoll ¶

    wcstoll :: proc "c" (nptr: [^]u16, endptr: ^[^]u16, base: i32) -> i64 ---

    wcstombs ¶

    wcstombs :: proc "c" (s: [^]u8, pwcs: ^u16, n: uint) -> uint ---

    wcstoul ¶

    wcstoul :: proc "c" (nptr: [^]u16, endptr: ^[^]u16, base: i32) -> u32 ---

    wcstoull ¶

    wcstoull :: proc "c" (nptr: [^]u16, endptr: ^[^]u16, base: i32) -> u64 ---

    wcsxfrm ¶

    wcsxfrm :: proc "c" (s1, s2: [^]u16, n: uint) -> uint ---

    wctob ¶

    wctob :: proc "c" (c: wint_t) -> i32 ---

    wctomb ¶

    wctomb :: proc "c" (s: [^]u8, wc: u16) -> i32 ---

    wctrans ¶

    wctrans :: proc "c" (property: cstring) -> wctrans_t ---

    wctype ¶

    wctype :: proc "c" (property: cstring) -> wctype_t ---

    wmemchr ¶

    wmemchr :: proc "c" (s: [^]u16, c: u16, n: uint) -> [^]u16 ---

    wmemcmp ¶

    wmemcmp :: proc "c" (s1, s2: [^]u16, n: uint) -> i32 ---

    wmemcpy ¶

    wmemcpy :: proc "c" (s1, s2: [^]u16, n: uint) -> [^]u16 ---

    wmemmove ¶

    wmemmove :: proc "c" (s1, s2: [^]u16, n: uint) -> [^]u16 ---

    wmemset ¶

    wmemset :: proc "c" (s: [^]u16, c: u16, n: uint) -> [^]u16 ---

    wprintf ¶

    wprintf :: proc "c" (format: [^]u16, .. arg: ..any) -> i32 ---

    wscanf ¶

    wscanf :: proc "c" (format: [^]u16, .. arg: ..any) -> i32 ---

    Procedure Groups

    acos ¶

    acos :: proc{
    	libc_acos,
    	libc_acosf,
    	cacos,
    	cacosf,
    }
    
     

    Emulate tgmath.h behavior with explicit procedure overloading here.

    acosf ¶

    acosf :: proc{
    	libc_acosf,
    }
    
     

    But retain the 'f' suffix-variant functions as well so they can be used, a trick is used here where we use explicit procedural overloading of one procedure. This is done because the foreign block is marked @(private) and aliasing functions does not remove privateness from the entity.

    acoshf ¶

    acoshf :: proc{
    	libc_acoshf,
    }
    

    asinf ¶

    asinf :: proc{
    	libc_asinf,
    }
    

    asinhf ¶

    asinhf :: proc{
    	libc_asinhf,
    }
    

    atan2f ¶

    atan2f :: proc{
    	libc_atan2f,
    }
    

    atanf ¶

    atanf :: proc{
    	libc_atanf,
    }
    

    atanhf ¶

    atanhf :: proc{
    	libc_atanhf,
    }
    

    cbrt ¶

    cbrt :: proc{
    	libc_cbrt,
    	libc_cbrtf,
    }
    

    cbrtf ¶

    cbrtf :: proc{
    	libc_cbrtf,
    }
    

    ceil ¶

    ceil :: proc{
    	libc_ceil,
    	libc_ceilf,
    }
    

    ceilf ¶

    ceilf :: proc{
    	libc_ceilf,
    }
    

    copysignf ¶

    copysignf :: proc{
    	libc_copysignf,
    }
    

    cosf ¶

    cosf :: proc{
    	libc_cosf,
    }
    

    coshf ¶

    coshf :: proc{
    	libc_coshf,
    }
    

    erf ¶

    erf :: proc{
    	libc_erf,
    	libc_erff,
    }
    

    erfc ¶

    erfc :: proc{
    	libc_erfc,
    	libc_erfcf,
    }
    

    erfcf ¶

    erfcf :: proc{
    	libc_erfcf,
    }
    

    erff ¶

    erff :: proc{
    	libc_erff,
    }
    

    exp2 ¶

    exp2 :: proc{
    	libc_exp2,
    	libc_exp2f,
    }
    

    exp2f ¶

    exp2f :: proc{
    	libc_exp2f,
    }
    

    expf ¶

    expf :: proc{
    	libc_expf,
    }
    

    expm1f ¶

    expm1f :: proc{
    	libc_expm1f,
    }
    

    fabsf ¶

    fabsf :: proc{
    	libc_fabsf,
    }
    

    fdim ¶

    fdim :: proc{
    	libc_fdim,
    	libc_fdimf,
    }
    

    fdimf ¶

    fdimf :: proc{
    	libc_fdimf,
    }
    

    floorf ¶

    floorf :: proc{
    	libc_floorf,
    }
    

    fma ¶

    fma :: proc{
    	libc_fma,
    	libc_fmaf,
    }
    

    fmaf ¶

    fmaf :: proc{
    	libc_fmaf,
    }
    

    fmax ¶

    fmax :: proc{
    	libc_fmax,
    	libc_fmaxf,
    }
    

    fmaxf ¶

    fmaxf :: proc{
    	libc_fmaxf,
    }
    

    fmin ¶

    fmin :: proc{
    	libc_fmin,
    	libc_fminf,
    }
    

    fminf ¶

    fminf :: proc{
    	libc_fminf,
    }
    

    fmod ¶

    fmod :: proc{
    	libc_fmod,
    	libc_fmodf,
    }
    

    fmodf ¶

    fmodf :: proc{
    	libc_fmodf,
    }
    

    frexpf ¶

    frexpf :: proc{
    	libc_frexpf,
    }
    

    hypotf ¶

    hypotf :: proc{
    	libc_hypotf,
    }
    

    ilogbf ¶

    ilogbf :: proc{
    	libc_ilogbf,
    }
    

    ldexpf ¶

    ldexpf :: proc{
    	libc_ldexpf,
    }
    

    lgammaf ¶

    lgammaf :: proc{
    	libc_lgammaf,
    }
    

    llrintf ¶

    llrintf :: proc{
    	libc_llrintf,
    }
    

    llroundf ¶

    llroundf :: proc{
    	libc_llroundf,
    }
    

    log10f ¶

    log10f :: proc{
    	libc_log10f,
    }
    

    log1pf ¶

    log1pf :: proc{
    	libc_log1pf,
    }
    

    log2 ¶

    log2 :: proc{
    	libc_log2,
    	libc_log2f,
    }
    

    log2f ¶

    log2f :: proc{
    	libc_log2f,
    }
    

    logb ¶

    logb :: proc{
    	libc_logb,
    	libc_logbf,
    }
    

    logbf ¶

    logbf :: proc{
    	libc_logbf,
    }
    

    logf ¶

    logf :: proc{
    	libc_logf,
    }
    

    lrintf ¶

    lrintf :: proc{
    	libc_lrintf,
    }
    

    lroundf ¶

    lroundf :: proc{
    	libc_lroundf,
    }
    

    modf ¶

    modf :: proc{
    	libc_modf,
    	libc_modff,
    }
    

    modff ¶

    modff :: proc{
    	libc_modff,
    }
    

    nan ¶

    nan :: proc{
    	libc_nan,
    }
    
     

    These two functions are special and not made type generic in tgmath.h since they only differ by their return type.

    nanf ¶

    nanf :: proc{
    	libc_nanf,
    }
    

    nearbyintf ¶

    nearbyintf :: proc{
    	libc_nearbyintf,
    }
    

    nextafterf ¶

    nextafterf :: proc{
    	libc_nextafterf,
    }
    

    powf ¶

    powf :: proc{
    	libc_powf,
    }
    

    remainderf ¶

    remainderf :: proc{
    	libc_remainderf,
    }
    

    remquof ¶

    remquof :: proc{
    	libc_remquof,
    }
    

    rint ¶

    rint :: proc{
    	libc_rint,
    	libc_rintf,
    }
    

    rintf ¶

    rintf :: proc{
    	libc_rintf,
    }
    

    roundf ¶

    roundf :: proc{
    	libc_roundf,
    }
    

    scalblnf ¶

    scalblnf :: proc{
    	libc_scalblnf,
    }
    

    scalbnf ¶

    scalbnf :: proc{
    	libc_scalbnf,
    }
    

    signbit ¶

    signbit :: proc{
    	_signbit,
    	_signbitf,
    }
    

    sinf ¶

    sinf :: proc{
    	libc_sinf,
    }
    

    sinhf ¶

    sinhf :: proc{
    	libc_sinhf,
    }
    

    sqrtf ¶

    sqrtf :: proc{
    	libc_sqrtf,
    }
    

    tanf ¶

    tanf :: proc{
    	libc_tanf,
    }
    

    tanhf ¶

    tanhf :: proc{
    	libc_tanhf,
    }
    

    tgammaf ¶

    tgammaf :: proc{
    	libc_tgammaf,
    }
    

    truncf ¶

    truncf :: proc{
    	libc_truncf,
    }
    

    Source Files

    Generation Information

    Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:00.915073700 +0000 UTC