std1.0.0-beta-7 SafeC docs

Module io

#include <std/io.h> source

I/O declarations (C11/C17/C23 stdio coverage)

Functions

printPrint a string without a trailing newline.
printlnPrint a string followed by a newline.
print_charPrint a single character to stdout.
print_intPrint a signed 64-bit integer to stdout.
print_uint
print_floatPrint a double to stdout.
print_hex
print_oct
print_ptrPrint the address a reference points at ("(nil)" for null).
println_intPrint a signed 64-bit integer followed by newline.
println_uint
println_floatPrint a double followed by newline.
println_char
eprintPrint a string to stderr without a trailing newline.
eprintlnPrint a string to stderr followed by a newline.
eprint_int
eprint_float
io_fmt_intAll return the number of characters written (excluding NUL), or -1 on error.
io_fmt_uint
io_fmt_float
io_fmt_float_prec
io_fmt_hex
io_fmt_str
io_getcharRead a single character from stdin. Returns the character or SC_EOF.
io_ungetcPush a character back onto stdin so the next io_getchar/io_scan_* returns it.
io_read_lineRead a line (up to buf.len-1 chars + NUL) from stdin into buf. Returns number of characters read (excluding NUL), or -1 on EOF/error.
io_read_tokenRead a whitespace-delimited token from stdin. Returns number of characters read (0 = EOF before token, -1 = error).
io_scan_intParse a signed decimal integer from stdin. Returns 1 on success, 0 on error.
io_scan_uintParse an unsigned decimal integer from stdin. Returns 1 on success.
io_scan_floatParse a floating-point number from stdin. Returns 1 on success.
io_removeRemove (delete) a file. Returns 0 on success, non-zero on error.
io_renameRename / move a file. Returns 0 on success, non-zero on error.
io_tmpfileCreate a temporary file; returns file handle or NULL on error.
flush_stdoutFlush stdout — call before program exit if using print() without println().
flush_stderrFlush stderr.

Macros

SC_SEEK_SET
SC_SEEK_CUR
SC_SEEK_END
SC_EOF