1 /*-------------------------------------------------------------------------
4 * Timezone Library Integration Functions
6 * Note: this file contains only definitions that are private to the
7 * timezone library. Public definitions are in pgtime.h.
9 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
14 *-------------------------------------------------------------------------
23 #define BIGGEST(a, b) (((a) > (b)) ? (a) : (b))
26 { /* time type information */
27 long tt_gmtoff
; /* UTC offset in seconds */
28 int tt_isdst
; /* used to set tm_isdst */
29 int tt_abbrind
; /* abbreviation list index */
30 int tt_ttisstd
; /* TRUE if transition is std time */
31 int tt_ttisgmt
; /* TRUE if transition is UTC */
35 { /* leap second information */
36 pg_time_t ls_trans
; /* transition time */
37 long ls_corr
; /* correction to apply */
48 pg_time_t ats
[TZ_MAX_TIMES
];
49 unsigned char types
[TZ_MAX_TIMES
];
50 struct ttinfo ttis
[TZ_MAX_TYPES
];
51 char chars
[BIGGEST(BIGGEST(TZ_MAX_CHARS
+ 1, 3 /* sizeof gmt */ ),
52 (2 * (TZ_STRLEN_MAX
+ 1)))];
53 struct lsinfo lsis
[TZ_MAX_LEAPS
];
59 /* TZname contains the canonically-cased name of the timezone */
60 char TZname
[TZ_STRLEN_MAX
+ 1];
66 extern int pg_open_tzfile(const char *name
, char *canonname
);
69 extern int tzload(const char *name
, char *canonname
, struct state
* sp
,
71 extern int tzparse(const char *name
, struct state
* sp
, int lastditch
);