time-internal.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Time internal interface
  2. Copyright 2015-2023 Free Software Foundation, Inc.
  3. This file is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This file is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  13. /* Written by Paul Eggert. */
  14. /* A time zone rule. */
  15. struct tm_zone
  16. {
  17. /* More abbreviations, should they be needed. Their TZ_IS_SET
  18. members are zero. */
  19. struct tm_zone *next;
  20. #if HAVE_TZNAME && !HAVE_STRUCT_TM_TM_ZONE
  21. /* Copies of recent strings taken from tzname[0] and tzname[1].
  22. The copies are in ABBRS, so that they survive tzset. Null if unknown. */
  23. char *tzname_copy[2];
  24. #endif
  25. /* If nonzero, the rule represents the TZ environment variable set
  26. to the first "abbreviation" (this may be the empty string).
  27. Otherwise, it represents an unset TZ. */
  28. char tz_is_set;
  29. /* A sequence of null-terminated strings packed next to each other.
  30. The strings are followed by an extra null byte. If TZ_IS_SET,
  31. there must be at least one string and the first string (which is
  32. actually a TZ environment value) may be empty. Otherwise all
  33. strings must be nonempty.
  34. Abbreviations are stored here because otherwise the values of
  35. tm_zone and/or tzname would be dead after changing TZ and calling
  36. tzset. Abbreviations never move once allocated, and are live
  37. until tzfree is called. */
  38. char abbrs[FLEXIBLE_ARRAY_MEMBER];
  39. };