Blame src/tzfile.h

Packit Service 21b5d1
/*!
Packit Service 21b5d1
  @file    tzfile.h
Packit Service 21b5d1
  @brief   This file is from the tz distribution at ftp://elsie.nci.nih.gov/pub/
Packit Service 21b5d1
*/
Packit Service 21b5d1
#ifndef TZFILE_H
Packit Service 21b5d1
Packit Service 21b5d1
#define TZFILE_H
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** This file is in the public domain, so clarified as of
Packit Service 21b5d1
** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** This header is for use ONLY with the time conversion code.
Packit Service 21b5d1
** There is no guarantee that it will remain unchanged,
Packit Service 21b5d1
** or that it will remain at all.
Packit Service 21b5d1
** Do NOT copy it to any system include directory.
Packit Service 21b5d1
** Thank you!
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** ID
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef lint
Packit Service 21b5d1
#ifndef NOID
Packit Service 21b5d1
static char	tzfilehid[] = "@(#)tzfile.h	7.14";
Packit Service 21b5d1
#endif /* !defined NOID */
Packit Service 21b5d1
#endif /* !defined lint */
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** Information about time zone files.
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef TZDIR
Packit Service 21b5d1
#define TZDIR	"/usr/local/etc/zoneinfo" /* Time zone object file directory */
Packit Service 21b5d1
#endif /* !defined TZDIR */
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef TZDEFAULT
Packit Service 21b5d1
#define TZDEFAULT	"localtime"
Packit Service 21b5d1
#endif /* !defined TZDEFAULT */
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef TZDEFRULES
Packit Service 21b5d1
#define TZDEFRULES	"posixrules"
Packit Service 21b5d1
#endif /* !defined TZDEFRULES */
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** Each file begins with. . .
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
#define	TZ_MAGIC	"TZif"
Packit Service 21b5d1
Packit Service 21b5d1
struct tzhead {
Packit Service 21b5d1
 	char	tzh_magic[4];		/* TZ_MAGIC */
Packit Service 21b5d1
	char	tzh_reserved[16];	/* reserved for future use */
Packit Service 21b5d1
	char	tzh_ttisgmtcnt[4];	/* coded number of trans. time flags */
Packit Service 21b5d1
	char	tzh_ttisstdcnt[4];	/* coded number of trans. time flags */
Packit Service 21b5d1
	char	tzh_leapcnt[4];		/* coded number of leap seconds */
Packit Service 21b5d1
	char	tzh_timecnt[4];		/* coded number of transition times */
Packit Service 21b5d1
	char	tzh_typecnt[4];		/* coded number of local time types */
Packit Service 21b5d1
	char	tzh_charcnt[4];		/* coded number of abbr. chars */
Packit Service 21b5d1
};
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** . . .followed by. . .
Packit Service 21b5d1
**
Packit Service 21b5d1
**	tzh_timecnt (char [4])s		coded transition times a la time(2)
Packit Service 21b5d1
**	tzh_timecnt (unsigned char)s	types of local time starting at above
Packit Service 21b5d1
**	tzh_typecnt repetitions of
Packit Service 21b5d1
**		one (char [4])		coded UTC offset in seconds
Packit Service 21b5d1
**		one (unsigned char)	used to set tm_isdst
Packit Service 21b5d1
**		one (unsigned char)	that's an abbreviation list index
Packit Service 21b5d1
**	tzh_charcnt (char)s		'\0'-terminated zone abbreviations
Packit Service 21b5d1
**	tzh_leapcnt repetitions of
Packit Service 21b5d1
**		one (char [4])		coded leap second transition times
Packit Service 21b5d1
**		one (char [4])		total correction after above
Packit Service 21b5d1
**	tzh_ttisstdcnt (char)s		indexed by type; if TRUE, transition
Packit Service 21b5d1
**					time is standard time, if FALSE,
Packit Service 21b5d1
**					transition time is wall clock time
Packit Service 21b5d1
**					if absent, transition times are
Packit Service 21b5d1
**					assumed to be wall clock time
Packit Service 21b5d1
**	tzh_ttisgmtcnt (char)s		indexed by type; if TRUE, transition
Packit Service 21b5d1
**					time is UTC, if FALSE,
Packit Service 21b5d1
**					transition time is local time
Packit Service 21b5d1
**					if absent, transition times are
Packit Service 21b5d1
**					assumed to be local time
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** In the current implementation, "tzset()" refuses to deal with files that
Packit Service 21b5d1
** exceed any of the limits below.
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef TZ_MAX_TIMES
Packit Service 21b5d1
/*
Packit Service 21b5d1
** The TZ_MAX_TIMES value below is enough to handle a bit more than a
Packit Service 21b5d1
** year's worth of solar time (corrected daily to the nearest second) or
Packit Service 21b5d1
** 138 years of Pacific Presidential Election time
Packit Service 21b5d1
** (where there are three time zone transitions every fourth year).
Packit Service 21b5d1
*/
Packit Service 21b5d1
#define TZ_MAX_TIMES	370
Packit Service 21b5d1
#endif /* !defined TZ_MAX_TIMES */
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef TZ_MAX_TYPES
Packit Service 21b5d1
#ifndef NOSOLAR
Packit Service 21b5d1
#define TZ_MAX_TYPES	256 /* Limited by what (unsigned char)'s can hold */
Packit Service 21b5d1
#endif /* !defined NOSOLAR */
Packit Service 21b5d1
#ifdef NOSOLAR
Packit Service 21b5d1
/*
Packit Service 21b5d1
** Must be at least 14 for Europe/Riga as of Jan 12 1995,
Packit Service 21b5d1
** as noted by Earl Chew <earl@hpato.aus.hp.com>.
Packit Service 21b5d1
*/
Packit Service 21b5d1
#define TZ_MAX_TYPES	20	/* Maximum number of local time types */
Packit Service 21b5d1
#endif /* !defined NOSOLAR */
Packit Service 21b5d1
#endif /* !defined TZ_MAX_TYPES */
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef TZ_MAX_CHARS
Packit Service 21b5d1
#define TZ_MAX_CHARS	50	/* Maximum number of abbreviation characters */
Packit Service 21b5d1
				/* (limited by what unsigned chars can hold) */
