updated to tzcode2007a

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19755 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2007-01-09 23:16:26 +00:00
parent f21b85581f
commit 9481ed48de
8 changed files with 946 additions and 340 deletions
+6 -1
View File
@@ -1,6 +1,11 @@
/*
** This file is in the public domain, so clarified as of
** 2006-07-17 by Arthur David Olson.
*/
#ifndef lint
#ifndef NOID
static char elsieid[] = "@(#)ialloc.c 8.29";
static char elsieid[] = "@(#)ialloc.c 8.30";
#endif /* !defined NOID */
#endif /* !defined lint */
+10 -6
View File
@@ -1,6 +1,11 @@
/*
** This file is in the public domain, so clarified as of
** 2006-07-17 by Arthur David Olson.
*/
#ifndef lint
#ifndef NOID
static char elsieid[] = "@(#)scheck.c 8.16";
static char elsieid[] = "@(#)scheck.c 8.19";
#endif /* !defined lint */
#endif /* !defined NOID */
@@ -8,20 +13,19 @@ static char elsieid[] = "@(#)scheck.c 8.16";
#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));
+44 -43
View File
@@ -1,4 +1,4 @@
static char elsieid[] = "@(#)zdump.c 7.65";
static char elsieid[] = "@(#)zdump.c 8.3";
/*
** This code has been made independent of the rest of the time
@@ -12,6 +12,10 @@ static char elsieid[] = "@(#)zdump.c 7.65";
#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 /* !defined isascii */
#ifndef ZDUMP_LO_YEAR
#define ZDUMP_LO_YEAR (-500)
@@ -126,11 +130,7 @@ static char elsieid[] = "@(#)zdump.c 7.65";
#endif /* !defined TZ_DOMAIN */
#ifndef P
#ifdef __STDC__
#define P(x) x
#else /* !defined __STDC__ */
#define P(x) ()
#endif /* !defined __STDC__ */
#endif /* !defined P */
extern char ** environ;
@@ -147,7 +147,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));
@@ -194,40 +194,40 @@ 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 int i;
register const char * cp;
register char * wp;
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;
}
@@ -266,7 +266,7 @@ char * argv[];
for (i = 1; i < argc; ++i)
if (strcmp(argv[i], "--version") == 0) {
(void) printf("%s\n", elsieid);
(void) exit(EXIT_SUCCESS);
exit(EXIT_SUCCESS);
}
vflag = 0;
cutarg = NULL;
@@ -279,7 +279,7 @@ char * argv[];
(void) fprintf(stderr,
_("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
progname, progname);
(void) exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
if (vflag) {
if (cutarg != NULL) {
@@ -296,7 +296,7 @@ _("%s: usage is %s [ --version ] [ -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();
@@ -319,7 +319,7 @@ _("%s: usage is %s [ --version ] [ -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;
(void) strcpy(fakeenv[to++], "TZ=");
@@ -385,8 +385,8 @@ _("%s: usage is %s [ --version ] [ -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);
(void) perror(_("Error writing to standard output"));
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
/* If exit fails to exit... */
@@ -410,18 +410,25 @@ 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) {
/*
** time_t is signed.
** time_t is signed. Assume overflow wraps around.
*/
register time_t hibit;
time_t t = 0;
time_t t1 = 1;
for (hibit = 1; (hibit * 2) != 0; hibit *= 2)
continue;
absolute_min_time = hibit;
absolute_max_time = -(hibit + 1);
while (t < t1) {
t = t1;
t1 = 2 * t1 + 1;
}
absolute_max_time = t;
t = -t;
absolute_min_time = t - 1;
if (t < absolute_min_time)
absolute_min_time = t;
} else {
/*
** time_t is unsigned.
@@ -464,10 +471,7 @@ const long y;
}
static time_t
hunt(name, lot, hit)
char * name;
time_t lot;
time_t hit;
hunt(char *name, time_t lot, time_t hit)
{
time_t t;
long diff;
@@ -510,7 +514,7 @@ time_t hit;
}
/*
** Thanks to Paul Eggert ([email protected]) for logic used in delta.
** Thanks to Paul Eggert for logic used in delta.
*/
static long
@@ -537,10 +541,7 @@ struct tm * oldp;
}
static void
show(zone, t, v)
char * zone;
time_t t;
int v;
show(char *zone, time_t t, int v)
{
register struct tm * tmp;
+604 -209
View File
File diff suppressed because it is too large Load Diff