| 1 |
/* Time internal interface |
| 2 |
|
| 3 |
Copyright 2015-2025 Free Software Foundation, Inc. |
| 4 |
|
| 5 |
This file is free software: you can redistribute it and/or modify |
| 6 |
it under the terms of the GNU Lesser General Public License as |
| 7 |
published by the Free Software Foundation, either version 3 of the |
| 8 |
License, or (at your option) any later version. |
| 9 |
|
| 10 |
This file is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
GNU Lesser General Public License for more details. |
| 14 |
|
| 15 |
You should have received a copy of the GNU Lesser General Public License |
| 16 |
along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
| 17 |
|
| 18 |
/* Written by Paul Eggert. */ |
| 19 |
|
| 20 |
/* This file is for Gnulib internal use only. |
| 21 |
Applications should not use it. */ |
| 22 |
|
| 23 |
/* A time zone rule. */ |
| 24 |
struct tm_zone |
| 25 |
{ |
| 26 |
/* More abbreviations, should they be needed. Their TZ_IS_SET |
| 27 |
members are zero. */ |
| 28 |
struct tm_zone *next; |
| 29 |
|
| 30 |
/* If nonzero, the rule represents the TZ environment variable set |
| 31 |
to the first "abbreviation" (this may be the empty string). |
| 32 |
Otherwise, it represents an unset TZ. */ |
| 33 |
char tz_is_set; |
| 34 |
|
| 35 |
/* A sequence of null-terminated strings packed next to each other. |
| 36 |
The strings are followed by an extra null byte. If TZ_IS_SET, |
| 37 |
there must be at least one string and the first string (which is |
| 38 |
actually a TZ environment value) may be empty. Otherwise all |
| 39 |
strings must be nonempty. |
| 40 |
|
| 41 |
Abbreviations are stored here even on platforms with tm_zone, because |
| 42 |
otherwise tm_zone values would be dead after changing TZ and calling |
| 43 |
tzset. Abbreviations never move once allocated, and are live |
| 44 |
until tzfree is called. */ |
| 45 |
char abbrs[FLEXIBLE_ARRAY_MEMBER]; |
| 46 |
}; |
| 47 |
|
| 48 |
timezone_t set_tz (timezone_t); |
| 49 |
bool revert_tz (timezone_t); |
| 50 |
|
| 51 |
/* Magic cookie timezone_t value, for local time. It differs from |
| 52 |
NULL and from all other timezone_t values. Only the address |
| 53 |
matters; the pointer is never dereferenced. */ |
| 54 |
#define local_tz ((timezone_t) 1) |