integer¶
An integer is a decimal with no decimal point or fractional component.
-
ExessVariableResult exess_read_integer(const char *str, size_t out_size, void *out)¶
Read a
integerstring after any leading whitespace.The high-precision value format is opaque to the user, but can be written or converted to other types.
- Parameters:
str – String to read.
out_size – Size of
outin bytes.out – Parsed value.
- Returns:
The
read_countof characters read,write_countof bytes written, and astatus. Thestatuswill beExessStatus.EXESS_LOSSif an approximate value was successfully read by dropping significant digits.
-
ExessResult exess_write_integer(size_t value_size, const void *value, size_t buf_size, char *buf)¶
Write a canonical
integerstring.- Parameters:
value_size – The size of
valuein bytes.value – Value to write.
buf_size – Size of
bufin bytes.buf – Output buffer, or null to only measure.
- Returns:
The
countof characters in the output, and astatus(ExessStatus.EXESS_SUCCESS, orExessStatus.EXESS_NO_SPACEif the buffer is too small).