StdcStdlib extension

<stdlib.h> standard library extensions for stdc.

on

Properties

EXIT_FAILURE int

Available on Stdc, provided by the StdcStdlib extension

Unsuccessful termination code.
no setter
EXIT_SUCCESS int

Available on Stdc, provided by the StdcStdlib extension

Successful termination code.
no setter

Methods

abort() → void

Available on Stdc, provided by the StdcStdlib extension

Aborts the current process abnormally. Maps to exit(1) on native platforms and throws UnsupportedError on Web.
atof(String str) double

Available on Stdc, provided by the StdcStdlib extension

Converts a string to a double.
atoi(String str) int

Available on Stdc, provided by the StdcStdlib extension

Converts a string to an integer.
atol(String str) int

Available on Stdc, provided by the StdcStdlib extension

Converts a string to a long integer.
bsearch<T>(T key, List<T> base, int compar(T a, T b)) → T?

Available on Stdc, provided by the StdcStdlib extension

Performs a binary search on a sorted array (list). Returns the matching element, or null if not found.
exit(int code) → void

Available on Stdc, provided by the StdcStdlib extension

Terminates the calling process normally with the given exit code. Throws UnsupportedError on platforms without process exit support (e.g., Web).
getenv(String name) String?

Available on Stdc, provided by the StdcStdlib extension

Gets an environment variable by name. Returns null if the variable is not found or if the platform does not support environment variables (e.g., Web).
labs(int n) int

Available on Stdc, provided by the StdcStdlib extension

Computes the absolute value of a long integer.
llabs(int n) int

Available on Stdc, provided by the StdcStdlib extension

Computes the absolute value of a long long integer.
qsort<T>(List<T> base, int compar(T a, T b)) → void

Available on Stdc, provided by the StdcStdlib extension

Sorts an array (list) using a comparator function. Modifies the list in-place.
rand() int

Available on Stdc, provided by the StdcStdlib extension

Returns a pseudo-random integer between 0 and 0x7FFFFFFF.
srand(int seed) → void

Available on Stdc, provided by the StdcStdlib extension

Seeds the pseudo-random number generator used by rand.
system(String command) int

Available on Stdc, provided by the StdcStdlib extension

Executes a system command. Passes the command to the system shell and returns the exit code. Throws UnsupportedError on platforms without shell access (e.g., Web).