tzparser.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*-------------------------------------------------------------------------
  2. *
  3. * tzparser.h
  4. * Timezone offset file parsing definitions.
  5. *
  6. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994, Regents of the University of California
  8. *
  9. * src/include/utils/tzparser.h
  10. *
  11. *-------------------------------------------------------------------------
  12. */
  13. #ifndef TZPARSER_H
  14. #define TZPARSER_H
  15. #include "utils/datetime.h"
  16. /*
  17. * The result of parsing a timezone configuration file is an array of
  18. * these structs, in order by abbrev. We export this because datetime.c
  19. * needs it.
  20. */
  21. typedef struct tzEntry
  22. {
  23. /* the actual data */
  24. char *abbrev; /* TZ abbreviation (downcased) */
  25. char *zone; /* zone name if dynamic abbrev, else NULL */
  26. /* for a dynamic abbreviation, offset/is_dst are not used */
  27. int offset; /* offset in seconds from UTC */
  28. bool is_dst; /* true if a DST abbreviation */
  29. /* source information (for error messages) */
  30. int lineno;
  31. const char *filename;
  32. } tzEntry;
  33. extern TimeZoneAbbrevTable *load_tzoffsets(const char *filename);
  34. #endif /* TZPARSER_H */