IO read library

September 1, 2024 ยท View on GitHub

Source: include/stdlib/io/read.ml

Extendable and safe frontend for scanf/fscanf.

Functions

FunctionDescription
_readread handlers that call fscanf based on the argument type

Macros

MacroDescription
inputReads a string (str, not c_str) from stdin until a newline is found
readReads values from stdin and updates its arguments
read_fromReads values from the given stream and updates its arguments

Extensibility

Important

To extend read or any of the macros, simply declare a new _read helper with a c_stream argument and a pointer to the custom type to extend.

Warnings