diff options
-rw-r--r-- | lib/libc/time/Theory | 98 | ||||
-rw-r--r-- | lib/libc/time/asctime.c | 4 | ||||
-rw-r--r-- | lib/libc/time/localtime.c | 16 | ||||
-rw-r--r-- | lib/libc/time/private.h | 6 | ||||
-rw-r--r-- | lib/libc/time/scheck.c | 13 | ||||
-rw-r--r-- | lib/libc/time/tz-art.htm | 8 | ||||
-rw-r--r-- | lib/libc/time/tz-link.htm | 159 | ||||
-rw-r--r-- | lib/libc/time/tzfile.5 | 4 | ||||
-rw-r--r-- | lib/libc/time/tzfile.h | 8 | ||||
-rw-r--r-- | lib/libc/time/tzset.3 | 4 | ||||
-rw-r--r-- | lib/libc/time/zdump.8 | 4 | ||||
-rw-r--r-- | lib/libc/time/zdump.c | 53 | ||||
-rw-r--r-- | lib/libc/time/zic.8 | 18 | ||||
-rw-r--r-- | lib/libc/time/zic.c | 94 |
14 files changed, 285 insertions, 204 deletions
diff --git a/lib/libc/time/Theory b/lib/libc/time/Theory index 0c8afa13928..b6205371947 100644 --- a/lib/libc/time/Theory +++ b/lib/libc/time/Theory @@ -1,5 +1,5 @@ -$OpenBSD: Theory,v 1.10 2005/07/19 15:51:29 millert Exp $ -@(#)Theory 7.16 +$OpenBSD: Theory,v 1.11 2006/02/18 21:54:17 millert Exp $ +@(#)Theory 7.19 ----- Outline ----- @@ -13,26 +13,27 @@ $OpenBSD: Theory,v 1.10 2005/07/19 15:51:29 millert Exp $ ----- Time and date functions ----- -These time and date functions are upwards compatible with POSIX.1, +These time and date functions are upwards compatible with POSIX, an international standard for UNIX-like systems. -As of this writing, the current edition of POSIX.1 is: +As of this writing, the current edition of POSIX is: - Information technology --Portable Operating System Interface (POSIX (R)) - -- Part 1: System Application Program Interface (API) [C Language] - ISO/IEC 9945-1:1996 - ANSI/IEEE Std 1003.1, 1996 Edition - 1996-07-12 + Standard for Information technology + -- Portable Operating System Interface (POSIX (R)) + -- System Interfaces + IEEE Std 1003.1, 2004 Edition + <http://www.opengroup.org/online-pubs?DOC=7999959899> + <http://www.opengroup.org/pubs/catalog/t041.htm> -POSIX.1 has the following properties and limitations. +POSIX has the following properties and limitations. -* In POSIX.1, time display in a process is controlled by the - environment variable TZ. Unfortunately, the POSIX.1 TZ string takes +* In POSIX, time display in a process is controlled by the + environment variable TZ. Unfortunately, the POSIX TZ string takes a form that is hard to describe and is error-prone in practice. - Also, POSIX.1 TZ strings can't deal with other (for example, Israeli) + Also, POSIX TZ strings can't deal with other (for example, Israeli) daylight saving time rules, or situations where more than two time zone abbreviations are used in an area. - The POSIX.1 TZ string takes the following form: + The POSIX TZ string takes the following form: stdoffset[dst[offset],date[/time],date[/time]] @@ -41,6 +42,9 @@ POSIX.1 has the following properties and limitations. std and dst are 3 or more characters specifying the standard and daylight saving time (DST) zone names. + Starting with POSIX.1-2001, std and dst may also be + in a quoted form like "<UTC+10>"; this allows + "+" and "-" in the names. offset is of the form `[-]hh:[mm[:ss]]' and specifies the offset west of UTC. The default DST offset is one hour @@ -62,15 +66,26 @@ POSIX.1 has the following properties and limitations. where week 1 is the first week in which day d appears, and `5' stands for the last week in which day d appears (which may be either the 4th or 5th week). + + Here is an example POSIX TZ string, for US Pacific time using rules + appropriate from 1987 through 2006: -* In POSIX.1, when a TZ value like "EST5EDT" is parsed, - typically the current US DST rules are used, + TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00' + + This POSIX TZ string is hard to remember, and mishandles time stamps + before 1987 and after 2006. With this package you can use this + instead: + + TZ='America/Los_Angeles' + +* POSIX does not define the exact meaning of TZ values like "EST5EDT". + Typically the current US DST rules are used to interpret such values, but this means that the US DST rules are compiled into each program that does time conversion. This means that when US time conversion rules change (as in the United States in 1987), all programs that do time conversion must be recompiled to ensure proper results. -* In POSIX.1, there's no tamper-proof way for a process to learn the +* In POSIX, there's no tamper-proof way for a process to learn the system's best idea of local wall clock. (This is important for applications that an administrator wants used only at certain times-- without regard to whether the user has fiddled the "TZ" environment @@ -79,9 +94,9 @@ POSIX.1 has the following properties and limitations. daylight saving time shifts--as might be required to limit phone calls to off-peak hours.) -* POSIX.1 requires that systems ignore leap seconds. +* POSIX requires that systems ignore leap seconds. -These are the extensions that have been made to the POSIX.1 functions: +These are the extensions that have been made to the POSIX functions: * The "TZ" environment variable is used in generating the name of a file from which time zone information is read (or is interpreted a la @@ -109,7 +124,7 @@ These are the extensions that have been made to the POSIX.1 functions: * To handle places where more than two time zone abbreviations are used, the functions "localtime" and "gmtime" set tzname[tmp->tm_isdst] (where "tmp" is the value the function returns) to the time zone - abbreviation to be used. This differs from POSIX.1, where the elements + abbreviation to be used. This differs from POSIX, where the elements of tzname are only changed as a result of calls to tzset. * Since the "TZ" environment variable can now be used to control time @@ -173,9 +188,9 @@ Hewlett Packard, offer a wider selection of functions that provide capabilities beyond those provided here. The absence of such functions from this package is not meant to discourage the development, standardization, or use of such functions. Rather, their absence reflects the decision to make this package -contain valid extensions to POSIX.1, to ensure its broad -acceptability. If more powerful time conversion functions can be standardized, -so much the better. +contain valid extensions to POSIX, to ensure its broad acceptability. If +more powerful time conversion functions can be standardized, so much the +better. ----- Names of time zone rule files ----- @@ -228,6 +243,8 @@ in decreasing order of importance: Include at least one location per time zone rule set per country. One such location is enough. Use ISO 3166 (see the file iso3166.tab) to help decide whether something is a country. + However, uninhabited ISO 3166 regions like Bouvet Island + do not need locations, since local time is not defined there. If all the clocks in a country's region have agreed since 1970, don't bother to include more than one location even if subregions' clocks disagreed before 1970. @@ -263,7 +280,8 @@ in decreasing order of importance: If a name is changed, put its old spelling in the `backward' file. The file `zone.tab' lists the geographical locations used to name -time zone rule files. +time zone rule files. It is intended to be an exhaustive list +of canonical names for geographic regions. Older versions of this package used a different naming scheme, and these older names are still supported. @@ -277,7 +295,7 @@ and `Factory' (see the file `factory'). ----- Time zone abbreviations ----- When this package is installed, it generates time zone abbreviations -like `EST' to be compatible with human tradition and POSIX.1. +like `EST' to be compatible with human tradition and POSIX. Here are the general rules used for choosing time zone abbreviations, in decreasing order of importance: @@ -292,17 +310,16 @@ in decreasing order of importance: preferred "ChST", so the rule has been relaxed. This rule guarantees that all abbreviations could have - been specified by a POSIX.1 TZ string. POSIX.1 + been specified by a POSIX TZ string. POSIX requires at least three characters for an - abbreviation. POSIX.1-1996 says that an abbreviation + abbreviation. POSIX through 2000 says that an abbreviation cannot start with ':', and cannot contain ',', '-', - '+', NUL, or a digit. Draft 7 of POSIX 1003.1-200x - changes this rule to say that an abbreviation can - contain only '-', '+', and alphanumeric characters in - the current locale. To be portable to both sets of + '+', NUL, or a digit. POSIX from 2001 on changes this + rule to say that an abbreviation can contain only '-', '+', + and alphanumeric characters from the portable character set + in the current locale. To be portable to both sets of rules, an abbreviation must therefore use only ASCII - letters, as these are the only letters that are - alphabetic in all locales. + letters. Use abbreviations that are in common use among English-speakers, e.g. `EST' for Eastern Standard Time in North America. @@ -328,8 +345,9 @@ in decreasing order of importance: and then append `T', `ST', etc. as before; e.g. `VLAST' for VLAdivostok Summer Time. - Use "zzz" for locations while uninhabited. The mnemonic is that - these locations are, in some sense, asleep. + Use UTC (with time zone abbreviation "zzz") for locations while + uninhabited. The "zzz" mnemonic is that these locations are, + in some sense, asleep. Application writers should note that these abbreviations are ambiguous in practice: e.g. `EST' has a different meaning in Australia than @@ -343,10 +361,10 @@ abbreviations like `EST'; this avoids the ambiguity. Calendrical issues are a bit out of scope for a time zone database, but they indicate the sort of problems that we would run into if we extended the time zone database further into the past. An excellent -resource in this area is Nachum Dershowitz and Edward M. Reingold, -<a href="http://emr.cs.uiuc.edu/home/reingold/calendar-book/index.shtml"> -Calendrical Calculations -</a>, Cambridge University Press (1997). Other information and +resource in this area is Edward M. Reingold and Nachum Dershowitz, +<a href="http://emr.cs.uiuc.edu/home/reingold/calendar-book/second-edition/"> +Calendrical Calculations: The Millennium Edition +</a>, Cambridge University Press (2001). Other information and sources are given below. They sometimes disagree. @@ -546,7 +564,7 @@ Sources: Michael Allison and Robert Schmunk, "Technical Notes on Mars Solar Time as Adopted by the Mars24 Sunclock" -<http://www.giss.nasa.gov/tools/mars24/help/notes.html> (2004-03-15). +<http://www.giss.nasa.gov/tools/mars24/help/notes.html> (2004-07-30). Jia-Rui Chong, "Workdays Fit for a Martian", Los Angeles Times (2004-01-14), pp A1, A20-A21. diff --git a/lib/libc/time/asctime.c b/lib/libc/time/asctime.c index 1b5b98d5780..a70ae4b6d3d 100644 --- a/lib/libc/time/asctime.c +++ b/lib/libc/time/asctime.c @@ -1,7 +1,7 @@ -/* $OpenBSD: asctime.c,v 1.13 2005/08/08 08:05:38 espie Exp $ */ +/* $OpenBSD: asctime.c,v 1.14 2006/02/18 21:54:17 millert Exp $ */ /* ** This file is in the public domain, so clarified as of -** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). +** 1996-06-05 by Arthur David Olson. */ /* diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c index f403bd05e79..8fd6ef1523f 100644 --- a/lib/libc/time/localtime.c +++ b/lib/libc/time/localtime.c @@ -1,13 +1,12 @@ -/* $OpenBSD: localtime.c,v 1.30 2005/08/09 16:12:12 millert Exp $ */ +/* $OpenBSD: localtime.c,v 1.31 2006/02/18 21:54:17 millert Exp $ */ /* ** This file is in the public domain, so clarified as of -** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). +** 1996-06-05 by Arthur David Olson. */ /* -** Leap second handling from Bradley White (bww@k.gp.cs.cmu.edu). -** POSIX-style TZ environment variable handling from Guy Harris -** (guy@auspex.com). +** Leap second handling from Bradley White. +** POSIX-style TZ environment variable handling from Guy Harris. */ /*LINTLIBRARY*/ @@ -206,7 +205,7 @@ char * tzname[2] = { ** Except for the strftime function, these functions [asctime, ** ctime, gmtime, localtime] return values in one of two static ** objects: a broken-down time structure and an array of char. -** Thanks to Paul Eggert (eggert@twinsun.com) for noting this. +** Thanks to Paul Eggert for noting this. */ static struct tm tm; @@ -1445,7 +1444,6 @@ char * buf; ** Adapted from code provided by Robert Elz, who writes: ** The "best" way to do mktime I think is based on an idea of Bob ** Kridle's (so its said...) from a long time ago. -** [kridle@xinet.com as of 1996-01-16.] ** It does a binary search of the time_t space. Since time_t's are ** just 32 bits, its a max of 32 iterations (even at 64 bits it ** would still be very reasonable). @@ -1456,7 +1454,7 @@ char * buf; #endif /* !defined WRONG */ /* -** Simplified normalize logic courtesy Paul Eggert (eggert@twinsun.com). +** Simplified normalize logic courtesy Paul Eggert. */ static int @@ -1756,7 +1754,7 @@ const long offset; t = time2(tmp, funcp, offset, &okay); #ifdef PCTS /* - ** PCTS code courtesy Grant Sullivan (grant@osf.org). + ** PCTS code courtesy Grant Sullivan. */ if (okay) return t; diff --git a/lib/libc/time/private.h b/lib/libc/time/private.h index 8f8c737e870..8acebd17725 100644 --- a/lib/libc/time/private.h +++ b/lib/libc/time/private.h @@ -1,11 +1,11 @@ -/* $OpenBSD: private.h,v 1.17 2005/07/05 13:40:51 millert Exp $ */ +/* $OpenBSD: private.h,v 1.18 2006/02/18 21:54:17 millert Exp $ */ #ifndef PRIVATE_H #define PRIVATE_H /* ** This file is in the public domain, so clarified as of -** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). +** 1996-06-05 by Arthur David Olson. */ /* OpenBSD defaults */ @@ -233,7 +233,7 @@ char * imalloc P((int n)); void * irealloc P((void * pointer, int size)); void icfree P((char * pointer)); void ifree P((char * pointer)); -char * scheck P((const char *string, char *format)); +const char *scheck P((const char *string, const char *format)); /* ** Finally, some convenience items. diff --git a/lib/libc/time/scheck.c b/lib/libc/time/scheck.c index f9daef7a4a7..c5e00e38f51 100644 --- a/lib/libc/time/scheck.c +++ b/lib/libc/time/scheck.c @@ -1,27 +1,26 @@ -/* $OpenBSD: scheck.c,v 1.8 2005/08/08 08:05:38 espie Exp $ */ +/* $OpenBSD: scheck.c,v 1.9 2006/02/18 21:54:17 millert Exp $ */ /* ** This file is in the public domain, so clarified as of -** Feb 14, 2003 by Arthur David Olson (arthur_david_olson@nih.gov). +** Feb 14, 2003 by Arthur David Olson. */ /*LINTLIBRARY*/ #include "private.h" -char * +const char * scheck(string, format) const char * const string; -char * const format; +const char * const format; { register char * fbuf; register const char * fp; register char * tp; register int c; - register char * result; + register const char * result; char dummy; - static char nada; - result = &nada; + result = ""; if (string == NULL || format == NULL) return result; fbuf = imalloc((int) (2 * strlen(format) + 4)); diff --git a/lib/libc/time/tz-art.htm b/lib/libc/time/tz-art.htm index 28c8d5c8604..4abbd519b36 100644 --- a/lib/libc/time/tz-art.htm +++ b/lib/libc/time/tz-art.htm @@ -10,7 +10,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <body> <h1>Time and the Arts</h1> <address> -@(#)tz-art.htm 7.55 +@(#)tz-art.htm 7.59 </address> <p> Please send corrections to this web page to the @@ -175,9 +175,9 @@ An on-line English-language translation of the book is available at <a href="http://www.literature.org/Works/Jules-Verne/eighty">http://www.literature.org/Works/Jules-Verne/eighty</a></td></tr> <tr><td> </td></tr> <tr><td>Film</td><td>Bell Science - About Time</td></tr> -<tr><td>Notes</td><td>The Frank Baxter/Richard Deacon extravaganza -Information on ordering is available at -<a href="http://www.videoflicks.com/VF2/1035/1035893.ihtml">http://www.videoflicks.com/VF2/1035/1035893.ihtml</a></td></tr> +<tr><td>Notes</td><td>The Frank Baxter/Richard Deacon extravaganza. +Information is available at +<a href="http://www.videoflicks.com/titles/1035/1035893.htm">http://www.videoflicks.com/titles/1035/1035893.htm</a></td></tr> </table> <hr /> <ul> diff --git a/lib/libc/time/tz-link.htm b/lib/libc/time/tz-link.htm index 76ae60be8b7..17b8d7fbfd6 100644 --- a/lib/libc/time/tz-link.htm +++ b/lib/libc/time/tz-link.htm @@ -9,7 +9,7 @@ <meta http-equiv="Content-type" content='text/html; charset="US-ASCII"' /> <meta name="DC.Creator" content="Eggert, Paul" /> <meta name="DC.Contributor" content="Olson, Arthur David" /> -<meta name="DC.Date" content="2005-03-11" /> +<meta name="DC.Date" content="2006-01-20" /> <meta name="DC.Description" content="Sources of information about time zones and daylight saving time" /> <meta name="DC.Identifier" content="http://www.twinsun.com/tz/tz-link.htm" /> @@ -19,7 +19,7 @@ <body> <h1>Sources for Time Zone and Daylight Saving Time Data</h1> <address> -@(#)tz-link.htm 7.48 +@(#)tz-link.htm 7.54 </address> <p> Please send corrections to this web page to the @@ -30,8 +30,12 @@ The public-domain time zone database contains code and data that represent the history of local time for many representative locations around the globe. It is updated periodically to reflect changes made by political bodies -to <abbr title="Coordinated Universal Time">UTC</abbr> -offsets and daylight-saving rules. +to <a href="http://en.wikipedia.org/wiki/Time_zone">time zone</a> +boundaries, <a +href="http://en.wikipedia.org/wiki/Coordinated_Universal_Time"><abbr +title="Coordinated Universal Time">UTC</abbr></a> offsets, and +<a href="http://en.wikipedia.org/wiki/Daylight_saving">daylight-saving</a> +rules. This database (often called <code>tz</code> or <code>zoneinfo</code>) is used by several implementations, including @@ -49,7 +53,7 @@ title="DJ's GNU Programming Platform">DJGPP</abbr></a>, <a href="http://www.sgi.com/developers/technology/irix/">IRIX</a>, <a href="http://www.apple.com/macosx/">Mac OS X</a>, <a href="http://h71000.www7.hp.com/">OpenVMS</a>, -<a href="http://wwws.sun.com/software/solaris/">Solaris</a>, +<a href="http://www.sun.com/software/solaris/">Solaris</a>, <a href="http://h30097.www3.hp.com/">Tru64</a>, and <a href="http://www.sco.com/products/unixware/">UnixWare</a>.</p> <p> @@ -59,15 +63,16 @@ Locations are identified by continent or ocean and then by the name of the location, which is typically the largest city within the region. For example, <code>America/New_York</code> represents most of the <abbr title="United States">US</abbr> eastern time zone; -<code>America/Indianapolis</code> represents most of Indiana, which -uses eastern time without daylight saving time (<abbr +<code>America/Phoenix</code> represents most of Arizona, which +uses mountain time without daylight saving time (<abbr title="daylight saving time">DST</abbr>); <code>America/Detroit</code> represents most of Michigan, which uses eastern time but with different <abbr>DST</abbr> rules in 1975; and other entries represent smaller regions like Starke County, -Kentucky, which switched from central to eastern time in 1991. +Indiana, which switched from central to eastern time in 1991 +and switched back in 2006. To use the database on an extended <a -href="http://www.pasc.org/#POSIX"><abbr +href="http://en.wikipedia.org/wiki/POSIX"><abbr title="Portable Operating System Interface">POSIX</abbr></a> implementation set the <code>TZ</code> environment variable to the location's full name, e.g., <code>TZ="America/New_York"</code>.</p> @@ -111,7 +116,7 @@ Here are some recent links that may be of interest. </p> <h2>Web pages using recent versions of the <code>tz</code> database</h2> <ul> -<li><a href="http://twiki.org/cgi-bin/xtra/tzdate">Date and Time Gateway</a> +<li><a href="http://twiki.org/cgi-bin/xtra/tzdatepick.html">Date and Time Gateway</a> is a text-based point-and-click interface to tables of current time throughout the world.</li> <li>Fancier web interfaces, roughly in ascending order of complexity, include: @@ -137,8 +142,20 @@ Calendaring and Scheduling Working Group (<abbr title="Calendaring and Scheduling Working Group">calsch</abbr>)</a> covers time zone data; see its VTIMEZONE calendar component. -The <a href='http://www.calconnect.org/'>Calendaring and Scheduling -Consortium</a> is promoting further work in this area.</li> +The <a href="http://www.calconnect.org/">Calendaring and Scheduling +Consortium</a> is promoting further work in this area. <a +href="ftp://ftp.rfc-editor.org/internet-drafts/draft-royer-ical-basic-04.txt">iCalendar +Basic</a> is a draft simplified definition that omits VTIMEZONE due to +its complexity, but this removal is expected to appear as an +independent specification later.</li> +<li><a +href="ftp://ftp.rfc-editor.org/internet-drafts/draft-royer-timezone-registry-03.txt">Time +Zone Registry</a> proposes an <a href="http://www.iana.org/"><abbr +title="Internet Assigned Numbers Authority">IANA</abbr></a> time zone +registration process that would establish unique names for each +version of each <code>tz</code> zone, along with a polygonal +representation of the geographical area corresponding to the +zone.</li> <li>The <a href="http://lists.w3.org/Archives/Public/www-rdf-calendar/">www-rdf-calendar</a> list discusses <a @@ -147,15 +164,14 @@ title="Resource Description Framework">RDF</abbr></a>-based calendar and group scheduling systems, and has a <a href="http://www.w3.org/2002/12/cal/#tzd">workspace on time zone data</a> converted from <code>tz</code>. An earlier <a -href="http://www.w3.org/2000/01/foo">schema</a> was sketched out by <a -href="http://www.w3.org/People/Berners-Lee/">Tim Berners-Lee</a>.</li> +href="http://www.w3.org/2000/01/foo">schema</a> was sketched out.</li> <li><a -href="http://www.calsch.org/ietf/archives/draft-ietf-calsch-many-xcal-02.txt"><abbr -title="XML DTD for iCalendar">XCal</abbr></a> -was a draft <a +href="ftp://ftp.rfc-editor.org/internet-drafts/draft-royer-calsch-xcal-03.txt"><abbr +title="iCalendar in XML Format">xCal-Basic</abbr></a> +is a draft <a href="http://www.w3.org/XML/"><abbr title="Extensible Markup Language">XML</abbr></a> document type -definition that corresponded to iCalendar.</li> +definition that corresponds to iCalendar.</li> </ul> <h2>Other <code>tz</code> compilers</h2> <ul> @@ -177,7 +193,7 @@ available under both the <abbr>GPL</abbr> and the Perl Artistic License. DateTime::TimeZone also contains a script <code>tests_from_zdump</code> that generates test cases for each clock transition in the <code>tz</code> database.</li> -<li><a href="http://oss.software.ibm.com/icu/"><abbr +<li><a href="http://www-306.ibm.com/software/globalization/icu/"><abbr title="International Components for Unicode">ICU</abbr></a> contains a C/C++ library for internationalization that has a compiler from <code>tz</code> source @@ -194,6 +210,11 @@ is freely available under a <abbr>BSD</abbr>-style license.</li> Zone Library</a> compiles <code>tz</code> source into <a href="http://www.python.org/">Python</a>. It is freely available under a <abbr>BSD</abbr>-style license.</li> +<li><a href="http://tzinfo.rubyforge.org/">TZInfo - Ruby Timezone Library</a> +compiles <code>tz</code> source into +<a href="http://www.ruby-lang.org/">Ruby</a>. +It is freely available under the <abbr +title="Massachusetts Institute of Technology">MIT</abbr> license.</li> </ul> <h2>Other <code>tz</code> binary file readers</h2> <ul> @@ -209,20 +230,24 @@ This library is freely available under the and is widely used in <abbr>GNU</abbr>/Linux systems.</li> <li><a href="http://www.bmsi.com/java/#TZ">ZoneInfo.java</a> is a <code>tz</code> binary file reader written in Java. -It is freely available under the <abbr>GNU</abbr> -<abbr>LGPL</abbr>.</li> +It is freely available under the <abbr>LGPL</abbr>.</li> <li><a href="http://s.keim.free.fr/tz/doc.html">Python time zones</a> is a <code>tz</code> binary file reader written in Python. It is freely available under a <abbr>BSD</abbr>-style license.</li> </ul> -<h2>Other <code>tz</code>-based time zone conversion software</h2> +<h2>Other <code>tz</code>-based time zone software</h2> <ul> +<li><a +href="http://users.skynet.be/Peter.Verthez/projects/intclock/">International +clock (intclock)</a> is a multi-timezone clock for +<abbr>GNU</abbr>/Linux and similar systems. It is freely available +under the <abbr>GPL</abbr>.</li> <li><a href="http://java.sun.com/">Sun Java</a> releases since 1.4 contain a copy of a subset of a recent <code>tz</code> database in a Java-specific format.</li> <li><a href="http://www1.tip.nl/~t876506/AboutTimeZonesHC.html">HyperCard -time zones calculator</a> is a HyperCard stack.</li> +time zones calculator</a> was a HyperCard stack.</li> <li><a href="http://www.veladg.com/velaterra.html">VelaTerra</a> is a Mac OS X program. Its developers @@ -237,8 +262,12 @@ Microsoft Windows program.</li> <li><a href="http://www.astro.com/cgi/aq.cgi?lang=e">Atlas Query</a> is Astrodienst's Web version of Shanks's excellent time zone history atlases published in both <a -href="http://astrocom.com/products/software.php?software_id=ibmwboth">computer -and book form</a> by <a +href="http://astrocom.com/products/software.php?software_id=ibmwboth">computer</a> +and book form (<a +href="http://astrocom.com/products/book.php?book_id=b110x">one volume +for the USA</a>, and <a +href="http://astrocom.com/products/book.php?book_id=b112x">one for +other locations</a>) by <a href="http://astrocom.com/">Astro Communications Services</a>.</li> <li><a href="http://worldtime.com/">WORLDTIME: interactive atlas, time info, public holidays</a> @@ -252,10 +281,9 @@ contains data from the Time Service Department of the for the <code>usno*</code> files in the <code>tz</code> distribution.</li> <li>The <a href="http://www.iata.org/ps/publications/9179.htm">Standard Schedules Information Manual</a> of the -the <a href="http://www.iata.org/">International Air Transport -Association</a>, -which gives current time zone rules for -all the airports served by commercial aviation.</li> +<a href="http://www.iata.org/index.htm">International Air Transport +Association</a> +gives current time zone rules for airports served by commercial aviation.</li> </ul> <h2>Maps</h2> <ul> @@ -295,7 +323,7 @@ world time zone boundaries distributed under the <abbr>GPL</abbr>.</li> <li>The <abbr>US</abbr> Geological Survey's National Atlas of the United States -publishes the <a href="http://www.nationalatlas.gov/timeznm.html">Time +publishes the <a href="http://nationalatlas.gov/mld/timeznp.html">Time Zones of the United States</a> in the public domain.</li> <li>The GeoCommunity lists several commercial sources for <a href="http://spatialnews.geocomm.com/features/timezones/">International @@ -309,6 +337,8 @@ surveys the evolution of timekeeping.</li> <li><a href="http://webexhibits.org/daylightsaving/">About Daylight Saving Time - History, rationale, laws & dates</a> is an overall history of <abbr>DST</abbr>.</li> +<li><a href="http://www.energy.ca.gov/daylightsaving.html">Saving Time, +Saving Energy</a> discusses a primary justification for <abbr>DST</abbr>.</li> <li><a href="http://www.seizethedaylight.com/dst/">Who Knew? A Brief History of Daylight Saving Time</a> summarizes some of the contentious history of <abbr>DST</abbr>.</li> @@ -326,11 +356,8 @@ Zone Concepts</a> discusses terminological issues behind time zones.</li> <h2>National histories of legal time</h2> <dl> <dt>Australia</dt> -<dd>The Community Relations Division of the New South Wales -(<abbr title="New South Wales">NSW</abbr>) -Attorney General's Department maintains a <a -href="http://www.lawlink.nsw.gov.au/crd.nsf/pages/time2">history of -daylight saving in <abbr>NSW</abbr></a>.</dd> +<dd>The Bureau of Metrology publishes a list of +<a href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">Implementation Dates of Daylight Savings Time within Australia</a>.</dd> <dt>Austria</dt> <dd>The Federal Office of Metrology and Surveying publishes a table of <a href="http://www.metrologie.at/pdf/sommerzeit.pdf" @@ -347,7 +374,7 @@ Portuguese)</a>.</dd> <dt>Canada</dt> <dd>The Institute for National Measurement Standards publishes current and some older information about <a -href="http://inms-ienm.nrc-cnrc.gc.ca/time_services/daylight_savings_e.html">Time +href="http://inms-ienm.nrc-cnrc.gc.ca/en/time_services/daylight_saving_e.php">Time Zones & Daylight Saving Time</a>.</dd> <dt>Chile</dt> <dd>WebExhibits publishes a <a @@ -375,10 +402,15 @@ hreflang="nl">Legal time in the Netherlands (in Dutch)</a> covers the history of local time in the Netherlands from ancient times.</dd> <dt>New Zealand</dt> <dd>The Department of Internal Affairs maintains a brief history <a -href="http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Resource-material-Information-We-Provide-About-Daylight-Saving">about -daylight saving</a>. The privately-maintained <a -href="http://www.astrologyhouse.co.nz/timechanges.htm">Time Changes in -New Zealand</a> has more details.</dd> +href="http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Resource-material-Information-We-Provide-About-Daylight-Saving">About +Daylight Saving</a>. The privately-maintained <a +href="http://www.astrologyschool.com/nztime.html">History of New Zealand +time</a> has more details.</dd> +<dt>Norway</dt> +<dd>The Norwegian Meteorological Institute lists +<a href="http://met.no/met/met_lex/q_u/sommertid.html" hreflang="no">Summer +time in Norway (in Norwegian)</a>, citing the +Institute of Theoretical Astrophysics, Oslo.</dd> <dt>Singapore</dt> <dd><a href="http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html">Why @@ -390,13 +422,13 @@ href="http://www.srcf.ucam.org/~jsm28/british-time/">History of legal time in Britain</a> discusses in detail the country with perhaps the best-documented history of clock adjustments. The National Physical Laboratory also maintains an <a -href="http://www.npl.co.uk/time/summer_time_archive.html">archive -of summer time dates</a>.</dd> +href="http://www.npl.co.uk/time/summer_time_archive.html">Archive +of Summer time dates</a>.</dd> </dl> <h2>Precision timekeeping</h2> <ul> <li><a -href="http://literature.agilent.com/litwebbin/purl.cgi?org_id=tmo&pub_id=5965-7984E">The +href="http://literature.agilent.com/litweb/pdf/5965-7984E.pdf">The Science of Timekeeping</a> is a thorough introduction to the theory and practice of precision timekeeping.</li> <li><a href="http://www.ntp.org/"><abbr @@ -411,11 +443,13 @@ the <abbr title="Royal Greenwich Observatory">RGO</abbr></a> answers questions like "What is the difference between <abbr>GMT</abbr> and <abbr>UTC</abbr>?"</li> <li><a -href="http://www.gb.nrao.edu/~rfisher/Ephemerides/times.html">Astronomical +href="http://www.cv.nrao.edu/~rfisher/Ephemerides/times.html">Astronomical Times</a> explains more abstruse astronomical time scales like <abbr title="Terrestrial Dynamic Time">TDT</abbr>, <abbr title="Geocentric Coordinate Time">TCG</abbr>, and -<abbr title="Barycentric Dynamic Time">TDB</abbr>.</li> +<abbr title="Barycentric Dynamic Time">TDB</abbr>. +<a href="http://www.ucolick.org/~sla/leapsecs/timescales.html">Time +Scales</a> goes into more detail, particularly for historical variants.</li> <li>The <a href="http://www.iau.org/"><abbr title="International Astronomical Union">IAU</abbr></a>'s <a href="http://www.iau-sofa.rl.ac.uk/"><abbr @@ -435,6 +469,10 @@ describes Mars Coordinated Time (<abbr title="Mars Coordinated Time">MTC</abbr>) and the diverse local time scales used by each landed mission on Mars.</li> +<li><a href="http://www.leapsecond.com/">LeapSecond.com</a> is +dedicated not only to leap seconds but to precise time and frequency +in general. It covers the state of the art in amateur timekeeping, and +how the art has progressed over the past few decades.</li> <li><a href="http://hpiers.obspm.fr/eop-pc/products/bulletins/bulletins.html">Bulletins maintained by the @@ -446,19 +484,20 @@ International Earth Rotation Service, the committee that decides when leap seconds occur.</li> <li>The <a href="http://www.mail-archive.com/leapsecs@rom.usno.navy.mil/">Leap -Second Discussion List</a> covers <a +Second Discussion List</a> and <a +href="http://rom.usno.navy.mil/archives/leapsecs.html">archive</a> covers <a href="http://gauss.gge.unb.ca/papers.pdf/gpsworld.november99.pdf">McCarthy and Klepczynski's proposal to discontinue leap seconds</a>, published in <a -href="http://www.gpsworld.com/"><abbr +href="http://www.gpsworld.com/gpsworld/"><abbr title="Global Positioning System">GPS</abbr> World</a> <strong>10</strong>, 11 (1999-11), 50–57 and discussed further in R. A. Nelson et al., <a href="http://www.cl.cam.ac.uk/~mgk25/time/metrologia-leapsecond.pdf">The leap second: its history and possible future</a>, -<a href="http://www.bipm.fr/metrologia/">Metrologia</a> +<a href="http://www.bipm.fr/metrologia/index.html">Metrologia</a> <strong>38</strong> (2001), 509–529. -<a href="http://www.ucolick.org/~sla/leapsecs/onlinebib.html">The -Future of Leap Seconds</a> catalogs information about this +<a href="http://www.ucolick.org/~sla/leapsecs/">The +Future of Leap Seconds</a> covers this contentious issue.</li> </ul> <h2>Time notation</h2> @@ -473,6 +512,10 @@ title="International Organization for Standardization">ISO</abbr> 8601:2004 -- Data elements and interchange formats -- Information interchange -- Representation of dates and times</a>.</li> <li> +<a href="http://www.w3.org/TR/xmlschema-2/#dateTime"><abbr>XML</abbr> +Schema: Datatypes - dateTime</a> specifies a format inspired by +<abbr>ISO</abbr> 8601 that is in common use in <abbr>XML</abbr> data.</li> +<li> Section 3.3 of <a href="ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt">Internet <abbr title="Request For Comments">RFC</abbr> 2822</a> @@ -485,13 +528,16 @@ headers.</li> profile for use in new Internet protocols.</li> <li> +<a href="http://www.hackcraft.net/web/datetime/">Date & Time +Formats on the Web</a> surveys web- and Internet-oriented date and time +formats.</li> +<li> <a href="http://www.exit109.com/~ghealton/y2k/yrexamples.html">The Best of Dates, the Worst of Dates</a> covers many problems encountered by software developers when handling dates and time stamps.</li> <li><a -href="http://ibm.com/software/globalization/icu"><abbr -title="International Components for Unicode">ICU</abbr></a> contains a -mechanism for localizing time zone +href="http://www-306.ibm.com/software/globalization/icu/"><abbr>ICU</abbr></a> +contains a mechanism for localizing time zone labels and abbreviations; for example, one can use it to specify Russian translations for "Eastern European Summer Time", "<abbr title="Eastern European Summer Time">EEST</abbr>", @@ -500,8 +546,7 @@ This mechanism is part of the <a href="http://unicode.org/cldr/">Unicode <abbr title="Common Locale Data Repository">CLDR</abbr> Project</a>; for example, the <a -href="http://www.unicode.org/cldr/data/diff/by_type/dates_timeZoneNames.html">By-Type -Chart for //ldml/dates/timeZoneNames/…</a> +href="http://unicode.org/cldr/data/diff/by_type/dates_timeZoneNames.html"><abbr>CLDR</abbr> Sideways Data for dates_timeZoneNames</a> shows values for time zone names in many locales.</li> <li>Alphabetic time zone abbreviations should not be used as unique identifiers for <abbr>UTC</abbr> offsets as they are ambiguous in @@ -523,7 +568,7 @@ example, one might use <code>TZ="JST-9"</code> and <code>tz</code> database is available, it is usually better to use settings like <code>TZ="Asia/Tokyo"</code> and <code>TZ="Pacific/Honolulu"</code> instead, as this should avoid -confusion, handle old timestamps better, and insulate you better from +confusion, handle old time stamps better, and insulate you better from any future changes to the rules. One should never set <abbr>POSIX</abbr> <code>TZ</code> to a value like <code>"GMT-9"</code>, though, since this would falsely claim that @@ -538,7 +583,7 @@ Reference: Time</a></li> <li><a href="http://directory.google.com/Top/Reference/Time/">Google Directory - Reference > Time</a></li> <li><a href="http://dir.yahoo.com/Science/Measurements_and_Units/Time/">Yahoo! -Science > Measurements and Units > Time</a></li> +Directory > Science > Measurements and Units > Time</a></li> </ul> </body> </html> diff --git a/lib/libc/time/tzfile.5 b/lib/libc/time/tzfile.5 index 5b5de5ae523..ffe37006b03 100644 --- a/lib/libc/time/tzfile.5 +++ b/lib/libc/time/tzfile.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tzfile.5,v 1.8 1999/07/09 13:35:21 aaron Exp $ +.\" $OpenBSD: tzfile.5,v 1.9 2006/02/18 21:54:17 millert Exp $ .Dd May 24, 1999 .Dt TZFILE 5 .Os @@ -138,4 +138,4 @@ in the file. .Xr ctime 3 .\" @(#)tzfile.5 7.11 .\" This file is in the public domain, so clarified as of -.\" 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). +.\" 1996-06-05 by Arthur David Olson. diff --git a/lib/libc/time/tzfile.h b/lib/libc/time/tzfile.h index 96d7d05a3ff..2a31ed526a8 100644 --- a/lib/libc/time/tzfile.h +++ b/lib/libc/time/tzfile.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tzfile.h,v 1.6 2005/07/05 13:40:51 millert Exp $ */ +/* $OpenBSD: tzfile.h,v 1.7 2006/02/18 21:54:17 millert Exp $ */ #ifndef TZFILE_H @@ -6,7 +6,7 @@ /* ** This file is in the public domain, so clarified as of -** 1996-06-05 by Arthur David Olson (arthur_david_olson@nih.gov). +** 1996-06-05 by Arthur David Olson. */ /* @@ -24,7 +24,7 @@ #if 0 #ifndef lint #ifndef NOID -static char tzfilehid[] = "@(#)tzfile.h 7.17"; +static char tzfilehid[] = "@(#)tzfile.h 7.18"; #endif /* !defined NOID */ #endif /* !defined lint */ #endif @@ -109,7 +109,7 @@ struct tzhead { #ifdef NOSOLAR /* ** Must be at least 14 for Europe/Riga as of Jan 12 1995, -** as noted by Earl Chew <earl@hpato.aus.hp.com>. +** as noted by Earl Chew. */ #define TZ_MAX_TYPES 20 /* Maximum number of local time types */ #endif /* !defined NOSOLAR */ diff --git a/lib/libc/time/tzset.3 b/lib/libc/time/tzset.3 index de89e8f0fb0..1f0c18399e7 100644 --- a/lib/libc/time/tzset.3 +++ b/lib/libc/time/tzset.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tzset.3,v 1.14 2004/04/16 10:48:39 jmc Exp $ +.\" $OpenBSD: tzset.3,v 1.15 2006/02/18 21:54:17 millert Exp $ .Dd May 24, 1999 .Dt TZSET 3 .Os @@ -288,4 +288,4 @@ UTC leap seconds are loaded from .Xr tzfile 5 .\" @(#)newtzset.3 7.5 .\" This file is in the public domain, so clarified as of -.\" 2003-02-14 by Arthur David Olson (arthur_david_olson@nih.gov). +.\" 2003-02-14 by Arthur David Olson. diff --git a/lib/libc/time/zdump.8 b/lib/libc/time/zdump.8 index 6db735d5ff4..76465be6cd7 100644 --- a/lib/libc/time/zdump.8 +++ b/lib/libc/time/zdump.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: zdump.8,v 1.11 2005/07/05 18:22:39 jmc Exp $ +.\" $OpenBSD: zdump.8,v 1.12 2006/02/18 21:54:17 millert Exp $ .Dd May 23, 1999 .Dt ZDUMP 8 .Os @@ -61,4 +61,4 @@ one can construct artificial time zones for which this fails. .Xr zic 8 .\" @(#)zdump.8 7.7 .\" This file is in the public domain, so clarified as of -.\" 2003-02-14 by Arthur David Olson (arthur_david_olson@nih.gov). +.\" 2003-02-14 by Arthur David Olson. diff --git a/lib/libc/time/zdump.c b/lib/libc/time/zdump.c index 99e1ce5a40d..614398641d7 100644 --- a/lib/libc/time/zdump.c +++ b/lib/libc/time/zdump.c @@ -1,7 +1,7 @@ -/* $OpenBSD: zdump.c,v 1.17 2005/08/08 08:05:38 espie Exp $ */ +/* $OpenBSD: zdump.c,v 1.18 2006/02/18 21:54:17 millert Exp $ */ /* ** This file is in the public domain, so clarified as of -** Feb 14, 2003 by Arthur David Olson (arthur_david_olson@nih.gov). +** Feb 14, 2003 by Arthur David Olson. */ /* @@ -17,6 +17,10 @@ #include "time.h" /* for struct tm */ #include "stdlib.h" /* for exit, malloc, atoi */ #include "float.h" /* for FLT_MAX and DBL_MAX */ +#include "ctype.h" /* for isalpha et al. */ +#ifndef isascii +#define isascii(x) 1 +#endif #ifndef ZDUMP_LO_YEAR #define ZDUMP_LO_YEAR (-500) @@ -152,7 +156,7 @@ static char * progname; static int warned; static char * abbr P((struct tm * tmp)); -static void abbrok P((const char * abbr, const char * zone)); +static void abbrok P((const char * abbrp, const char * zone)); static long delta P((struct tm * newp, struct tm * oldp)); static void dumptime P((const struct tm * tmp)); static time_t hunt P((char * name, time_t lot, time_t hit)); @@ -199,8 +203,8 @@ time_t * tp; #endif /* !defined TYPECHECK */ static void -abbrok(abbr, zone) -const char * const abbr; +abbrok(abbrp, zone) +const char * const abbrp; const char * const zone; { register const char * cp; @@ -208,30 +212,31 @@ const char * const zone; if (warned) return; - cp = abbr; + cp = abbrp; wp = NULL; - while (isascii(*cp) && isalpha(*cp)) + while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp)) ++cp; - if (cp - abbr == 0) + if (cp - abbrp == 0) wp = _("lacks alphabetic at start"); - if (cp - abbr < 3) + else if (cp - abbrp < 3) wp = _("has fewer than 3 alphabetics"); - if (cp - abbr > 6) + else if (cp - abbrp > 6) wp = _("has more than 6 alphabetics"); if (wp == NULL && (*cp == '+' || *cp == '-')) { ++cp; - if (isascii(*cp) && isdigit(*cp)) - if (*cp++ == '1' && *cp >= '0' && *cp <= '4') - ++cp; + if (isascii((unsigned char) *cp) && + isdigit((unsigned char) *cp)) + if (*cp++ == '1' && *cp >= '0' && *cp <= '4') + ++cp; + if (*cp != '\0') + wp = _("differs from POSIX standard"); } - if (*cp != '\0') - wp = _("differs from POSIX standard"); if (wp == NULL) return; (void) fflush(stdout); (void) fprintf(stderr, - "%s: warning: zone \"%s\" abbreviation \"%s\" %s\n", - progname, zone, abbr, wp); + _("%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"), + progname, zone, abbrp, wp); warned = TRUE; } @@ -276,9 +281,9 @@ char * argv[]; if ((c != EOF && c != -1) || (optind == argc - 1 && strcmp(argv[optind], "=") == 0)) { (void) fprintf(stderr, -_("usage %s [-v] [-c [loyear,]hiyear] zonename ...\n"), +_("usage: %s [-v] [-c [loyear,]hiyear] zonename ...\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (vflag) { if (cutarg != NULL) { @@ -295,7 +300,7 @@ _("usage %s [-v] [-c [loyear,]hiyear] zonename ...\n"), } else { (void) fprintf(stderr, _("%s: wild -c argument %s\n"), progname, cutarg); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } setabsolutes(); @@ -318,7 +323,7 @@ _("usage %s [-v] [-c [loyear,]hiyear] zonename ...\n"), if (fakeenv == NULL || (fakeenv[0] = (char *) malloc(longest + 4)) == NULL) { (void) perror(progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } to = 0; strlcpy(fakeenv[to++], "TZ=", longest + 4); @@ -384,7 +389,7 @@ _("usage %s [-v] [-c [loyear,]hiyear] zonename ...\n"), if (fflush(stdout) || ferror(stdout)) { (void) fprintf(stderr, "%s: ", progname); (void) perror(_("Error writing standard output")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } exit(EXIT_SUCCESS); /* If exit fails to exit... */ @@ -408,7 +413,7 @@ setabsolutes() (void) fprintf(stderr, _("%s: use of -v on system with floating time_t other than float or double\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } else if (0 > (time_t) -1) { /* @@ -508,7 +513,7 @@ time_t hit; } /* -** Thanks to Paul Eggert (eggert@twinsun.com) for logic used in delta. +** Thanks to Paul Eggert for logic used in delta. */ static long diff --git a/lib/libc/time/zic.8 b/lib/libc/time/zic.8 index e7b3b78699f..8ca931f3d27 100644 --- a/lib/libc/time/zic.8 +++ b/lib/libc/time/zic.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: zic.8,v 1.17 2004/06/28 14:47:41 millert Exp $ +.\" $OpenBSD: zic.8,v 1.18 2006/02/18 21:54:17 millert Exp $ .Dd May 23, 1999 .Dt ZIC 8 .Os @@ -381,6 +381,18 @@ you may need to use local standard time in the .Em AT field of the earliest transition time's rule to ensure that the earliest transition time recorded in the compiled file is correct. +.Pp +If, +for a particular zone, +a clock advance caused by the start of daylight saving +coincides with and is equal to +a clock retreat caused by a change in UTC offset, +.Nm +produces a single transition to daylight saving at the new UTC offset +(without any change in wall clock time). +To get separate transitions +use multiple zone continuation lines +specifying transition instants using universal time. .Sh FILES .Bl -tag -width "/usr/share/zoneinfo" -compact .It Pa /etc/localtime @@ -392,6 +404,6 @@ standard directory used for created files .Xr ctime 3 , .Xr tzfile 5 , .Xr zdump 8 -.\" @(#)zic.8 7.20 +.\" @(#)zic.8 7.24 .\" This file is in the public domain, so clarified as of -.\" 2003-02-14 by Arthur David Olson (arthur_david_olson@nih.gov). +.\" 2003-02-14 by Arthur David Olson. diff --git a/lib/libc/time/zic.c b/lib/libc/time/zic.c index e3680472aa3..df293bf052b 100644 --- a/lib/libc/time/zic.c +++ b/lib/libc/time/zic.c @@ -1,7 +1,7 @@ -/* $OpenBSD: zic.c,v 1.25 2005/08/08 08:05:38 espie Exp $ */ +/* $OpenBSD: zic.c,v 1.26 2006/02/18 21:54:17 millert Exp $ */ /* ** This file is in the public domain, so clarified as of -** Feb 14, 2003 by Arthur David Olson (arthur_david_olson@nih.gov). +** Feb 14, 2003 by Arthur David Olson. */ /* @@ -374,7 +374,7 @@ char * const ptr; (void) fprintf(stderr, _("%s: Memory exhausted: %s\n"), progname, e); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } return ptr; } @@ -458,7 +458,7 @@ usage P((void)) { (void) fprintf(stderr, _("usage: %s [-sv] [-d directory] [-L leapsecondfilename] [-l timezone]\n\t[-p timezone] [-y command] [filename ...]\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } static const char * psxrules; @@ -499,7 +499,7 @@ char * argv[]; (void) fprintf(stderr, _("%s: More than one -d option specified\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } break; case 'l': @@ -509,7 +509,7 @@ _("%s: More than one -d option specified\n"), (void) fprintf(stderr, _("%s: More than one -l option specified\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } break; case 'p': @@ -519,7 +519,7 @@ _("%s: More than one -l option specified\n"), (void) fprintf(stderr, _("%s: More than one -p option specified\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } break; case 'y': @@ -529,7 +529,7 @@ _("%s: More than one -p option specified\n"), (void) fprintf(stderr, _("%s: More than one -y option specified\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } break; case 'L': @@ -539,7 +539,7 @@ _("%s: More than one -y option specified\n"), (void) fprintf(stderr, _("%s: More than one -L option specified\n"), progname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } break; case 'v': @@ -566,7 +566,7 @@ _("%s: More than one -L option specified\n"), for (i = optind; i < argc; ++i) infile(argv[i]); if (errors) - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); associate(); for (i = 0; i < nzones; i = j) { /* @@ -631,7 +631,7 @@ const char * const tofile; int result; if (mkdirs(toname) != 0) - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); result = link(fromname, toname); #if HAVE_SYMLINK @@ -644,7 +644,7 @@ const char * const tofile; (void) fprintf(stderr, _("%s: Can't link from %s to %s: %s\n"), progname, fromname, toname, e); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } ifree(fromname); @@ -805,7 +805,7 @@ associate P((void)) } } if (errors) - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } static void @@ -829,7 +829,7 @@ const char * name; (void) fprintf(stderr, _("%s: Can't open %s: %s\n"), progname, name, e); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } wantcont = FALSE; for (num = 1; ; ++num) { @@ -839,7 +839,7 @@ const char * name; cp = strchr(buf, '\n'); if (cp == NULL) { error(_("line too long")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } *cp = '\0'; fields = getfields(buf); @@ -883,7 +883,7 @@ _("%s: Leap line in non leap seconds file %s\n"), (void) fprintf(stderr, _("%s: panic: Invalid l_value %d\n"), progname, lp->l_value); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } ifree((char *) fields); @@ -891,14 +891,14 @@ _("%s: panic: Invalid l_value %d\n"), if (ferror(fp)) { (void) fprintf(stderr, _("%s: Error reading %s\n"), progname, filename); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (fp != stdin && fclose(fp)) { const char *e = strerror(errno); (void) fprintf(stderr, _("%s: Error closing %s: %s\n"), progname, filename, e); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (wantcont) error(_("expected continuation line not found")); @@ -1307,7 +1307,7 @@ const char * const timep; (void) fprintf(stderr, _("%s: panic: Invalid l_value %d\n"), progname, lp->l_value); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } else if (sscanf(cp, scheck(cp, "%d"), &rp->r_loyear) != 1) { error(_("invalid starting year")); return; @@ -1332,7 +1332,7 @@ const char * const timep; (void) fprintf(stderr, _("%s: panic: Invalid l_value %d\n"), progname, lp->l_value); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } else if (sscanf(cp, scheck(cp, "%d"), &rp->r_hiyear) != 1) { error(_("invalid ending year")); return; @@ -1505,17 +1505,17 @@ const char * const name; (void) fprintf(stderr, _("%s: Can't remove %s: %s\n"), progname, fullname, e); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if ((fp = fopen(fullname, "wb")) == NULL) { if (mkdirs(fullname) != 0) - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); if ((fp = fopen(fullname, "wb")) == NULL) { const char *e = strerror(errno); (void) fprintf(stderr, _("%s: Can't create %s: %s\n"), progname, fullname, e); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } convert(eitol(typecnt), tzh.tzh_ttisgmtcnt); @@ -1582,7 +1582,7 @@ const char * const name; if (ferror(fp) || fclose(fp)) { (void) fprintf(stderr, _("%s: Error writing %s\n"), progname, fullname); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } @@ -1634,7 +1634,7 @@ const int zonecount; typecnt = 0; charcnt = 0; /* - ** Thanks to Earl Chew (earl@dnd.icp.nec.com.au) + ** Thanks to Earl Chew ** for noting the need to unconditionally initialize startttisstd. */ startttisstd = FALSE; @@ -1819,7 +1819,7 @@ int type; } if (timecnt >= TZ_MAX_TIMES) { error(_("too many transitions?!")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } attypes[timecnt].at = starttime; attypes[timecnt].type = type; @@ -1838,15 +1838,15 @@ const int ttisgmt; if (isdst != TRUE && isdst != FALSE) { error(_("internal error - addtype called with bad isdst")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (ttisstd != TRUE && ttisstd != FALSE) { error(_("internal error - addtype called with bad ttisstd")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (ttisgmt != TRUE && ttisgmt != FALSE) { error(_("internal error - addtype called with bad ttisgmt")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } /* ** See if there's already an entry for this zone type. @@ -1865,7 +1865,7 @@ const int ttisgmt; */ if (typecnt >= TZ_MAX_TYPES) { error(_("too many local time types")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } gmtoffs[i] = gmtoff; isdsts[i] = isdst; @@ -1893,13 +1893,13 @@ int count; if (leapcnt + (positive ? count : 1) > TZ_MAX_LEAPS) { error(_("too many leap seconds")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } for (i = 0; i < leapcnt; ++i) if (t <= trans[i]) { if (t == trans[i]) { error(_("repeated leap second moment")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } break; } @@ -1956,7 +1956,7 @@ const char * const type; (void) fprintf(stderr, _("%s: command was '%s', result was %d\n"), progname, buf, result); for ( ; ; ) - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } static int @@ -2037,8 +2037,9 @@ register char * cp; emalloc((int) ((strlen(cp) + 1) * sizeof *array)); nsubs = 0; for ( ; ; ) { - while (isascii(*cp) && isspace((unsigned char) *cp)) - ++cp; + while (isascii((unsigned char) *cp) && + isspace((unsigned char) *cp)) + ++cp; if (*cp == '\0' || *cp == '#') break; array[nsubs++] = dp = cp; @@ -2071,7 +2072,7 @@ const long t2; t = t1 + t2; if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) { error(_("time overflow")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } return t; } @@ -2090,7 +2091,7 @@ const long t2; t = t1 + t2; if ((t2 > 0 && t <= t1) || (t2 < 0 && t >= t1)) { error(_("time overflow")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } return t; } @@ -2137,7 +2138,7 @@ register const int wantedy; --i; else { error(_("use of 2/29 in non leap-year")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } } --i; @@ -2201,8 +2202,9 @@ const char * const string; */ cp = string; wp = NULL; - while (isascii(*cp) && isalpha(*cp)) - ++cp; + while (isascii((unsigned char) *cp) && + isalpha((unsigned char) *cp)) + ++cp; if (cp - string == 0) wp = _("time zone abbreviation lacks alphabetic at start"); if (noise && cp - string > 3) @@ -2211,9 +2213,11 @@ wp = _("time zone abbreviation has more than 3 alphabetics"); wp = _("time zone abbreviation has too many alphabetics"); if (wp == NULL && (*cp == '+' || *cp == '-')) { ++cp; - if (isascii(*cp) && isdigit(*cp)) - if (*cp++ == '1' && *cp >= '0' && *cp <= '4') - ++cp; + if (isascii((unsigned char) *cp) && + isdigit((unsigned char) *cp)) + if (*cp++ == '1' && + *cp >= '0' && *cp <= '4') + ++cp; } if (*cp != '\0') wp = _("time zone abbreviation differs from POSIX standard"); @@ -2229,7 +2233,7 @@ wp = _("time zone abbreviation differs from POSIX standard"); i = strlen(string) + 1; if (charcnt + i > TZ_MAX_CHARS) { error(_("too many, or too long, time zone abbreviations")); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } strlcpy(&chars[charcnt], string, sizeof(chars) - charcnt); charcnt += eitol(i); @@ -2293,7 +2297,7 @@ const int i; (void) fprintf(stderr, _("%s: %d did not sign extend correctly\n"), progname, i); - (void) exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } return l; } |