Module: libc.ctype
Source: ./libc/ctype.reef
Overview
libc.ctype - C character type functions (FFI)
Raw libc <ctype.h> FFI. This is a BINDING, not a peer of core.chars:
the predicates return int (C's nonzero-is-true), not bool, so they do
not compose with Reef conditionals the way core.chars does — write
libc.ctype.isdigit(c) != 0, never if libc.ctype.isdigit(c). Case
conversion (toupper/tolower) does return char.
Stdlib and applications should use core.chars, which is the one character library (0.9.2 C4) and is pure Reef. Reach for this module only for direct libc access in performance-critical code, and only on a hosted target: it is NOT available freestanding, since it links against the C library.
Functions
fn toupper(c: int): int
fn tolower(c: int): int
fn isalpha(c: int): int
fn isdigit(c: int): int
fn isalnum(c: int): int
fn isspace(c: int): int
fn isupper(c: int): int
fn islower(c: int): int
fn isprint(c: int): int
fn ispunct(c: int): int
fn toupper(c: char): char
Converts lowercase letter to uppercase Non-lowercase characters are returned unchanged
fn tolower(c: char): char
Converts uppercase letter to lowercase Non-uppercase characters are returned unchanged
fn isalpha(c: char): int
Returns non-zero if c is an alphabetic character
fn isdigit(c: char): int
Returns non-zero if c is a digit ('0'-'9')
fn isalnum(c: char): int
Returns non-zero if c is alphanumeric
fn isspace(c: char): int
Returns non-zero if c is whitespace
fn isupper(c: char): int
Returns non-zero if c is uppercase
fn islower(c: char): int
Returns non-zero if c is lowercase
fn isprint(c: char): int
Returns non-zero if c is printable
fn ispunct(c: char): int
Returns non-zero if c is punctuation
Generated by reefc doc