]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/tools/tzcode/patch-icu-tzcode
ICU-6.2.13.tar.gz
[apple/icu.git] / icuSources / tools / tzcode / patch-icu-tzcode
index 37da13800f38a856e59c42356f9c58265cc5b06e..0985c79cfe250d9cc33bc6a5b0437684dcb7dcd5 100644 (file)
@@ -1,6 +1,6 @@
 diff -u -r ../tzcode.orig/Makefile ./Makefile
---- ../tzcode.orig/Makefile    2003-12-15 06:33:34.000000000 -0800
-+++ ./Makefile 2004-05-24 14:30:31.659356800 -0700
+--- Makefile.orig      2006-11-27 05:54:05.000000000 -0800
++++ Makefile   2006-12-06 14:54:28.000000000 -0800
 @@ -40,7 +40,7 @@
  # (and subdirectories).
  # Use an absolute path name for TZDIR unless you're just testing the software.
@@ -10,7 +10,7 @@ diff -u -r ../tzcode.orig/Makefile ./Makefile
  
  # The "tzselect", "zic", and "zdump" commands get installed in. . .
  
-@@ -239,9 +239,11 @@
+@@ -241,9 +241,11 @@
  
  ###############################################################################
  
@@ -22,20 +22,20 @@ diff -u -r ../tzcode.orig/Makefile ./Makefile
 +
  TZCSRCS=      zic.c localtime.c asctime.c scheck.c ialloc.c
  TZCOBJS=      zic.o localtime.o asctime.o scheck.o ialloc.o
- TZDSRCS=      zdump.c localtime.c asctime.c ialloc.c
-@@ -275,7 +277,10 @@
+ TZDSRCS=      zdump.c localtime.c ialloc.c
+@@ -278,7 +280,10 @@
  
  SHELL=                /bin/sh
  
 -all:          tzselect zic zdump $(LIBOBJS)
-+LS=           /usr/bin/ls
++LS=           /bin/ls
 +SED=          /usr/bin/sed
 +
 +all:          tzselect zic zdump $(LIBOBJS) tz2icu
  
  ALL:          all date
  
-@@ -308,9 +313,12 @@
+@@ -311,9 +316,12 @@
  zdump:                $(TZDOBJS)
                $(CC) $(CFLAGS) $(LFLAGS) $(TZDOBJS) $(LDLIBS) -o $@
  
@@ -49,7 +49,7 @@ diff -u -r ../tzcode.orig/Makefile ./Makefile
  yearistype:   yearistype.sh
                cp yearistype.sh yearistype
                chmod +x yearistype
-@@ -321,6 +329,9 @@
+@@ -324,6 +332,9 @@
  right_only:   zic leapseconds $(TDATA)
                $(ZIC) -y $(YEARISTYPE) -d $(TZDIR) -L leapseconds $(TDATA)
  
@@ -60,9 +60,9 @@ diff -u -r ../tzcode.orig/Makefile ./Makefile
  # subdirectories of $(TZDIR).  However, this led to configuration errors.
  # For example, with posix_right under the earlier scheme,
 diff -u -r ../tzcode.orig/zic.c ./zic.c
---- ../tzcode.orig/zic.c       2003-12-15 06:36:35.000000000 -0800
-+++ ./zic.c    2004-05-24 14:03:43.937566400 -0700
-@@ -13,6 +13,20 @@
+--- zic.c.orig 2006-12-06 14:29:17.000000000 -0800
++++ zic.c      2006-12-06 14:51:36.000000000 -0800
+@@ -26,6 +26,20 @@
  #define MKDIR_UMASK 0755
  #endif
  
