gYear

EXESS_MAX_YEAR_LENGTH

12U

The maximum length of a gYear string from exess_write_year()

struct ExessYear

A Gregorian year.

int16_t year

Year: any positive or negative value.

ExessTimezone zone

Timezone offset in quarter hours.

ExessResult exess_read_year(const char *str, ExessYear *out)

Read a gYear string after any leading whitespace.

Parameters:
  • str – String to read.

  • out – Parsed value, or zero on error.

Returns:

The count of characters read, and a status.

ExessResult exess_write_year(ExessYear value, size_t buf_size, char *buf)

Write a canonical gYear string.

The output is always in canonical form, like 2001 or 2001+03:00.

Parameters:
  • value – Value to write.

  • buf_size – Size of buf in bytes.

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

Returns:

ExessStatus.EXESS_SUCCESS on success, ExessStatus.EXESS_NO_SPACE if the buffer is too small, or ExessStatus.EXESS_BAD_VALUE if the value is invalid.