Blame timezone/tzfile.h

Packit 6c4009
#ifndef TZFILE_H
Packit 6c4009
Packit 6c4009
#define TZFILE_H
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
** This file is in the public domain, so clarified as of
Packit 6c4009
** 1996-06-05 by Arthur David Olson.
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
** This header is for use ONLY with the time conversion code.
Packit 6c4009
** There is no guarantee that it will remain unchanged,
Packit 6c4009
** or that it will remain at all.
Packit 6c4009
** Do NOT copy it to any system include directory.
Packit 6c4009
** Thank you!
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
** Information about time zone files.
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
#ifndef TZDIR
Packit 6c4009
#define TZDIR	"/usr/local/etc/zoneinfo" /* Time zone object file directory */
Packit 6c4009
#endif /* !defined TZDIR */
Packit 6c4009
Packit 6c4009
#ifndef TZDEFAULT
Packit 6c4009
#define TZDEFAULT	"localtime"
Packit 6c4009
#endif /* !defined TZDEFAULT */
Packit 6c4009
Packit 6c4009
#ifndef TZDEFRULES
Packit 6c4009
#define TZDEFRULES	"posixrules"
Packit 6c4009
#endif /* !defined TZDEFRULES */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
** Each file begins with. . .
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
#define	TZ_MAGIC	"TZif"
Packit 6c4009
Packit 6c4009
struct tzhead {
Packit 6c4009
	char	tzh_magic[4];		/* TZ_MAGIC */
Packit 6c4009
	char	tzh_version[1];		/* '\0' or '2' or '3' as of 2013 */
Packit 6c4009
	char	tzh_reserved[15];	/* reserved; must be zero */
Packit 6c4009
	char	tzh_ttisgmtcnt[4];	/* coded number of trans. time flags */
Packit 6c4009
	char	tzh_ttisstdcnt[4];	/* coded number of trans. time flags */
Packit 6c4009
	char	tzh_leapcnt[4];		/* coded number of leap seconds */
Packit 6c4009
	char	tzh_timecnt[4];		/* coded number of transition times */
Packit 6c4009
	char	tzh_typecnt[4];		/* coded number of local time types */
Packit 6c4009
	char	tzh_charcnt[4];		/* coded number of abbr. chars */
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
** . . .followed by. . .
Packit 6c4009
**
Packit 6c4009
**	tzh_timecnt (char [4])s		coded transition times a la time(2)
Packit 6c4009
**	tzh_timecnt (unsigned char)s	types of local time starting at above
Packit 6c4009
**	tzh_typecnt repetitions of
Packit 6c4009
**		one (char [4])		coded UT offset in seconds
Packit 6c4009
**		one (unsigned char)	used to set tm_isdst
Packit 6c4009
**		one (unsigned char)	that's an abbreviation list index
Packit 6c4009
**	tzh_charcnt (char)s		'\0'-terminated zone abbreviations
Packit 6c4009
**	tzh_leapcnt repetitions of
Packit 6c4009
**		one (char [4])		coded leap second transition times
Packit 6c4009
**		one (char [4])		total correction after above
Packit 6c4009
**	tzh_ttisstdcnt (char)s		indexed by type; if 1, transition
Packit 6c4009
**					time is standard time, if 0,
Packit 6c4009
**					transition time is wall clock time
Packit 6c4009
**					if absent, transition times are
Packit 6c4009
**					assumed to be wall clock time
Packit 6c4009
**	tzh_ttisgmtcnt (char)s		indexed by type; if 1, transition
Packit 6c4009
**					time is UT, if 0,
Packit 6c4009
**					transition time is local time
Packit 6c4009
**					if absent, transition times are
Packit 6c4009
**					assumed to be local time
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
** If tzh_version is '2' or greater, the above is followed by a second instance
Packit 6c4009
** of tzhead and a second instance of the data in which each coded transition
Packit 6c4009
** time uses 8 rather than 4 chars,
Packit 6c4009
** then a POSIX-TZ-environment-variable-style string for use in handling
Packit 6c4009
** instants after the last transition time stored in the file
Packit 6c4009
** (with nothing between the newlines if there is no POSIX representation for
Packit 6c4009
** such instants).
Packit 6c4009
**
Packit 6c4009
** If tz_version is '3' or greater, the above is extended as follows.
Packit 6c4009
** First, the POSIX TZ string's hour offset may range from -167
Packit 6c4009
** through 167 as compared to the POSIX-required 0 through 24.
Packit 6c4009
** Second, its DST start time may be January 1 at 00:00 and its stop
Packit 6c4009
** time December 31 at 24:00 plus the difference between DST and
Packit 6c4009
** standard time, indicating DST all year.
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
** In the current implementation, "tzset()" refuses to deal with files that
Packit 6c4009
** exceed any of the limits below.
Packit 6c4009
*/
Packit 6c4009
Packit 6c4009
#ifndef TZ_MAX_TIMES
Packit 6c4009
#define TZ_MAX_TIMES	2000
Packit 6c4009
#endif /* !defined TZ_MAX_TIMES */
Packit 6c4009
Packit 6c4009
#ifndef TZ_MAX_TYPES
Packit 6c4009
/* This must be at least 17 for Europe/Samara and Europe/Vilnius.  */
Packit 6c4009
#define TZ_MAX_TYPES	256 /* Limited by what (unsigned char)'s can hold */
Packit 6c4009
#endif /* !defined TZ_MAX_TYPES */
Packit 6c4009
Packit 6c4009
#ifndef TZ_MAX_CHARS
Packit 6c4009
#define TZ_MAX_CHARS	50	/* Maximum number of abbreviation characters */
Packit 6c4009
				/* (limited by what unsigned chars can hold) */
Packit 6c4009
#endif /* !defined TZ_MAX_CHARS */
Packit 6c4009
Packit 6c4009
#ifndef TZ_MAX_LEAPS
Packit 6c4009
#define TZ_MAX_LEAPS	50	/* Maximum number of leap second corrections */
Packit 6c4009
#endif /* !defined TZ_MAX_LEAPS */
Packit 6c4009
Packit 6c4009
#endif /* !defined TZFILE_H */