@@ -82,11 +82,11 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
 +
  /*
  ** On some ancient hosts, predicates like `isspace(C)' are defined
- ** only if isascii(C) || C == EOF.  Modern hosts obey the C Standard,
-@@ -86,8 +100,14 @@
+ ** only if isascii(C) || C == EOF. Modern hosts obey the C Standard,
+@@ -106,8 +120,14 @@
  extern int    optind;
  
- static void   addtt P((time_t starttime, int type));
+ static void   addtt P((zic_t starttime, int type));
 +#ifdef ICU
 +static int    addtype P((long gmtoff, long rawoff, long dstoff,
 +                              const char * abbr, int isdst,
@@ -95,10 +95,10 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
  static int    addtype P((long gmtoff, const char * abbr, int isdst,
                                int ttisstd, int ttisgmt));
 +#endif
- static void   leapadd P((time_t t, int positive, int rolling, int count));
+ static void   leapadd P((zic_t t, int positive, int rolling, int count));
  static void   adjleap P((void));
  static void   associate P((void));
-@@ -256,6 +276,18 @@
+@@ -287,6 +307,18 @@
        const int       l_value;
  };
  
@@ -117,7 +117,7 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
  static struct lookup const *  byword P((const char * string,
                                        const struct lookup * lp));
  
-@@ -338,6 +370,11 @@
+@@ -369,6 +401,11 @@
        unsigned char   type;
  }                     attypes[TZ_MAX_TIMES];
  static long           gmtoffs[TZ_MAX_TYPES];
@@ -129,8 +129,8 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
  static char           isdsts[TZ_MAX_TYPES];
  static unsigned char  abbrinds[TZ_MAX_TYPES];
  static char           ttisstds[TZ_MAX_TYPES];
-@@ -447,6 +484,62 @@
-       (void) exit(EXIT_FAILURE);
+@@ -480,6 +517,62 @@
+       exit(EXIT_FAILURE);
  }
  
 +#ifdef ICU
@@ -192,7 +192,7 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
  static const char *   psxrules;
  static const char *   lcltime;
  static const char *   directory;
-@@ -554,6 +647,14 @@
+@@ -591,6 +684,14 @@
                adjleap();
        }
  
@@ -207,17 +207,17 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
        for (i = optind; i < argc; ++i)
                infile(argv[i]);
        if (errors)
-@@ -573,6 +674,9 @@
+@@ -610,6 +711,9 @@
        for (i = 0; i < nlinks; ++i) {
                eat(links[i].l_filename, links[i].l_linenum);
                dolink(links[i].l_from, links[i].l_to);
 +#ifdef ICU
-+                emit_icu_link(icuFile, links[i].l_from, links[i].l_to);
++        emit_icu_link(icuFile, links[i].l_from, links[i].l_to);
 +#endif
-       }
-       if (lcltime != NULL) {
-               eat("command line", 1);
-@@ -582,6 +686,11 @@
+               if (noise)
+                       for (j = 0; j < nlinks; ++j)
+                               if (strcmp(links[i].l_to,
+@@ -624,6 +728,11 @@
                eat("command line", 1);
                dolink(psxrules, TZDEFRULES);
        }
@@ -229,43 +229,43 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
        return (errors == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
  }
  
-@@ -642,7 +751,9 @@
+@@ -689,7 +798,9 @@
                        (void) fprintf(stderr,
                                _("%s: Can't link from %s to %s: %s\n"),
                                progname, fromname, toname, e);
 +#ifndef ICU_LINKS
-                       (void) exit(EXIT_FAILURE);
+                       exit(EXIT_FAILURE);
 +#endif
                }
        }
        ifree(fromname);
-@@ -1503,7 +1614,12 @@
-       convert(eitol(timecnt), tzh.tzh_timecnt);
-       convert(eitol(typecnt), tzh.tzh_typecnt);
-       convert(eitol(charcnt), tzh.tzh_charcnt);
+@@ -1655,7 +1766,12 @@
+ #define DO(field)     (void) fwrite((void *) tzh.field, \
+                               (size_t) sizeof tzh.field, (size_t) 1, fp)
+               tzh = tzh0;
 +#ifdef ICU
 +        * (ICUZoneinfoVersion*) &tzh.tzh_reserved = TZ_ICU_VERSION;
 +      (void) strncpy(tzh.tzh_magic, TZ_ICU_MAGIC, sizeof tzh.tzh_magic);
 +#else
-       (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
+               (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
 +#endif
- #define DO(field)     (void) fwrite((void *) tzh.field, (size_t) sizeof tzh.field, (size_t) 1, fp)
-       DO(tzh_magic);
-       DO(tzh_reserved);
-@@ -1527,7 +1643,12 @@
-               (void) fwrite((void *) types, (size_t) sizeof types[0],
-                       (size_t) timecnt, fp);
-       for (i = 0; i < typecnt; ++i) {
+               tzh.tzh_version[0] = ZIC_VERSION;
+               convert(eitol(thistypecnt), tzh.tzh_ttisgmtcnt);
+               convert(eitol(thistypecnt), tzh.tzh_ttisstdcnt);
+@@ -1688,7 +1804,12 @@
+               }
+               for (i = 0; i < typecnt; ++i)
+                       if (writetype[i]) {
 +#ifdef ICU
 +              puttzcode((long) rawoffs[i], fp);
 +              puttzcode((long) dstoffs[i], fp);
 +#else
-               puttzcode((long) gmtoffs[i], fp);
+                               puttzcode(gmtoffs[i], fp);
 +#endif
-               (void) putc(isdsts[i], fp);
-               (void) putc(abbrinds[i], fp);
-       }
-@@ -1583,6 +1704,24 @@
+                               (void) putc(isdsts[i], fp);
+                               (void) putc((unsigned char) indmap[abbrinds[i]], fp);
+                       }
+@@ -1957,6 +2078,24 @@
        }
  }
  
@@ -290,19 +290,19 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
  static void
  outzone(zpfirst, zonecount)
  const struct zone * const     zpfirst;
-@@ -1601,6 +1740,11 @@
-       register int                    startttisgmt;
-       register int                    type;
-       char                            startbuf[BUFSIZ];
+@@ -1979,6 +2118,11 @@
+       register char *                 envvar;
+       register int                    max_abbr_len;
+       register int                    max_envvar_len;
 +#ifdef ICU
 +        int                  finalRuleYear, finalRuleIndex;
 +        const struct rule*   finalRule1;
 +        const struct rule*   finalRule2;
 +#endif
  
-       INITIALIZE(untiltime);
-       INITIALIZE(starttime);
-@@ -1630,11 +1774,55 @@
+       max_abbr_len = 2 + max_format_len + max_abbrvar_len;
+       max_envvar_len = 2 * max_abbr_len + 5 * 9;
+@@ -2055,11 +2199,55 @@
                eat(zp->z_filename, zp->z_linenum);
                *startbuf = '\0';
                startoff = zp->z_gmtoff;
@@ -350,7 +350,7 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
                if (zp->z_nrules == 0) {
                        stdoff = zp->z_stdoff;
                        doabbr(startbuf, zp->z_format,
-                               (char *) NULL, stdoff != 0);
+                               (char *) NULL, stdoff != 0, FALSE);
                        type = addtype(oadd(zp->z_gmtoff, stdoff),
 +#ifdef ICU
 +                                zp->z_gmtoff, stdoff,
@@ -358,7 +358,7 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
                                startbuf, stdoff != 0, startttisstd,
                                startttisgmt);
                        if (usestart) {
-@@ -1708,6 +1896,15 @@
+@@ -2132,6 +2320,15 @@
                                        break;  /* go on to next year */
                                rp = &zp->z_rules[k];
                                rp->r_todo = FALSE;
