1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-05-13 15:13:36 +00:00

strcasecmp_l: New module.

* lib/strings.in.h: Include <locale.h>.
(strcasecmp_l): New declaration.
* lib/strcasecmp_l.c: New file, based on lib/strcasecmp.c.
* m4/strcasecmp_l.m4: New file.
* m4/strings_h.m4 (gl_STRINGS_H): Test for strcasecmp_l.
(gl_STRINGS_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRCASECMP_L.
(gl_STRINGS_H_DEFAULTS): Initialize HAVE_STRCASECMP_L,
REPLACE_STRCASECMP_L.
* modules/strings-h (Makefile.am): Substitute GNULIB_STRCASECMP_L,
HAVE_STRCASECMP_L, REPLACE_STRCASECMP_L.
* modules/strcasecmp_l: New file.
* tests/test-strings-h-c++.cc: Check declaration of strcasecmp_l.
* doc/posix-functions/strcasecmp_l.texi: Mention the new module and the
macOS, Solaris, Cygwin bugs.
This commit is contained in:
Bruno Haible
2025-02-16 22:32:02 +01:00
parent 3b564fec28
commit 6fafa36c51
9 changed files with 246 additions and 7 deletions

39
modules/strcasecmp_l Normal file
View File

@@ -0,0 +1,39 @@
Description:
Case-insensitive string comparison for unibyte locales.
Files:
lib/strcasecmp_l.c
m4/strcasecmp_l.m4
m4/strcasecmp.m4
m4/intl-thread-locale.m4
Depends-on:
strings-h
locale-h
extensions
c-strcasecmp [test $HAVE_STRCASECMP_L = 0 || test $REPLACE_STRCASECMP_L = 1]
tolower_l [test $HAVE_STRCASECMP_L = 0 || test $REPLACE_STRCASECMP_L = 1]
configure.ac:
gl_FUNC_STRCASECMP_L
gl_CONDITIONAL([GL_COND_OBJ_STRCASECMP_L],
[test $HAVE_STRCASECMP_L = 0 || test $REPLACE_STRCASECMP_L = 1])
AM_COND_IF([GL_COND_OBJ_STRCASECMP_L], [
gl_PREREQ_STRCASECMP_L
])
gl_MODULE_INDICATOR([strcasecmp_l])
gl_STRINGS_MODULE_INDICATOR([strcasecmp_l])
Makefile.am:
if GL_COND_OBJ_STRCASECMP_L
lib_SOURCES += strcasecmp_l.c
endif
Include:
<strings.h>
License:
LGPLv2+
Maintainer:
all

View File

@@ -34,12 +34,15 @@ strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE
-e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
-e 's/@''GNULIB_FFS''@/$(GNULIB_FFS)/g' \
-e 's/@''GNULIB_STRCASECMP''@/$(GNULIB_STRCASECMP)/g' \
-e 's/@''GNULIB_STRCASECMP_L''@/$(GNULIB_STRCASECMP_L)/g' \
-e 's/@''GNULIB_STRNCASECMP''@/$(GNULIB_STRNCASECMP)/g' \
-e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \
-e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
-e 's|@''HAVE_STRCASECMP_L''@|$(HAVE_STRCASECMP_L)|g' \
-e 's|@''HAVE_STRNCASECMP''@|$(HAVE_STRNCASECMP)|g' \
-e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
-e 's|@''REPLACE_STRCASECMP''@|$(REPLACE_STRCASECMP)|g' \
-e 's|@''REPLACE_STRCASECMP_L''@|$(REPLACE_STRCASECMP_L)|g' \
-e 's|@''REPLACE_STRNCASECMP''@|$(REPLACE_STRNCASECMP)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \