Make to_timestamp and friends skip leading spaces before an integer field,
[PostgreSQL.git] / src / timezone / pgtz.h
blobbae0a5851e47860bbce905a43ad2abf4bcbef04d
1 /*-------------------------------------------------------------------------
3 * pgtz.h
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
11 * IDENTIFICATION
12 * $PostgreSQL$
14 *-------------------------------------------------------------------------
16 #ifndef _PGTZ_H
17 #define _PGTZ_H
19 #include "tzfile.h"
20 #include "pgtime.h"
23 #define BIGGEST(a, b) (((a) > (b)) ? (a) : (b))
25 struct ttinfo
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 */
34 struct lsinfo
35 { /* leap second information */
36 pg_time_t ls_trans; /* transition time */
37 long ls_corr; /* correction to apply */
40 struct state
42 int leapcnt;
43 int timecnt;
44 int typecnt;
45 int charcnt;
46 int goback;
47 int goahead;
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];
57 struct pg_tz
59 /* TZname contains the canonically-cased name of the timezone */
60 char TZname[TZ_STRLEN_MAX + 1];
61 struct state state;
65 /* in pgtz.c */
66 extern int pg_open_tzfile(const char *name, char *canonname);
68 /* in localtime.c */
69 extern int tzload(const char *name, char *canonname, struct state * sp,
70 int doextend);
71 extern int tzparse(const char *name, struct state * sp, int lastditch);
73 #endif /* _PGTZ_H */