@@ -374,22 +374,22 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
                                if (useuntil && ktime >= untiltime)
                                        break;
                                stdoff = rp->r_stdoff;
-@@ -1735,8 +1932,14 @@
-                               doabbr(buf, zp->z_format, rp->r_abbrvar,
-                                       rp->r_stdoff != 0);
+@@ -2163,8 +2360,14 @@
+                               doabbr(ab, zp->z_format, rp->r_abbrvar,
+                                       rp->r_stdoff != 0, FALSE);
                                offset = oadd(zp->z_gmtoff, rp->r_stdoff);
 +#ifdef ICU
 +                              type = addtype(offset, zp->z_gmtoff, rp->r_stdoff,
-+                                        buf, rp->r_stdoff != 0,
++                                        ab, rp->r_stdoff != 0,
 +                                      rp->r_todisstd, rp->r_todisgmt);
 +#else
-                               type = addtype(offset, buf, rp->r_stdoff != 0,
+                               type = addtype(offset, ab, rp->r_stdoff != 0,
                                        rp->r_todisstd, rp->r_todisgmt);
 +#endif
                                addtt(ktime, type);
                        }
                }
-@@ -1750,10 +1953,19 @@
+@@ -2178,10 +2381,19 @@
                        if (*startbuf == '\0')
  error(_("can't determine time zone abbreviation to use just after until time"));
                        else    addtt(starttime,
@@ -409,7 +409,7 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
                }
                /*
                ** Now we may get to set starttime for the next zone line.
-@@ -1779,6 +1991,10 @@
+@@ -2210,6 +2422,10 @@
        if (starttime <= min_time ||
                (timecnt == 1 && attypes[0].at < min_time)) {
                gmtoffs[0] = gmtoffs[type];
@@ -420,7 +420,7 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
                isdsts[0] = isdsts[type];
                ttisstds[0] = ttisstds[type];
                ttisgmts[0] = ttisgmts[type];
-@@ -1800,8 +2016,15 @@
+@@ -2231,8 +2447,15 @@
  }
  
  static int
@@ -436,9 +436,9 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
  const char * const    abbr;
  const int             isdst;
  const int             ttisstd;
-@@ -1821,12 +2044,25 @@
+@@ -2252,12 +2475,25 @@
                error(_("internal error - addtype called with bad ttisgmt"));
-               (void) exit(EXIT_FAILURE);
+               exit(EXIT_FAILURE);
        }
 +#ifdef ICU
 +      if (isdst != (dstoff != 0)) {
@@ -462,8 +462,8 @@ diff -u -r ../tzcode.orig/zic.c ./zic.c
                        strcmp(abbr, &chars[abbrinds[i]]) == 0 &&
                        ttisstd == ttisstds[i] &&
                        ttisgmt == ttisgmts[i])
-@@ -1841,6 +2077,10 @@
-               (void) exit(EXIT_FAILURE);
+@@ -2272,6 +2508,10 @@
+               exit(EXIT_FAILURE);
        }
        gmtoffs[i] = gmtoff;
 +#ifdef ICU