Mstdlib-1.24.0
|
Functions | |
M_time_tzs_t * | M_time_tzs_create (void) |
void | M_time_tzs_destroy (M_time_tzs_t *tzs) |
M_time_load_source_t | M_time_tzs_load (M_time_tzs_t **tzs, M_uint32 zones, M_uint32 alias_f, M_uint32 flags) |
M_time_tzs_t * | M_time_tzs_load_zoneinfo (const char *path, M_uint32 zones, M_uint32 alias_f, M_uint32 flags) |
M_time_tzs_t * | M_time_tzs_load_win_zones (M_uint32 zones, M_uint32 alias_f, M_uint32 flags) |
M_time_result_t | M_time_tzs_add_win_zone (M_time_tzs_t *tzs, const char *name) |
M_time_result_t | M_time_tzs_add_posix_str (M_time_tzs_t *tzs, const char *str) |
M_time_result_t | M_time_tzs_add_tzfile (M_time_tzs_t *tzs, const char *path, const char *name) |
M_list_str_t * | M_time_tzs_get_loaded_zones (const M_time_tzs_t *tzs) |
const M_time_tz_t * | M_time_tzs_get_tz (M_time_tzs_t *tzs, const char *name) |
M_time_tzs_t * M_time_tzs_create | ( | void | ) |
Create an empty timezone db.
void M_time_tzs_destroy | ( | M_time_tzs_t * | tzs | ) |
Destroy a time zone db.
[in] | tzs | Time zone db. |
M_time_load_source_t M_time_tzs_load | ( | M_time_tzs_t ** | tzs, |
M_uint32 | zones, | ||
M_uint32 | alias_f, | ||
M_uint32 | flags | ||
) |
Load default timezones from system available source.
This will attempt to load system timezone data. If that fails, it will fall back to loading the four main US timezones with DST times and without historic data.
[out] | tzs | Time zone db. |
[in] | zones | M_time_tz_zones_t zones. What zones from the db should be loaded. |
[in] | alias_f | M_time_tz_alias_t to handle alias loading. |
[in] | flags | M_time_tz_load_t flags. How should the data be loaded. Specifically should lazy loading be used. When lazying loading data is read from disk (and cached) on demand. If lazy loading is not used all day is read from disk immediately. |
M_time_tzs_t * M_time_tzs_load_zoneinfo | ( | const char * | path, |
M_uint32 | zones, | ||
M_uint32 | alias_f, | ||
M_uint32 | flags | ||
) |
Load a tzs with data from a precomputed Olson/TZ/Zoneinfo db.
To prevent possible issues the zoneinfo path cannot be a symlink. If it is a symlink the symlink needs to be resolved before passing into this function. Further, symlinks within the zoneinfo base dir cannot point to locations outside of the base dir.
[in] | path | The path to the data to load. On Unix systems this is typically "/usr/share/zoneinfo" or "/usr/lib/zoneinfo". If NULL those two default locations will be checked for zoneinfo. |
[in] | zones | M_time_tz_zones_t zones. What zones from the db should be loaded. |
[in] | alias_f | M_time_tz_alias_t to handle alias loading. |
[in] | flags | M_time_tz_load_t flags. How should the data be loaded. Specifically should lazy loading be used. When lazying loading data is read from disk (and cached) on demand. If lazy loading is not used all day is read from disk immediately. |
M_time_tzs_t * M_time_tzs_load_win_zones | ( | M_uint32 | zones, |
M_uint32 | alias_f, | ||
M_uint32 | flags | ||
) |
Load a tzs with data from the Windows time zone database.
Windows only.
[in] | zones | M_time_tz_zones_t zones. What zones from the db should be loaded. |
[in] | alias_f | M_time_tz_alias_t to handle alias loading. |
[in] | flags | M_time_tz_load_t flags. How should the data be loaded. Specifically should lazy loading be used. When lazying loading data is read from disk (and cached) on demand. If lazy loading is not used all day is read from disk immediately. |
M_time_result_t M_time_tzs_add_win_zone | ( | M_time_tzs_t * | tzs, |
const char * | name | ||
) |
Add data from the Windows time zone database.
Windows only.
[in,out] | tzs | The tz db. |
[in] | name | The info to load. Only the Windows name is supported. |
M_time_result_t M_time_tzs_add_posix_str | ( | M_time_tzs_t * | tzs, |
const char * | str | ||
) |
Add the timezone data from a Posix TZ string.
Only the M day of week format is supported for specifying transition day. Example: EST5EDT,M3.2.0/02:00:00,M11.1.0/02:00:00
[in,out] | tzs | The tz db. |
[in] | str | The string to parse. |
M_time_result_t M_time_tzs_add_tzfile | ( | M_time_tzs_t * | tzs, |
const char * | path, | ||
const char * | name | ||
) |
Add data from a specific TZif file.
[in,out] | tzs | The tz db. |
[in] | path | The file to load. |
[in] | name | The name to associate with the file. |
M_list_str_t * M_time_tzs_get_loaded_zones | ( | const M_time_tzs_t * | tzs | ) |
Get a list of loaded timezones.
The names are stored case preserving but a lookup is case insensitive.
[in] | tzs | The tz db. |
const M_time_tz_t * M_time_tzs_get_tz | ( | M_time_tzs_t * | tzs, |
const char * | name | ||
) |
Get a specific tz from the db.
The time zone will be loaded if lazy loading is in use.
[in,out] | tzs | The tz db. |
[in] | name | The name of the tz. The names are looked up case insensitive. |