|
int | link (const char *target, const char *linkname) |
|
static void | memory_exhausted (const char *msg) pg_attribute_noreturn() |
|
static void | verror (const char *string, va_list args) pg_attribute_printf(1 |
|
static void static void | error (const char *string,...) pg_attribute_printf(1 |
|
static void static void static void | warning (const char *string,...) pg_attribute_printf(1 |
|
static void static void static void static void | usage (FILE *stream, int status) pg_attribute_noreturn() |
|
static void | addtt (zic_t starttime, int type) |
|
static int | addtype (zic_t, char const *, bool, bool, bool) |
|
static void | leapadd (zic_t, int, int) |
|
static void | adjleap (void) |
|
static void | associate (void) |
|
static void | dolink (const char *, const char *, bool) |
|
static char ** | getfields (char *buf) |
|
static zic_t | gethms (const char *string, const char *errstring) |
|
static zic_t | getsave (char *, bool *) |
|
static void | inexpires (char **, int) |
|
static void | infile (const char *filename) |
|
static void | inleap (char **fields, int nfields) |
|
static void | inlink (char **fields, int nfields) |
|
static void | inrule (char **fields, int nfields) |
|
static bool | inzcont (char **fields, int nfields) |
|
static bool | inzone (char **fields, int nfields) |
|
static bool | inzsub (char **, int, bool) |
|
static bool | itsdir (char const *) |
|
static bool | itssymlink (char const *) |
|
static bool | is_alpha (char a) |
|
static char | lowerit (char) |
|
static void | mkdirs (char const *, bool) |
|
static void | newabbr (const char *abbr) |
|
static zic_t | oadd (zic_t t1, zic_t t2) |
|
static void | outzone (const struct zone *zp, ptrdiff_t ntzones) |
|
static zic_t | rpytime (const struct rule *rp, zic_t wantedy) |
|
static void | rulesub (struct rule *rp, const char *loyearp, const char *hiyearp, const char *typep, const char *monthp, const char *dayp, const char *timep) |
|
static zic_t | tadd (zic_t t1, zic_t t2) |
|
static struct lookup const * | byword (const char *string, const struct lookup *lp) |
|
static size_t | size_product (size_t nitems, size_t itemsize) |
|
static void * | memcheck (void *ptr) |
|
static void * | emalloc (size_t size) |
|
static void * | erealloc (void *ptr, size_t size) |
|
static char * | ecpyalloc (char const *str) |
|
static void * | growalloc (void *ptr, size_t itemsize, ptrdiff_t nitems, ptrdiff_t *nitems_alloc) |
|
static void | eats (char const *name, lineno_t num, char const *rname, lineno_t rnum) |
|
static void | eat (char const *name, lineno_t num) |
|
static void | close_file (FILE *stream, char const *dir, char const *name) |
|
static void | change_directory (char const *dir) |
|
static bool | timerange_option (char *timerange) |
|
static bool | want_bloat (void) |
|
int | main (int argc, char **argv) |
|
static bool | componentcheck (char const *name, char const *component, char const *component_end) |
|
static bool | namecheck (const char *name) |
|
static int | hardlinkerr (char const *target, char const *linkname) |
|
static int | rcomp (const void *cp1, const void *cp2) |
|
static zic_t | getleapdatetime (char **fields, int nfields, bool expire_line) |
|
static void | convert (const int32 val, char *const buf) |
|
static void | convert64 (const zic_t val, char *const buf) |
|
static void | puttzcode (const int32 val, FILE *const fp) |
|
static void | puttzcodepass (zic_t val, FILE *fp, int pass) |
|
static int | atcomp (const void *avp, const void *bvp) |
|
static struct timerange | limitrange (struct timerange r, zic_t lo, zic_t hi, zic_t const *ats, unsigned char const *types) |
|
static void | writezone (const char *const name, const char *const string, char version, int defaulttype) |
|
static char const * | abbroffset (char *buf, zic_t offset) |
|
static size_t | doabbr (char *abbr, struct zone const *zp, char const *letters, bool isdst, zic_t save, bool doquotes) |
|
static void | updateminmax (const zic_t x) |
|
static int | stringoffset (char *result, zic_t offset) |
|
static int | stringrule (char *result, struct rule *const rp, zic_t save, zic_t stdoff) |
|
static int | rule_cmp (struct rule const *a, struct rule const *b) |
|
static int | stringzone (char *result, struct zone const *zpfirst, ptrdiff_t zonecount) |
|
static bool | is_space (char a) |
|
static bool | ciequal (const char *ap, const char *bp) |
|
static bool | itsabbr (const char *abbr, const char *word) |
|
static bool | ciprefix (char const *abbr, char const *word) |
|
static void | time_overflow (void) |
|
static void infile |
( |
const char * |
filename | ) |
|
|
static |
Definition at line 1241 of file zic.c.
1252 if (strcmp(
name,
"-") == 0)
1254 name =
_(
"standard input");
1257 else if ((fp = fopen(
name,
"r")) == NULL)
1261 fprintf(stderr,
_(
"%s: Cannot open %s: %s\n"),
1266 for (num = 1;; ++num)
1271 cp = strchr(
buf,
'\n');
1274 error(
_(
"line too long"));
1280 while (fields[nfields] != NULL)
1284 if (strcmp(fields[nfields],
"-") == 0)
1285 fields[nfields] = &nada;
1302 sscanf(
buf,
"#expires %ld", &cl_tmp);
1308 wantcont =
inzcont(fields, nfields);
1312 struct lookup const *line_codes
1315 lp =
byword(fields[0], line_codes);
1317 error(
_(
"input line of unknown type"));
1326 wantcont =
inzone(fields, nfields);
1342 _(
"%s: panic: Invalid l_value %d\n"),
1351 error(
_(
"expected continuation line not found"));
static const char * leapsec
static void inleap(char **fields, int nfields)
static bool inzone(char **fields, int nfields)
static void inexpires(char **, int)
static bool inzcont(char **fields, int nfields)
static struct lookup const zi_line_codes[]
static void inrule(char **fields, int nfields)
static char ** getfields(char *buf)
static struct lookup const leap_line_codes[]
static void inlink(char **fields, int nfields)
References _, buf, byword(), close_file(), comment_leapexpires, eat(), error(), exit(), EXIT_FAILURE, filename, fprintf, free, getfields(), inexpires(), inleap(), inlink(), inrule(), inzcont(), inzone(), lookup::l_value, LC_EXPIRES, LC_LEAP, LC_LINK, LC_RULE, LC_ZONE, leap_line_codes, leapsec, name, progname, strerror, and zi_line_codes.
Referenced by AlterSystemSetConfigFile(), isolation_start_test(), main(), psql_start_test(), and readfile().
static bool inzsub |
( |
char ** |
fields, |
|
|
int |
nfields, |
|
|
bool |
iscont |
|
) |
| |
|
static |
Definition at line 1565 of file zic.c.
1569 static struct zone z;
1605 z.z_stdoff =
gethms(fields[i_stdoff],
_(
"invalid UT offset"));
1606 if ((cp = strchr(fields[i_format],
'%')) != NULL)
1608 if ((*++cp !=
's' && *cp !=
'z') || strchr(cp,
'%')
1609 || strchr(fields[i_format],
'/'))
1611 error(
_(
"invalid abbreviation format"));
1616 z.z_format = cp1 =
ecpyalloc(fields[i_format]);
1617 z.z_format_specifier = cp ? *cp :
'\0';
1618 if (z.z_format_specifier ==
'z')
1621 warning(
_(
"format '%s' not handled by pre-2015 versions of zic"),
1623 cp1[cp - fields[i_format]] =
's';
1627 hasuntil = nfields > i_untilyear;
1630 z.z_untilrule.r_filename =
filename;
1631 z.z_untilrule.r_linenum =
linenum;
1633 fields[i_untilyear],
1636 (nfields > i_untilmonth) ?
1637 fields[i_untilmonth] :
"Jan",
1638 (nfields > i_untilday) ? fields[i_untilday] :
"1",
1639 (nfields > i_untiltime) ? fields[i_untiltime] :
"0");
1640 z.z_untiltime =
rpytime(&z.z_untilrule,
1641 z.z_untilrule.r_loyear);
1642 if (iscont &&
nzones > 0 &&
1649 error(
_(
"Zone continuation line end time is not after end time of previous line"));
static int max_format_len
static ptrdiff_t nzones_alloc
static zic_t rpytime(const struct rule *rp, zic_t wantedy)
References _, ecpyalloc(), error(), filename, gethms(), growalloc(), linenum, max_format_len, max_time, min_time, namecheck(), noise, nzones, nzones_alloc, rule::r_filename, rule::r_linenum, rule::r_loyear, rpytime(), rulesub(), warning(), zone::z_filename, zone::z_format, zone::z_format_specifier, zone::z_linenum, zone::z_name, zone::z_rule, zone::z_stdoff, zone::z_untilrule, zone::z_untiltime, ZF_FORMAT, ZF_NAME, ZF_RULE, ZF_STDOFF, ZF_TILDAY, ZF_TILMONTH, ZF_TILTIME, ZF_TILYEAR, ZFC_FORMAT, ZFC_RULE, ZFC_STDOFF, ZFC_TILDAY, ZFC_TILMONTH, ZFC_TILTIME, ZFC_TILYEAR, and zones.
Referenced by inzcont(), and inzone().
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 652 of file zic.c.
658 bool timerange_given =
false;
667 _(
"wild compilation-time specification of zic_t"));
670 for (k = 1; k < argc; k++)
671 if (strcmp(argv[k],
"--version") == 0)
673 printf(
"zic %s\n", PG_VERSION);
677 else if (strcmp(argv[k],
"--help") == 0)
681 while ((
c =
getopt(argc, argv,
"b:d:l:L:p:Pr:st:vy:")) != EOF &&
c != -1)
687 if (strcmp(
optarg,
"slim") == 0)
690 error(
_(
"incompatible -b options"));
693 else if (strcmp(
optarg,
"fat") == 0)
696 error(
_(
"incompatible -b options"));
708 _(
"%s: More than one -d option specified\n"),
719 _(
"%s: More than one -l option specified\n"),
730 _(
"%s: More than one -p option specified\n"),
739 _(
"%s: More than one -t option"
755 _(
"%s: More than one -L option specified\n"),
771 _(
"%s: More than one -r option specified\n"),
778 _(
"%s: invalid time range: %s\n"),
782 timerange_given =
true;
788 if (
optind == argc - 1 && strcmp(argv[
optind],
"=") == 0)
794 if (strcmp(bloat_default,
"slim") == 0)
796 else if (strcmp(bloat_default,
"fat") == 0)
812 for (k =
optind; k < argc; k++)
837 if (strcmp(
links[
i].l_linkname,
843 eat(
_(
"command line"), 1);
848 eat(
_(
"command line"), 1);
851 if (
warnings && (ferror(stderr) || fclose(stderr) != 0))
int getopt(int nargc, char *const *nargv, const char *ostr)
PGDLLIMPORT char * optarg
#define ZIC_BLOAT_DEFAULT
static void change_directory(char const *dir)
static bool print_abbrevs
static void outzone(const struct zone *zp, ptrdiff_t ntzones)
static zic_t print_cutoff
static void infile(const char *filename)
static bool timerange_option(char *timerange)
static void dolink(const char *, const char *, bool)
static void static void static void static void usage(FILE *stream, int status) pg_attribute_noreturn()
static void adjleap(void)
static void associate(void)
References _, adjleap(), associate(), bloat, change_directory(), close_file(), directory, dolink(), eat(), error(), errors, EXIT_FAILURE, EXIT_SUCCESS, fprintf, getopt(), i, infile(), j, lcltime, leapsec, links, nlinks, noise, nzones, optarg, optind, outzone(), print_abbrevs, print_cutoff, printf, progname, psxrules, S_IWGRP, S_IWOTH, generate_unaccent_rules::stdout, timerange_option(), TYPE_BIT, TZDEFAULT, tzdefault, TZDEFRULES, usage(), warning(), warnings, zone::z_name, ZIC_BLOAT_DEFAULT, and zones.
static void outzone |
( |
const struct zone * |
zp, |
|
|
ptrdiff_t |
ntzones |
|
) |
| |
|
static |
Definition at line 2944 of file zic.c.
2946 const struct zone *zp;
2970 ptrdiff_t lastatmax = -1;
2972 zic_t y2038_boundary = one << 31;
2974 int defaulttype = -1;
2977 max_envvar_len = 2 * max_abbr_len + 5 * 9;
2978 startbuf =
emalloc(max_abbr_len + 1);
2979 ab =
emalloc(max_abbr_len + 1);
2980 envvar =
emalloc(max_envvar_len + 1);
2990 prodstic = zonecount == 1;
2996 startttisstd =
false;
2997 startttisut =
false;
3004 for (
i = 0;
i < zonecount; ++
i)
3007 if (
i < zonecount - 1)
3031 _(
"no POSIX environment variable for zone"),
3039 warning(
_(
"%s: pre-%d clients may mishandle"
3040 " distant timestamps"),
3041 zpfirst->z_name,
compat);
3095 for (
i = 0;
i < zonecount; ++
i)
3097 struct rule *prevrp = NULL;
3104 usestart =
i > 0 && (zp - 1)->z_untiltime >
min_time;
3105 useuntil =
i < (zonecount - 1);
3117 startbuf, zp->
z_isdst, startttisstd,
3149 = (rp->
r_temp < y2038_boundary
3150 || year <= max_year0);
3169 untiltime =
tadd(untiltime,
3172 untiltime =
tadd(untiltime,
3190 offset =
oadd(offset, save);
3195 jtime =
tadd(jtime, -offset);
3196 if (k < 0 || jtime < ktime)
3201 else if (jtime == ktime)
3203 char const *dup_rules_msg =
3204 _(
"two rules for same instant");
3212 error(
"%s", dup_rules_msg);
3219 if (useuntil && ktime >= untiltime)
3222 if (usestart && ktime == starttime)
3226 if (ktime < starttime)
3237 if (*startbuf ==
'\0'
3261 if (defaulttype < 0 && !rp->
r_isdst)
3273 if (*startbuf ==
'\0' &&
3275 strchr(zp->
z_format,
'%') == NULL &&
3279 if (*startbuf ==
'\0')
3280 error(
_(
"cannot determine time zone abbreviation to use just after until time"));
3283 bool isdst = startoff != zp->
z_stdoff;
3286 startttisstd, startttisut);
3287 if (defaulttype < 0 && !isdst)
3302 starttime =
tadd(starttime, -save);
3304 starttime =
tadd(starttime, -stdoff);
3307 if (defaulttype < 0)
3327 xr.r_dayofmonth = 1;
3335 lastat ? lastat->
type : defaulttype);
3339 writezone(zpfirst->z_name, envvar, version, defaulttype);
static int addtype(zic_t, char const *, bool, bool, bool)
#define ZIC_VERSION_PRE_2013
static int stringzone(char *result, struct zone const *zpfirst, ptrdiff_t zonecount)
static void writezone(const char *const name, const char *const string, char version, int defaulttype)
static void addtt(zic_t starttime, int type)
static void updateminmax(const zic_t x)
static size_t doabbr(char *abbr, struct zone const *zp, char const *letters, bool isdst, zic_t save, bool doquotes)
References _, addtt(), addtype(), attype::at, attypes, charcnt, compat, DC_DOM, doabbr(), attype::dontmerge, eat(), eats(), emalloc(), EPOCH_YEAR, error(), free, i, INITIALIZE, j, leapmaxyear, leapminyear, leapseen, max_abbrvar_len, max_format_len, max_time, max_year, min_time, min_year, noise, oadd(), rule::r_abbrvar, rule::r_dayofmonth, rule::r_dycode, rule::r_filename, rule::r_hiwasnum, rule::r_hiyear, rule::r_isdst, rule::r_linenum, rule::r_lowasnum, rule::r_loyear, rule::r_month, rule::r_save, rule::r_temp, rule::r_tod, rule::r_todisstd, rule::r_todisut, rule::r_todo, rpytime(), stringzone(), tadd(), timecnt, TM_JANUARY, generate_unaccent_rules::type, attype::type, typecnt, updateminmax(), want_bloat(), warning(), writezone(), YEARSPERREPEAT, zone::z_filename, zone::z_format, zone::z_isdst, zone::z_linenum, zone::z_name, zone::z_nrules, zone::z_rules, zone::z_save, zone::z_stdoff, zone::z_untilrule, zone::z_untiltime, ZIC_MAX, ZIC_MIN, ZIC_VERSION, and ZIC_VERSION_PRE_2013.
Referenced by main().
static void rulesub |
( |
struct rule * |
rp, |
|
|
const char * |
loyearp, |
|
|
const char * |
hiyearp, |
|
|
const char * |
typep, |
|
|
const char * |
monthp, |
|
|
const char * |
dayp, |
|
|
const char * |
timep |
|
) |
| |
|
static |
Definition at line 1821 of file zic.c.
1836 error(
_(
"invalid month name"));
1845 ep = dp + strlen(dp) - 1;
1887 _(
"%s: panic: Invalid l_value %d\n"),
1891 else if (sscanf(cp,
"%d%c", &year_tmp, &xs) == 1)
1895 error(
_(
"invalid starting year"));
1915 _(
"%s: panic: Invalid l_value %d\n"),
1919 else if (sscanf(cp,
"%d%c", &year_tmp, &xs) == 1)
1923 error(
_(
"invalid ending year"));
1928 error(
_(
"starting year greater than ending year"));
1933 error(
_(
"year type \"%s\" is unsupported; use \"-\" instead"),
1951 if ((ep = strchr(dp,
'<')) != NULL)
1953 else if ((ep = strchr(dp,
'>')) != NULL)
1965 error(
_(
"invalid day of month"));
1971 error(
_(
"invalid weekday name"));
1981 error(
_(
"invalid day of month"));
static struct lookup const begin_years[]
static struct lookup const end_years[]
References _, begin_years, byword(), DC_DOM, DC_DOWGEQ, DC_DOWLEQ, ecpyalloc(), end_years, error(), exit(), EXIT_FAILURE, fprintf, free, gethms(), lookup::l_value, lasts, len_months, lowerit(), mon_names, progname, rule::r_dayofmonth, rule::r_dycode, rule::r_hiwasnum, rule::r_hiyear, rule::r_lowasnum, rule::r_loyear, rule::r_month, rule::r_tod, rule::r_todisstd, rule::r_todisut, rule::r_wday, wday_names, YR_MAXIMUM, YR_MINIMUM, YR_ONLY, ZIC_MAX, and ZIC_MIN.
Referenced by inrule(), and inzsub().
static int stringzone |
( |
char * |
result, |
|
|
struct zone const * |
zpfirst, |
|
|
ptrdiff_t |
zonecount |
|
) |
| |
|
static |
Definition at line 2809 of file zic.c.
2811 const struct zone *zp;
2816 const char *abbrvar;
2833 zp = zpfirst + zonecount - 1;
2834 stdrp = dstrp = NULL;
2855 if (stdrp == NULL && dstrp == NULL)
2861 struct rule *stdabbrrp = NULL;
2871 if (stdrp != NULL && stdrp->
r_isdst)
2876 dstr.r_dayofmonth = 1;
2878 dstr.r_todisstd = dstr.r_todisut =
false;
2879 dstr.r_isdst = stdrp->
r_isdst;
2880 dstr.r_save = stdrp->
r_save;
2884 stdr.r_dayofmonth = 31;
2886 stdr.r_todisstd = stdr.r_todisut =
false;
2887 stdr.r_isdst =
false;
2890 = (stdabbrrp ? stdabbrrp->
r_abbrvar :
"");
2897 abbrvar = (stdrp == NULL) ?
"" : stdrp->
r_abbrvar;
2898 len =
doabbr(result, zp, abbrvar,
false, 0,
true);
2921 result[
len++] =
',';
2930 len += strlen(result +
len);
2931 result[
len++] =
',';
static int stringrule(char *result, struct rule *const rp, zic_t save, zic_t stdoff)
static int rule_cmp(struct rule const *a, struct rule const *b)
References compat, DC_DOM, doabbr(), hi_time, i, len, max_time, MINSPERHOUR, rule::r_abbrvar, rule::r_dayofmonth, rule::r_dycode, rule::r_hiwasnum, rule::r_hiyear, rule::r_isdst, rule::r_month, rule::r_save, rule::r_tod, rule::r_todisstd, rule::r_todisut, rule_cmp(), SECSPERDAY, SECSPERMIN, stringoffset(), stringrule(), TM_DECEMBER, TM_JANUARY, zone::z_isdst, zone::z_nrules, zone::z_rules, zone::z_stdoff, and ZIC_MAX.
Referenced by outzone().
static void writezone |
( |
const char *const |
name, |
|
|
const char *const |
string, |
|
|
char |
version, |
|
|
int |
defaulttype |
|
) |
| |
|
static |
Definition at line 2080 of file zic.c.
2087 static const struct tzhead tzh0;
2088 static struct tzhead tzh;
2089 bool dir_checked =
false;
2091 zic_t y2038_boundary = one << 31;
2099 void *typesptr = ats + nats;
2100 unsigned char *
types = typesptr;
2120 for (; fromi <
timecnt; ++fromi)
2149 warning(
_(
"reference clients mishandle"
2150 " more than %d transition times"),
2153 warning(
_(
"pre-2014 clients may mishandle"
2154 " more than 1200 transition times"));
2190 && ats[
timecnt - 1] < y2038_boundary - 1 && strchr(
string,
'<'))
2192 ats[
timecnt] = y2038_boundary - 1;
2198 rangeall.base = rangeall.leapbase = 0;
2207 if (remove(
name) == 0)
2209 else if (errno != ENOENT)
2213 fprintf(stderr,
_(
"%s: Cannot remove %s/%s: %s\n"),
2217 fp = fopen(
name,
"wb");
2220 int fopen_errno = errno;
2222 if (fopen_errno == ENOENT && !dir_checked)
2225 fp = fopen(
name,
"wb");
2226 fopen_errno = errno;
2230 fprintf(stderr,
_(
"%s: Cannot create %s/%s: %s\n"),
2235 for (pass = 1; pass <= 2; ++pass)
2237 ptrdiff_t thistimei,
2273 ? range64.defaulttype
2274 : range32.defaulttype);
2276 thistimei = range32.base;
2277 thistimecnt = range32.count;
2278 toomanytimes = thistimecnt >> 31 >> 1 != 0;
2279 thisleapi = range32.leapbase;
2280 thisleapcnt = range32.leapcount;
2286 thisdefaulttype = range64.defaulttype;
2287 thistimei = range64.base;
2288 thistimecnt = range64.count;
2289 toomanytimes = thistimecnt >> 31 >> 31 >> 2 != 0;
2290 thisleapi = range64.leapbase;
2291 thisleapcnt = range64.leapcount;
2296 error(
_(
"too many transition times"));
2306 if (0 < thistimei && ats[thistimei] !=
lo_time)
2313 thistimelim = thistimei + thistimecnt;
2314 thisleaplim = thisleapi + thisleapcnt;
2315 if (thistimecnt != 0)
2317 if (ats[thistimei] ==
lo_time)
2322 memset(omittype,
true,
typecnt);
2323 omittype[thisdefaulttype] =
false;
2324 for (
i = thistimei;
i < thistimelim;
i++)
2325 omittype[
types[
i]] =
false;
2332 old0 = strlen(omittype);
2334 #ifndef LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH
2350 hidst = histd = mrudst = mrustd = -1;
2351 for (
i = thistimei;
i < thistimelim; ++
i)
2358 int h = (
i == old0 ? thisdefaulttype
2359 :
i == thisdefaulttype ? old0 :
i);
2369 if (hidst >= 0 && mrudst >= 0 && hidst != mrudst &&
2379 omittype[
type] =
false;
2381 if (histd >= 0 && mrustd >= 0 && histd != mrustd &&
2391 omittype[
type] =
false;
2399 typemap[
i == old0 ? thisdefaulttype
2400 :
i == thisdefaulttype ? old0 :
i]
2403 for (
i = 0;
i <
sizeof indmap /
sizeof indmap[0]; ++
i)
2405 thischarcnt = stdcnt = utcnt = 0;
2413 stdcnt = thistypecnt;
2415 utcnt = thistypecnt;
2419 for (
j = 0;
j < thischarcnt; ++
j)
2420 if (strcmp(&thischars[
j], thisabbr) == 0)
2422 if (
j == thischarcnt)
2424 strcpy(&thischars[thischarcnt], thisabbr);
2425 thischarcnt += strlen(thisabbr) + 1;
2431 utcnt = stdcnt = thisleapcnt = 0;
2432 thistimecnt = -(locut + hicut);
2433 thistypecnt = thischarcnt = 1;
2434 thistimelim = thistimei;
2436 #define DO(field) fwrite(tzh.field, sizeof tzh.field, 1, fp)
2438 memcpy(tzh.tzh_magic,
TZ_MAGIC,
sizeof tzh.tzh_magic);
2439 tzh.tzh_version[0] = version;
2440 convert(utcnt, tzh.tzh_ttisutcnt);
2441 convert(stdcnt, tzh.tzh_ttisstdcnt);
2442 convert(thisleapcnt, tzh.tzh_leapcnt);
2443 convert(locut + thistimecnt + hicut, tzh.tzh_timecnt);
2444 convert(thistypecnt, tzh.tzh_typecnt);
2445 convert(thischarcnt, tzh.tzh_charcnt);
2470 for (
i = thistimei;
i < thistimelim; ++
i)
2475 char *thisabbrev = &thischars[indmap[
desigidx[
tm]]];
2484 if (thistimei >= thistimelim)
2487 char *thisabbrev = &thischars[indmap[
desigidx[
tm]]];
2504 for (
i = thistimei;
i < thistimelim; ++
i)
2506 zic_t at = ats[
i] < lo ? lo : ats[
i];
2514 putc(currenttype, fp);
2515 for (
i = thistimei;
i < thistimelim; ++
i)
2517 currenttype = typemap[
types[
i]];
2518 putc(currenttype, fp);
2521 putc(currenttype, fp);
2525 int h = (
i == old0 ? thisdefaulttype
2526 :
i == thisdefaulttype ? old0 :
i);
2535 if (thischarcnt != 0)
2536 fwrite(thischars,
sizeof thischars[0],
2538 for (
i = thisleapi;
i < thisleaplim; ++
i)
2578 fprintf(fp,
"\n%s\n",
string);
static int atcomp(const void *avp, const void *bvp)
static void puttzcodepass(zic_t val, FILE *fp, int pass)
static struct timerange limitrange(struct timerange r, zic_t lo, zic_t hi, zic_t const *ats, unsigned char const *types)
References _, addtype(), attype::at, atcomp(), attypes, timerange::base, chars, close_file(), convert(), corr, timerange::count, timerange::defaulttype, desigidx, directory, DO, emalloc(), error(), exit(), EXIT_FAILURE, fprintf, free, hi_time, i, INT64_FORMAT, isdsts, j, timerange::leapbase, leapcnt, timerange::leapcount, limitrange(), lo_time, max_time, MAXALIGN, min_time, mkdirs(), name, noise, PG_INT32_MAX, PG_INT32_MIN, print_abbrevs, print_cutoff, progname, puttzcode(), puttzcodepass(), qsort, roll, size_product(), generate_unaccent_rules::stdout, strerror, tadd(), timecnt, tm, trans, ttisstds, ttisuts, generate_unaccent_rules::type, attype::type, typecnt, types, TZ_MAGIC, TZ_MAX_CHARS, TZ_MAX_TIMES, TZ_MAX_TYPES, tzhead::tzh_charcnt, tzhead::tzh_leapcnt, tzhead::tzh_magic, tzhead::tzh_timecnt, tzhead::tzh_ttisstdcnt, tzhead::tzh_ttisutcnt, tzhead::tzh_typecnt, tzhead::tzh_version, utoffs, want_bloat(), warning(), WORK_AROUND_QTBUG_53071, and ZIC_MAX.
Referenced by outzone().