Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/time Merge tzcode2003e.
details: https://anonhg.NetBSD.org/src/rev/e38d186431ab
branches: trunk
changeset: 556521:e38d186431ab
user: kleink <kleink%NetBSD.org@localhost>
date: Sat Dec 20 00:12:05 2003 +0000
description:
Merge tzcode2003e.
diffstat:
lib/libc/time/Theory | 8 ++++----
lib/libc/time/localtime.c | 35 ++++++++++++++++++++++++++---------
lib/libc/time/private.h | 6 +++---
lib/libc/time/tz-link.htm | 40 ++++++++++++++++++++++++++++++++--------
lib/libc/time/zic.8 | 9 ++++++---
lib/libc/time/zic.c | 9 ++++++---
6 files changed, 77 insertions(+), 30 deletions(-)
diffs (297 lines):
diff -r e7ab5c2644cc -r e38d186431ab lib/libc/time/Theory
--- a/lib/libc/time/Theory Fri Dec 19 23:52:44 2003 +0000
+++ b/lib/libc/time/Theory Sat Dec 20 00:12:05 2003 +0000
@@ -1,5 +1,5 @@
-# $NetBSD: Theory,v 1.6 2002/01/29 12:40:33 kleink Exp $
-@(#)Theory 7.13
+# $NetBSD: Theory,v 1.7 2003/12/20 00:12:05 kleink Exp $
+@(#)Theory 7.14
----- Outline -----
@@ -13,7 +13,7 @@
----- Time and date functions -----
These time and date functions are upwards compatible with POSIX.1,
-an international standard for Unix-like systems.
+an international standard for UNIX-like systems.
As of this writing, the current edition of POSIX.1 is:
Information technology --Portable Operating System Interface (POSIX (R))
@@ -145,7 +145,7 @@
since the format of zic's input changed slightly in late 1994,
and many vendors still do not support the new input format.
-* The Unix Version 7 "timezone" function is not present in this package;
+* The UNIX Version 7 "timezone" function is not present in this package;
it's impossible to reliably map timezone's arguments (a "minutes west
of GMT" value and a "daylight saving time in effect" flag) to a
time zone abbreviation, and we refuse to guess.
diff -r e7ab5c2644cc -r e38d186431ab lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Fri Dec 19 23:52:44 2003 +0000
+++ b/lib/libc/time/localtime.c Sat Dec 20 00:12:05 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: localtime.c,v 1.34 2003/10/29 20:43:27 kleink Exp $ */
+/* $NetBSD: localtime.c,v 1.35 2003/12/20 00:12:05 kleink Exp $ */
/*
** This file is in the public domain, so clarified as of
@@ -8,9 +8,9 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
#if 0
-static char elsieid[] = "@(#)localtime.c 7.76";
+static char elsieid[] = "@(#)localtime.c 7.78";
#else
-__RCSID("$NetBSD: localtime.c,v 1.34 2003/10/29 20:43:27 kleink Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.35 2003/12/20 00:12:05 kleink Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -1123,8 +1123,9 @@
}
/*
- * Re-entrant version of localtime
- */
+** Re-entrant version of localtime.
+*/
+
struct tm *
localtime_r(timep, tmp)
const time_t * const timep;
@@ -1192,8 +1193,9 @@
}
/*
- * Re-entrant version of gmtime
- */
+** Re-entrant version of gmtime.
+*/
+
struct tm *
gmtime_r(timep, tmp)
const time_t * const timep;
@@ -1583,6 +1585,11 @@
register time_t t;
register const struct state * sp;
register int samei, otheri;
+ register int sameind, otherind;
+ register int i;
+ register int nseen;
+ int seen[TZ_MAX_TYPES];
+ int types[TZ_MAX_TYPES];
int okay;
if (tmp->tm_isdst > 1)
@@ -1616,10 +1623,20 @@
if (sp == NULL)
return WRONG;
#endif /* defined ALL_STATE */
- for (samei = sp->typecnt - 1; samei >= 0; --samei) {
+ for (i = 0; i < sp->typecnt; ++i)
+ seen[i] = FALSE;
+ nseen = 0;
+ for (i = sp->timecnt - 1; i >= 0; --i)
+ if (!seen[sp->types[i]]) {
+ seen[sp->types[i]] = TRUE;
+ types[nseen++] = sp->types[i];
+ }
+ for (sameind = 0; sameind < nseen; ++sameind) {
+ samei = types[sameind];
if (sp->ttis[samei].tt_isdst != tmp->tm_isdst)
continue;
- for (otheri = sp->typecnt - 1; otheri >= 0; --otheri) {
+ for (otherind = 0; otherind < nseen; ++otherind) {
+ otheri = types[otherind];
if (sp->ttis[otheri].tt_isdst == tmp->tm_isdst)
continue;
tmp->tm_sec += (int)(sp->ttis[otheri].tt_gmtoff -
diff -r e7ab5c2644cc -r e38d186431ab lib/libc/time/private.h
--- a/lib/libc/time/private.h Fri Dec 19 23:52:44 2003 +0000
+++ b/lib/libc/time/private.h Sat Dec 20 00:12:05 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: private.h,v 1.23 2003/10/27 00:12:42 lukem Exp $ */
+/* $NetBSD: private.h,v 1.24 2003/12/20 00:12:05 kleink Exp $ */
#ifndef PRIVATE_H
#define PRIVATE_H
@@ -34,7 +34,7 @@
#ifndef lint
#ifndef NOID
#if 0
-static char privatehid[] = "@(#)private.h 7.52";
+static char privatehid[] = "@(#)private.h 7.53";
#endif
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -300,7 +300,7 @@
#endif /* HAVE_INCOMPATIBLE_CTIME_R */
/*
-** UNIX was a registered trademark of UNIX System Laboratories in 1993.
+** UNIX was a registered trademark of The Open Group in 2003.
*/
#endif /* !defined PRIVATE_H */
diff -r e7ab5c2644cc -r e38d186431ab lib/libc/time/tz-link.htm
--- a/lib/libc/time/tz-link.htm Fri Dec 19 23:52:44 2003 +0000
+++ b/lib/libc/time/tz-link.htm Sat Dec 20 00:12:05 2003 +0000
@@ -19,7 +19,7 @@
<body>
<h1>Sources for Time Zone and Daylight Saving Time Data</h1>
<address>
-@(#)tz-link.htm 7.39
+@(#)tz-link.htm 7.41
</address>
<p>
Please send corrections to this web page to the
@@ -88,9 +88,11 @@
send changes to the <a href="mailto:tz%elsie.nci.nih.gov@localhost">time zone
mailing list</a>. You can also <a
href="mailto:tz-request%elsie.nci.nih.gov@localhost">subscribe</a> to the
-mailing list, or retrieve the <a
+mailing list, retrieve the <a
href="ftp://elsie.nci.nih.gov/pub/tzarchive.gz">archive of old
-messages</a> (in gzip compressed format).</p>
+messages</a> (in gzip compressed format), or retrieve <a
+href="ftp://munnari.oz.au/pub/oldtz/">archived older versions of code
+and data</a>.</p>
<p>
The Web has several other sources for time zone and daylight saving time data.
Here are some recent links that may be of interest.
@@ -124,7 +126,7 @@
Calendaring and Scheduling Working Group (calsch)</a> covers time zone
data; see its VTIMEZONE calendar component.</li>
<li>The <a
-href="http://lists.w3.org/Archives/Public/www-rdf-calendar/"><samp>www-rdf-calendar</samp></a>
+href="http://lists.w3.org/Archives/Public/www-rdf-calendar/">www-rdf-calendar</a>
list discusses <a href="http://www.w3.org/RDF/">RDF</a>-based calendar
and group scheduling systems, and has a <a
href="http://www.w3.org/2002/12/cal/#tzd">workspace on time zone
@@ -138,11 +140,23 @@
</ul>
<h2>Other <code>tz</code> compilers</h2>
<ul>
-<li><a href="http://primates.ximian.com/~damon/icalendar/">Olson ->
-VTIMEZONE Converter</a> describes a program Vzic that
-compiles <code>tz</code> source into iCalendar format. Vzic is freely
+<li><a href="http://www.dachaplin.dsl.pipex.com/vzic">Vzic iCalendar
+Timezone Converter</a> describes a program Vzic that compiles
+<code>tz</code> source into iCalendar-compatible VTIMEZONE files.
+Vzic is freely
available under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU
General Public License (GPL)</a>.</li>
+<li><a
+href="http://search.cpan.org/dist/DateTime-TimeZone/">DateTime::TimeZone</a>
+contains a script <code>parse_olson</code> that compiles
+<code>tz</code> source into <a href="http://www.perl.org/">Perl</a>
+modules. It is part of the Perl <a
+href="http://datetime.perl.org/">DateTime Project</a>, which is freely
+available under both the GPL and the Perl <a
+href="http://www.perl.com/language/misc/Artistic.html">Artistic
+License</a>. 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>
</ul>
<h2>Other <code>tz</code> binary file readers</h2>
<ul>
@@ -220,6 +234,9 @@
</ul>
<h2>Time zone boundaries</h2>
<ul>
+<li><a href="http://home-4.tiscali.nl/~t876506/Multizones.html">Time
+zone boundaries for multizone countries</a> summarizes legal
+boundaries between time zones within countries.</li>
<li>Manifold.net's <a
href="http://www.manifold.net/download/freemaps.html">Free Maps and
GIS Data</a> includes a Manifold-format map of world time zone
@@ -248,7 +265,7 @@
<li><a href="http://www.phys.uu.nl/~vgent/idl/idl.htm">A History of
the International Date Line</a> tells the story of the most important
time zone boundary.</li>
-<li><a href="http://www.mindspring.com/~gwil/tconcept.html">Basic Time
+<li><a href="http://www.statoids.com/tconcept.html">Basic Time
Zone Concepts</a> discusses terminological issues behind time zones.</li>
</ul>
<h2>National histories of legal time</h2>
@@ -294,6 +311,8 @@
Congress has published a <a
href="http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/"
hreflang="es">history of Mexican local time (in Spanish)</a>.</dd>
+<dt>Malaysia</dt>
+<dd>See Singapore below.</dd>
<dt>Netherlands</dt>
<dd><a href="http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm"
hreflang="nl">Legal time in the Netherlands (in Dutch)</a>
@@ -304,6 +323,11 @@
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>
+<dt>Singapore</dt>
+<dd><a
+href="http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html">Why
+is Singapore in the "Wrong" Time Zone?</a> details the
+history of legal time in Singapore and Malaysia.</dd>
<dt>United Kingdom</dt>
<dd><a
href="http://student.cusu.cam.ac.uk/~jsm28/british-time/">History of
diff -r e7ab5c2644cc -r e38d186431ab lib/libc/time/zic.8
--- a/lib/libc/time/zic.8 Fri Dec 19 23:52:44 2003 +0000
+++ b/lib/libc/time/zic.8 Sat Dec 20 00:12:05 2003 +0000
@@ -1,6 +1,6 @@
-.\" $NetBSD: zic.8,v 1.13 2003/10/29 20:43:27 kleink Exp $
-.\" @(#)zic.8 7.20
-.Dd October 29, 2003
+.\" $NetBSD: zic.8,v 1.14 2003/12/20 00:12:05 kleink Exp $
+.\" @(#)zic.8 7.22
+.Dd December 20, 2003
.Os
.Dt ZIC 8
.Sh NAME
@@ -58,6 +58,9 @@
of years representable by
.Xr time 3
values.
+Also complain if a time of 24:00
+.Pq which cannot be handled by pre-1998 versions of Nm
+appears in the input.
.It Fl y Ar command
Use the given
.Ar command
diff -r e7ab5c2644cc -r e38d186431ab lib/libc/time/zic.c
--- a/lib/libc/time/zic.c Fri Dec 19 23:52:44 2003 +0000
+++ b/lib/libc/time/zic.c Sat Dec 20 00:12:05 2003 +0000
@@ -1,13 +1,14 @@
-/* $NetBSD: zic.c,v 1.20 2003/10/29 20:43:27 kleink Exp $ */
+/* $NetBSD: zic.c,v 1.21 2003/12/20 00:12:05 kleink Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#ifndef NOID
-__RCSID("$NetBSD: zic.c,v 1.20 2003/10/29 20:43:27 kleink Exp $");
+__RCSID("$NetBSD: zic.c,v 1.21 2003/12/20 00:12:05 kleink Exp $");
#endif /* !defined NOID */
#endif /* !defined lint */
static char elsieid[] = "@(#)zic.c 7.113";
+static char elsieid[] = "@(#)zic.c 7.115";
#include "private.h"
#include "locale.h"
@@ -945,6 +946,8 @@
error(errstring);
return 0;
}
+ if (noise && hh == HOURSPERDAY)
+ warning(_("24:00 not handled by pre-1998 versions of zic"));
return eitol(sign) *
(eitol(hh * MINSPERHOUR + mm) *
eitol(SECSPERMIN) + eitol(ss));
@@ -2249,5 +2252,5 @@
}
/*
-** UNIX was a registered trademark of UNIX System Laboratories in 1993.
+** UNIX was a registered trademark of The Open Group in 2003.
*/
Home |
Main Index |
Thread Index |
Old Index