postgresql/src/timezone/tzfile.h

111 lines
3.5 KiB
C
Raw Normal View History

/* Layout and location of TZif files. */
2004-04-30 06:44:06 +02:00
#ifndef TZFILE_H
2004-04-30 06:44:06 +02:00
#define TZFILE_H
/*
* This file is in the public domain, so clarified as of
* 1996-06-05 by Arthur David Olson.
*
* IDENTIFICATION
2010-09-20 22:08:53 +02:00
* src/timezone/tzfile.h
*/
2004-04-30 06:44:06 +02:00
/*
* This header is for use ONLY with the time conversion code.
* There is no guarantee that it will remain unchanged,
* or that it will remain at all.
* Do NOT copy it to any system include directory.
* Thank you!
*/
2004-04-30 06:44:06 +02:00
/*
* Information about time zone files.
*/
2004-04-30 06:44:06 +02:00
#define TZDEFAULT "/etc/localtime"
2004-04-30 06:44:06 +02:00
#define TZDEFRULES "posixrules"
/* See Internet RFC 8536 for more details about the following format. */
2004-04-30 06:44:06 +02:00
/*
* Each file begins with. . .
*/
2004-04-30 06:44:06 +02:00
#define TZ_MAGIC "TZif"
struct tzhead
{
char tzh_magic[4]; /* TZ_MAGIC */
char tzh_version[1]; /* '\0' or '2' or '3' as of 2013 */
Phase 2 of pgindent updates. Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
char tzh_reserved[15]; /* reserved; must be zero */
char tzh_ttisutcnt[4]; /* coded number of trans. time flags */
Phase 2 of pgindent updates. Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
char tzh_leapcnt[4]; /* coded number of leap seconds */
char tzh_timecnt[4]; /* coded number of transition times */
char tzh_typecnt[4]; /* coded number of local time types */
char tzh_charcnt[4]; /* coded number of abbr. chars */
2004-04-30 06:44:06 +02:00
};
/*
* . . .followed by. . .
*
* tzh_timecnt (char [4])s coded transition times a la time(2)
* tzh_timecnt (unsigned char)s types of local time starting at above
* tzh_typecnt repetitions of
* one (char [4]) coded UT offset in seconds
* one (unsigned char) used to set tm_isdst
* one (unsigned char) that's an abbreviation list index
* tzh_charcnt (char)s '\0'-terminated zone abbreviations
* tzh_leapcnt repetitions of
* one (char [4]) coded leap second transition times
* one (char [4]) total correction after above
* tzh_ttisstdcnt (char)s indexed by type; if 1, transition
* time is standard time, if 0,
* transition time is local (wall clock)
* time; if absent, transition times are
* assumed to be local time
* tzh_ttisutcnt (char)s indexed by type; if 1, transition
* time is UT, if 0, transition time is
* local time; if absent, transition
* times are assumed to be local time.
* When this is 1, the corresponding
* std/wall indicator must also be 1.
*/
2004-04-30 06:44:06 +02:00
/*
* If tzh_version is '2' or greater, the above is followed by a second instance
* of tzhead and a second instance of the data in which each coded transition
* time uses 8 rather than 4 chars,
* then a POSIX-TZ-environment-variable-style string for use in handling
* instants after the last transition time stored in the file
* (with nothing between the newlines if there is no POSIX representation for
* such instants).
*
* If tz_version is '3' or greater, the above is extended as follows.
* First, the POSIX TZ string's hour offset may range from -167
* through 167 as compared to the POSIX-required 0 through 24.
* Second, its DST start time may be January 1 at 00:00 and its stop
* time December 31 at 24:00 plus the difference between DST and
* standard time, indicating DST all year.
*/
2004-04-30 06:44:06 +02:00
/*
* In the current implementation, "tzset()" refuses to deal with files that
* exceed any of the limits below.
*/
#define TZ_MAX_TIMES 2000
2004-04-30 06:44:06 +02:00
/* This must be at least 17 for Europe/Samara and Europe/Vilnius. */
2005-10-15 04:49:52 +02:00
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
2004-04-30 06:44:06 +02:00
2005-10-15 04:49:52 +02:00
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
/* (limited by what unsigned chars can hold) */
2004-04-30 06:44:06 +02:00
2005-10-15 04:49:52 +02:00
#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
2004-04-30 06:44:06 +02:00
Phase 2 of pgindent updates. Change pg_bsd_indent to follow upstream rules for placement of comments to the right of code, and remove pgindent hack that caused comments following #endif to not obey the general rule. Commit e3860ffa4dd0dad0dd9eea4be9cc1412373a8c89 wasn't actually using the published version of pg_bsd_indent, but a hacked-up version that tried to minimize the amount of movement of comments to the right of code. The situation of interest is where such a comment has to be moved to the right of its default placement at column 33 because there's code there. BSD indent has always moved right in units of tab stops in such cases --- but in the previous incarnation, indent was working in 8-space tab stops, while now it knows we use 4-space tabs. So the net result is that in about half the cases, such comments are placed one tab stop left of before. This is better all around: it leaves more room on the line for comment text, and it means that in such cases the comment uniformly starts at the next 4-space tab stop after the code, rather than sometimes one and sometimes two tabs after. Also, ensure that comments following #endif are indented the same as comments following other preprocessor commands such as #else. That inconsistency turns out to have been self-inflicted damage from a poorly-thought-through post-indent "fixup" in pgindent. This patch is much less interesting than the first round of indent changes, but also bulkier, so I thought it best to separate the effects. Discussion: https://postgr.es/m/E1dAmxK-0006EE-1r@gemulon.postgresql.org Discussion: https://postgr.es/m/30527.1495162840@sss.pgh.pa.us
2017-06-21 21:18:54 +02:00
#endif /* !defined TZFILE_H */