2025-09-17 Paul Eggert <eggert@cs.ucla.edu>
+ stringeq: prefer streq to strcmp in other modules
+ * lib/acl-internal.c, lib/argmatch.c, lib/argp-help.c:
+ * lib/argp-parse.c, lib/bcp47.c, lib/c32_get_mapping.c:
+ * lib/c32_get_type_test.c, lib/concat-filename.c:
+ * lib/cpu-supports.h, lib/dfa.c, lib/duplocale.c, lib/exclude.c:
+ * lib/findprog-in.c, lib/findprog.c, lib/fopen.c, lib/freopen.c:
+ * lib/fts.c, lib/gen-uni-tables.c, lib/getfilecon.c:
+ * lib/getlogin.c, lib/getugroups.c, lib/hard-locale.c:
+ * lib/hashcode-named-file.c, lib/hashkey-string.c:
+ * lib/iconv_open.c, lib/idcache.c, lib/lc-charset-unicode.c:
+ * lib/localcharset.c, lib/localename-environ.c:
+ * lib/localename-unsafe.c, lib/mbs_endswith.c, lib/mountlist.c:
+ * lib/newlocale.c, lib/nl_langinfo.c, lib/nproc.c, lib/open.c:
+ * lib/os2-spawn.c, lib/parse-datetime.y, lib/popen.c:
+ * lib/progreloc.c, lib/propername.c, lib/pt_chown.c, lib/putenv.c:
+ * lib/qcopy-acl.c, lib/readutmp.c, lib/rpmatch.c:
+ * lib/setlocale-fixes.c, lib/setlocale.c, lib/sig2str.c:
+ * lib/spawni.c, lib/stat.c, lib/str_endswith.c, lib/streq.h:
+ * lib/striconveha.c, lib/struniq.h, lib/supersede.c:
+ * lib/time_rz.c, lib/unicodeio.c, lib/vasnprintf.c:
+ * lib/vc-mtime.c, lib/wctrans-impl.h, lib/wctype-impl.h:
+ Prefer streq to strcmp when either will do.
+ Do not make this change to files shared with glibc.
+ Do not make the change to test files, at least not for now.
+ * lib/gen-uni-tables.c (streq): New static function, in same style.
+ * modules/acl-permissions, modules/argp, modules/c32_get_mapping:
+ * modules/c32_get_type_test, modules/concat-filename:
+ * modules/cpu-supports, modules/dfa, modules/duplocale:
+ * modules/exclude, modules/findprog, modules/findprog-in:
+ * modules/fopen, modules/fopen-gnu, modules/freopen, modules/fts:
+ * modules/getlocalename_l-simple, modules/getlocalename_l-unsafe:
+ * modules/getlogin, modules/getugroups, modules/hard-locale:
+ * modules/hashcode-named-file, modules/hashkey-string:
+ * modules/iconv_open, modules/idcache, modules/localcharset:
+ * modules/localename, modules/localename-unsafe:
+ * modules/mbs_endswith, modules/mountlist, modules/newlocale:
+ * modules/nl_langinfo, modules/nproc, modules/open:
+ * modules/parse-datetime, modules/popen:
+ * modules/posix_spawn-internal, modules/propername:
+ * modules/pt_chown, modules/putenv-gnu, modules/qcopy-acl:
+ * modules/rpmatch, modules/selinux-h, modules/setenv:
+ * modules/setlocale, modules/setlocale-fixes, modules/sig2str:
+ * modules/spawn-pipe, modules/stat, modules/str_endswith:
+ * modules/streq, modules/striconveha, modules/supersede:
+ * modules/time_rz, modules/uchar-h, modules/unicodeio:
+ * modules/uniconv/base, modules/wctrans, modules/wctype:
+ (Depends-on): Add stringeq.
+
stringeq: prefer memeq to memcmp in other modules
* lib/argmatch.c, lib/argmatch.h, lib/backupfile.c, lib/bcp47.c:
* lib/boot-time.c, lib/csharpcomp.c, lib/csharpexec.c:
- S-1-5-32-545 (group "Users")
Cf. <https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids>
and look at the output of the 'mkgroup' command. */
- ignorable = (strcmp (group_sid, "S-1-5-18") == 0
- || strcmp (group_sid, "S-1-5-32-544") == 0
- || strcmp (group_sid, "S-1-5-32-545") == 0);
+ ignorable = (streq (group_sid, "S-1-5-18")
+ || streq (group_sid, "S-1-5-32-544")
+ || streq (group_sid, "S-1-5-32-545"));
}
}
if (!ignorable)
/* Test elements for exact match. */
for (i = 0; arglist[i]; i++)
{
- if (!strcmp (arglist[i], arg))
+ if (streq (arglist[i], arg))
return i;
}
unsigned num_opts = entry->num;
while (num_opts-- > 0)
- if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0)
+ if (opt->name && ovisible (opt) && streq (opt->name, name))
return entry;
else
opt++;
{
struct option *l = long_options;
while (l->name != NULL)
- if (name != NULL && strcmp (l->name, name) == 0)
+ if (name != NULL && streq (l->name, name))
return l - long_options;
else
l++;
{
parser->try_getopt = 0;
if (parser->state.next > 1
- && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
- == 0)
+ && streq (parser->state.argv[parser->state.next - 1], QUOTE))
/* Not only is this the end of the options, but it's a
"quoted" region, which may have args that *look* like
options, so we definitely shouldn't try to use getopt past
xpg_to_bcp47 (char *bcp47, const char *xpg)
{
/* Special cases. */
- if (strcmp (xpg, "") == 0)
+ if (streq (xpg, ""))
fail:
{
strcpy (bcp47, "und");
return;
}
if ((xpg[0] == 'C' && (xpg[1] == '\0' || xpg[1] == '.'))
- || strcmp (xpg, "POSIX") == 0)
+ || streq (xpg, "POSIX"))
{
/* The "C" (or "C.UTF-8") and "POSIX" locales most closely resemble the
"en_US" locale. */
bcp47_to_xpg (char *xpg, const char *bcp47, const char *codeset)
{
/* Special cases. */
- if (strcmp (bcp47, "") == 0)
+ if (streq (bcp47, ""))
fail:
{
strcpy (xpg, "");
default_script_in_territory (xpg, territory);
if (sp != NULL)
{
- if (strcmp (script, sp->name) == 0)
+ if (streq (script, sp->name))
script = NULL;
}
else if (memeq (xpg, "zh", 2))
default_script_for_language2 (xpg);
if (sp != NULL)
{
- if (strcmp (script, sp->name) == 0)
+ if (streq (script, sp->name))
script = NULL;
}
else if (memeq (xpg, "iu", 2))
default_script_for_language3 (xpg);
if (sp != NULL)
{
- if (strcmp (script, sp->name) == 0)
+ if (streq (script, sp->name))
script = NULL;
}
else if (memeq (xpg, "nan", 3))
switch (name[2])
{
case 'l':
- if (strcmp (name + 3, "ower") == 0)
+ if (streq (name + 3, "ower"))
return c32tolower;
break;
case 'u':
- if (strcmp (name + 3, "pper") == 0)
+ if (streq (name + 3, "pper"))
return c32toupper;
break;
default:
switch (name[2])
{
case 'n':
- if (strcmp (name + 3, "um") == 0)
+ if (streq (name + 3, "um"))
return c32isalnum;
break;
case 'p':
- if (strcmp (name + 3, "ha") == 0)
+ if (streq (name + 3, "ha"))
return c32isalpha;
break;
default:
}
break;
case 'b':
- if (strcmp (name + 1, "lank") == 0)
+ if (streq (name + 1, "lank"))
return c32isblank;
break;
case 'c':
- if (strcmp (name + 1, "ntrl") == 0)
+ if (streq (name + 1, "ntrl"))
return c32iscntrl;
break;
case 'd':
- if (strcmp (name + 1, "igit") == 0)
+ if (streq (name + 1, "igit"))
return c32isdigit;
break;
case 'g':
- if (strcmp (name + 1, "raph") == 0)
+ if (streq (name + 1, "raph"))
return c32isgraph;
break;
case 'l':
- if (strcmp (name + 1, "ower") == 0)
+ if (streq (name + 1, "ower"))
return c32islower;
break;
case 'p':
switch (name[1])
{
case 'r':
- if (strcmp (name + 2, "int") == 0)
+ if (streq (name + 2, "int"))
return c32isprint;
break;
case 'u':
- if (strcmp (name + 2, "nct") == 0)
+ if (streq (name + 2, "nct"))
return c32ispunct;
break;
default:
}
break;
case 's':
- if (strcmp (name + 1, "pace") == 0)
+ if (streq (name + 1, "pace"))
return c32isspace;
break;
case 'u':
- if (strcmp (name + 1, "pper") == 0)
+ if (streq (name + 1, "pper"))
return c32isupper;
break;
case 'x':
- if (strcmp (name + 1, "digit") == 0)
+ if (streq (name + 1, "digit"))
return c32isxdigit;
break;
default:
char *result;
char *p;
- if (strcmp (directory, ".") == 0)
+ if (streq (directory, "."))
{
/* No need to prepend the directory. */
result = (char *) malloc (strlen (filename)
-# ifndef STREQ
-# define STREQ(a, b) (strcmp (a, b) == 0)
-# endif
-
/* Return the glibc.cpu.hwcaps setting (prepended with "-"),
corresponding to the passed gcc _builtin_cpu_supports(FEATURE).
Supported hwcaps can be identified from the bit_cpu_* defines
if (0)
;
# if defined __x86_64__
- else if (STREQ (feature, "avx")) hwcap = "-AVX";
- else if (STREQ (feature, "avx2")) hwcap = "-AVX2";
- else if (STREQ (feature, "avx512bw")) hwcap = "-AVX512BW";
- else if (STREQ (feature, "avx512f")) hwcap = "-AVX512F";
- else if (STREQ (feature, "pclmul")) hwcap = "-PCLMULQDQ";
- else if (STREQ (feature, "vpclmulqdq")) hwcap = "-VPCLMULQDQ";
+ else if (streq (feature, "avx")) hwcap = "-AVX";
+ else if (streq (feature, "avx2")) hwcap = "-AVX2";
+ else if (streq (feature, "avx512bw")) hwcap = "-AVX512BW";
+ else if (streq (feature, "avx512f")) hwcap = "-AVX512F";
+ else if (streq (feature, "pclmul")) hwcap = "-PCLMULQDQ";
+ else if (streq (feature, "vpclmulqdq")) hwcap = "-VPCLMULQDQ";
# elif defined __aarch64__
- else if (STREQ (feature, "pmull")) hwcap = "-PMULL";
+ else if (streq (feature, "pmull")) hwcap = "-PMULL";
# endif
return hwcap;
# define c32isprint iswprint
# define c32isspace iswspace
# define mbszero(p) memset (p, 0, sizeof (mbstate_t))
+# define streq(a, b) (strcmp (a, b) == 0)
#else
/* Use ISO C 11 + gnulib API. */
# include <uchar.h>
MMU will check anyway. */
#define assume_nonnull(x) assume ((x) != NULL)
-static bool
-str_eq (char const *a, char const *b)
-{
- return strcmp (a, b) == 0;
-}
-
static bool
c_isdigit (char c)
{
find_pred (const char *str)
{
for (int i = 0; prednames[i].name; i++)
- if (str_eq (str, prednames[i].name))
+ if (streq (str, prednames[i].name))
return &prednames[i];
return NULL;
}
worry about that possibility. */
{
char const *class
- = (dfa->syntax.case_fold && (str_eq (str, "upper")
- || str_eq (str, "lower"))
+ = (dfa->syntax.case_fold && (streq (str, "upper")
+ || streq (str, "lower"))
? "alpha" : str);
const struct dfa_ctype *pred = find_pred (class);
if (!pred)
idx_t j, ln, rn, n;
/* Guaranteed to be. Unlikely, but ... */
- if (str_eq (lmp->is, rmp->is))
+ if (streq (lmp->is, rmp->is))
{
lmp->begline &= rmp->begline;
lmp->endline &= rmp->endline;
for (idx_t i = 0; mp->in[i] != NULL; i++)
if (strlen (mp->in[i]) > strlen (result))
result = mp->in[i];
- if (str_eq (result, mp->is))
+ if (streq (result, mp->is))
{
if ((!need_begline || mp->begline) && (!need_endline
|| mp->endline))
errno = err;
return NULL;
}
- if (strcmp (name, base_name) != 0)
+ if (!streq (name, base_name))
{
locale_t copy = newlocale (category_mask, name, base_copy);
if (copy == NULL)
static bool
string_compare (void const *data1, void const *data2)
{
- return strcmp (data1, data2) == 0;
+ return streq (data1, data2);
}
/* compare two strings for equality, case-insensitive */
struct exclude *ex, char const *file_name, int options,
char line_end)
{
- if (strcmp (file_name, "-") == 0)
+ if (streq (file_name, "-"))
return add_exclude_fp (call_addfn, ex, stdin, options, line_end, &add_func);
FILE *in = fopen (file_name, "re");
if (! S_ISDIR (statbuf.st_mode))
{
/* Found! */
- if (strcmp (progpathname, progname) == 0)
+ if (streq (progpathname, progname))
{
free (progpathname);
return progname;
if (! S_ISDIR (statbuf.st_mode))
{
/* Found! */
- if (strcmp (progpathname, progname) == 0)
+ if (streq (progpathname, progname))
{
free (progpathname);
&& ! S_ISDIR (statbuf.st_mode))
{
/* Found! */
- if (strcmp (progpathname, progname) == 0)
+ if (streq (progpathname, progname))
{
free (progpathname);
#endif
#if defined _WIN32 && ! defined __CYGWIN__
- if (strcmp (filename, "/dev/null") == 0)
+ if (streq (filename, "/dev/null"))
filename = "NUL";
#endif
FILE *result;
#if defined _WIN32 && ! defined __CYGWIN__
char const *null_device = "NUL";
- if (filename && strcmp (filename, "/dev/null") == 0)
+ if (filename && streq (filename, "/dev/null"))
filename = null_device;
#else
char const *null_device = "/dev/null";
#endif
#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
-#define STREQ(a, b) (strcmp (a, b) == 0)
#define CLR(opt) (sp->fts_options &= ~(opt))
#define ISSET(opt) ((sp->fts_options & (opt)) != 0)
fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *dir)
{
int ret;
- bool is_dotdot = dir && STREQ (dir, "..");
+ bool is_dotdot = dir && streq (dir, "..");
int newfd;
/* This clause handles the unusual case in which FTS_NOCHDIR
not "..", diropen's use of O_NOFOLLOW ensures we don't mistakenly
follow a symlink, so we can avoid the expense of this fstat. */
if (ISSET(FTS_LOGICAL) || ! HAVE_WORKING_O_NOFOLLOW
- || (dir && STREQ (dir, "..")))
+ || (dir && streq (dir, "..")))
{
struct stat sb;
if (fstat(newfd, &sb))
{
size_t len = strlen (string);
size_t n = strlen (suffix);
- return len >= n && strcmp (string + len - n, suffix) == 0;
+ return len >= n && streq (string + len - n, suffix);
}
static bool
return !memcmp (s1, s2, n);
}
+static bool
+streq (char const *s1, char const *s2)
+{
+ return !strcmp (s1, s2);
+}
+
/* ========================================================================= */
/* Reading UnicodeData.txt. */
fprintf (stderr, "index too large\n");
exit (1);
}
- if (strcmp (field2, "Cs") == 0)
+ if (streq (field2, "Cs"))
/* Surrogates are UTF-16 artifacts, not real characters. Ignore them. */
return;
uni = &unicode_attributes[i];
fprintf (stream, "/* Copyright (C) 2000-2025 Free Software Foundation, Inc.\n");
fprintf (stream, "\n");
output_library_license (stream,
- strcmp (filename, "unictype/categ_M.h") == 0
+ streq (filename, "unictype/categ_M.h")
|| str_startswith (filename, "unictype/ctype_")
- || strcmp (filename, "uniwidth/width2.h") == 0);
+ || streq (filename, "uniwidth/width2.h"));
fprintf (stream, "\n");
t.p = 4; /* or: 5 */
i2 = i1;
}
#define PROP(name,code) \
- if (strcmp (propname, name) == 0) propcode = code; else
+ if (streq (propname, name)) propcode = code; else
/* PropList.txt */
PROP ("White_Space", PROP_WHITE_SPACE)
PROP ("Bidi_Control", PROP_BIDI_CONTROL)
PROP ("Extended_Pictographic", PROP_EXTENDED_PICTOGRAPHIC)
#undef PROP
/* An enum-valued property from DerivedCoreProperties.txt */
- if (strcmp (propname, "InCB;") == 0)
+ if (streq (propname, "InCB;"))
{
char valuename[200+1];
unsigned int valuecode;
exit (1);
}
- if (strcmp (valuename, "None") == 0)
+ if (streq (valuename, "None"))
valuecode = UC_INDIC_CONJUNCT_BREAK_NONE;
- else if (strcmp (valuename, "Consonant") == 0)
+ else if (streq (valuename, "Consonant"))
valuecode = UC_INDIC_CONJUNCT_BREAK_CONSONANT;
- else if (strcmp (valuename, "Linker") == 0)
+ else if (streq (valuename, "Linker"))
valuecode = UC_INDIC_CONJUNCT_BREAK_LINKER;
- else if (strcmp (valuename, "Extend") == 0)
+ else if (streq (valuename, "Extend"))
valuecode = UC_INDIC_CONJUNCT_BREAK_EXTEND;
else
{
{
bool result1 =
(unicode_attributes[ch].name != NULL
- && strcmp (unicode_attributes[ch].name, "<control>") == 0);
+ && streq (unicode_attributes[ch].name, "<control>"));
bool result2 =
is_category_Cc (ch);
is_property_combining (unsigned int ch)
{
return (unicode_attributes[ch].name != NULL
- && (strcmp (unicode_attributes[ch].combining, "0") != 0
+ && (!streq (unicode_attributes[ch].combining, "0")
|| is_category_Mc (ch)
|| is_category_Me (ch)
|| is_category_Mn (ch)));
}
assert (i < 0x110000);
-#define TRY(name) else if (strcmp (joining_type_name, #name + 16) == 0) joining_type = name;
+#define TRY(name) else if (streq (joining_type_name, #name + 16)) joining_type = name;
if (false) {}
TRY(UC_JOINING_TYPE_U)
TRY(UC_JOINING_TYPE_T)
&& joining_group_name[strlen (joining_group_name) - 1] == ' ')
joining_group_name[strlen (joining_group_name) - 1] = '\0';
-#define TRY(value,name) else if (strcmp (joining_group_name, name) == 0) joining_group = value;
+#define TRY(value,name) else if (streq (joining_group_name, name)) joining_group = value;
if (false) {}
TRY(UC_JOINING_GROUP_NONE, "No_Joining_Group")
TRY(UC_JOINING_GROUP_AIN, "AIN")
assert (i2 < 0x110000);
for (script = numscripts - 1; script >= 0; script--)
- if (strcmp (scripts[script], scriptname) == 0)
+ if (streq (scripts[script], scriptname))
break;
if (script < 0)
{
is_cntrl (unsigned int ch)
{
return (unicode_attributes[ch].name != NULL
- && (strcmp (unicode_attributes[ch].name, "<control>") == 0
+ && (streq (unicode_attributes[ch].name, "<control>")
/* Categories Zl and Zp */
|| (unicode_attributes[ch].category[0] == 'Z'
&& (unicode_attributes[ch].category[1] == 'l'
is_graph (unsigned int ch)
{
return (unicode_attributes[ch].name != NULL
- && strcmp (unicode_attributes[ch].name, "<control>")
+ && !streq (unicode_attributes[ch].name, "<control>")
&& !is_space (ch));
}
is_print (unsigned int ch)
{
return (unicode_attributes[ch].name != NULL
- && strcmp (unicode_attributes[ch].name, "<control>")
+ && !streq (unicode_attributes[ch].name, "<control>")
/* Categories Zl and Zp */
&& !(unicode_attributes[ch].name != NULL
&& unicode_attributes[ch].category[0] == 'Z'
return '0';
/* Test for double-width character. */
if (unicode_width[ch] != NULL
- && (strcmp (unicode_width[ch], "W") == 0
- || strcmp (unicode_width[ch], "F") == 0))
+ && (streq (unicode_width[ch], "W")
+ || streq (unicode_width[ch], "F")))
return '2';
/* Test for half-width character. */
if (unicode_width[ch] != NULL
- && strcmp (unicode_width[ch], "H") == 0)
+ && streq (unicode_width[ch], "H"))
return '1';
}
/* In ancient CJK encodings, Cyrillic and most other characters are
get_lbea (unsigned int ch)
{
return (unicode_width[ch] != NULL
- && (strcmp (unicode_width[ch], "W") == 0
- || strcmp (unicode_width[ch], "F") == 0
- || strcmp (unicode_width[ch], "H") == 0));
+ && (streq (unicode_width[ch], "W")
+ || streq (unicode_width[ch], "F")
+ || streq (unicode_width[ch], "H")));
}
/* Returns the line breaking classification for ch, as a bit mask. */
/* Remove trailing spaces from field1. */
while (strlen (field1) > 0 && field1[strlen (field1) - 1] == ' ')
field1[strlen (field1) - 1] = '\0';
-#define TRY(bit) else if (strcmp (field1, #bit + 4) == 0) value = bit;
+#define TRY(bit) else if (streq (field1, #bit + 4)) value = bit;
if (false) {}
TRY(LBP_BK)
TRY(LBP_CR)
TRY(LBP_EM)
TRY(LBP_XX)
#undef TRY
- else if (strcmp (field1, "NL") == 0) value = LBP_BK;
- else if (strcmp (field1, "SG") == 0) value = LBP_XX;
- else if (strcmp (field1, "CJ") == 0) value = LBP_NS;
+ else if (streq (field1, "NL")) value = LBP_BK;
+ else if (streq (field1, "SG")) value = LBP_XX;
+ else if (streq (field1, "CJ")) value = LBP_NS;
else
{
fprintf (stderr, "unknown property value \"%s\" in '%s':%d\n",
if (((unicode_properties[ch] >> PROP_GRAPHEME_EXTEND) & 1) != 0
|| ((unicode_properties[ch] >> PROP_OTHER_GRAPHEME_EXTEND) & 1) != 0
|| (unicode_attributes[ch].category != NULL
- && strcmp (unicode_attributes[ch].category, "Mc") == 0)
+ && streq (unicode_attributes[ch].category, "Mc"))
|| ((unicode_properties[ch] >> PROP_EMOJI_MODIFIER) & 1) != 0 /* Emoji modifier */)
attr |= 1 << WBP_EXTEND;
if (unicode_attributes[ch].category != NULL
- && strcmp (unicode_attributes[ch].category, "Cf") == 0
+ && streq (unicode_attributes[ch].category, "Cf")
&& !(ch >= 0x0600 && ch <= 0x0605)
&& ch != 0x06DD
&& ch != 0x070F
attr |= 1 << WBP_FORMAT;
if ((unicode_scripts[ch] < numscripts
- && strcmp (scripts[unicode_scripts[ch]], "Katakana") == 0)
+ && streq (scripts[unicode_scripts[ch]], "Katakana"))
|| (ch >= 0x3031 && ch <= 0x3035)
|| ch == 0x309B || ch == 0x309C || ch == 0x30A0 || ch == 0x30FC
|| ch == 0xFF70)
attr |= 1 << WBP_KATAKANA;
if ((unicode_scripts[ch] < numscripts
- && strcmp (scripts[unicode_scripts[ch]], "Hebrew") == 0)
- && strcmp (unicode_attributes[ch].category, "Lo") == 0)
+ && streq (scripts[unicode_scripts[ch]], "Hebrew"))
+ && streq (unicode_attributes[ch].category, "Lo"))
attr |= 1 << WBP_HL;
if ((((unicode_properties[ch] >> PROP_ALPHABETIC) & 1) != 0
&& (attr & (1 << WBP_KATAKANA)) == 0
&& ((get_lbp (ch) >> LBP_SA) & 1) == 0
&& !(unicode_scripts[ch] < numscripts
- && strcmp (scripts[unicode_scripts[ch]], "Hiragana") == 0)
+ && streq (scripts[unicode_scripts[ch]], "Hiragana"))
&& (attr & (1 << WBP_EXTEND)) == 0
&& (attr & (1 << WBP_HL)) == 0)
attr |= 1 << WBP_ALETTER;
attr |= 1 << WBP_NUMERIC;
if ((unicode_attributes[ch].category != NULL
- && strcmp (unicode_attributes[ch].category, "Pc") == 0)
+ && streq (unicode_attributes[ch].category, "Pc"))
|| ch == 0x202F /* NARROW NO-BREAK SPACE */)
attr |= 1 << WBP_EXTENDNUMLET;
i2 = i1;
}
#define PROP(name,value) \
- if (strcmp (propname, name) == 0) propvalue = value; else
+ if (streq (propname, name)) propvalue = value; else
PROP ("CR", WBP_CR)
PROP ("LF", WBP_LF)
PROP ("Newline", WBP_NEWLINE)
i2 = i1;
}
#define PROP(name,value) \
- if (strcmp (propname, name) == 0) propvalue = value; else
+ if (streq (propname, name)) propvalue = value; else
PROP ("CR", GBP_CR)
PROP ("LF", GBP_LF)
PROP ("Control", GBP_CONTROL)
/* Exclude decompositions where the first part is not a starter,
i.e. is not of canonical combining class 0. */
- if (strcmp (unicode_attributes[code1].combining, "0") == 0
+ if (streq (unicode_attributes[code1].combining, "0")
/* Exclude characters listed in CompositionExclusions.txt. */
&& !unicode_composition_exclusions[combined])
{
/* The combined character must now also be a starter.
Verify this. */
- assert (strcmp (unicode_attributes[combined].combining, "0") == 0);
+ assert (streq (unicode_attributes[combined].combining, "0"));
fprintf (stream, "0x%04X\t0x%04X\t0x%04X\t%s\n",
code1,
/* Exclude decompositions where the first part is not a starter,
i.e. is not of canonical combining class 0. */
- if (strcmp (unicode_attributes[code1].combining, "0") == 0
+ if (streq (unicode_attributes[code1].combining, "0")
/* Exclude characters listed in CompositionExclusions.txt. */
&& !unicode_composition_exclusions[combined])
{
/* The combined character must now also be a starter.
Verify this. */
- assert (strcmp (unicode_attributes[combined].combining, "0") == 0);
+ assert (streq (unicode_attributes[combined].combining, "0"));
if (max_code1 < code1)
max_code1 = code1;
fprintf (stream, "/* Copyright (C) 2000-2025 Free Software Foundation, Inc.\n");
fprintf (stream, "\n");
output_library_license (stream,
- strcmp (filename, "unicase/tolower.h") == 0
- || strcmp (filename, "unicase/toupper.h") == 0);
+ streq (filename, "unicase/tolower.h")
+ || streq (filename, "unicase/toupper.h"));
fprintf (stream, "\n");
t.p = 7;
if (rule->code == cfrule->code
&& (cfrule->language == NULL
|| (rule->language != NULL
- && strcmp (rule->language, cfrule->language) == 0)))
+ && streq (rule->language, cfrule->language))))
{
memcpy (rule->casefold_mapping, cfrule->mapping,
sizeof (rule->casefold_mapping));
if ((cfrule->language == NULL
? rule->language == NULL
: rule->language != NULL
- && strcmp (rule->language, cfrule->language) == 0)
+ && streq (rule->language, cfrule->language))
&& rule->context == SCC_ALWAYS)
{
/* Found it. */
return -1;
}
- if (ret == 10 && strcmp (*con, "unlabeled") == 0)
+ if (ret == 10 && streq (*con, "unlabeled"))
{
freecon (*con);
*con = NULL;
{
idx_t i;
for (i = 0; i < n; i++)
- if (strcmp (entries[i].ut_line, tty + 5) == 0)
+ if (streq (entries[i].ut_line, tty + 5))
{
if (strlen (entries[i].ut_user) < 64)
{
#else /* HAVE_GRP_H */
# include <grp.h>
-# define STREQ(a, b) (strcmp (a, b) == 0)
-
/* Like 'getgroups', but for user USERNAME instead of for the current
process. Store at most MAXCOUNT group IDs in the GROUPLIST array.
If GID is not -1, store it first (if possible). GID should be the
{
int n;
- if ( ! STREQ (username, *cp))
+ if (!streq (username, *cp))
continue;
/* See if this group number is already on the list. */
if (setlocale_null_r (category, locale, sizeof (locale)))
return false;
- if (!(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0))
+ if (!(streq (locale, "C") || streq (locale, "POSIX")))
return true;
#if defined __ANDROID__
#include "hashcode-string2.h"
#include "same-inode.h"
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
/* Hash an F_triple, and *do* consider the file name. */
size_t
triple_hash (void const *x, size_t table_size)
{
struct F_triple const *a = x;
struct F_triple const *b = y;
- return PSAME_INODE (a, b) && STREQ (a->name, b->name);
+ return PSAME_INODE (a, b) && streq (a->name, b->name);
}
/* Free an F_triple. */
{
const char *s1 = (const char *) x1;
const char *s2 = (const char *) x2;
- return strcmp (s1, s2) == 0;
+ return streq (s1, s2);
}
#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
&& c_toupper (tocode[2]) == 'F'
&& tocode[3] == '-')
{
- if (strcmp (fromcode + 4, "8") == 0)
+ if (streq (fromcode + 4, "8"))
{
if (c_strcasecmp (tocode + 4, "16BE") == 0)
return _ICONV_UTF8_UTF16BE;
if (c_strcasecmp (tocode + 4, "32LE") == 0)
return _ICONV_UTF8_UTF32LE;
}
- else if (strcmp (tocode + 4, "8") == 0)
+ else if (streq (tocode + 4, "8"))
{
if (c_strcasecmp (fromcode + 4, "16BE") == 0)
return _ICONV_UTF16BE_UTF8;
for (tail = user_alist; tail; tail = tail->next)
/* Avoid a function call for the most common case. */
- if (*tail->name == *user && !strcmp (tail->name, user))
+ if (*tail->name == *user && streq (tail->name, user))
return &tail->id.u;
for (tail = nouser_alist; tail; tail = tail->next)
/* Avoid a function call for the most common case. */
- if (*tail->name == *user && !strcmp (tail->name, user))
+ if (*tail->name == *user && streq (tail->name, user))
return NULL;
pwent = getpwnam (user);
for (tail = group_alist; tail; tail = tail->next)
/* Avoid a function call for the most common case. */
- if (*tail->name == *group && !strcmp (tail->name, group))
+ if (*tail->name == *group && streq (tail->name, group))
return &tail->id.g;
for (tail = nogroup_alist; tail; tail = tail->next)
/* Avoid a function call for the most common case. */
- if (*tail->name == *group && !strcmp (tail->name, group))
+ if (*tail->name == *group && streq (tail->name, group))
return NULL;
grent = getgrnam (group);
strcpy (conv->encoding, encoding);
gl_tls_set (converters_key, conv);
}
- else if (strcmp (conv->encoding, encoding) != 0)
+ else if (!streq (conv->encoding, encoding))
{
/* The locale encoding of this thread changed. */
iconv_t new_cd_locale_to_utf8 = iconv_open ("UTF-8", encoding);
/* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
returns "US-ASCII". Return the suffix of the locale name from the
environment variables (if present) or the codepage as a number. */
- if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
+ if (codeset != NULL && streq (codeset, "US-ASCII"))
{
const char *locale;
static char resultbuf[2 + 10 + 1];
/* For a locale name such as "French_France.65001", in Windows 10,
setlocale now returns "French_France.utf8" instead, or in the UTF-8
environment (with modern system settings) "fr_FR.UTF-8". */
- if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0
- || strcmp (buf + 2, "UTF-8") == 0)
+ if (streq (buf + 2, "65001") || streq (buf + 2, "utf8") || streq (buf + 2, "UTF-8"))
codeset = "UTF-8";
else
{
}
/* For the POSIX locale, don't use the system's codepage. */
- if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+ if (streq (locale, "C") || streq (locale, "POSIX"))
codeset = "";
}
Speed up the common case and slow down the less common cases by
testing for this case first. */
# if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
- if (strcmp (codeset, "UTF-8") == 0)
+ if (streq (codeset, "UTF-8"))
goto done_table_lookup;
else
# endif
#ifdef DARWIN7
/* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
(the default codeset) does not work when MB_CUR_MAX is 1. */
- if (strcmp (codeset, "UTF-8") == 0 && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
+ if (ostreq (codeset, "UTF-8") && MB_CUR_MAX_L (uselocale (NULL)) <= 1)
codeset = "ASCII";
#endif
#if HAVE_CFPREFERENCESCOPYAPPVALUE
/* Mac OS X 10.2 or newer.
Ignore invalid LANG value set by the Terminal application. */
- if (strcmp (retval, "UTF-8") != 0)
+ if (!streq (retval, "UTF-8"))
#endif
#if defined __CYGWIN__
/* Cygwin.
Ignore dummy LANG value set by ~/.profile. */
- if (strcmp (retval, "C.UTF-8") != 0)
+ if (!streq (retval, "C.UTF-8"))
#endif
return retval;
}
else
i1 = i;
}
- if (strcmp (name, legacy_table[i1].legacy) == 0)
+ if (streq (name, legacy_table[i1].legacy))
{
strcpy (name, legacy_table[i1].unixy);
return;
else
i1 = i;
}
- if (strcmp (name, langtag_table[i1].langtag) == 0)
+ if (streq (name, langtag_table[i1].langtag))
{
strcpy (name, langtag_table[i1].unixy);
return;
else
i1 = i;
}
- if (strcmp (name + 3, script_table[i1].script) == 0)
+ if (streq (name + 3, script_table[i1].script))
{
name[2] = '@';
strcpy (name + 3, script_table[i1].unixy);
/* Lock while looking for an LCID, to protect access to static
variables: last_lcid, last_locale, found_lcid, and lname. */
glwthread_mutex_lock (&get_lcid_lock);
- if (last_lcid > 0 && strcmp (locale_name, last_locale) == 0)
+ if (last_lcid > 0 && streq (locale_name, last_locale))
{
glwthread_mutex_unlock (&get_lcid_lock);
return last_lcid;
if (!mbi_avail (iter))
/* We can get here due to incomplete multibyte characters. */
return false;
- return strcmp (mbi_cur_ptr (iter), suffix) == 0;
+ return streq (mbi_cur_ptr (iter), suffix);
}
}
return false;
#endif
#define ME_DUMMY_0(Fs_name, Fs_type) \
- (strcmp (Fs_type, "autofs") == 0 \
- || strcmp (Fs_type, "proc") == 0 \
- || strcmp (Fs_type, "subfs") == 0 \
+ (streq (Fs_type, "autofs") \
+ || streq (Fs_type, "proc") \
+ || streq (Fs_type, "subfs") \
/* for Linux 2.6/3.x */ \
- || strcmp (Fs_type, "debugfs") == 0 \
- || strcmp (Fs_type, "devpts") == 0 \
- || strcmp (Fs_type, "fusectl") == 0 \
- || strcmp (Fs_type, "fuse.portal") == 0 \
- || strcmp (Fs_type, "mqueue") == 0 \
- || strcmp (Fs_type, "rpc_pipefs") == 0 \
- || strcmp (Fs_type, "sysfs") == 0 \
+ || streq (Fs_type, "debugfs") \
+ || streq (Fs_type, "devpts") \
+ || streq (Fs_type, "fusectl") \
+ || streq (Fs_type, "fuse.portal") \
+ || streq (Fs_type, "mqueue") \
+ || streq (Fs_type, "rpc_pipefs") \
+ || streq (Fs_type, "sysfs") \
/* FreeBSD, Linux 2.4 */ \
- || strcmp (Fs_type, "devfs") == 0 \
+ || streq (Fs_type, "devfs") \
/* for NetBSD 3.0 */ \
- || strcmp (Fs_type, "kernfs") == 0)
+ || streq (Fs_type, "kernfs"))
/* Historically, we have marked as "dummy" any file system of type "none",
but now that programs like du need to know about bind-mounted directories,
#ifdef MOUNTED_GETMNTENT1
# define ME_DUMMY(Fs_name, Fs_type, Bind) \
(ME_DUMMY_0 (Fs_name, Fs_type) \
- || (strcmp (Fs_type, "none") == 0 && !Bind))
+ || (streq (Fs_type, "none") && !Bind))
#else
# define ME_DUMMY(Fs_name, Fs_type) \
- (ME_DUMMY_0 (Fs_name, Fs_type) || strcmp (Fs_type, "none") == 0)
+ (ME_DUMMY_0 (Fs_name, Fs_type) || streq (Fs_type, "none"))
#endif
#ifdef __CYGWIN__
(strchr (Fs_name, ':') != NULL \
|| ((Fs_name)[0] == '/' \
&& (Fs_name)[1] == '/' \
- && (strcmp (Fs_type, "smbfs") == 0 \
- || strcmp (Fs_type, "smb3") == 0 \
- || strcmp (Fs_type, "cifs") == 0)) \
- || strcmp (Fs_type, "acfs") == 0 \
- || strcmp (Fs_type, "afs") == 0 \
- || strcmp (Fs_type, "coda") == 0 \
- || strcmp (Fs_type, "auristorfs") == 0 \
- || strcmp (Fs_type, "fhgfs") == 0 \
- || strcmp (Fs_type, "gpfs") == 0 \
- || strcmp (Fs_type, "ibrix") == 0 \
- || strcmp (Fs_type, "ocfs2") == 0 \
- || strcmp (Fs_type, "vxfs") == 0 \
- || strcmp ("-hosts", Fs_name) == 0)
+ && (streq (Fs_type, "smbfs") \
+ || streq (Fs_type, "smb3") \
+ || streq (Fs_type, "cifs"))) \
+ || streq (Fs_type, "acfs") \
+ || streq (Fs_type, "afs") \
+ || streq (Fs_type, "coda") \
+ || streq (Fs_type, "auristorfs") \
+ || streq (Fs_type, "fhgfs") \
+ || streq (Fs_type, "gpfs") \
+ || streq (Fs_type, "ibrix") \
+ || streq (Fs_type, "ocfs2") \
+ || streq (Fs_type, "vxfs") \
+ || streq ("-hosts", Fs_name))
#endif
#if MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
char *name;
struct stat statbuf;
- if (strcmp (d->d_name, "..") == 0)
+ if (streq (d->d_name, ".."))
continue;
- if (strcmp (d->d_name, ".") == 0)
+ if (streq (d->d_name, "."))
name = xstrdup ("/");
else
{
if (category_mask != 0)
{
/* Test whether NAME is valid. */
- if (!(strcmp (name, "C") == 0 || strcmp (name, "POSIX") == 0))
+ if (!(streq (name, "C") || streq (name, "POSIX")))
{
char *filename = (char *) malloc (18 + strlen (name) + 9 + 1);
if (filename == NULL)
}
/* Canonicalize the name. */
- if (strcmp (name, "POSIX") == 0)
+ if (streq (name, "POSIX"))
name = "C";
# if !HAVE_WINDOWS_LOCALE_T
/* In this case, the only NAMEs that we support are "C" and (equivalently)
"POSIX". */
- if (category_mask != 0 && strcmp (name, "C") != 0)
+ if (category_mask != 0 && !streq (name, "C"))
{
errno = ENOENT;
return NULL;
err = ENOMEM;
goto fail_with_err;
}
- if (strcmp (lcname, "C") == 0)
+ if (streq (lcname, "C"))
{
result->category[i].is_c_locale = true;
# if HAVE_WINDOWS_LOCALE_T
sprintf (buf + 2, "%u", GetACP ());
/* For a locale name such as "French_France.65001", in Windows 10,
setlocale now returns "French_France.utf8" instead. */
- if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+ if (streq (buf + 2, "65001") || streq (buf + 2, "utf8"))
return (char *) "UTF-8";
else
{
return NULL;
while ((mnt = getmntent (fp)) != NULL)
{
- if (strcmp (mnt->mnt_type, "cgroup2") == 0)
+ if (streq (mnt->mnt_type, "cgroup2"))
{
ret = strdup (mnt->mnt_dir);
break;
#endif
#if defined _WIN32 && ! defined __CYGWIN__
- if (strcmp (filename, "/dev/null") == 0)
+ if (streq (filename, "/dev/null"))
filename = "NUL";
#endif
#endif
if (!(libcx_spawn2_loaded
- || (currdir == NULL || strcmp (currdir, ".") == 0)))
+ || (currdir == NULL || streq (currdir, "."))))
{
errno = EINVAL;
return -1;
|| dup2 (new_stderr, STDERR_FILENO) >= 0))
{
if (!libcx_spawn2_loaded
- || (currdir == NULL || strcmp (currdir, ".") == 0))
+ || (currdir == NULL || streq (currdir, ".")))
ret = spawnvpe (mode, progname, (char * const *) argv,
(char * const *) envp);
#if HAVE_LIBCX_SPAWN2_H
#define HOUR(x) (60 * 60 * (x))
-#define STREQ(a, b) (strcmp (a, b) == 0)
-
/* Verify that time_t is an integer as POSIX requires, and that every
time_t value fits in intmax_t. Please file a bug report if these
assumptions are false on your platform. */
table const *tp;
for (tp = universal_time_zone_table; tp->name; tp++)
- if (strcmp (name, tp->name) == 0)
+ if (streq (name, tp->name))
return tp;
/* Try local zone abbreviations before those in time_zone_table, as
the local ones are more likely to be right. */
for (tp = pc->local_time_zone_table; tp->name; tp++)
- if (strcmp (name, tp->name) == 0)
+ if (streq (name, tp->name))
return tp;
for (tp = time_zone_table; tp->name; tp++)
- if (strcmp (name, tp->name) == 0)
+ if (streq (name, tp->name))
return tp;
return NULL;
*p = c_toupper (to_uchar (*p));
for (tp = meridian_table; tp->name; tp++)
- if (strcmp (word, tp->name) == 0)
+ if (streq (word, tp->name))
return tp;
/* See if we have an abbreviation for a month. */
if ((tp = lookup_zone (pc, word)))
return tp;
- if (strcmp (word, dst_table[0].name) == 0)
+ if (streq (word, dst_table[0].name))
return dst_table;
for (tp = time_units_table; tp->name; tp++)
- if (strcmp (word, tp->name) == 0)
+ if (streq (word, tp->name))
return tp;
/* Strip off any plural and try the units table again. */
{
word[wordlen - 1] = '\0';
for (tp = time_units_table; tp->name; tp++)
- if (strcmp (word, tp->name) == 0)
+ if (streq (word, tp->name))
return tp;
word[wordlen - 1] = 'S'; /* For "this" in relative_time_table. */
}
for (tp = relative_time_table; tp->name; tp++)
- if (strcmp (word, tp->name) == 0)
+ if (streq (word, tp->name))
return tp;
/* Military time zones. */
populate_local_time_zone_table (&pc, &probe_tm);
if (pc.local_time_zone_table[1].name)
{
- if (! strcmp (pc.local_time_zone_table[0].name,
- pc.local_time_zone_table[1].name))
+ if (streq (pc.local_time_zone_table[0].name,
+ pc.local_time_zone_table[1].name))
{
/* This locale uses the same abbreviation for standard and
daylight times. So if we see that abbreviation, we don't
{
if (tz != tzdefault)
fprintf (stderr, _("TZ=\"%s\" in date string"), tzstring);
- else if (STREQ (tzstring, "UTC0"))
+ else if (streq (tzstring, "UTC0"))
{
/* Special case: 'date -u' sets TZ="UTC0". */
fputs (_("TZ=\"UTC0\" environment value or -u"), stderr);
/* Special case: using 'date -u' simply set TZ=UTC0 */
if (! tzstring)
dbg_fputs (_("timezone: system default\n"));
- else if (STREQ (tzstring, "UTC0"))
+ else if (streq (tzstring, "UTC0"))
dbg_fputs (_("timezone: Universal Time\n"));
else
dbg_printf (_("timezone: TZ=\"%s\" environment value\n"), tzstring);
popen (const char *filename, const char *mode)
{
/* Use binary mode by default. */
- if (strcmp (mode, "r") == 0)
+ if (streq (mode, "r"))
mode = "rb";
- else if (strcmp (mode, "w") == 0)
+ else if (streq (mode, "w"))
mode = "wb";
return _popen (filename, mode);
link = xreadlink ("/proc/curproc/file");
if (link != NULL)
{
- if (strcmp (link, "unknown") != 0)
+ if (!streq (link, "unknown"))
return link;
free (link);
}
/* See whether we have a translation. Some translators have not understood
that they should use the UTF-8 form of the name, if possible. So if the
translator provided a no-op translation, we ignore it. */
- if (strcmp (translation, name_ascii) != 0)
+ if (!streq (translation, name_ascii))
{
/* See whether the translation contains the original name. */
if (mbsstr_trimmed_wordbounded (translation, name_ascii)
}
/* It would be possible to drop setuid/setgid privileges here. But it is not
- really needed, since the code below only calls strcmp and [f]printf. */
+ really needed, since the code below only calls streq and [f]printf. */
{
int do_help = 0;
if (arg[0] == '-')
{
- if (strcmp (arg, "--") == 0)
+ if (streq (arg, "--"))
{
remaining++;
break;
}
- else if (strcmp (arg, "--help") == 0)
+ else if (streq (arg, "--help"))
do_help = 1;
- else if (strcmp (arg, "--version") == 0)
+ else if (streq (arg, "--version"))
do_version = 1;
else
{
name_x[name_end - string + 2] = 0;
putenv_result = _putenv (name_x);
for (ep = environ; *ep; ep++)
- if (strcmp (*ep, name_x) == 0)
+ if (streq (*ep, name_x))
{
*ep = string;
break;
{
/* We need to explicitly test for the known extended attribute names,
because at least on CentOS 7, attr_copy_action does not do it. */
- return strcmp (name, XATTR_NAME_POSIX_ACL_ACCESS) == 0
- || strcmp (name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0
- || strcmp (name, XATTR_NAME_NFSV4_ACL) == 0
+ return streq (name, XATTR_NAME_POSIX_ACL_ACCESS)
+ || streq (name, XATTR_NAME_POSIX_ACL_DEFAULT)
+ || streq (name, XATTR_NAME_NFSV4_ACL)
|| attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
}
SET_UTMP_ENT ();
# if (defined __linux__ && !defined __ANDROID__) || defined __minix
- bool file_is_utmp = (strcmp (file, UTMP_FILE) == 0);
+ bool file_is_utmp = streq (file, UTMP_FILE);
/* Timestamp of the "runlevel" entry, if any. */
struct timespec runlevel_ts = {0};
# endif
it produces wrong values after the date has been bumped in the running
system. */
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
}
else
{
- if (strcmp (file, UTMP_FILE) != 0)
+ if (!streq (file, UTMP_FILE))
{
int saved_errno = errno;
free (a.utmp);
# if defined __OpenBSD__
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
# if defined __linux__ && !defined __ANDROID__
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
&& defined CTL_KERN && defined KERN_BOOTTIME \
&& !defined __minix
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
# if defined __HAIKU__
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
# if HAVE_OS_H /* BeOS, Haiku */
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
# if defined __CYGWIN__ || defined _WIN32
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
# if defined _WIN32 && ! defined __CYGWIN__
if ((options & (READ_UTMP_USER_PROCESS | READ_UTMP_NO_BOOT_TIME)) == 0
- && strcmp (file, UTMP_FILE) == 0
+ && streq (file, UTMP_FILE)
&& !have_boot_time (a))
{
struct timespec boot_time;
/* Try harder to get a sensible value for the tty. */
if (sd_session_get_type (session, &type) < 0)
type = missing;
- if (strcmp (type, "tty") == 0)
+ if (streq (type, "tty"))
{
char *service;
if (sd_session_get_service (session, &service) < 0)
else if (pty != NULL)
tty = pty;
}
- else if (strcmp (type, "web") == 0)
+ else if (streq (type, "web"))
{
char *service;
if (sd_session_get_service (session, &service) < 0)
host field. */
if (!type && sd_session_get_type (session, &type) < 0)
type = missing;
- if (strcmp (type, "x11") == 0)
+ if (streq (type, "x11"))
{
char *display;
if (sd_session_get_display (session, &display) < 0)
int options)
{
# if READUTMP_USE_SYSTEMD
- if (strcmp (file, UTMP_FILE) == 0)
+ if (streq (file, UTMP_FILE))
/* Imitate reading UTMP_FILE, using systemd and Linux APIs. */
return read_utmp_from_systemd (n_entries, utmp_buf, options);
# endif
static int
try (const char *response, const char *pattern, char **lastp, regex_t *re)
{
- if (*lastp == NULL || strcmp (pattern, *lastp) != 0)
+ if (*lastp == NULL || !streq (pattern, *lastp))
{
char *safe_pattern;
{
bool all_same = true;
for (size_t i = 1; i < 12; i++)
- if (strcmp (lc_cat_name[i], lc_cat_name[0]) != 0)
+ if (!streq (lc_cat_name[i], lc_cat_name[0]))
{
all_same = false;
break;
/* The native Windows implementation of setlocale understands the special
locale name "C", but not "POSIX". Therefore map "POSIX" to "C". */
- if (locale != NULL && strcmp (locale, "POSIX") == 0)
+ if (locale != NULL && streq (locale, "POSIX"))
locale = "C";
/* The native Windows implementation of setlocale, in the UTF-8 environment,
but it understands "English_United States.65001", which is functionally
equivalent. */
if (locale != NULL
- && ((is_utf8 && strcmp (locale, "C") == 0)
- || strcmp (locale, "C.UTF-8") == 0))
+ && ((is_utf8 && streq (locale, "C"))
+ || streq (locale, "C.UTF-8")))
locale = "English_United States.65001";
/* First, try setlocale with the original argument unchanged. */
/* llCC_buf now contains
language[_territory][@modifier]
*/
- if (strcmp (llCC_buf, locale) != 0)
+ if (!streq (llCC_buf, locale))
{
if (is_utf8)
{
case LC_TELEPHONE:
case LC_MEASUREMENT:
if (locale == NULL
- || strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+ || streq (locale, "C") || streq (locale, "POSIX"))
result = (char *) "C";
break;
default:
LC_CTYPE category to an invalid value ("C") when it does not
support the specified encoding. Report a failure instead. */
if (strchr (base_name, '.') != NULL
- && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ && streq (setlocale (LC_CTYPE, NULL), "C"))
goto fail;
# endif
/* If name is the same as base_name, it has already been set
through the setlocale call before the loop. */
- if (strcmp (name, base_name) != 0
+ if (!streq (name, base_name)
# if LC_MESSAGES == 1729
|| cat == LC_MESSAGES
# endif
set the LC_CTYPE category to an invalid value ("C") when
it does not support the specified encoding. Report a
failure instead. */
- if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+ if (streq (setlocale (LC_CTYPE, NULL), "C"))
{
/* Don't risk an endless recursion. */
if (saved_locale[0] != '\0')
{
char *name1 = setlocale (LC_ALL, NULL);
char *name2 = setlocale_single (LC_MESSAGES, NULL);
- if (strcmp (name1, name2) == 0)
+ if (streq (name1, name2))
/* Not a mixed locale. */
return name1;
else
{
unsigned int i;
for (i = 0; i < NUMNAME_ENTRIES; i++)
- if (strcmp (numname_table[i].name, signame) == 0)
+ if (streq (numname_table[i].name, signame))
return numname_table[i].num;
{
open_handle (const char *name, int flags, mode_t mode)
{
/* To ease portability. Like in open.c. */
- if (strcmp (name, "/dev/null") == 0)
+ if (streq (name, "/dev/null"))
name = "NUL";
/* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
<https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ? */
/* To ease portability. Like in open.c. */
- if (strcmp (name, "/dev/null") == 0)
+ if (streq (name, "/dev/null"))
name = "NUL";
/* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
{
size_t len = strlen (string);
size_t n = strlen (suffix);
- return len >= n && strcmp (string + len - n, suffix) == 0;
+ return len >= n && streq (string + len - n, suffix);
}
static inline int
streq9 (const char *s1, const char *s2)
{
- return strcmp (s1 + 9, s2 + 9) == 0;
+ return streq (s1 + 9, s2 + 9);
}
static inline int
/* Unsupported from_codeset or to_codeset. Check whether the caller
requested autodetection. */
for (alias = autodetect_list; alias != NULL; alias = alias->next)
- if (strcmp (from_codeset, alias->name) == 0)
+ if (streq (from_codeset, alias->name))
{
const char * const *encodings;
/* Unsupported from_codeset or to_codeset. Check whether the caller
requested autodetection. */
for (alias = autodetect_list; alias != NULL; alias = alias->next)
- if (strcmp (from_codeset, alias->name) == 0)
+ if (streq (from_codeset, alias->name))
{
const char * const *encodings;
struct struniq_hash_node *new_node;
struct struniq_hash_node *p;
for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
- if (strcmp (p->contents, string) == 0)
+ if (streq (p->contents, string))
return p->contents;
size = strlen (string) + 1;
new_node =
/* Check whether another thread already added the string while we were
waiting on the lock. */
for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
- if (strcmp (p->contents, string) == 0)
+ if (streq (p->contents, string))
{
free (new_node);
new_node = p;
#endif
#if defined _WIN32 && ! defined __CYGWIN__
- if (strcmp (filename, "/dev/null") == 0)
+ if (streq (filename, "/dev/null"))
filename = "NUL";
#endif
{
zone_copy = tz->abbrs;
- while (strcmp (zone_copy, zone) != 0)
+ while (!streq (zone_copy, zone))
{
if (! (*zone_copy || (zone_copy == tz->abbrs && tz->tz_is_set)))
{
{
char *env_tz = getenv_TZ ();
if (env_tz
- ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0
+ ? tz->tz_is_set && streq (tz->abbrs, env_tz)
: !tz->tz_is_set)
return local_tz;
else
{
const char *charset = locale_charset ();
- is_utf8 = !strcmp (charset, UTF8_NAME);
+ is_utf8 = streq (charset, UTF8_NAME);
#if HAVE_ICONV
if (!is_utf8)
{
stackbuf[strlen (stackbuf) - 3] = '\0';
# if defined __sun
/* Solaris specific hack: Replace wrong result (0xC2 means U+00A0). */
- if (strcmp (&stackbuf[1], "\302") == 0)
+ if (streq (&stackbuf[1], "\302"))
strcpy (&stackbuf[1], MB_CUR_MAX > 1 ? "\302\240" : "\240");
# endif
return &stackbuf[1];
/* Now tmp = L"1<thousep>000". */
tmp[strlen (tmp) - 3] = '\0';
/* Solaris specific hack: Replace wrong result (0xC2 means U+00A0). */
- if (strcmp (&tmp[1], "\302") == 0)
+ if (streq (&tmp[1], "\302"))
strcpy (&tmp[1], MB_CUR_MAX > 1 ? "\302\240" : "\240");
if (tmp[1] != '\0')
{
static long
ancestor_level (const char *dir1, const char *dir2)
{
- if (strcmp (dir1, "/") == 0)
+ if (streq (dir1, "/"))
dir1 = "";
- if (strcmp (dir2, "/") == 0)
+ if (streq (dir2, "/"))
dir2 = "";
size_t dir1_len = strlen (dir1);
if (strncmp (dir1, dir2, dir1_len) == 0)
relativize (const char *filename,
unsigned long n, const char *dir1, const char *dir2)
{
- if (strcmp (dir1, "/") == 0)
+ if (streq (dir1, "/"))
dir1 = "";
size_t dir1_len = strlen (dir1);
if (!(strncmp (filename, dir1, dir1_len) == 0
&& (filename[dir1_len] == '\0' || ISSLASH (filename[dir1_len]))))
/* Invalid argument. */
abort ();
- if (strcmp (dir2, "/") == 0)
+ if (streq (dir2, "/"))
dir2 = "";
dir2 += dir1_len;
/* Test which of these absolute file names are outside of the
git_checkout. */
char *git_checkout_slash =
- (strcmp (git_checkout, "/") == 0
+ (streq (git_checkout, "/")
? xstrdup (git_checkout)
: xasprintf ("%s%c", git_checkout, SLASH));
static void
test_relativize (void)
{
- assert (strcmp (relativize ("/home/user/projects/gnulib",
- 0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
- ".") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/NEWS",
- 0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
- "NEWS") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/doc/Makefile",
- 0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
- "doc/Makefile") == 0);
-
- assert (strcmp (relativize ("/",
- 0, "/", "/"),
- ".") == 0);
- assert (strcmp (relativize ("/swapfile",
- 0, "/", "/"),
- "swapfile") == 0);
- assert (strcmp (relativize ("/etc/passwd",
- 0, "/", "/"),
- "etc/passwd") == 0);
-
- assert (strcmp (relativize ("/home/user/projects/gnulib",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- "../../") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/lib",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- "../") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/lib/crypto",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- ".") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/lib/malloc",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- "../malloc") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/lib/cr",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- "../cr") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/lib/cryptography",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- "../cryptography") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/doc",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- "../../doc") == 0);
- assert (strcmp (relativize ("/home/user/projects/gnulib/doc/Makefile",
- 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
- "../../doc/Makefile") == 0);
-
- assert (strcmp (relativize ("/",
- 2, "/", "/home/user"),
- "../../") == 0);
- assert (strcmp (relativize ("/home",
- 2, "/", "/home/user"),
- "../") == 0);
- assert (strcmp (relativize ("/home/user",
- 2, "/", "/home/user"),
- ".") == 0);
- assert (strcmp (relativize ("/home/root",
- 2, "/", "/home/user"),
- "../root") == 0);
- assert (strcmp (relativize ("/home/us",
- 2, "/", "/home/user"),
- "../us") == 0);
- assert (strcmp (relativize ("/home/users",
- 2, "/", "/home/user"),
- "../users") == 0);
- assert (strcmp (relativize ("/etc",
- 2, "/", "/home/user"),
- "../../etc") == 0);
- assert (strcmp (relativize ("/etc/passwd",
- 2, "/", "/home/user"),
- "../../etc/passwd") == 0);
+ assert (streq (relativize ("/home/user/projects/gnulib",
+ 0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
+ "."));
+ assert (streq (relativize ("/home/user/projects/gnulib/NEWS",
+ 0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
+ "NEWS"));
+ assert (streq (relativize ("/home/user/projects/gnulib/doc/Makefile",
+ 0, "/home/user/projects/gnulib", "/home/user/projects/gnulib"),
+ "doc/Makefile"));
+
+ assert (streq (relativize ("/",
+ 0, "/", "/"),
+ "."));
+ assert (streq (relativize ("/swapfile",
+ 0, "/", "/"),
+ "swapfile"));
+ assert (streq (relativize ("/etc/passwd",
+ 0, "/", "/"),
+ "etc/passwd"));
+
+ assert (streq (relativize ("/home/user/projects/gnulib",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "../../"));
+ assert (streq (relativize ("/home/user/projects/gnulib/lib",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "../"));
+ assert (streq (relativize ("/home/user/projects/gnulib/lib/crypto",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "."));
+ assert (streq (relativize ("/home/user/projects/gnulib/lib/malloc",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "../malloc"));
+ assert (streq (relativize ("/home/user/projects/gnulib/lib/cr",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "../cr"));
+ assert (streq (relativize ("/home/user/projects/gnulib/lib/cryptography",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "../cryptography"));
+ assert (streq (relativize ("/home/user/projects/gnulib/doc",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "../../doc"));
+ assert (streq (relativize ("/home/user/projects/gnulib/doc/Makefile",
+ 2, "/home/user/projects/gnulib", "/home/user/projects/gnulib/lib/crypto"),
+ "../../doc/Makefile"));
+
+ assert (streq (relativize ("/",
+ 2, "/", "/home/user"),
+ "../../"));
+ assert (streq (relativize ("/home",
+ 2, "/", "/home/user"),
+ "../"));
+ assert (streq (relativize ("/home/user",
+ 2, "/", "/home/user"),
+ "."));
+ assert (streq (relativize ("/home/root",
+ 2, "/", "/home/user"),
+ "../root"));
+ assert (streq (relativize ("/home/us",
+ 2, "/", "/home/user"),
+ "../us"));
+ assert (streq (relativize ("/home/users",
+ 2, "/", "/home/user"),
+ "../users"));
+ assert (streq (relativize ("/etc",
+ 2, "/", "/home/user"),
+ "../../etc"));
+ assert (streq (relativize ("/etc/passwd",
+ 2, "/", "/home/user"),
+ "../../etc/passwd"));
}
/* Usage: ./a.out FILE[...]
switch (name[2])
{
case 'l':
- if (strcmp (name + 3, "ower") == 0)
+ if (streq (name + 3, "ower"))
return (wctrans_t) towlower;
break;
case 'u':
- if (strcmp (name + 3, "pper") == 0)
+ if (streq (name + 3, "pper"))
return (wctrans_t) towupper;
break;
default:
switch (name[2])
{
case 'n':
- if (strcmp (name + 3, "um") == 0)
+ if (streq (name + 3, "um"))
return (wctype_t) iswalnum;
break;
case 'p':
- if (strcmp (name + 3, "ha") == 0)
+ if (streq (name + 3, "ha"))
return (wctype_t) iswalpha;
break;
default:
}
break;
case 'b':
- if (strcmp (name + 1, "lank") == 0)
+ if (streq (name + 1, "lank"))
return (wctype_t) iswblank;
break;
case 'c':
- if (strcmp (name + 1, "ntrl") == 0)
+ if (streq (name + 1, "ntrl"))
return (wctype_t) iswcntrl;
break;
case 'd':
- if (strcmp (name + 1, "igit") == 0)
+ if (streq (name + 1, "igit"))
return (wctype_t) iswdigit;
break;
case 'g':
- if (strcmp (name + 1, "raph") == 0)
+ if (streq (name + 1, "raph"))
return (wctype_t) iswgraph;
break;
case 'l':
- if (strcmp (name + 1, "ower") == 0)
+ if (streq (name + 1, "ower"))
return (wctype_t) iswlower;
break;
case 'p':
switch (name[1])
{
case 'r':
- if (strcmp (name + 2, "int") == 0)
+ if (streq (name + 2, "int"))
return (wctype_t) iswprint;
break;
case 'u':
- if (strcmp (name + 2, "nct") == 0)
+ if (streq (name + 2, "nct"))
return (wctype_t) iswpunct;
break;
default:
}
break;
case 's':
- if (strcmp (name + 1, "pace") == 0)
+ if (streq (name + 1, "pace"))
return (wctype_t) iswspace;
break;
case 'u':
- if (strcmp (name + 1, "pper") == 0)
+ if (streq (name + 1, "pper"))
return (wctype_t) iswupper;
break;
case 'x':
- if (strcmp (name + 1, "digit") == 0)
+ if (streq (name + 1, "digit"))
return (wctype_t) iswxdigit;
break;
default:
fstat
minmax
stat
+stringeq
bool
sys_stat-h
stdint-h
extern-inline
getopt-gnu
strchrnul
+stringeq
sysexits-h
malloc-gnu
mempcpy
wctrans
c32tolower
c32toupper
+stringeq
configure.ac:
gl_UCHAR_MODULE_INDICATOR([c32_get_mapping])
c32isspace
c32isupper
c32isxdigit
+stringeq
configure.ac:
gl_UCHAR_MODULE_INDICATOR([c32_get_type_test])
filename
malloc-posix
stpcpy
+stringeq
configure.ac:
attribute
bool
c99
+stringeq
configure.ac:
AC_REQUIRE([AC_C_INLINE])
stdio-h
stdlib-h
string-h
+stringeq
uchar-h
# The lonesome_lower array requires ISO C 23 semantics for char32_t.
# But uchar-h-c23 has a global effect, therefore leave it to each package
freelocale [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
newlocale [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
setlocale-null [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
+stringeq [test $HAVE_LOCALE_T = 0 || { test $HAVE_DUPLOCALE = 1 && test $REPLACE_DUPLOCALE = 1; }]
configure.ac:
gl_FUNC_DUPLOCALE
mbuiter [test "$GNULIB_MCEL_PREFER" != yes]
nullptr
regex
+stringeq
bool
unlocked-io-internal
xalloc
xconcat-filename
access
stat
+stringeq
unistd-h
configure.ac:
access
stat
strdup-posix
+stringeq
malloc-posix
unistd-h
largefile
fcntl-h [test $REPLACE_FOPEN = 1]
bool [test $REPLACE_FOPEN = 1]
+stringeq [test $REPLACE_FOPEN = 1]
unistd-h [test $REPLACE_FOPEN = 1]
close [test $REPLACE_FOPEN = 1]
fstat [test $REPLACE_FOPEN = 1]
open [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
fcntl-h [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
bool [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
+stringeq [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
unistd-h [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
close [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
fstat [test $REPLACE_FOPEN_FOR_FOPEN_GNU = 1]
Depends-on:
fcntl-h [test $REPLACE_FREOPEN = 1]
+stringeq [test $REPLACE_FREOPEN = 1]
open [test $REPLACE_FREOPEN = 1]
stdio-h
largefile
bool
stddef-h
stdint-h
+stringeq
configure.ac:
gl_FUNC_FTS
getlocalename_l-unsafe [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
flexmember [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
lock [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
+stringeq [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
bool [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
thread-optim [test $HAVE_GETLOCALENAME_L = 0 || test $REPLACE_GETLOCALENAME_L = 1]
getlocalename_l-unsafe-limited
flexmember
lock
+stringeq
bool
thread-optim
setlocale-fixes
Depends-on:
unistd-h
readutmp [test $HAVE_GETLOGIN = 0 || test $REPLACE_GETLOGIN = 1]
+stringeq [test $HAVE_GETLOGIN = 0 || test $REPLACE_GETLOGIN = 1]
configure.ac:
gl_FUNC_GETLOGIN
Depends-on:
errno-h
+stringeq
configure.ac:
gl_GETUGROUPS
Depends-on:
bool
setlocale-null
+stringeq
configure.ac:
AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
Depends-on:
hashcode-string2
same-inode
+stringeq
bool
configure.ac:
Depends-on:
bool
+stringeq
configure.ac:
c-ctype [test $REPLACE_ICONV_OPEN = 1]
c-strcasecmp [test $REPLACE_ICONV_OPEN = 1]
stdint-h [test $REPLACE_ICONV_UTF = 1]
+stringeq [test $REPLACE_ICONV_UTF = 1]
unistr/u8-mbtoucr [test $REPLACE_ICONV_UTF = 1]
unistr/u8-uctomb [test $REPLACE_ICONV_UTF = 1]
Depends-on:
flexmember
+stringeq
xalloc
configure.ac:
Depends-on:
extensions
+stringeq
configure.ac:
gl_LOCALCHARSET
localename-unsafe
flexmember
lock
+stringeq
bool
thread-optim
extensions
locale-h
strdup
+stringeq
windows-mutex
getlocalename_l-unsafe
setlocale-null-unlocked
string-h
bool
str_endswith
+stringeq
mbslen
mbiter
unlocked-io-internal
bool
stdint-h
+stringeq
strstr-simple
xalloc
Depends-on:
locale-h
localename-environ
+stringeq
configure.ac:
gl_FUNC_NEWLOCALE
langinfo-h
localeconv [test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1]
setlocale-null [test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0]
+stringeq [test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0]
configure.ac:
gl_FUNC_NL_LANGINFO
c-ctype
extensions
minmax
+stringeq
unistd-h
configure.ac:
fstat [test $REPLACE_OPEN = 1]
lstat [test $REPLACE_OPEN = 1]
stat [test $REPLACE_OPEN = 1]
+stringeq [test $REPLACE_OPEN = 1]
configure.ac:
gl_FUNC_OPEN
inttypes-h
mktime
stdckdint-h
+stringeq
time-h
time_r
time_rz
Depends-on:
stdio-h
open [test $HAVE_POPEN = 0 || test $REPLACE_POPEN = 1]
+stringeq [test $HAVE_POPEN = 0 || test $REPLACE_POPEN = 1]
configure.ac:
gl_FUNC_POPEN
findprog-in [test $HAVE_POSIX_SPAWN = 0]
free-posix [test $HAVE_POSIX_SPAWN = 0]
malloca [test $HAVE_POSIX_SPAWN = 0]
+stringeq [test $HAVE_POSIX_SPAWN = 0]
bool [test $HAVE_POSIX_SPAWN = 0]
windows-spawn [test $HAVE_POSIX_SPAWN = 0]
mbuiter
iconv
localcharset
+stringeq
c-strcasecmp
xstriconv
xalloc
stdlib-h
configmake
stat
+stringeq
configure.ac:
environ [test $REPLACE_PUTENV = 1]
free-posix [test $REPLACE_PUTENV = 1]
malloc-posix [test $REPLACE_PUTENV = 1]
+stringeq [test $REPLACE_PUTENV = 1]
unsetenv [test $REPLACE_PUTENV = 1]
configure.ac:
acl-permissions
dirent-h [test "$use_xattr" = yes]
file-has-acl [test "$use_xattr" = yes]
+stringeq [test "$use_xattr" = yes]
configure.ac:
gl_QCOPY_ACL
gnulib-i18n [test $HAVE_RPMATCH = 0]
regex [test $HAVE_RPMATCH = 0]
strdup [test $HAVE_RPMATCH = 0]
+stringeq [test $HAVE_RPMATCH = 0]
configure.ac:
gl_FUNC_RPMATCH
Maintainer:
Jim Meyering
-
sys_types-h
extern-inline
gen-header
+stringeq
configure.ac:
gl_HEADERS_SELINUX_SELINUX_H
malloca [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
alloca-opt [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
malloc-posix [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
+stringeq [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
unistd-h [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
environ [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1]
Depends-on:
locale-h
+stringeq
setlocale-fixes [test $NEED_SETLOCALE_IMPROVED = 1]
localename [test $NEED_SETLOCALE_IMPROVED = 1]
localename-environ [test $NEED_SETLOCALE_IMPROVED = 1]
lib/setlocale-fixes.c
Depends-on:
+stringeq
configure.ac:
AC_REQUIRE([AC_CANONICAL_HOST])
Depends-on:
signal-h
+stringeq
configure.ac:
gl_FUNC_SIG2STR
posix_spawnattr_destroy
bool
stdlib-h
+stringeq
unistd-h
unistd-safer
wait-process
malloca [test $REPLACE_STAT = 1]
pathmax [test $REPLACE_STAT = 1]
stat-time [test $REPLACE_STAT = 1]
+stringeq [test $REPLACE_STAT = 1]
bool [test $REPLACE_STAT = 1]
configure.ac:
Depends-on:
string-h
+stringeq
bool
configure.ac:
lib/streq.h
Depends-on:
+stringeq
configure.ac:
striconveh
malloca
strdup
+stringeq
c-strcasecmp
configure.ac:
c99
fcntl-h
bool
+stringeq
sys_stat-h
clean-temp
tempname
idx [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
setenv [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
bool [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
+stringeq [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
time_r [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
timegm [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
tzset [test $HAVE_TZALLOC = 0 || test $REPLACE_LOCALTIME_RZ = 1 || test $REPLACE_MKTIME_Z = 1]
extern-inline
assert-h
stdint-h
+stringeq
wchar-h
wctype-h
localcharset
error
stdio-h
+stringeq
configure.ac:
gl_UNICODEIO
Depends-on:
gen-header
bool
+stringeq
unitypes-h
configure.ac:
m4/wctrans.m4
Depends-on:
+stringeq
wctype-h
# When we override wctrans_t, we also need to override towctrans().
towctrans [test $REPLACE_WCTRANS = 1]
iswdigit [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
iswpunct [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
iswxdigit [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
+stringeq [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1]
# When we override wctype_t, we also need to override iswctype().
iswctype [test $REPLACE_WCTYPE = 1]