Unsigned Short

An xsd:unsignedShort is an unsigned 16-bit integer.

Values range from 0 to 65535 inclusive.

The lexical form is the same as xsd:unsignedLong, the only difference is that the value space of xsd:unsignedShort is smaller. See Unsigned Long for details.

ExessResult exess_read_ushort(uint16_t *out, const char *str)

Read an xsd:unsignedShort string after any leading whitespace.

Parameters
  • out – Set to the parsed value, or zero on error.

  • str – String input.

Returns

The count of characters read, and a status code.

ExessResult exess_write_ushort(uint16_t value, size_t buf_size, char *buf)

Write a canonical xsd:unsignedShort string.

Parameters
  • value – Value to write.

  • buf_size – The size of buf in bytes.

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

Returns

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

EXESS_MAX_USHORT_LENGTH

The maximum length of a canonical xsd:unsignedShort string, 5.