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 integer string 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 out in bytes.

  • out – Parsed value.

Returns:

The read_count of characters read, write_count of bytes written, and a status. The status will be ExessStatus.EXESS_LOSS if 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 integer string.

Parameters:
  • value_size – The size of value in bytes.

  • value – Value to write.

  • buf_size – Size of buf in bytes.

  • buf – Output buffer, or null to only measure.

Returns:

The count of characters in the output, and a status (ExessStatus.EXESS_SUCCESS, or ExessStatus.EXESS_NO_SPACE if the buffer is too small).