Mstdlib-1.24.0
|
Functions | |
M_time_result_t | M_mtzfile_tzs_add_file (M_time_tzs_t *tzs, const char *path, size_t *err_line, char **err_sect, char **err_data) |
M_time_result_t | M_mtzfile_tzs_add_str (M_time_tzs_t *tzs, const char *data, size_t *err_line, char **err_sect, char **err_data) |
The Mstdlib TZ format is a simple way to describe timezone information. It is intended for use on systems that do not provide timezone information. Such as embedded systems. A time.zone file is provided in the formats/time directory in the source package which provides timezone descriptions for US, Canada, and Mexico.
The format is an ini file which can be parsed with m_ini. However, functions are provided here which will parse and load the format into a M_time_tzs_t object.
Format description:
Section define zones. Aliases are alternate names that identify the zone. The section must have an offset and abbreviation. The offset is assumed negative unless the value start explicitly with '+'. DST offsets and abbreviations are used when a DST rule is in effect. A DST rule is a Posix DST rule with the first part replaced with a year (the year the rule applies) followed by a ';'. For DST rules only the M day format is supported.
Example:
M_time_result_t M_mtzfile_tzs_add_file | ( | M_time_tzs_t * | tzs, |
const char * | path, | ||
size_t * | err_line, | ||
char ** | err_sect, | ||
char ** | err_data | ||
) |
Add Mstdlib TZ from a file.
[in,out] | tzs | The tz db. |
[in] | path | The file and path to load. |
[out] | err_line | The line number if failure is due to ini parse failure. |
[out] | err_sect | The section that failed to parse if a parse failure not due to an ini parse failure. |
[out] | err_data | The data that caused the failure. |
M_time_result_t M_mtzfile_tzs_add_str | ( | M_time_tzs_t * | tzs, |
const char * | data, | ||
size_t * | err_line, | ||
char ** | err_sect, | ||
char ** | err_data | ||
) |
Add Mstdlib TZ from a string.
[in,out] | tzs | The tz db. |
[in] | data | The data to load. |
[out] | err_line | The line number if failure is due to ini parse failure. |
[out] | err_sect | The section that failed to parse if a parse failure not due to an ini parse failure. |
[out] | err_data | The data that caused the failure. |