Packit Service 21b5d1
#endif /* !defined TZ_MAX_CHARS */
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef TZ_MAX_LEAPS
Packit Service 21b5d1
#define TZ_MAX_LEAPS	50	/* Maximum number of leap second corrections */
Packit Service 21b5d1
#endif /* !defined TZ_MAX_LEAPS */
Packit Service 21b5d1
Packit Service 21b5d1
#define SECSPERMIN	60
Packit Service 21b5d1
#define MINSPERHOUR	60
Packit Service 21b5d1
#define HOURSPERDAY	24
Packit Service 21b5d1
#define DAYSPERWEEK	7
Packit Service 21b5d1
#define DAYSPERNYEAR	365
Packit Service 21b5d1
#define DAYSPERLYEAR	366
Packit Service 21b5d1
#define SECSPERHOUR	(SECSPERMIN * MINSPERHOUR)
Packit Service 21b5d1
#define SECSPERDAY	((long) SECSPERHOUR * HOURSPERDAY)
Packit Service 21b5d1
#define MONSPERYEAR	12
Packit Service 21b5d1
Packit Service 21b5d1
#define TM_SUNDAY	0
Packit Service 21b5d1
#define TM_MONDAY	1
Packit Service 21b5d1
#define TM_TUESDAY	2
Packit Service 21b5d1
#define TM_WEDNESDAY	3
Packit Service 21b5d1
#define TM_THURSDAY	4
Packit Service 21b5d1
#define TM_FRIDAY	5
Packit Service 21b5d1
#define TM_SATURDAY	6
Packit Service 21b5d1
Packit Service 21b5d1
#define TM_JANUARY	0
Packit Service 21b5d1
#define TM_FEBRUARY	1
Packit Service 21b5d1
#define TM_MARCH	2
Packit Service 21b5d1
#define TM_APRIL	3
Packit Service 21b5d1
#define TM_MAY		4
Packit Service 21b5d1
#define TM_JUNE		5
Packit Service 21b5d1
#define TM_JULY		6
Packit Service 21b5d1
#define TM_AUGUST	7
Packit Service 21b5d1
#define TM_SEPTEMBER	8
Packit Service 21b5d1
#define TM_OCTOBER	9
Packit Service 21b5d1
#define TM_NOVEMBER	10
Packit Service 21b5d1
#define TM_DECEMBER	11
Packit Service 21b5d1
Packit Service 21b5d1
#define TM_YEAR_BASE	1900
Packit Service 21b5d1
Packit Service 21b5d1
#define EPOCH_YEAR	1970
Packit Service 21b5d1
#define EPOCH_WDAY	TM_THURSDAY
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** Accurate only for the past couple of centuries;
Packit Service 21b5d1
** that will probably do.
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
Packit Service 21b5d1
Packit Service 21b5d1
#ifndef USG
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
** Use of the underscored variants may cause problems if you move your code to
Packit Service 21b5d1
** certain System-V-based systems; for maximum portability, use the
Packit Service 21b5d1
** underscore-free variants.  The underscored variants are provided for
Packit Service 21b5d1
** backward compatibility only; they may disappear from future versions of
Packit Service 21b5d1
** this file.
Packit Service 21b5d1
*/
Packit Service 21b5d1
Packit Service 21b5d1
#define SECS_PER_MIN	SECSPERMIN
Packit Service 21b5d1
#define MINS_PER_HOUR	MINSPERHOUR
Packit Service 21b5d1
#define HOURS_PER_DAY	HOURSPERDAY
Packit Service 21b5d1
#define DAYS_PER_WEEK	DAYSPERWEEK
Packit Service 21b5d1
#define DAYS_PER_NYEAR	DAYSPERNYEAR
Packit Service 21b5d1
#define DAYS_PER_LYEAR	DAYSPERLYEAR
Packit Service 21b5d1
#define SECS_PER_HOUR	SECSPERHOUR
Packit Service 21b5d1
#define SECS_PER_DAY	SECSPERDAY
Packit Service 21b5d1
#define MONS_PER_YEAR	MONSPERYEAR
Packit Service 21b5d1
Packit Service 21b5d1
#endif /* !defined USG */
Packit Service 21b5d1
Packit Service 21b5d1
#endif /* !defined TZFILE_H */