tzfile.h revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CDDL HEADER END
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * from Arthur Olson's 6.1
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#pragma ident "%Z%%M% %I% %E% SMI"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwextern "C" {
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Information about time zone files.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define TZDIR "/usr/share/lib/zoneinfo" /* Time zone object file directory */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Each file begins with. . .
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char tzh_timecnt[4]; /* coded number of transition times */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw char tzh_typecnt[4]; /* coded number of local time types */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * . . .followed by. . .
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * tzh_timecnt (char [4])s coded transition times a la time(2)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * tzh_timecnt (unsigned char)s types of local time starting at above
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * tzh_typecnt repetitions of
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * one (char [4]) coded GMT offset in seconds
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * one (unsigned char) used to set tm_isdst
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * one (unsigned char) that's an abbreviation list index
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * tzh_charcnt (char)s '\0'-terminated zone abbreviations
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * tzh_leapcnt repetitions of
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * one (char [4]) coded leap second transition times
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * one (char [4]) total correction after above
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * time is standard time, if FALSE,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * transition time is wall clock time
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * if absent, transition times are
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * assumed to be wall clock time
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * In the current implementation, "tzset()" refuses to deal with files that
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * exceed any of the limits below.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * The TZ_MAX_TIMES value below is enough to handle a bit more than a
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * year's worth of solar time (corrected daily to the nearest second) or
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 138 years of Pacific Presidential Election time
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * (where there are three time zone transitions every fourth year).
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Accurate only for the past couple of centuries;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * that will probably do.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use of the underscored variants may cause problems if you move your code to
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * certain System-V-based systems; for maximum portability, use the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * underscore-free variants. The underscored variants are provided for
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * backward compatibility only; they may disappear from future versions of
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * this file.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#endif /* _SYS_TZFILE_H */