Expand description
Safe, Rust-idiomatic equivalents of C standard library functions.
Each function preserves the corresponding libc function’s behavior for inputs
whose behavior libc defines, with priority given to preserving its return value.
C types map to fixed Rust types: char to i8, int to i32, long to i64,
float to f32, double to f64, long double to f128::f128, and
size_t to usize. Null-terminated strings are represented by i8 slices
containing a null byte where required by the libc interface.
Function documentation is intentionally concise because behavior follows libc; it notes Rust-specific return values and error handling where needed.
Re-exports§
pub use ctype::isalnum;pub use ctype::isalpha;pub use ctype::isblank;pub use ctype::iscntrl;pub use ctype::isdigit;pub use ctype::isgraph;pub use ctype::islower;pub use ctype::isprint;pub use ctype::ispunct;pub use ctype::isspace;pub use ctype::isupper;pub use ctype::isxdigit;pub use ctype::tolower;pub use ctype::toupper;pub use stdio::printf;pub use stdio::fgetc;pub use stdio::fgets;pub use stdio::fputc;pub use stdio::fputs;pub use stdio::fread;pub use stdio::fseek;pub use stdio::ftell;pub use stdio::fwrite;pub use stdio::getchar;pub use stdio::putchar;pub use stdio::puts;pub use stdio::rewind;pub use stdio::remove;pub use stdio::rename;pub use stdlib::atof;pub use stdlib::atoi;pub use stdlib::atol;pub use stdlib::strtod;pub use stdlib::strtod_mut;pub use stdlib::strtof;pub use stdlib::strtof_mut;pub use stdlib::strtol;pub use stdlib::strtol_mut;pub use stdlib::strtold;pub use stdlib::strtold_mut;pub use stdlib::strtoul;pub use stdlib::strtoul_mut;pub use string::memchr;pub use string::memchr_mut;pub use string::memcmp;pub use string::strcat;pub use string::strchr;pub use string::strchr_mut;pub use string::strcmp;pub use string::strcpy;pub use string::strcspn;pub use string::strdup;pub use string::strlen;pub use string::strncat;pub use string::strncmp;pub use string::strncpy;pub use string::strndup;pub use string::strrchr;pub use string::strrchr_mut;pub use string::strspn;pub use string::strstr;pub use string::strstr_mut;pub use strings::strcasecmp;pub use strings::strncasecmp;
Modules§
- ctype
- Safe equivalents of functions declared in C’s
ctype.hheader. - stdio
- Safe equivalents of functions declared in C’s
stdio.hheader. - stdlib
- Safe equivalents of functions declared in C’s
stdlib.hheader. - string
- Safe equivalents of functions declared in C’s
string.hheader. - strings
- Safe equivalents of functions declared in C’s
strings.hheader.