35#define SCNdZIC SCNdFAST64
37#ifndef ZIC_MAX_ABBR_LEN_WO_WARN
38#define ZIC_MAX_ABBR_LEN_WO_WARN 6
52#define ALL_PERMS (S_IRWXU | S_IRWXG | S_IRWXO)
55#define TROUBLE_PERMS (S_IWGRP | S_IWOTH)
61#define MKDIR_PERMS (ALL_PERMS & ~TROUBLE_PERMS)
67#define CREAT_PERMS (MKDIR_PERMS & ~(S_IXUSR | S_IXGRP | S_IXOTH))
75#define GID_T_MAX MAXVAL(gid_t, TYPE_BIT(gid_t))
78#define UID_T_MAX MAXVAL(uid_t, TYPE_BIT(uid_t))
86#if __STDC_VERSION__ < 201112 || defined __SUNPRO_C
87#define alignof(type) offsetof(struct { char a; type b; }, b)
88#elif __STDC_VERSION__ < 202311
94#define TZDEFRULES "posixrules"
98#ifndef _POSIX2_LINE_MAX
99#define _POSIX2_LINE_MAX 2048
167#ifndef AT_SYMLINK_FOLLOW
168#define linkat(targetdir, target, linknamedir, linkname, flag) \
169 (errno = ENOTSUP, -1)
214 return '0' <=
c &&
c <=
'9';
461 {
"Stationary",
false},
466 {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
467 {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
584#if defined ckd_add && defined ckd_mul
627 return _(
"command line");
632 return strcmp(fname,
"-") == 0 ?
_(
"standard input") : fname;
714#define MODE_T_MAX MAXVAL(mode_t, TYPE_BIT(mode_t))
718#if (defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ \
719 || (defined __APPLE__ && defined __MACH__))
720#define HAVE_SETMODE 1
722#define HAVE_SETMODE 0
744 N_(
"%s: -m '%s': invalid mode\n"));
775 char const *
e = (
ferror(stream) ?
_(
"I/O error")
786 dir ? dir :
"", dir ?
"/" :
"",
806 _(
"%s: usage is %s [ --version ] [ --help ] [ -v ] [ -P ] \\\n"
807 "\t[ -b {slim|fat} ] [ -d directory ] [ -D ] \\\n"
808 "\t[ -l localtime ] [ -L leapseconds ] [ -m mode ] \\\n"
809 "\t[ -p posixrules ] [ -r '[@lo][/@hi]' ] [ -R @hi ] \\\n"
810 "\t[ -t localtime-link ] [ -u 'owner[:group]' ] \\\n"
811 "\t[ filename ... ]\n\n"
812 "Report bugs to %s.\n"),
836 N_(
"%s: invalid group: %s\n")));
859 N_(
"%s: invalid owner: %s\n")));
1027 error(
_(
"\"Link %s %s\" is part of a link cycle"),
1066 warning(
_(
"link %s targeting link %s mishandled by pre-2023 zic"),
1070 warning(
_(
"link %s targeting link %s"),
1098 static int const signals[] = {
1248#ifndef ZIC_BLOAT_DEFAULT
1249#define ZIC_BLOAT_DEFAULT "slim"
1262 progname = argv[0] ? argv[0] :
"zic";
1266 _(
"wild compilation-time specification of zic_t"));
1269 for (k = 1; k < argc; k++)
1270 if (
strcmp(argv[k],
"--version") == 0)
1276 else if (
strcmp(argv[k],
"--help") == 0)
1280 while ((
c =
getopt(argc, argv,
"b:d:Dg:l:L:m:p:Pr:R:st:u:vy:")) != -1)
1289 error(
_(
"incompatible -b options"));
1295 error(
_(
"incompatible -b options"));
1332 " and likely ineffective"));
1372 _(
"%s: invalid time range: %s\n"),
1421 for (k =
optind; k < argc; k++)
1468 error(
_(
"empty file name"));
1471 ?
"file name '%s' begins with '/'"
1473 ?
"file name '%s' contains '//'"
1474 :
"file name '%s' ends with '/'"),
1483 error(
_(
"file name '%s' contains '%.*s' component"),
1490 warning(
_(
"file name '%s' component contains leading '-'"),
1493 warning(
_(
"file name '%s' contains overlength component"
1506 static char const benign[] =
1508 "abcdefghijklmnopqrstuvwxyz"
1509 "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
1516 " !\"#$%&'()*+,.0123456789:;<=>?@[\\]^`{|}~";
1522 unsigned char c = *
cp;
1527 ?
_(
"file name '%s' contains byte '%c'")
1528 :
_(
"file name '%s' contains byte '\\%o'")),
1627 char const *src = *
name;
1629 static char const prefix[] =
".zic";
1631 "abcdefghijklmnopqrstuvwxyz"
1632 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
1789 char const *f = target;
1844 for (; *
a == *
b;
a++,
b++)
1860 if (
strcmp(target,
"-") == 0)
1962 warning(
_(
"symbolic link used because hard link failed: %s"),
1972 fp =
fopen(target,
"rb");
1987 warning(
_(
"copy used because hard link failed: %s"),
1991 warning(
_(
"copy used because symbolic link not obvious"));
1993 warning(
_(
"copy used because symbolic link failed: %s"),
2060 warning(
_(
"same rule name in multiple files"));
2062 warning(
_(
"same rule name in multiple files"));
2084 for (base = 0; base <
nrules; base = out)
2087 for (out = base + 1; out <
nrules; ++out)
2096 zp->z_nrules = out - base;
2102 if (
zp->z_nrules == 0)
2107 eat(
zp->z_filenum,
zp->z_linenum);
2114 if (
zp->z_format_specifier ==
's')
2115 error(
"%s",
_(
"%s in ruleless zone"));
2145 error(
_(
"unterminated line"));
2150 error(
_(
"NUL input byte"));
2156 error(
_(
"line too long"));
2185 for (num = 1;; ++num)
2199 sizeof fields /
sizeof *fields);
2215 error(
_(
"input line of unknown type"));
2217 switch (
lp->l_value)
2246 error(
_(
"expected continuation line not found"));
2272 if (
string ==
NULL || *
string ==
'\0')
2282 "%" SCNdZIC "%c%d%c%d%c%1d%*[0]%c%*[0123456789]%c",
2294 warning(
_(
"fractional seconds rejected by"
2295 " pre-2018 versions of zic"));
2318 ss += 5 + ((ss ^ 1) & (
xr ==
'0')) <=
tenths;
2321 warning(
_(
"values over 24 hours not handled by pre-2007 versions of zic"));
2361 error(
_(
"wrong number of fields on Rule line"));
2410 error(
_(
"wrong number of fields on Zone line"));
2415 error(
_(
"\"Zone %s\" line and -l option are mutually exclusive"),
2421 error(
_(
"\"Zone %s\" line and -p option are mutually exclusive"),
2429 error(
_(
"duplicate zone name %s"
2430 " (file \"%s\", line %" PRIdMAX ")"),
2436 return inzsub(fields, nfields,
false);
2444 error(
_(
"wrong number of fields on Zone continuation line"));
2447 return inzsub(fields, nfields,
true);
2497 error(
_(
"invalid abbreviation format"));
2525 error(
_(
"Zone continuation line end time is"
2526 " not after end time of previous line"));
2537 warning(
_(
"format '%s' not handled by pre-2015 versions of zic"),
2572 error(
_(
"invalid leaping year"));
2600 error(
_(
"invalid month name"));
2603 month =
lp->l_value;
2615 error(
_(
"invalid day of month"));
2623 error(
_(
"leap second precedes Epoch"));
2631 error(
_(
"wrong number of fields on Leap line"));
2641 error(
_(
"invalid Rolling/Stationary field on Leap line"));
2651 error(
_(
"invalid CORRECTION field on Leap line"));
2663 error(
_(
"wrong number of fields on Expires line"));
2665 error(
_(
"multiple Expires lines"));
2677 error(
_(
"wrong number of fields on Link line"));
2682 error(
_(
"blank TARGET field on Link line"));
2708 error(
_(
"invalid month name"));
2711 rp->r_month =
lp->l_value;
2712 rp->r_todisstd =
false;
2713 rp->r_todisut =
false;
2721 rp->r_todisstd =
true;
2722 rp->r_todisut =
false;
2726 rp->r_todisstd =
false;
2727 rp->r_todisut =
false;
2733 rp->r_todisstd =
true;
2734 rp->r_todisut =
true;
2748 switch (
lp->l_value)
2751 warning(
_(
"FROM year \"%s\" is obsolete;"
2761 error(
_(
"invalid starting year"));
2767 if (!
rp->r_hiwasnum)
2768 switch (
lp->l_value)
2774 rp->r_hiyear =
rp->r_loyear;
2781 error(
_(
"invalid ending year"));
2784 if (
rp->r_loyear >
rp->r_hiyear)
2786 error(
_(
"starting year greater than ending year"));
2791 error(
_(
"year type \"%s\" is unsupported; use \"-\" instead"),
2804 rp->r_wday =
lp->l_value;
2828 error(
_(
"invalid day of month"));
2834 error(
_(
"invalid weekday name"));
2838 rp->r_wday =
lp->l_value;
2841 rp->r_dayofmonth <= 0 ||
2844 error(
_(
"invalid day of month"));
2858 unsigned char *
const b = (
unsigned char *)
buf;
2860 for (
i = 0, shift = 24;
i < 4; ++
i, shift -= 8)
2861 b[
i] = (
val >> shift) & 0xff;
2869 unsigned char *
const b = (
unsigned char *)
buf;
2871 for (
i = 0, shift = 56;
i < 8; ++
i, shift -= 8)
2872 b[
i] = (
val >> shift) & 0xff;
2906 return a <
b ? -1 :
a >
b;
2924 while (0 < r.count && ats[r.base] < lo)
2938 while (1 < r.leapcount &&
leap[r.leapbase + 1].trans <= lo)
2943 while (0 < r.leapbase
2944 && ((
leap[r.leapbase - 1].corr <
leap[r.leapbase].corr)
2945 != (0 <
leap[r.leapbase].corr)))
2955 while (0 < r.count && hi + 1 < ats[r.base + r.count - 1])
2957 while (0 < r.leapcount && hi + 1 <
leap[r.leapbase + r.leapcount - 1].trans)
3053 warning(
_(
"reference clients mishandle"
3054 " more than %d transition times"),
3057 warning(
_(
"pre-2014 clients may mishandle"
3058 " more than 1200 transition times"));
3061 warning(
_(
"reference clients mishandle more than %d leap seconds"),
3111 warning(
_(
"%s: pre-2021b clients may mishandle"
3112 " leap second expiry"),
3120 warning(
_(
"%s: pre-2021b clients may mishandle"
3121 " leap second table truncation"),
3184 error(
_(
"too many transition times"));
3233#ifndef LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH
3340#define DO(field) fwrite(tzh.field, sizeof tzh.field, 1, fp)
3341 memset(&tzh, 0,
sizeof tzh);
3391 unsigned char tm = defaulttype;
3402 warning(
_(
"%s: pre-2026 reference clients mishandle"
3403 " more than 50 bytes of abbreviations"),
3494 fprintf(fp,
"\n%s\n",
string);
3519 error(
_(
"%%z UT offset magnitude exceeds 99:59:59"));
3527 *p++ =
'0' + offset / 10;
3528 *p++ =
'0' + offset % 10;
3559 if (
zp->z_format_specifier ==
'z')
3579 if (
len > 0 && *
cp ==
'\0')
3603 bool negative = offset < 0;
3645 for (month = 0; month <
rp->r_month; ++month)
3648 if (
rp->r_month <= 1)
3656 int wday =
rp->r_wday;
3687 rp->r_month + 1,
week, wday);
3691 if (
rp->r_todisstd && !
rp->r_isdst)
3719 if (
a->r_hiyear !=
b->r_hiyear)
3720 return a->r_hiyear <
b->r_hiyear ? -1 : 1;
3723 if (
a->r_month -
b->r_month != 0)
3724 return a->r_month -
b->r_month;
3725 return a->r_dayofmonth -
b->r_dayofmonth;
3764 for (
i = 0;
i <
zp->z_nrules; ++
i)
3769 rp = &
zp->z_rules[
i];
3804 zstr[0].z_format =
"XXX";
3805 zstr[0].z_format_specifier = 0;
3806 zstr[1].z_stdoff =
zstr[0].z_stdoff;
3807 zstr[1].z_format =
zp->z_format;
3808 zstr[1].z_format_specifier =
zp->z_format_specifier;
3812 dstr.r_dayofmonth = 1;
3814 dstr.r_todisstd =
dstr.r_todisut =
false;
3815 dstr.r_isdst =
true;
3820 stdr.r_dayofmonth = 31;
3822 stdr.r_todisstd =
stdr.r_todisut =
false;
3823 stdr.r_isdst =
false;
3895 int defaulttype = -1;
3938 for (
j = 0;
j <
zp->z_nrules; ++
j)
3952 version =
compat < 2013 ?
'2' :
'3';
3958 _(
"no proleptic TZ string for zone"),
3966 warning(
_(
"%s: pre-%d clients may mishandle"
3967 " distant timestamps"),
4014 eat(
zp->z_filenum,
zp->z_linenum);
4016 if (
zp->z_nrules == 0)
4044 if (
useuntil && year >
zp->z_untilrule.r_hiyear)
4052 for (
j = 0;
j <
zp->z_nrules; ++
j)
4059 rp->r_filenum,
rp->r_linenum);
4060 rp->r_todo = year >=
rp->r_loyear &&
4061 year <=
rp->r_hiyear;
4087 if (!
zp->z_untilrule.r_todisut)
4090 if (!
zp->z_untilrule.r_todisstd)
4100 for (
j = 0;
j <
zp->z_nrules; ++
j)
4102 struct rule *r = &
zp->z_rules[
j];
4121 _(
"two rules for same instant");
4126 r = &
zp->z_rules[k];
4134 rp = &
zp->z_rules[k];
4142 rp->r_isdst,
rp->r_save,
4151 if (
ktime < starttime)
4175 rp->r_filenum,
rp->r_linenum);
4177 rp->r_isdst,
rp->r_save,
false);
4178 offset =
oadd(
zp->z_stdoff,
rp->r_save);
4180 rp->r_todisstd,
rp->r_todisut);
4200 eat(
zp->z_filenum,
zp->z_linenum);
4202 error(
_(
"cannot determine time zone abbreviation"
4203 " to use just after until time"));
4209 if (defaulttype < 0 && !
isdst)
4222 starttime =
zp->z_untiltime;
4224 starttime =
tadd(starttime, -
save);
4229 if (defaulttype < 0)
4260 ||
strchr(envvar,
',')));
4282 xr.r_dayofmonth = 1;
4320 error(
_(
"UT offset out of range"));
4355 error(
_(
"too many local time types"));
4374 error(
_(
"Rolling leap seconds not supported with -r"));
4402 error(
_(
"Leap seconds too close together"));
4407 last =
leap[
i].corr += last;
4415 error(
_(
"last Leap time does not precede Expires time"));
4587 while (*++
abbr !=
'\0')
4610static const struct lookup *
4627 warning(
_(
"\"%s\" is undocumented; use \"last%s\" instead"),
4666 warning(
_(
"\"%s\" is ambiguous in pre-2017c zic"),
word);
4689 if (*
cp ==
'\0' || *
cp ==
'#')
4694 if ((*
dp = *
cp++) !=
'"')
4697 while ((*
dp = *
cp++) !=
'"')
4702 error(
_(
"Odd number of quotation marks"));
4711 error(
_(
"Too many input fields"));
4722 error(
_(
"time overflow"));
4814 while (m !=
rp->r_month)
4820 i =
rp->r_dayofmonth;
4827 error(
_(
"use of 2/29 in non leap-year"));
4841 while (wday !=
rp->r_wday)
4859 warning(
_(
"rule goes past start/end of month; \
4860will not work with pre-2004 versions of zic"));
4864 return tadd(t,
rp->r_tod);
4878 || *
cp ==
'-' || *
cp ==
'+')
4881 mp =
_(
"time zone abbreviation has fewer than 3 characters");
4883 mp =
_(
"time zone abbreviation has too many characters");
4885 mp =
_(
"time zone abbreviation differs from POSIX standard");
4941 error(
_(
"too many, or too long, time zone abbreviations"));
5009 error(
_(
"%s: Cannot create directory %s: %s"),
#define pg_attribute_printf(f, a)
memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets))
#define fprintf(file, fmt, msg)
void err(int eval, const char *fmt,...)
static PgChecksumMode mode
int getopt(int nargc, char *const *nargv, const char *ostr)
PGDLLIMPORT char * optarg
static const struct lconv_member_info table[]
static char buf[DEFAULT_XLOG_SEG_SIZE]
#define qsort(a, b, c, d)
static int fd(const char *x, int i)
#define ATTRIBUTE_PURE_114833
#define ATTRIBUTE_FALLTHROUGH
#define ATTRIBUTE_PURE_114833_HACK
#define ATTRIBUTE_NORETURN
static int cmp(const chr *x, const chr *y, size_t len)
static void word(struct vars *v, int dir, struct state *lp, struct state *rp)
#define symlink(oldpath, newpath)
#define readlink(path, buf, size)
static char chars[TZ_MAX_CHARS]
static void verror(const char *const string, va_list args) pg_attribute_printf(1
static zic_t gethms(const char *string, const char *errstring)
#define ZIC_BLOAT_DEFAULT
static void change_directory(char const *dir)
static zic_t const ZIC32_MAX
static struct zone * zones
static int getfields(char *cp, char **array, int arrayelts)
static gid_t output_group
static unsigned char desigidx[TZ_MAX_TYPES]
static bool print_abbrevs
static int unspecifiedtype
static zic_t oadd(zic_t t1, zic_t t2)
static void use_safe_temp_permissions(void)
static void * memcheck(void *ptr)
static ATTRIBUTE_PURE_114833 bool same_parent_dirs(char const *a, char const *b)
static ATTRIBUTE_NORETURN void size_overflow(void)
static ptrdiff_t doabbr(char *abbr, struct zone const *zp, char const *letters, bool isdst, zic_t save, bool doquotes)
static char const * abbroffset(char *buf, zic_t offset)
static void puttzcode(zic_t val, FILE *fp)
static ATTRIBUTE_PURE_114833_HACK ptrdiff_t align_to(ptrdiff_t size, ptrdiff_t alignment)
static bool ttisuts[TZ_MAX_TYPES]
static void * xrealloc(void *ptr, size_t size)
static int atcomp(const void *avp, const void *bvp)
static char isdsts[TZ_MAX_TYPES]
static struct lookup const lasts[]
static struct lookup const leap_types[]
static FILE * open_outfile(char const **outname, char **tempname)
static mode_t creat_perms
static zic_t getleapdatetime(char **fields, bool expire_line)
static int bsearch_linkcmp(void const *key, void const *b)
static void convert64(uint_fast64_t val, char *buf)
static ATTRIBUTE_PURE_114833_HACK ptrdiff_t size_sum(size_t a, size_t b)
static zic_t const ZIC_MAX
static void static void static void warning(const char *const string,...) pg_attribute_printf(1
static struct lookup const mon_names[]
static zic_t print_cutoff
static zic_t redundant_time
static char *const * main_argv
static bool rulesub(struct rule *rp, const char *loyearp, const char *hiyearp, const char *typep, const char *monthp, const char *dayp, const char *timep)
static void make_links(void)
static char const * diagdir(char const *filename)
static void inleap(char **fields, int nfields)
static char const disable_percent_s[]
static void mkdirs(char const *argname, bool ancestors)
static struct @228 * leap
static int qsort_linkcmp(void const *a, void const *b)
static unsigned long arg2num(char const *arg, int base, unsigned long maxval, char const *msgid)
static void puttzcodepass(zic_t val, FILE *fp, int pass)
static void convert(uint_fast32_t val, char *buf)
static bool inzone(char **fields, int nfields)
static struct lookup const begin_years[]
static int chmetadata(FILE *stream)
static mode_t const no_mode
static ATTRIBUTE_PURE_114833 bool ciprefix(char const *abbr, char const *word)
static void outzone(const struct zone *zpfirst, ptrdiff_t zonecount)
static void infile(int fnum, char const *name)
static void rename_dest(char *tempname, char const *name)
static bool componentcheck(char const *name, char const *component, char const *component_end)
static zic_t tadd(zic_t t1, zic_t t2)
static int max_format_len
static ptrdiff_t nzones_alloc
static int max_abbrvar_len
static void eat(int fnum, lineno_t num)
static int itssymlink(char const *name, int *cache)
static zic_t rpytime(const struct rule *rp, zic_t wantedy)
static bool inzcont(char **fields, int nfields)
static bool is_digit(char c)
static ATTRIBUTE_PURE_114833 bool itsabbr(const char *abbr, const char *word)
static ptrdiff_t nlinks_alloc
#define linkat(targetdir, target, linknamedir, linkname, flag)
static const char * lcltime
static bool ttisstds[TZ_MAX_TYPES]
static int stringoffset(char *result, zic_t offset)
static struct lookup const zi_line_codes[]
static void inexpires(char **fields, int nfields)
static bool want_bloat(void)
static int stringrule(char *result, struct rule *const rp, zic_t save, zic_t stdoff)
static int addtype(zic_t utoff, char const *abbr, bool isdst, bool ttisstd, bool ttisut)
static bool is_alpha(char a)
static void * growalloc(void *ptr, ptrdiff_t itemsize, ptrdiff_t nitems, ptrdiff_t *nitems_alloc)
static ATTRIBUTE_NORETURN void time_overflow(void)
static const int len_months[2][MONSPERYEAR]
static uint_fast64_t get_rand_u64(void)
static int stringzone(char *result, struct zone const *zpfirst, ptrdiff_t zonecount)
static bool is_space(char a)
static ATTRIBUTE_PURE_114833 bool ciequal(const char *ap, const char *bp)
static void static void static void static int addabbr(char chs[TZ_MAX_CHARS], int *pnchs, char const *abbr)
static void inrule(char **fields, int nfields)
static sig_atomic_t got_signal
static bool timerange_option(char *timerange)
static ptrdiff_t leap_alloc
static const char * directory
static const char * psxrules
static ptrdiff_t grow_nitems_alloc(ptrdiff_t *nitems_alloc, ptrdiff_t itemsize)
static void dolink(char const *target, char const *linkname, bool staysymlink)
static struct lookup const * byword(const char *word, const struct lookup *table)
static void eats(int fnum, lineno_t num, int rfnum, lineno_t rnum)
static zic_t utoffs[TZ_MAX_TYPES]
static ATTRIBUTE_NORETURN void duplicate_options(char const *opt)
static bool redundant_time_option(char *opt)
static ptrdiff_t nrules_alloc
static ATTRIBUTE_NORETURN void memory_exhausted(const char *msg)
static void writezone(const char *const name, const char *const string, char version, int defaulttype)
static zic_t const max_time
static char lowerit(char a)
static bool namecheck(const char *name)
static char const * diagslash(char const *filename)
static bool inzsub(char **fields, int nfields, bool iscont)
static void check_for_signal(void)
static struct rule * rules
static zic_t const ZIC_MIN
static zic_t getsave(char *field, bool *isdst)
static ptrdiff_t timecnt_alloc
static mode_t output_mode
static mode_t mode_option(char const *arg)
@ FORMAT_LEN_GROWTH_BOUND
static char * xstrdup(char const *str)
static uid_t const no_uid
static zic_t const min_time
static void group_option(char const *arg)
#define ZIC_MAX_ABBR_LEN_WO_WARN
static void addtt(zic_t starttime, int type)
static const char * progname
static int rcomp(const void *cp1, const void *cp2)
static ATTRIBUTE_PURE_114833_HACK ptrdiff_t size_product(ptrdiff_t nitems, ptrdiff_t itemsize)
static void updateminmax(const zic_t x)
static struct attype * attypes
static zic_t omul(zic_t t1, zic_t t2)
static struct lookup const wday_names[]
static zic_t const ZIC32_MIN
static uid_t output_owner
static void adjleap(void)
static struct lookup const end_years[]
static void associate(void)
static void signal_handler(int sig)
static void catch_signals(void)
static struct timerange limitrange(struct timerange r, zic_t lo, zic_t hi, zic_t const *ats, unsigned char const *types)
static struct link * links
static char const * leapsec
static const int len_years[2]
static void owner_option(char const *arg)
static void leapadd(zic_t t, int correction, int rolling)
static bool directory_ends_in_slash
static void close_file(FILE *stream, char const *dir, char const *name, char const *tempname)
static struct lookup const leap_line_codes[]
static void * xmalloc(size_t size)
static gid_t const no_gid
static const char * tzdefault
static void random_dirent(char const **name, char **namealloc)
static int rule_cmp(struct rule const *a, struct rule const *b)
static void inlink(char **fields, int nfields)
static bool inputline(FILE *fp, char *buf, ptrdiff_t bufsize)
static void checkabbr(char const *string)