C libraries
Nelua provides bindings for common C functions according to the C11 specification. This is a list of all imported C libraries.
To use a C library, use require 'C.stdlib'
for example.
Nelua encourages you to use it’s standard libraries instead of the C APIs, these are provided just as convenience for interoperating with C libraries.
C.arg
Library importing C’s main argc
and argv
.
C.argc
global C.argc: cint
C.argv
global C.argv: *[0]cstring
C.ctype
Library importing symbols from <ctype.h>
header according to C11 spec.
For a complete documentation about the functions, see C ctype documentation.
C.isalnum
function C.isalnum(x: cint): cint
C.isalpha
function C.isalpha(x: cint): cint
C.islower
function C.islower(x: cint): cint
C.isupper
function C.isupper(x: cint): cint
C.isdigit
function C.isdigit(x: cint): cint
C.isxdigit
function C.isxdigit(x: cint): cint
C.iscntrl
function C.iscntrl(x: cint): cint
C.isgraph
function C.isgraph(x: cint): cint
C.isspace
function C.isspace(x: cint): cint
C.isblank
function C.isblank(x: cint): cint
C.isprint
function C.isprint(x: cint): cint
C.ispunct
function C.ispunct(x: cint): cint
C.tolower
function C.tolower(c: cint): cint
C.toupper
function C.toupper(c: cint): cint
C.errno
Library that imports symbols from the <errno.h>
header according to C11 specifications.
For a complete documentation about the functions, see C errno documentation.
C.errno
global C.errno: cint
C.EDOM
global C.EDOM: cint
C.EILSEQ
global C.EILSEQ: cint
C.ERANGE
global C.ERANGE: cint
C.locale
Library that imports symbols from the <locale.h>
header according to C11 specifications.
For a complete documentation about the functions, see C locale documentation.
C.lconv
global C.lconv: type = @record{
decimal_point: cstring,
thousands_sep: cstring,
grouping: cstring,
int_curr_symbol: cstring,
currency_symbol: cstring,
mon_decimal_point: cstring,
mon_thousands_sep: cstring,
mon_grouping: cstring,
positive_sign: cstring,
negative_sign: cstring,
int_frac_digits: cchar,
frac_digits: cchar,
p_cs_precedes: cchar,
p_sep_by_space: cchar,
n_cs_precedes: cchar,
n_sep_by_space: cchar,
p_sign_posn: cchar,
n_sign_posn: cchar,
int_p_cs_precedes: cchar,
int_p_sep_by_space: cchar,
int_n_cs_precedes: cchar,
int_n_sep_by_space: cchar,
int_p_sign_posn: cchar,
int_n_sign_posn: cchar
}
C.setlocale
function C.setlocale(category: cint, locale: cstring): cstring
C.localeconv
function C.localeconv(): *C.lconv
C.LC_ALL
global C.LC_ALL: cint
C.LC_COLLATE
global C.LC_COLLATE: cint
C.LC_CTYPE
global C.LC_CTYPE: cint
C.LC_MONETARY
global C.LC_MONETARY: cint
C.LC_NUMERIC
global C.LC_NUMERIC: cint
C.LC_TIME
global C.LC_TIME: cint
C.math
Library that imports symbols from the <math.h>
header according to C11 specifications.
For a complete documentation about the functions, see C math documentation.
C.fabs
function C.fabs(x: float64): float64
C.fabsf
function C.fabsf(x: float32): float32
C.fabsl
function C.fabsl(x: clongdouble): clongdouble
C.fmod
function C.fmod(x: float64, y: float64): float64
C.fmodf
function C.fmodf(x: float32, y: float32): float32
C.fmodl
function C.fmodl(x: clongdouble, y: clongdouble): clongdouble
C.remainder
function C.remainder(x: float64, y: float64): float64
C.remainderf
function C.remainderf(x: float32, y: float32): float32
C.remainderl
function C.remainderl(x: clongdouble, y: clongdouble): clongdouble
C.remquo
function C.remquo(x: float64, y: float64, quo: *cint): float64
C.remquof
function C.remquof(x: float32, y: float32, quo: *cint): float32
C.remquol
function C.remquol(x: clongdouble, y: clongdouble, quo: *cint): clongdouble
C.fma
function C.fma(x: float64, y: float64, z: float64): float64
C.fmaf
function C.fmaf(x: float32, y: float32, z: float32): float32
C.fmal
function C.fmal(x: clongdouble, y: clongdouble, z: clongdouble): clongdouble
C.fmax
function C.fmax(x: float64, y: float64): float64
C.fmaxf
function C.fmaxf(x: float32, y: float32): float32
C.fmaxl
function C.fmaxl(x: clongdouble, y: clongdouble): clongdouble
C.fmin
function C.fmin(x: float64, y: float64): float64
C.fminf
function C.fminf(x: float32, y: float32): float32
C.fminl
function C.fminl(x: clongdouble, y: clongdouble): clongdouble
C.fdim
function C.fdim(x: float64, y: float64): float64
C.fdimf
function C.fdimf(x: float32, y: float32): float32
C.fdiml
function C.fdiml(x: clongdouble, y: clongdouble): clongdouble
C.nan
function C.nan(tagb: cstring): float64
C.nanf
function C.nanf(tagb: cstring): float32
C.nanl
function C.nanl(tagb: cstring): clongdouble
C.exp
function C.exp(x: float64): float64
C.expf
function C.expf(x: float32): float32
C.expl
function C.expl(x: clongdouble): clongdouble
C.exp2
function C.exp2(x: float64): float64
C.exp2f
function C.exp2f(x: float32): float32
C.exp2l
function C.exp2l(x: clongdouble): clongdouble
C.expm1
function C.expm1(x: float64): float64
C.expm1f
function C.expm1f(x: float32): float32
C.expm1l
function C.expm1l(x: clongdouble): clongdouble
C.log
function C.log(x: float64): float64
C.logf
function C.logf(x: float32): float32
C.logl
function C.logl(x: clongdouble): clongdouble
C.log10
function C.log10(x: float64): float64
C.log10f
function C.log10f(x: float32): float32
C.log10l
function C.log10l(x: clongdouble): clongdouble
C.log1p
function C.log1p(x: float64): float64
C.log1pf
function C.log1pf(x: float32): float32
C.log1pl
function C.log1pl(x: clongdouble): clongdouble
C.log2
function C.log2(x: float64): float64
C.log2f
function C.log2f(x: float32): float32
C.log2l
function C.log2l(x: clongdouble): clongdouble
C.logb
function C.logb(x: float64): float64
C.logbf
function C.logbf(x: float32): float32
C.logbl
function C.logbl(x: clongdouble): clongdouble
C.pow
function C.pow(x: float64, y: float64): float64
C.powf
function C.powf(x: float32, y: float32): float32
C.powl
function C.powl(x: clongdouble, y: clongdouble): clongdouble
C.sqrt
function C.sqrt(x: float64): float64
C.sqrtf
function C.sqrtf(x: float32): float32
C.sqrtl
function C.sqrtl(x: clongdouble): clongdouble
C.cbrt
function C.cbrt(x: float64): float64
C.cbrtf
function C.cbrtf(x: float32): float32
C.cbrtl
function C.cbrtl(x: clongdouble): clongdouble
C.hypot
function C.hypot(x: float64, y: float64): float64
C.hypotf
function C.hypotf(x: float32, y: float32): float32
C.hypotl
function C.hypotl(x: clongdouble, y: clongdouble): clongdouble
C.cos
function C.cos(x: float64): float64
C.cosf
function C.cosf(x: float32): float32
C.cosl
function C.cosl(x: clongdouble): clongdouble
C.sin
function C.sin(x: float64): float64
C.sinf
function C.sinf(x: float32): float32
C.sinl
function C.sinl(x: clongdouble): clongdouble
C.tan
function C.tan(x: float64): float64
C.tanf
function C.tanf(x: float32): float32
C.tanl
function C.tanl(x: clongdouble): clongdouble
C.acos
function C.acos(x: float64): float64
C.acosf
function C.acosf(x: float32): float32
C.acosl
function C.acosl(x: clongdouble): clongdouble
C.asin
function C.asin(x: float64): float64
C.asinf
function C.asinf(x: float32): float32
C.asinl
function C.asinl(x: clongdouble): clongdouble
C.atan
function C.atan(x: float64): float64
C.atanf
function C.atanf(x: float32): float32
C.atanl
function C.atanl(x: clongdouble): clongdouble
C.atan2
function C.atan2(y: float64, x: float64): float64
C.atan2f
function C.atan2f(y: float32, x: float32): float32
C.atan2l
function C.atan2l(y: clongdouble, x: clongdouble): clongdouble
C.cosh
function C.cosh(x: float64): float64
C.coshf
function C.coshf(x: float32): float32
C.coshl
function C.coshl(x: clongdouble): clongdouble
C.sinh
function C.sinh(x: float64): float64
C.sinhf
function C.sinhf(x: float32): float32
C.sinhl
function C.sinhl(x: clongdouble): clongdouble
C.tanh
function C.tanh(x: float64): float64
C.tanhf
function C.tanhf(x: float32): float32
C.tanhl
function C.tanhl(x: clongdouble): clongdouble
C.acosh
function C.acosh(x: float64): float64
C.acoshf
function C.acoshf(x: float32): float32
C.acoshl
function C.acoshl(x: clongdouble): clongdouble
C.asinh
function C.asinh(x: float64): float64
C.asinhf
function C.asinhf(x: float32): float32
C.asinhl
function C.asinhl(x: clongdouble): clongdouble
C.atanh
function C.atanh(x: float64): float64
C.atanhf
function C.atanhf(x: float32): float32
C.atanhl
function C.atanhl(x: clongdouble): clongdouble
C.erf
function C.erf(x: float64): float64
C.erff
function C.erff(x: float32): float32
C.erfl
function C.erfl(x: clongdouble): clongdouble
C.erfc
function C.erfc(x: float64): float64
C.erfcf
function C.erfcf(x: float32): float32
C.erfcl
function C.erfcl(x: clongdouble): clongdouble
C.tgamma
function C.tgamma(x: float64): float64
C.tgammaf
function C.tgammaf(x: float32): float32
C.tgammal
function C.tgammal(x: clongdouble): clongdouble
C.lgamma
function C.lgamma(x: float64): float64
C.lgammaf
function C.lgammaf(x: float32): float32
C.lgammal
function C.lgammal(x: clongdouble): clongdouble
C.ceil
function C.ceil(x: float64): float64
C.ceilf
function C.ceilf(x: float32): float32
C.ceill
function C.ceill(x: clongdouble): clongdouble
C.floor
function C.floor(x: float64): float64
C.floorf
function C.floorf(x: float32): float32
C.floorl
function C.floorl(x: clongdouble): clongdouble
C.trunc
function C.trunc(x: float64): float64
C.truncf
function C.truncf(x: float32): float32
C.truncl
function C.truncl(x: clongdouble): clongdouble
C.round
function C.round(x: float64): float64
C.roundf
function C.roundf(x: float32): float32
C.roundl
function C.roundl(x: clongdouble): clongdouble
C.lround
function C.lround(x: float64): clong
C.lroundf
function C.lroundf(x: float32): clong
C.lroundl
function C.lroundl(x: clongdouble): clong
C.llround
function C.llround(x: float64): clonglong
C.llroundf
function C.llroundf(x: float32): clonglong
C.llroundl
function C.llroundl(x: clongdouble): clonglong
C.rint
function C.rint(x: float64): float64
C.rintf
function C.rintf(x: float32): float32
C.rintl
function C.rintl(x: clongdouble): clongdouble
C.lrint
function C.lrint(x: float64): clong
C.lrintf
function C.lrintf(x: float32): clong
C.lrintl
function C.lrintl(x: clongdouble): clong
C.llrint
function C.llrint(x: float64): clonglong
C.llrintf
function C.llrintf(x: float32): clonglong
C.llrintl
function C.llrintl(x: clongdouble): clonglong
C.nearbyint
function C.nearbyint(x: float64): float64
C.nearbyintf
function C.nearbyintf(x: float32): float32
C.nearbyintl
function C.nearbyintl(x: clongdouble): clongdouble
C.frexp
function C.frexp(x: float64, exponent: *cint): float64
C.frexpf
function C.frexpf(x: float32, exponent: *cint): float32
C.frexpl
function C.frexpl(x: clongdouble, exponent: *cint): clongdouble
C.ldexp
function C.ldexp(x: float64, exponent: cint): float64
C.ldexpf
function C.ldexpf(x: float32, exponent: cint): float32
C.ldexpl
function C.ldexpl(x: clongdouble, exponent: cint): clongdouble
C.modf
function C.modf(x: float64, iptr: *float64): float64
C.modff
function C.modff(x: float32, iptr: *float32): float32
C.modfl
function C.modfl(x: clongdouble, iptr: *clongdouble): clongdouble
C.scalbln
function C.scalbln(x: float64, n: clong): float64
C.scalblnf
function C.scalblnf(x: float32, n: clong): float32
C.scalblnl
function C.scalblnl(x: clongdouble, n: clong): clongdouble
C.scalbn
function C.scalbn(x: float64, n: cint): float64
C.scalbnf
function C.scalbnf(x: float32, n: cint): float32
C.scalbnl
function C.scalbnl(x: clongdouble, n: cint): clongdouble
C.ilogb
function C.ilogb(x: float64): cint
C.ilogbf
function C.ilogbf(x: float32): cint
C.ilogbl
function C.ilogbl(x: clongdouble): cint
C.nextafter
function C.nextafter(x: float64, y: float64): float64
C.nextafterf
function C.nextafterf(x: float32, y: float32): float32
C.nextafterl
function C.nextafterl(x: clongdouble, y: clongdouble): clongdouble
C.nexttoward
function C.nexttoward(x: float64, y: clongdouble): float64
C.nexttowardf
function C.nexttowardf(x: float32, y: clongdouble): float32
C.nexttowardl
function C.nexttowardl(x: clongdouble, y: clongdouble): clongdouble
C.copysign
function C.copysign(x: float64, y: float64): float64
C.copysignf
function C.copysignf(x: float32, y: float32): float32
C.copysignl
function C.copysignl(x: clongdouble, y: clongdouble): clongdouble
C.fpclassify
function C.fpclassify(x: float64): cint
C.fpclassifyf
function C.fpclassifyf(x: float32): cint
C.fpclassifyl
function C.fpclassifyl(x: clongdouble): cint
C.isfinite
function C.isfinite(x: float64): cint
C.isfinitef
function C.isfinitef(x: float32): cint
C.isfinitel
function C.isfinitel(x: clongdouble): cint
C.isinf
function C.isinf(x: float64): cint
C.isinff
function C.isinff(x: float32): cint
C.isinfl
function C.isinfl(x: clongdouble): cint
C.isnan
function C.isnan(x: float64): cint
C.isnanf
function C.isnanf(x: float32): cint
C.isnanl
function C.isnanl(x: clongdouble): cint
C.isnormal
function C.isnormal(x: float64): cint
C.isnormalf
function C.isnormalf(x: float32): cint
C.isnormall
function C.isnormall(x: clongdouble): cint
C.signbit
function C.signbit(x: float64): cint
C.signbitf
function C.signbitf(x: float32): cint
C.signbitl
function C.signbitl(x: clongdouble): cint
C.isgreater
function C.isgreater(x: float64, y: float64): cint
C.isgreaterf
function C.isgreaterf(x: float32, y: float32): cint
C.isgreaterl
function C.isgreaterl(x: clongdouble, y: clongdouble): cint
C.isgreaterequal
function C.isgreaterequal(x: float64, y: float64): cint
C.isgreaterequalf
function C.isgreaterequalf(x: float32, y: float32): cint
C.isgreaterequall
function C.isgreaterequall(x: clongdouble, y: clongdouble): cint
C.isless
function C.isless(x: float64, y: float64): cint
C.islessf
function C.islessf(x: float32, y: float32): cint
C.islessl
function C.islessl(x: clongdouble, y: clongdouble): cint
C.islessequal
function C.islessequal(x: float64, y: float64): cint
C.islessequalf
function C.islessequalf(x: float32, y: float32): cint
C.islessequall
function C.islessequall(x: clongdouble, y: clongdouble): cint
C.islessgreater
function C.islessgreater(x: float64, y: float64): cint
C.islessgreaterf
function C.islessgreaterf(x: float32, y: float32): cint
C.islessgreaterl
function C.islessgreaterl(x: clongdouble, y: clongdouble): cint
C.isunordered
function C.isunordered(x: float64, y: float64): cint
C.isunorderedf
function C.isunorderedf(x: float32, y: float32): cint
C.isunorderedl
function C.isunorderedl(x: clongdouble, y: clongdouble): cint
C.HUGE_VALF
global C.HUGE_VALF: float32
C.HUGE_VAL
global C.HUGE_VAL: float64
C.HUGE_VALL
global C.HUGE_VALL: clongdouble
C.INFINITY
global C.INFINITY: cfloat
C.NAN
global C.NAN: cfloat
C.FP_FAST_FMAF
global C.FP_FAST_FMAF: float32
C.FP_FAST_FMA
global C.FP_FAST_FMA: float64
C.FP_FAST_FMAL
global C.FP_FAST_FMAL: clongdouble
C.FP_ILOGB0
global C.FP_ILOGB0: cint
C.FP_ILOGBNAN
global C.FP_ILOGBNAN: cint
C.math_errhandling
global C.math_errhandling: cint
C.MATH_ERRNO
global C.MATH_ERRNO: cint
C.MATH_ERREXCEPT
global C.MATH_ERREXCEPT: cint
C.FP_NORMAL
global C.FP_NORMAL: cint
C.FP_SUBNORMAL
global C.FP_SUBNORMAL: cint
C.FP_ZERO
global C.FP_ZERO: cint
C.FP_INFINITE
global C.FP_INFINITE: cint
C.FP_NAN
global C.FP_NAN: cint
C.signal
Library that imports symbols from the <signal.h>
header according to C11 specifications.
For a complete documentation about the functions, see C signal documentation.
C.signal
function C.signal(sig: cint, handler: function(cint)): function(cint): void
C.raise
function C.raise(sig: cint): cint
C.SIG_DFL
global C.SIG_DFL: function(cint): void
C.SIG_IGN
global C.SIG_IGN: function(cint): void
C.SIG_ERR
global C.SIG_ERR: function(cint): void
C.SIGTERM
global C.SIGTERM: cint
C.SIGSEGV
global C.SIGSEGV: cint
C.SIGINT
global C.SIGINT: cint
C.SIGILL
global C.SIGILL: cint
C.SIGABRT
global C.SIGABRT: cint
C.SIGFPE
global C.SIGFPE: cint
C.stdarg
Library that imports symbols from the <stdarg.h>
header according to C11 specifications.
For a complete documentation about the functions, see C stdarg documentation.
C.va_start
function C.va_start(ap: cvalist, paramN: auto): void
C.va_end
function C.va_end(ap: cvalist): void
C.va_arg
function C.va_arg(ap: *cvalist, T: type): auto
C.stdio
Library that imports symbols from the <stdio.h>
header according to C11 specifications.
For a complete documentation about the functions, see C stdio documentation.
C.FILE
global C.FILE: type = @record{}
C.fpos_t
global C.fpos_t: type = @record{}
C.remove
function C.remove(filename: cstring): cint
C.rename
function C.rename(old: cstring, new: cstring): cint
C.tmpfile
function C.tmpfile(): *C.FILE
C.tmpnam
function C.tmpnam(s: cstring): cstring
C.fclose
function C.fclose(stream: *C.FILE): cint
C.fflush
function C.fflush(stream: *C.FILE): cint
C.fopen
function C.fopen(filename: cstring, modes: cstring): *C.FILE
C.freopen
function C.freopen(filename: cstring, modes: cstring, stream: *C.FILE): *C.FILE
C.setbuf
function C.setbuf(stream: *C.FILE, buf: cstring): void
C.setvbuf
function C.setvbuf(stream: *C.FILE, buf: cstring, modes: cint, n: csize): cint
C.scanf
function C.scanf(format: cstring, ...: cvarargs): cint
C.fscanf
function C.fscanf(stream: *C.FILE, format: cstring, ...: cvarargs): cint
C.sscanf
function C.sscanf(s: cstring, format: cstring, ...: cvarargs): cint
C.vscanf
function C.vscanf(format: cstring, arg: cvalist): cint
C.vfscanf
function C.vfscanf(stream: *C.FILE, format: cstring, arg: cvalist): cint
C.vsscanf
function C.vsscanf(s: cstring, format: cstring, arg: cvalist): cint
C.printf
function C.printf(format: cstring, ...: cvarargs): cint
C.fprintf
function C.fprintf(stream: *C.FILE, format: cstring, ...: cvarargs): cint
C.sprintf
function C.sprintf(s: cstring, format: cstring, ...: cvarargs): cint
C.snprintf
function C.snprintf(s: cstring, maxlen: csize, format: cstring, ...: cvarargs): cint
C.vprintf
function C.vprintf(format: cstring, arg: cvalist): cint
C.vfprintf
function C.vfprintf(stream: *C.FILE, format: cstring, arg: cvalist): cint
C.vsprintf
function C.vsprintf(s: cstring, format: cstring, arg: cvalist): cint
C.vsnprintf
function C.vsnprintf(s: cstring, maxlen: csize, format: cstring, arg: cvalist): cint
C.getc
function C.getc(stream: *C.FILE): cint
C.putc
function C.putc(c: cint, stream: *C.FILE): cint
C.getchar
function C.getchar(): cint
C.putchar
function C.putchar(c: cint): cint
C.fgetc
function C.fgetc(stream: *C.FILE): cint
C.fputc
function C.fputc(c: cint, stream: *C.FILE): cint
C.fgets
function C.fgets(s: cstring, n: cint, stream: *C.FILE): cstring
C.fputs
function C.fputs(s: cstring, stream: *C.FILE): cint
C.gets
function C.gets(s: cstring): cstring
C.puts
function C.puts(s: cstring): cint
C.ungetc
function C.ungetc(c: cint, stream: *C.FILE): cint
C.fread
function C.fread(ptr: pointer, size: csize, n: csize, stream: *C.FILE): csize
C.fwrite
function C.fwrite(ptr: pointer, size: csize, n: csize, sream: pointer): csize
C.fgetpos
function C.fgetpos(stream: *C.FILE, pos: *C.fpos_t): cint
C.fsetpos
function C.fsetpos(stream: *C.FILE, pos: *C.fpos_t): cint
C.fseek
function C.fseek(stream: *C.FILE, off: clong, whence: cint): cint
C.ftell
function C.ftell(stream: *C.FILE): clong
C.rewind
function C.rewind(stream: *C.FILE): void
C.clearerr
function C.clearerr(stream: *C.FILE): void
C.feof
function C.feof(stream: *C.FILE): cint
C.ferror
function C.ferror(stream: *C.FILE): cint
C.perror
function C.perror(s: cstring): void
C.stdin
global C.stdin: *C.FILE
C.stdout
global C.stdout: *C.FILE
C.stderr
global C.stderr: *C.FILE
C.EOF
global C.EOF: cint
C.BUFSIZ
global C.BUFSIZ: cint
C.FOPEN_MAX
global C.FOPEN_MAX: cint
C.FILENAME_MAX
global C.FILENAME_MAX: cint
C._IOFBF
global C._IOFBF: cint
C._IOLBF
global C._IOLBF: cint
C._IONBF
global C._IONBF: cint
C.SEEK_SET
global C.SEEK_SET: cint
C.SEEK_CUR
global C.SEEK_CUR: cint
C.SEEK_END
global C.SEEK_END: cint
C.TMP_MAX
global C.TMP_MAX: cint
C.L_tmpnam
global C.L_tmpnam: cint
C.stdlib
Library that imports symbols from the <stdlib.h>
header according to C11 specifications.
For a complete documentation about the functions, see C stdlib documentation.
C.div_t
global C.div_t: type = @record{quot: cint, rem: cint}
C.ldiv_t
global C.ldiv_t: type = @record{quot: cint, rem: cint}
C.lldiv_t
global C.lldiv_t: type = @record{quot: cint, rem: cint}
C.malloc
function C.malloc(size: csize): pointer
C.calloc
function C.calloc(nmemb: csize, size: csize): pointer
C.realloc
function C.realloc(ptr: pointer, size: csize): pointer
C.free
function C.free(ptr: pointer): void
C.aligned_alloc
function C.aligned_alloc(alignment: csize, size: csize): pointer
C.abort
function C.abort(): void
C.exit
function C.exit(status: cint): void
C.quick_exit
function C.quick_exit(status: cint): void
C._Exit
function C._Exit(status: cint): void
C.atexit
function C.atexit(func: function(): void): cint
C.at_quick_exit
function C.at_quick_exit(func: function(): void): cint
C.system
function C.system(command: cstring): cint
C.getenv
function C.getenv(name: cstring): cstring
C.bsearch
function C.bsearch(key: pointer, base: pointer, nmemb: csize, size: csize, compar: function(pointer, pointer): cint): pointer
C.qsort
function C.qsort(base: pointer, nmemb: csize, size: csize, compar: function(pointer, pointer): cint): void
C.rand
function C.rand(): cint
C.srand
function C.srand(seed: cuint): void
C.atof
function C.atof(nptr: cstring): float64
C.atoi
function C.atoi(nptr: cstring): cint
C.atol
function C.atol(nptr: cstring): clong
C.atoll
function C.atoll(nptr: cstring): clonglong
C.strtof
function C.strtof(nptr: cstring, endptr: *cstring): float32
C.strtod
function C.strtod(nptr: cstring, endptr: *cstring): float64
C.strtold
function C.strtold(nptr: cstring, endptr: *cstring): clongdouble
C.strtol
function C.strtol(nptr: cstring, endptr: *cstring, base: cint): clong
C.strtoll
function C.strtoll(nptr: cstring, endptr: *cstring, base: cint): clonglong
C.strtoul
function C.strtoul(nptr: cstring, endptr: *cstring, base: cint): culong
C.strtoull
function C.strtoull(nptr: cstring, endptr: *cstring, base: cint): culonglong
C.abs
function C.abs(x: cint): cint
C.labs
function C.labs(x: clong): clong
C.llabs
function C.llabs(x: clonglong): clonglong
C.div
function C.div(numer: cint, denom: cint): C.div_t
C.ldiv
function C.ldiv(numer: clong, denom: clong): C.ldiv_t
C.lldiv
function C.lldiv(numer: clonglong, denom: clonglong): C.lldiv_t
C.EXIT_SUCCESS
global C.EXIT_SUCCESS: cint
C.EXIT_FAILURE
global C.EXIT_FAILURE: cint
C.RAND_MAX
global C.RAND_MAX: cint
C.string
Library that imports symbols from the <string.h>
header according to C11 specifications.
For a complete documentation about the functions, see C string documentation.
C.memcpy
function C.memcpy(dest: pointer, src: pointer, n: csize): pointer
C.memmove
function C.memmove(dest: pointer, src: pointer, n: csize): pointer
C.memset
function C.memset(s: pointer, c: cint, n: csize): pointer
C.memcmp
function C.memcmp(s1: pointer, s2: pointer, n: csize): cint
C.memchr
function C.memchr(s: pointer, c: cint, n: csize): pointer
C.strcpy
function C.strcpy(dest: cstring, src: cstring): cstring
C.strncpy
function C.strncpy(dest: cstring, src: cstring, n: csize): cstring
C.strcat
function C.strcat(dest: cstring, src: cstring): cstring
C.strncat
function C.strncat(dest: cstring, src: cstring, n: csize): cstring
C.strcmp
function C.strcmp(s1: cstring, s2: cstring): cint
C.strncmp
function C.strncmp(s1: cstring, s2: cstring, n: csize): cint
C.strcoll
function C.strcoll(s1: cstring, s2: cstring): cint
C.strxfrm
function C.strxfrm(dest: cstring, src: cstring, n: csize): csize
C.strchr
function C.strchr(s: cstring, c: cint): cstring
C.strrchr
function C.strrchr(s: cstring, c: cint): cstring
C.strcspn
function C.strcspn(s: cstring, reject: cstring): csize
C.strspn
function C.strspn(s: cstring, accept: cstring): csize
C.strpbrk
function C.strpbrk(s: cstring, accept: cstring): cstring
C.strstr
function C.strstr(haystack: cstring, needle: cstring): cstring
C.strlen
function C.strlen(s: cstring): csize
C.strerror
function C.strerror(errnum: cint): cstring
C.memccpy
function C.memccpy(dest: pointer, src: pointer, c: cint, n: csize): pointer
C.strdup
function C.strdup(s: cstring): cstring
C.strndup
function C.strndup(string: cstring, n: csize): cstring
C.time
Library that imports symbols from the <time.h>
header according to C11 specifications.
For a complete documentation about the functions, see C time documentation.
C.clock_t
global C.clock_t: type = @cclock_t
Types
C.time_t
global C.time_t: type = @ctime_t
C.tm
global C.tm: type = @record{
tm_sec: cint,
tm_min: cint,
tm_hour: cint,
tm_mday: cint,
tm_mon: cint,
tm_year: cint,
tm_wday: cint,
tm_yday: cint,
tm_isdst: cint
}
C.timespec
global C.timespec: type = @record{
tv_sec: C.time_t,
tv_nsec: clong
}
C.clock
function C.clock(): C.clock_t
C.difftime
function C.difftime(time1: C.time_t, time0: C.time_t): float64
C.mktime
function C.mktime(tp: *C.tm): C.time_t
C.strftime
function C.strftime(s: cstring, maxsize: csize, format: cstring, tp: *C.tm): csize
C.time
function C.time(timer: *C.time_t): C.time_t
C.asctime
function C.asctime(tp: *C.tm): cstring
C.ctime
function C.ctime(timer: *C.time_t): cstring
C.gmtime
function C.gmtime(timer: *C.time_t): *C.tm
C.localtime
function C.localtime(timer: *C.time_t): *C.tm
C.timespec_get
function C.timespec_get(ts: *C.timespec, base: cint): cint
C.CLOCKS_PER_SEC
global C.CLOCKS_PER_SEC: C.clock_t
C.TIME_UTC
global C.TIME_UTC: cint
C.asctime_r
function C.asctime_r(tp: *C.tm, buf: cstring): cstring
C.ctime_r
function C.ctime_r(timer: *C.time_t, buf: cstring): cstring
C.gmtime_r
function C.gmtime_r(timer: *C.time_t, tp: *C.tm): *C.tm
C.localtime_r
function C.localtime_r(timer: *C.time_t, tp: *C.tm): *C.tm
C.threads
Library that imports symbols from the <threads.h>
header according to C11 specifications.
For a complete documentation about the functions, see C11 threads documentation.
C.tss_dtor_t
global C.tss_dtor_t: type = @function(pointer): void
C.thrd_start_t
global C.thrd_start_t: type = @function(pointer): cint
C.tss_t
global C.tss_t: type = @record{}
C.thrd_t
global C.thrd_t: type = @record{}
C.once_flag
global C.once_flag: type = @record{}
C.mtx_t
global C.mtx_t: type = @record{}
C.cnd_t
global C.cnd_t: type = @record{}
C.thrd_create
function C.thrd_create(thr: *C.thrd_t, func: C.thrd_start_t, arg: pointer): cint
C.thrd_equal
function C.thrd_equal(lhs: C.thrd_t, rhs: C.thrd_t): cint
C.thrd_current
function C.thrd_current(): C.thrd_t
C.thrd_sleep
function C.thrd_sleep(time_point: *C.timespec, remaining: *C.timespec): cint
C.thrd_exit
function C.thrd_exit(res: cint)
C.thrd_detach
function C.thrd_detach(thr: C.thrd_t): cint
C.thrd_join
function C.thrd_join(thr: C.thrd_t, res: *cint): cint
C.thrd_yield
function C.thrd_yield()
C.mtx_init
function C.mtx_init(mutex: *C.mtx_t, type: cint): cint
C.mtx_lock
function C.mtx_lock(mutex: *C.mtx_t): cint
C.mtx_timedlock
function C.mtx_timedlock(mutex: *C.mtx_t, time_point: *C.timespec): cint
C.mtx_trylock
function C.mtx_trylock(mutex: *C.mtx_t): cint
C.mtx_unlock
function C.mtx_unlock(mutex: *C.mtx_t): cint
C.mtx_destroy
function C.mtx_destroy(mutex: *C.mtx_t): void
C.call_once
function C.call_once(flag: *C.once_flag, func: function(): void)
C.cnd_init
function C.cnd_init(cond: *C.cnd_t): cint
C.cnd_signal
function C.cnd_signal(cond: *C.cnd_t): cint
C.cnd_broadcast
function C.cnd_broadcast(cond: *C.cnd_t): cint
C.cnd_wait
function C.cnd_wait(cond: *C.cnd_t, mutex: *C.mtx_t): cint
C.cnd_timedwait
function C.cnd_timedwait(cond: *C.cnd_t, mutex: *C.mtx_t, time_point: *C.timespec): cint
C.cnd_destroy
function C.cnd_destroy(COND: *C.cnd_t)
C.tss_create
function C.tss_create(tss_id: *C.tss_t, destructor: C.tss_dtor_t): cint
C.tss_get
function C.tss_get(tss_id: C.tss_t): pointer
C.tss_set
function C.tss_set(tss_id: C.tss_t, val: pointer): cint
C.tss_delete
function C.tss_delete(tss_id: C.tss_t)
C.thrd_success
global C.thrd_success: cint
C.thrd_busy
global C.thrd_busy: cint
C.thrd_error
global C.thrd_error: cint
C.thrd_nomem
global C.thrd_nomem: cint
C.thrd_timedout
global C.thrd_timedout: cint
C.mtx_plain
global C.mtx_plain: cint
C.mtx_recursive
global C.mtx_recursive: cint
C.mtx_timed
global C.mtx_timed: cint
C.ONCE_FLAG_INIT
global C.ONCE_FLAG_INIT: C.once_flag
C.TSS_DTOR_ITERATIONS
global C.TSS_DTOR_ITERATIONS: cint
C.stdatomic
Library that imports symbols from the <stdatomic.h>
header according to C11 specifications.
For a complete documentation about the functions, see C11 threads documentation.
C.memory_order
global C.memory_order: type = @cint
Memory ordering constraints.
C.memory_order_relaxed
global C.memory_order_relaxed: C.memory_order
C.memory_order_consume
global C.memory_order_consume: C.memory_order
C.memory_order_acquire
global C.memory_order_acquire: C.memory_order
C.memory_order_release
global C.memory_order_release: C.memory_order
C.memory_order_acq_rel
global C.memory_order_acq_rel: C.memory_order
C.memory_order_seq_cst
global C.memory_order_seq_cst: C.memory_order
C.atomic_flag
global C.atomic_flag: type = @record{__val: boolean}
Lock-free atomic boolean flag.
C.kill_dependency
function C.kill_dependency(y: is_atomicable): #[y.type]#
Breaks a dependency chain for memory_order_consume
.
C.atomic_flag_test_and_set
function C.atomic_flag_test_and_set(object: *C.atomic_flag <volatile>): boolean
Sets an atomic_flag to true
and returns the old value (uses memory_order_seq_cst
order).
C.atomic_flag_test_and_set_explicit
function C.atomic_flag_test_and_set_explicit(object: *C.atomic_flag <volatile>, order: C.memory_order): boolean
Sets an atomic_flag to true
and returns the old value.
C.atomic_flag_clear
function C.atomic_flag_clear(object: *C.atomic_flag <volatile>): void
Sets an C.atomic_flag to false
(uses memory_order_seq_cst
order).
C.atomic_flag_clear_explicit
function C.atomic_flag_clear_explicit(object: *C.atomic_flag <volatile>, order: C.memory_order): void
Sets an C.atomic_flag to false
.
C.atomic_init
function C.atomic_init(obj: is_atomicable_ptr <volatile>, value: is_atomicable): void
Initializes an existing atomic object.
C.atomic_is_lock_free
function C.atomic_is_lock_free(obj: is_atomicable_ptr <const,volatile>): boolean
Indicates whether the atomic object is lock-free.
C.atomic_store
function C.atomic_store(object: is_atomicable_ptr <volatile>, desired: is_atomicable): void
Stores a value in an atomic object (uses memory_order_seq_cst
order).
C.atomic_store_explicit
function C.atomic_store_explicit(object: is_atomicable_ptr <volatile>, desired: is_atomicable, order: C.memory_order): void
Stores a value in an atomic object.
C.atomic_load
function C.atomic_load(object: is_atomicable_ptr <volatile>): #[object.type.subtype]#
Reads a value from an atomic object (uses memory_order_seq_cst
order).
C.atomic_load_explicit
function C.atomic_load_explicit(object: is_atomicable_ptr <volatile>, order: C.memory_order): #[object.type.subtype]#
Reads a value from an atomic object.
C.atomic_exchange
function C.atomic_exchange(object: is_atomicable_ptr <volatile>, desired: is_atomicable): #[object.type.subtype]#
Swaps a value with the value of an atomic object (uses memory_order_seq_cst
order).
C.atomic_exchange_explicit
function C.atomic_exchange_explicit(object: is_atomicable_ptr <volatile>, desired: is_atomicable, order: C.memory_order): #[object.type.subtype]#
Swaps a value with the value of an atomic object.
C.atomic_compare_exchange_strong
function C.atomic_compare_exchange_strong(object: is_atomicable_ptr <volatile>, expected: is_atomicable_ptr, desired: is_atomicable): boolean
C.atomic_compare_exchange_strong_explicit
function C.atomic_compare_exchange_strong_explicit(object: is_atomicable_ptr <volatile>, expected: is_atomicable_ptr, desired: is_atomicable, success: C.memory_order, failure: C.memory_order): boolean
C.atomic_compare_exchange_weak
function C.atomic_compare_exchange_weak(object: is_atomicable_ptr <volatile>, expected: is_atomicable_ptr, desired: is_atomicable): boolean
C.atomic_compare_exchange_weak_explicit
function C.atomic_compare_exchange_weak_explicit(object: is_atomicable_ptr <volatile>, expected: is_atomicable_ptr, desired: is_atomicable, success: C.memory_order, failure: C.memory_order): boolean
C.atomic_fetch_add
function C.atomic_fetch_add(object: is_atomicable_ptr <volatile>, arg: is_atomicable): #[object.type.subtype]#
C.atomic_fetch_add_explicit
function C.atomic_fetch_add_explicit(object: is_atomicable_ptr <volatile>, arg: is_atomicable, order: C.memory_order): #[object.type.subtype]#
C.atomic_fetch_sub
function C.atomic_fetch_sub(object: is_atomicable_ptr <volatile>, arg: is_atomicable): #[object.type.subtype]#
C.atomic_fetch_sub_explicit
function C.atomic_fetch_sub_explicit(object: is_atomicable_ptr <volatile>, arg: is_atomicable, order: C.memory_order): #[object.type.subtype]#
C.atomic_fetch_or
function C.atomic_fetch_or(object: is_atomicable_ptr <volatile>, arg: is_atomicable): #[object.type.subtype]#
C.atomic_fetch_or_explicit
function C.atomic_fetch_or_explicit(object: is_atomicable_ptr <volatile>, arg: is_atomicable, order: C.memory_order): #[object.type.subtype]#
C.atomic_fetch_and
function C.atomic_fetch_and(object: is_atomicable_ptr <volatile>, arg: is_atomicable): #[object.type.subtype]#
C.atomic_fetch_and_explicit
function C.atomic_fetch_and_explicit(object: is_atomicable_ptr <volatile>, arg: is_atomicable, order: C.memory_order): #[object.type.subtype]#
C.atomic_thread_fence
function C.atomic_thread_fence(order: C.memory_order): void
Generic memory order-dependent fence synchronization primitive.
C.atomic_signal_fence
function C.atomic_signal_fence(order: C.memory_order): void
Fence between a thread and a signal handler executed in the same thread.
C.ATOMIC_BOOL_LOCK_FREE
global C.ATOMIC_BOOL_LOCK_FREE: cint
C.ATOMIC_CHAR_LOCK_FREE
global C.ATOMIC_CHAR_LOCK_FREE: cint
C.ATOMIC_CHAR16_T_LOCK_FREE
global C.ATOMIC_CHAR16_T_LOCK_FREE: cint
C.ATOMIC_CHAR32_T_LOCK_FREE
global C.ATOMIC_CHAR32_T_LOCK_FREE: cint
C.ATOMIC_WCHAR_T_LOCK_FREE
global C.ATOMIC_WCHAR_T_LOCK_FREE: cint
C.ATOMIC_SHORT_LOCK_FREE
global C.ATOMIC_SHORT_LOCK_FREE: cint
C.ATOMIC_INT_LOCK_FREE
global C.ATOMIC_INT_LOCK_FREE: cint
C.ATOMIC_LONG_LOCK_FREE
global C.ATOMIC_LONG_LOCK_FREE: cint
C.ATOMIC_LLONG_LOCK_FREE
global C.ATOMIC_LLONG_LOCK_FREE: cint
C.ATOMIC_POINTER_LOCK_FREE
global C.ATOMIC_POINTER_LOCK_FREE: cint
C.ATOMIC_FLAG_INIT
global C.ATOMIC_FLAG_INIT: C.atomic_flag
Initializes a new atomic flag.