Loading...
stdtime/FreeBSD/tzfile.h Libc-1725.40.4 Libc-320
--- Libc/Libc-1725.40.4/stdtime/FreeBSD/tzfile.h
+++ Libc/Libc-320/stdtime/FreeBSD/tzfile.h
@@ -4,9 +4,9 @@
 
 /*
 ** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson.
+** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov).
 **
-** $FreeBSD: head/contrib/tzcode/stdtime/tzfile.h 192625 2009-05-23 06:31:50Z edwin $
+** $FreeBSD: src/lib/libc/stdtime/tzfile.h,v 1.8 2002/03/22 23:42:05 obrien Exp $
 */
 
 /*
@@ -24,7 +24,7 @@
 #ifndef lint
 #ifndef NOID
 /*
-static char	tzfilehid[] = "@(#)tzfile.h	8.1";
+static char	tzfilehid[] = "@(#)tzfile.h	7.14";
 */
 #endif /* !defined NOID */
 #endif /* !defined lint */
@@ -33,29 +33,13 @@
 ** Information about time zone files.
 */
 
-#include <TargetConditionals.h>
-#include <Availability.h>
+#ifndef TZDIR
+#define TZDIR	"/usr/share/zoneinfo" /* Time zone object file directory */
+#endif /* !defined TZDIR */
 
-/* Time zone object file directory */
-#ifndef TZDIR
-# if TARGET_OS_SIMULATOR || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_13)
-#  define TZDIR   "/usr/share/zoneinfo"
-# else
-#  define TZDIR   "/var/db/timezone/zoneinfo"
-# endif
-#endif
-
-/* No gurantee is made that the TZDEFAULT symlink will have TZDIR as a prefix.
- * However, clients can assume that the final path component of the prefix will
- * be "zoneinfo"
- */
 #ifndef TZDEFAULT
-# if TARGET_OS_SIMULATOR || TARGET_OS_OSX
-#  define TZDEFAULT       "/etc/localtime"
-# else
-#  define TZDEFAULT       "/var/db/timezone/localtime"
-# endif
-#endif
+#define TZDEFAULT	"/etc/localtime"
+#endif /* !defined TZDEFAULT */
 
 #ifndef TZDEFRULES
 #define TZDEFRULES	"posixrules"
@@ -68,9 +52,8 @@
 #define	TZ_MAGIC	"TZif"
 
 struct tzhead {
-	char	tzh_magic[4];		/* TZ_MAGIC */
-	char	tzh_version[1];		/* '\0' or '2' as of 2005 */
-	char	tzh_reserved[15];	/* reserved--must be zero */
+ 	char	tzh_magic[4];		/* TZ_MAGIC */
+	char	tzh_reserved[16];	/* reserved for future use */
 	char	tzh_ttisgmtcnt[4];	/* coded number of trans. time flags */
 	char	tzh_ttisstdcnt[4];	/* coded number of trans. time flags */
 	char	tzh_leapcnt[4];		/* coded number of leap seconds */
@@ -105,22 +88,18 @@
 */
 
 /*
-** 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).
-*/
-
-/*
 ** In the current implementation, "tzset()" refuses to deal with files that
 ** exceed any of the limits below.
 */
 
 #ifndef TZ_MAX_TIMES
-#define TZ_MAX_TIMES	1200
+/*
+** The TZ_MAX_TIMES value below is enough to handle a bit more than a
+** year's worth of solar time (corrected daily to the nearest second) or
+** 138 years of Pacific Presidential Election time
+** (where there are three time zone transitions every fourth year).
+*/
+#define TZ_MAX_TIMES	370
 #endif /* !defined TZ_MAX_TIMES */
 
 #ifndef TZ_MAX_TYPES
@@ -130,7 +109,7 @@
 #ifdef NOSOLAR
 /*
 ** Must be at least 14 for Europe/Riga as of Jan 12 1995,
-** as noted by Earl Chew.
+** as noted by Earl Chew <earl@hpato.aus.hp.com>.
 */
 #define TZ_MAX_TYPES	20	/* Maximum number of local time types */
 #endif /* !defined NOSOLAR */
@@ -181,20 +160,33 @@
 #define EPOCH_YEAR	1970
 #define EPOCH_WDAY	TM_THURSDAY
 
+/*
+** Accurate only for the past couple of centuries;
+** that will probably do.
+*/
+
 #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
 
+#ifndef USG
+
 /*
-** Since everything in isleap is modulo 400 (or a factor of 400), we know that
-**	isleap(y) == isleap(y % 400)
-** and so
-**	isleap(a + b) == isleap((a + b) % 400)
-** or
-**	isleap(a + b) == isleap(a % 400 + b % 400)
-** This is true even if % means modulo rather than Fortran remainder
-** (which is allowed by C89 but not C99).
-** We use this to avoid addition overflow problems.
+** Use of the underscored variants may cause problems if you move your code to
+** certain System-V-based systems; for maximum portability, use the
+** underscore-free variants.  The underscored variants are provided for
+** backward compatibility only; they may disappear from future versions of
+** this file.
 */
 
-#define isleap_sum(a, b)	isleap((a) % 400 + (b) % 400)
+#define SECS_PER_MIN	SECSPERMIN
+#define MINS_PER_HOUR	MINSPERHOUR
+#define HOURS_PER_DAY	HOURSPERDAY
+#define DAYS_PER_WEEK	DAYSPERWEEK
+#define DAYS_PER_NYEAR	DAYSPERNYEAR
+#define DAYS_PER_LYEAR	DAYSPERLYEAR
+#define SECS_PER_HOUR	SECSPERHOUR
+#define SECS_PER_DAY	SECSPERDAY
+#define MONS_PER_YEAR	MONSPERYEAR
+
+#endif /* !defined USG */
 
 #endif /* !defined TZFILE_H */