package core:c/libc
Index
Types (117)
- FILE
- Locale_Category
- Whence
- atomic_bool
- atomic_char
- atomic_char16_t
- atomic_char32_t
- atomic_flag
- atomic_int
- atomic_int_fast16_t
- atomic_int_fast32_t
- atomic_int_fast64_t
- atomic_int_fast8_t
- atomic_int_least16_t
- atomic_int_least32_t
- atomic_int_least64_t
- atomic_int_least8_t
- atomic_intmax_t
- atomic_intptr_t
- atomic_llong
- atomic_long
- atomic_ptrdiff_t
- atomic_schar
- atomic_short
- atomic_size_t
- atomic_uchar
- atomic_uint
- atomic_uint_fast16_t
- atomic_uint_fast32_t
- atomic_uint_fast64_t
- atomic_uint_fast8_t
- atomic_uint_least16_t
- atomic_uint_least32_t
- atomic_uint_least64_t
- atomic_uint_least8_t
- atomic_uintmax_t
- atomic_uintptr_t
- atomic_ullong
- atomic_ulong
- atomic_ushort
- atomic_wchar_t
- bool
- char
- char16_t
- char32_t
- clock_t
- cnd_t
- complex_double
- complex_float
- div_t
- double
- double_t
- float
- float_t
- fpos_t
- int
- int16_t
- int32_t
- int64_t
- int8_t
- int_fast16_t
- int_fast32_t
- int_fast64_t
- int_fast8_t
- int_least16_t
- int_least32_t
- int_least64_t
- int_least8_t
- intmax_t
- intptr_t
- jmp_buf
- lconv
- ldiv_t
- lldiv_t
- long
- longlong
- mbstate_t
- memory_order
- mtx_t
- once_flag
- ptrdiff_t
- schar
- short
- sig_atomic_t
- size_t
- ssize_t
- thrd_start_t
- thrd_t
- time_t
- timespec
- tm
- tss_dtor_t
- tss_t
- uchar
- uint
- uint16_t
- uint32_t
- uint64_t
- uint8_t
- uint_fast16_t
- uint_fast32_t
- uint_fast64_t
- uint_fast8_t
- uint_least16_t
- uint_least32_t
- uint_least64_t
- uint_least8_t
- uintmax_t
- uintptr_t
- ulong
- ulonglong
- ushort
- va_list
- wchar_t
- wctrans_t
- wctype_t
- wint_t
Constants (96)
- ATOMIC_BOOL_LOCK_FREE
- ATOMIC_CHAR16_T_LOCK_FREE
- ATOMIC_CHAR32_T_LOCK_FREE
- ATOMIC_CHAR_LOCK_FREE
- ATOMIC_INT_LOCK_FREE
- ATOMIC_LLONG_LOCK_FREE
- ATOMIC_LONG_LOCK_FREE
- ATOMIC_POINTER_LOCK_FREE
- ATOMIC_SHORT_LOCK_FREE
- ATOMIC_WCHAR_T_LOCK_FREE
- BUFSIZ
- CHAR_BIT
- CLOCKS_PER_SEC
- EDOM
- EILSEQ
- EOF
- ERANGE
- EXIT_FAILURE
- EXIT_SUCCESS
- FILENAME_MAX
- FOPEN_MAX
- FP_ILOGB0
- FP_ILOGBNAN
- FP_INFINITE
- FP_NAN
- FP_NORMAL
- FP_SUBNORMAL
- FP_ZERO
- HUGE_VAL
- HUGE_VALF
- INFINITY
- INT16_MAX
- INT16_MIN
- INT32_MAX
- INT32_MIN
- INT64_MAX
- INT64_MIN
- INT8_MAX
- INT8_MIN
- LC_ALL
- LC_COLLATE
- LC_CTYPE
- LC_MESSAGES
- LC_MONETARY
- LC_NUMERIC
- LC_TIME
- L_tmpnam
- MATH_ERREXCEPT
- MATH_ERRNO
- NDEBUG
- NULL
- PTRDIFF_MAX
- PTRDIFF_MIN
- RAND_MAX
- SEEK_CUR
- SEEK_END
- SEEK_SET
- SIGABRT
- SIGFPE
- SIGILL
- SIGINT
- SIGSEGV
- SIGTERM
- SIG_ATOMIC_MAX
- SIG_ATOMIC_MIN
- SIG_DFL
- SIG_ERR
- SIG_IGN
- SIZE_MAX
- TIME_UTC
- TMP_MAX
- TSS_DTOR_ITERATIONS
- UINT16_MAX
- UINT32_MAX
- UINT64_MAX
- UINT8_MAX
- WCHAR_MAX
- WCHAR_MIN
- WEOF
- WINT_MAX
- WINT_MIN
- math_errhandling
- memory_order_acq_rel
- memory_order_acquire
- memory_order_consume
- memory_order_relaxed
- memory_order_release
- memory_order_seq_cst
- mtx_plain
- mtx_recursive
- mtx_timed
- thrd_busy
- thrd_error
- thrd_nomem
- thrd_success
- thrd_timedout
Procedures (329)
- ATOMIC_VAR_INIT
- CMPLX
- CMPLXF
- MB_CUR_MAX
- abort
- abs
- aligned_alloc
- aligned_free
- asctime
- at_quick_exit
- atexit
- atof
- atoi
- atol
- atoll
- atomic_compare_exchange_strong
- atomic_compare_exchange_strong_explicit
- atomic_compare_exchange_weak
- atomic_compare_exchange_weak_explicit
- atomic_exchange
- atomic_exchange_explicit
- atomic_fetch_add
- atomic_fetch_add_explicit
- atomic_fetch_and
- atomic_fetch_and_explicit
- atomic_fetch_or
- atomic_fetch_or_explicit
- atomic_fetch_sub
- atomic_fetch_sub_explicit
- atomic_fetch_xor
- atomic_fetch_xor_explicit
- atomic_flag_clear
- atomic_flag_clear_explicit
- atomic_flag_test_and_set
- atomic_flag_test_and_set_explicit
- atomic_init
- atomic_is_lock_free
- atomic_load
- atomic_load_explicit
- atomic_signal_fence
- atomic_store
- atomic_store_explicit
- atomic_thread_fence
- bsearch
- btowc
- c16rtomb
- c32rtomb
- cabs
- cabsf
- cacos
- cacosf
- cacosh
- cacoshf
- call_once
- calloc
- carg
- cargf
- casin
- casinf
- casinh
- casinhf
- catan
- catanf
- catanh
- catanhf
- ccos
- ccosf
- ccosh
- ccoshf
- cexp
- cexpf
- cimag
- cimagf
- clearerr
- clock
- clog
- clogf
- cnd_broadcast
- cnd_destroy
- cnd_init
- cnd_signal
- cnd_timedwait
- cnd_wait
- conj
- conjf
- cpow
- cpowf
- cproj
- cprojf
- creal
- crealf
- csin
- csinf
- csinh
- csinhf
- csqrt
- csqrtf
- ctan
- ctanf
- ctanh
- ctanhf
- ctime
- difftime
- div
- errno
- exit
- fclose
- feof
- ferror
- fflush
- fgetc
- fgetpos
- fgets
- fgetws
- fopen
- fprintf
- fputc
- fputwc
- fputws
- fread
- free
- freopen
- fscanf
- fseek
- fsetpos
- ftell
- fwgetc
- fwide
- fwprintf
- fwrite
- fwscanf
- getc
- getchar
- getenv
- getwc
- getwchar
- gmtime
- isalnum
- isalpha
- isblank
- iscntrl
- isdigit
- isfinite
- isgraph
- isgreater
- isgreaterequal
- isinf
- isless
- islessequal
- islessgreater
- islower
- isnan
- isnormal
- isprint
- ispunct
- isspace
- isunordered
- isupper
- iswalnum
- iswalpha
- iswblank
- iswcntrl
- iswctype
- iswdigit
- iswgraph
- iswlower
- iswprint
- iswpunct
- iswspace
- iswupper
- iswxdigit
- isxdigit
- kill_dependency
- labs
- ldiv
- llabs
- lldiv
- localeconv
- localtime
- longjmp
- malloc
- mblen
- mbrlen
- mbrtoc16
- mbrtoc32
- mbrtowc
- mbsinit
- mbsrtowcs
- mbstowcs
- mbtowc
- memchr
- memcmp
- memcpy
- memmove
- memset
- mktime
- mtx_destroy
- mtx_init
- mtx_lock
- mtx_timedlock
- mtx_trylock
- mtx_unlock
- perror
- printf
- putc
- putchar
- puts
- putwc
- putwchar
- qsort
- quick_exit
- raise
- rand
- realloc
- remove
- rename
- rewind
- scanf
- setbuf
- setjmp
- setlocale
- setvbuf
- signal
- snprintf
- srand
- sscanf
- strcat
- strchr
- strcmp
- strcoll
- strcpn
- strcpy
- strcspn
- strerror
- strftime
- strlen
- strncat
- strncmp
- strncpy
- strpbrk
- strrchr
- strtod
- strtof
- strtok
- strtol
- strtoll
- strtoul
- strtoull
- strxfrm
- swprintf
- swscanf
- system
- thrd_create
- thrd_current
- thrd_detach
- thrd_equal
- thrd_exit
- thrd_join
- thrd_sleep
- thrd_yield
- time
- timespec_get
- tmpfile
- tmpnam
- to_stream
- tolower
- toupper
- towctrans
- towlower
- towupper
- tss_create
- tss_delete
- tss_get
- tss_set
- ungetc
- ungetwc
- va_copy
- va_end
- va_start
- vfprintf
- vfscanf
- vfwprintf
- vfwscanf
- vprintf
- vscanf
- vsnprintf
- vsprintf
- vsscanf
- vswprintf
- vswscanf
- vwprintf
- vwscanf
- wcrtomb
- wcscat
- wcschr
- wcscmp
- wcscoll
- wcscpy
- wcscspn
- wcsftime
- wcslen
- wcsncat
- wcsncmp
- wcsncpy
- wcspbrk
- wcsrchr
- wcsrtombs
- wcsspn
- wcsstr
- wcstod
- wcstof
- wcstok
- wcstol
- wcstoll
- wcstombs
- wcstoul
- wcstoull
- wcsxfrm
- wctob
- wctomb
- wctrans
- wctype
- wmemchr
- wmemcmp
- wmemcpy
- wmemmove
- wmemset
- wprintf
- wscanf
Procedure Groups (114)
- acos
- acosf
- acosh
- acoshf
- asin
- asinf
- asinh
- asinhf
- atan
- atan2
- atan2f
- atanf
- atanh
- atanhf
- cbrt
- cbrtf
- ceil
- ceilf
- copysign
- copysignf
- cos
- cosf
- cosh
- coshf
- erf
- erfc
- erfcf
- erff
- exp
- exp2
- exp2f
- expf
- expm1
- expm1f
- fabs
- fabsf
- fdim
- fdimf
- floor
- floorf
- fma
- fmaf
- fmax
- fmaxf
- fmin
- fminf
- fmod
- fmodf
- fpclassify
- frexp
- frexpf
- hypot
- hypotf
- ilogb
- ilogbf
- ldexp
- ldexpf
- lgamma
- lgammaf
- llrint
- llrintf
- llround
- llroundf
- log
- log10
- log10f
- log1p
- log1pf
- log2
- log2f
- logb
- logbf
- logf
- lrint
- lrintf
- lround
- lroundf
- modf
- modff
- nan
- nanf
- nearbyint
- nearbyintf
- nextafter
- nextafterf
- pow
- powf
- remainder
- remainderf
- remquo
- remquof
- rint
- rintf
- round
- roundf
- scalbln
- scalblnf
- scalbn
- scalbnf
- signbit
- sin
- sinf
- sinh
- sinhf
- sqrt
- sqrtf
- tan
- tanf
- tanh
- tanhf
- tgamma
- tgammaf
- trunc
- truncf
Types
FILE ¶
FILE :: struct {}
Related Procedures With Parameters
- clearerr
- fclose
- feof
- ferror
- fflush
- fgetc
- fgetpos
- fgets
- fgetws
- fprintf
- fputc
- fputwc
- fputws
- fread
- freopen
- fscanf
- fseek
- fsetpos
- ftell
- fwgetc
- fwide
- fwprintf
- fwrite
- fwscanf
- getc
- getwc
- putc
- putwc
- rewind
- setbuf
- setvbuf
- swprintf
- to_stream
- ungetc
- ungetwc
- vfprintf
- vfscanf
- vfwprintf
- vfwscanf
Related Procedures With Returns
Locale_Category ¶
Locale_Category :: enum i32 { ALL = 0, COLLATE = 1, CTYPE = 2, MESSAGES = 6, MONETARY = 3, NUMERIC = 4, TIME = 5, }
Related Procedures With Parameters
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
char16_t ¶
char16_t :: u16
char32_t ¶
char32_t :: u32
complex_double ¶
complex_double :: distinct complex128
Related Procedures With Parameters
- cabs
- cacos
- cacosh
- carg
- casin
- casinh
- catan
- catanh
- ccos
- ccosh
- cexp
- cimag
- clog
- conj
- cpow
- cproj
- creal
- csin
- csinh
- csqrt
- ctan
- ctanh
- acos (procedure groups)
- acosh (procedure groups)
- asin (procedure groups)
- asinh (procedure groups)
- atan (procedure groups)
- atanh (procedure groups)
- cos (procedure groups)
- cosh (procedure groups)
- exp (procedure groups)
- fabs (procedure groups)
- log (procedure groups)
- pow (procedure groups)
- sin (procedure groups)
- sinh (procedure groups)
- sqrt (procedure groups)
- tan (procedure groups)
- tanh (procedure groups)
Related Procedures With Returns
complex_float ¶
complex_float :: distinct complex64
Related Procedures With Parameters
- cabsf
- cacosf
- cacoshf
- cargf
- casinf
- casinhf
- catanf
- catanhf
- ccosf
- ccoshf
- cexpf
- cimagf
- clogf
- conjf
- cpowf
- cprojf
- crealf
- csinf
- csinhf
- csqrtf
- ctanf
- ctanhf
- acos (procedure groups)
- acosh (procedure groups)
- asin (procedure groups)
- asinh (procedure groups)
- atan (procedure groups)
- atanh (procedure groups)
- cos (procedure groups)
- cosh (procedure groups)
- exp (procedure groups)
- fabs (procedure groups)
- log (procedure groups)
- pow (procedure groups)
- sin (procedure groups)
- sinh (procedure groups)
- sqrt (procedure groups)
- tan (procedure groups)
- tanh (procedure groups)
Related Procedures With Returns
div_t ¶
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_t ¶
double_t :: f64
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.
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
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
memory_order ¶
memory_order :: enum i32 { relaxed, consume, acquire, release, acq_rel, seq_cst, }
7.17.3 Order and consistency
Related Procedures With Parameters
- atomic_compare_exchange_strong_explicit
- atomic_compare_exchange_weak_explicit
- atomic_exchange_explicit
- atomic_fetch_add_explicit
- atomic_fetch_and_explicit
- atomic_fetch_or_explicit
- atomic_fetch_sub_explicit
- atomic_fetch_xor_explicit
- atomic_flag_clear_explicit
- atomic_flag_test_and_set_explicit
- atomic_load_explicit
- atomic_signal_fence
- atomic_store_explicit
- atomic_thread_fence
Related Constants
thrd_start_t ¶
Related Procedures With Parameters
timespec ¶
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
uint16_t ¶
uint16_t :: u16
uint32_t ¶
uint32_t :: u32
uint64_t ¶
uint64_t :: u64
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
uintptr_t ¶
uintptr_t :: uintptr
ulonglong ¶
ulonglong :: u64
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
- iswalnum
- iswalpha
- iswblank
- iswcntrl
- iswctype
- iswdigit
- iswgraph
- iswlower
- iswprint
- iswpunct
- iswspace
- iswupper
- iswxdigit
- towctrans
- towlower
- towupper
- wctob
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
CHAR_BIT ¶
CHAR_BIT :: 8
CLOCKS_PER_SEC ¶
CLOCKS_PER_SEC :: 1000
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
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_COLLATE ¶
LC_COLLATE :: 1
LC_CTYPE ¶
LC_CTYPE :: 2
LC_MESSAGES ¶
LC_MESSAGES :: 6
LC_MONETARY ¶
LC_MONETARY :: 3
LC_NUMERIC ¶
LC_NUMERIC :: 4
MATH_ERREXCEPT ¶
MATH_ERREXCEPT :: 2
MATH_ERRNO ¶
MATH_ERRNO :: 1
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
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)
SIZE_MAX ¶
SIZE_MAX: uint : c.SIZE_MAX
TIME_UTC ¶
TIME_UTC :: 1
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
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.
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
Variables
Procedures
CMPLX ¶
CMPLX :: proc(x, y: f64) -> complex_double {…}
CMPLXF ¶
CMPLXF :: proc(x, y: f32) -> complex_float {…}
MB_CUR_MAX ¶
MB_CUR_MAX :: proc() -> uint {…}
aligned_free ¶
aligned_free :: proc "c" (ptr: rawptr) {…}
at_quick_exit ¶
at_quick_exit :: proc "c" (func: proc "c" ()) -> i32 ---
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_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_explicit ¶
atomic_store_explicit :: proc(object: ^$T, desired: $T, order: memory_order) {…}
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 ¶
7.29.6.1 Single-byte/wide character conversion functions
cabsf ¶
cabsf :: proc "c" (z: complex_float) -> f32 ---
cacosf ¶
cacosf :: proc "c" (z: complex_float) -> complex_float ---
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 ¶
7.22.3 Memory management 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 ---
clog ¶
clog :: proc "c" (z: complex_double) -> complex_double ---
clogf ¶
clogf :: proc "c" (z: complex_float) -> complex_float ---
cnd_broadcast ¶
7.26.3 Condition variable functions
cnd_destroy ¶
cnd_destroy :: proc "c" (cond: ^cnd_t) ---
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 ---
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.
fgetpos ¶
7.21.9 File positioning functions
fprintf ¶
7.21.6 Formatted input/output functions
fwgetc ¶
7.29.3 Wide character input/output functions
fwprintf ¶
7.29.2 Formatted wide character input/output functions
getwchar ¶
getwchar :: proc "c" () -> wint_t ---
isfinite ¶
isfinite :: proc(x: $T) -> bool {…}
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 {…}
islessequal ¶
islessequal :: proc(x, y: $T) -> bool {…}
islessgreater ¶
islessgreater :: proc(x, y: $T) -> bool {…}
isnormal ¶
isnormal :: proc(x: $T) -> bool {…}
isunordered ¶
isunordered :: proc(x, y: $T) -> bool {…}
iswalnum ¶
7.30.2.1 Wide character classification functions
iswctype ¶
7.30.2.2 Extensible wide character classification functions
kill_dependency ¶
kill_dependency :: proc(value: $T) -> $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()
longjmp ¶
7.13.2 Restore calling environment
mblen ¶
7.22.7 Multibyte/wide character conversion functions
mbrlen ¶
7.29.6.3 Restartable multibyte/wide character conversion functions
mbrtoc16 ¶
7.28.1 Restartable multibyte/wide character conversion functions
mbsrtowcs ¶
7.29.6.4 Restartable multibyte/wide string conversion functions
mbstowcs ¶
7.22.8 Multibyte/wide string conversion functions
memchr ¶
7.24.5 Search functions
quick_exit ¶
quick_exit :: proc "c" (status: i32) -> ! ---
setjmp ¶
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
strcat ¶
7.24.3 Concatenation functions
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_exit ¶
thrd_exit :: proc "c" (res: i32) -> ! ---
thrd_yield ¶
thrd_yield :: proc "c" () ---
towctrans ¶
7.30.3.2 Extensible wide character case mapping functions
towlower ¶
7.30.3 Wide character case mapping utilities
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) ---
wcscat ¶
7.29.4.3 Wide string concatenation functions
wcschr ¶
7.29.4.5 Wide string search functions
wcscmp ¶
7.29.4.4 Wide string comparison functions
wcscpy ¶
7.29.4.2 Wide string copying functions
wcsftime ¶
7.29.5 Wide character time conversion functions
wcstod ¶
7.29.4 General wide string utilities
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.
acosh ¶
acosh :: proc{ libc_acosh, libc_acoshf, cacosh, cacoshf, }
acoshf ¶
acoshf :: proc{ libc_acoshf, }
asinf ¶
asinf :: proc{ libc_asinf, }
asinh ¶
asinh :: proc{ libc_asinh, libc_asinhf, casinh, casinhf, }
asinhf ¶
asinhf :: proc{ libc_asinhf, }
atan2 ¶
atan2 :: proc{ libc_atan2, libc_atan2f, }
atan2f ¶
atan2f :: proc{ libc_atan2f, }
atanf ¶
atanf :: proc{ libc_atanf, }
atanh ¶
atanh :: proc{ libc_atanh, libc_atanhf, catanh, catanhf, }
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, }
copysign ¶
copysign :: proc{ libc_copysign, libc_copysignf, }
copysignf ¶
copysignf :: proc{ libc_copysignf, }
coshf ¶
coshf :: proc{ libc_coshf, }
erfc ¶
erfc :: proc{ libc_erfc, libc_erfcf, }
erfcf ¶
erfcf :: proc{ libc_erfcf, }
exp2 ¶
exp2 :: proc{ libc_exp2, libc_exp2f, }
exp2f ¶
exp2f :: proc{ libc_exp2f, }
expm1 ¶
expm1 :: proc{ libc_expm1, libc_expm1f, }
expm1f ¶
expm1f :: proc{ libc_expm1f, }
fabsf ¶
fabsf :: proc{ libc_fabsf, }
fdim ¶
fdim :: proc{ libc_fdim, libc_fdimf, }
fdimf ¶
fdimf :: proc{ libc_fdimf, }
floor ¶
floor :: proc{ libc_floor, libc_floorf, }
floorf ¶
floorf :: proc{ libc_floorf, }
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, }
fpclassify ¶
fpclassify :: proc{ _fpclassify, _fpclassifyf, }
frexp ¶
frexp :: proc{ libc_frexp, libc_frexpf, }
frexpf ¶
frexpf :: proc{ libc_frexpf, }
hypot ¶
hypot :: proc{ libc_hypot, libc_hypotf, }
hypotf ¶
hypotf :: proc{ libc_hypotf, }
ilogb ¶
ilogb :: proc{ libc_ilogb, libc_ilogbf, }
ilogbf ¶
ilogbf :: proc{ libc_ilogbf, }
ldexp ¶
ldexp :: proc{ libc_ldexp, libc_ldexpf, }
ldexpf ¶
ldexpf :: proc{ libc_ldexpf, }
lgamma ¶
lgamma :: proc{ libc_lgamma, libc_lgammaf, }
lgammaf ¶
lgammaf :: proc{ libc_lgammaf, }
llrint ¶
llrint :: proc{ libc_llrint, libc_llrintf, }
llrintf ¶
llrintf :: proc{ libc_llrintf, }
llround ¶
llround :: proc{ libc_llround, libc_llroundf, }
llroundf ¶
llroundf :: proc{ libc_llroundf, }
log10 ¶
log10 :: proc{ libc_log10, libc_log10f, }
log10f ¶
log10f :: proc{ libc_log10f, }
log1p ¶
log1p :: proc{ libc_log1p, libc_log1pf, }
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, }
lrint ¶
lrint :: proc{ libc_lrint, libc_lrintf, }
lrintf ¶
lrintf :: proc{ libc_lrintf, }
lround ¶
lround :: proc{ libc_lround, libc_lroundf, }
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.
nearbyint ¶
nearbyint :: proc{ libc_nearbyint, libc_nearbyintf, }
nearbyintf ¶
nearbyintf :: proc{ libc_nearbyintf, }
nextafter ¶
nextafter :: proc{ libc_nextafter, libc_nextafterf, }
nextafterf ¶
nextafterf :: proc{ libc_nextafterf, }
remainder ¶
remainder :: proc{ libc_remainder, libc_remainderf, }
remainderf ¶
remainderf :: proc{ libc_remainderf, }
remquo ¶
remquo :: proc{ libc_remquo, libc_remquof, }
remquof ¶
remquof :: proc{ libc_remquof, }
rint ¶
rint :: proc{ libc_rint, libc_rintf, }
rintf ¶
rintf :: proc{ libc_rintf, }
round ¶
round :: proc{ libc_round, libc_roundf, }
roundf ¶
roundf :: proc{ libc_roundf, }
scalbln ¶
scalbln :: proc{ libc_scalbln, libc_scalblnf, }
scalblnf ¶
scalblnf :: proc{ libc_scalblnf, }
scalbn ¶
scalbn :: proc{ libc_scalbn, libc_scalbnf, }
scalbnf ¶
scalbnf :: proc{ libc_scalbnf, }
sinhf ¶
sinhf :: proc{ libc_sinhf, }
sqrtf ¶
sqrtf :: proc{ libc_sqrtf, }
tanhf ¶
tanhf :: proc{ libc_tanhf, }
tgamma ¶
tgamma :: proc{ libc_tgamma, libc_tgammaf, }
tgammaf ¶
tgammaf :: proc{ libc_tgammaf, }
trunc ¶
trunc :: proc{ libc_trunc, libc_truncf, }
truncf ¶
truncf :: proc{ libc_truncf, }
Source Files
- complex.odin
- ctype.odin
- errno.odin
- locale.odin
- math.odin
- setjmp.odin
- signal.odin
- stdarg.odin
- stdatomic.odin
- stdio.odin
- stdlib.odin
- string.odin
- threads.odin
- time.odin
- types.odin
- uchar.odin
- wchar.odin
- wctype.odin
Generation Information
Generated with odin version dev-2024-12 (vendor "odin") Windows_amd64 @ 2024-12-17 21:11:00.915073700 +0000 UTC