Consistently use "superuser" instead of "super user"
[pgsql.git] / src / timezone / pgtz.h
blobca01722ee98a8f78947a07571435d98de9bbf327
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-2021, PostgreSQL Global Development Group
11 * IDENTIFICATION
12 * src/timezone/pgtz.h
14 *-------------------------------------------------------------------------
16 #ifndef _PGTZ_H
17 #define _PGTZ_H
19 #include "pgtime.h"
20 #include "tzfile.h"
23 #define SMALLEST(a, b) (((a) < (b)) ? (a) : (b))
24 #define BIGGEST(a, b) (((a) > (b)) ? (a) : (b))
26 struct ttinfo
27 { /* time type information */
28 int32 tt_utoff; /* UT offset in seconds */
29 bool tt_isdst; /* used to set tm_isdst */
30 int tt_desigidx; /* abbreviation list index */
31 bool tt_ttisstd; /* transition is std time */
32 bool tt_ttisut; /* transition is UT */
35 struct lsinfo
36 { /* leap second information */
37 pg_time_t ls_trans; /* transition time */
38 int64 ls_corr; /* correction to apply */
41 struct state
43 int leapcnt;
44 int timecnt;
45 int typecnt;
46 int charcnt;
47 bool goback;
48 bool goahead;
49 pg_time_t ats[TZ_MAX_TIMES];
50 unsigned char types[TZ_MAX_TIMES];
51 struct ttinfo ttis[TZ_MAX_TYPES];
52 char chars[BIGGEST(BIGGEST(TZ_MAX_CHARS + 1, 4 /* sizeof gmt */ ),
53 (2 * (TZ_STRLEN_MAX + 1)))];
54 struct lsinfo lsis[TZ_MAX_LEAPS];
57 * The time type to use for early times or if no transitions. It is always
58 * zero for recent tzdb releases. It might be nonzero for data from tzdb
59 * 2018e or earlier.
61 int defaulttype;
65 struct pg_tz
67 /* TZname contains the canonically-cased name of the timezone */
68 char TZname[TZ_STRLEN_MAX + 1];
69 struct state state;
73 /* in pgtz.c */
74 extern int pg_open_tzfile(const char *name, char *canonname);
76 /* in localtime.c */
77 extern int tzload(const char *name, char *canonname, struct state *sp,
78 bool doextend);
79 extern bool tzparse(const char *name, struct state *sp, bool lastditch);
81 #endif /* _PGTZ_H */