1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-06-15 23:35:50 +00:00

11 Commits

Author SHA1 Message Date
Bruno Haible 875d01ba0d streq, memeq: New modules.
* lib/string.in.h (_GL_STRING_INLINE): Remove macro.
(_GL_MEMEQ_INLINE): New macro.
(memeq): Use it instead of _GL_STRING_INLINE. Test GNULIB_MEMEQ.
(_GL_STREQ_INLINE): New macro.
(streq): Use it instead of _GL_STRING_INLINE. Test GNULIB_STREQ.
* lib/memeq.c: New file.
* lib/streq.c: New file.
* lib/string.c: Remove file.
* m4/memeq.m4: New file, based on m4/stringeq.m4.
* m4/streq.m4: New file, based on m4/stringeq.m4.
* m4/stringeq.m4: Remove file.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_MEMEQ, GNULIB_STREQ. Don't initialize GNULIB_STRINGEQ.
* modules/string-h (Makefile.am): Substitute GNULIB_MEMEQ, GNULIB_STREQ.
Don't substitute GNULIB_STRINGEQ.
* modules/memeq: New file.
* modules/streq: New file.
* modules/stringeq: Change to just be the union of streq and memeq.
* MODULES.html.sh (func_all_modules): Add memeq, streq.
2026-02-28 21:17:44 +01:00
Bruno Haible bb962a9cc8 strnul: New module.
Suggested by Alejandro Colomar <alx@kernel.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2026-02/msg00121.html>.

* lib/string.in.h (gl_strnul): New function.
(strnul): New macro or template.
* lib/string.c: Update comment.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_STRNUL.
* modules/string-h (Makefile.am): Substitute GNULIB_STRNUL.
* modules/strnul: New file.
2026-02-21 10:26:13 +01:00
Bruno Haible 4672014aff strncpy: Add workaround for FreeBSD 15.0/x86_64.
* lib/string.in.h (strncpy): New declaration.
* lib/strncpy.c: New file, based on lib/wcsncpy-impl.h.
* m4/strncpy.m4: New file, based on m4/strncat.m4.
* m4/string_h.m4 (gl_STRING_H): Test whether strncpy is declared.
(gl_STRING_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRNCPY.
(gl_STRING_H_DEFAULTS): Initialize REPLACE_STRNCPY.
* modules/string-h (Makefile.am): Substitute GNULIB_STRNCPY,
REPLACE_STRNCPY.
* modules/strncpy (Status, Notice): Remove.
(Files): Add lib/strncpy.c, m4/strncpy.m4, m4/mmap-anon.m4.
(configure.ac): Invoke gl_FUNC_STRNCPY. Arrange to define
GNULIB_STRNCPY. Add GL_COND_OBJ_STRNCPY conditional.
(Makefile.am): Arrange to conditionally compile strncpy.c.
* tests/test-string-h-c++.cc: Check signature of strncpy.
* doc/posix-functions/strncpy.texi: Mention the FreeBSD bug.
2025-12-02 22:14:13 +01:00
Paul Eggert 6b7a999681 stringeq: port to platforms declaring memeq, streq
Work even if the system <string.h> declares memeq and streq.
Current standards allow systems to do that,
and we hope future systems will do it.
* lib/string.in.h (memeq) [HAVE_DECL_MEMEQ]: Do not define.
(streq) [HAVE_DECL_STREQ]: Do not define.
* m4/string_h.m4 (gl_STRING_H_DEFAULTS): Default HAVE_DECL_MEMEQ,
HAVE_DECL_STREQ.
* modules/string-h (string-h):
Substitute HAVE_DECL_MEMEQ, HAVE_DECL_STREQ.
* modules/stringeq (configure.ac):
Define HAVE_DECL_MEMEQ, HAVE_DECL_STREQ.
2025-09-17 10:12:33 -07:00
Paul Eggert 60b0949c93 stringeq: new module
* MODULES.html.sh (func_all_modules): Add stringeq.
* lib/string.c, modules/stringeq: New files.
* lib/string.in.h: Use _GL_INLINE-related macros.
(memeq, streq): New functions, if stringeq module is in use.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS):
New var GNULIB_STRINGEQ.
* modules/string-h (string.h): Substitute GNULIB_STRINGEQ.
2025-09-17 08:20:23 -07:00
Bruno Haible 7f279c8267 strerror_l: New module.
* lib/string.in.h: Include <locale.h>.
(strerror_l, strerror_l_r): New declarations.
* lib/strerror_l.c: New file.
* m4/strerror_l.m4: New file.
* m4/string_h.m4 (gl_STRING_H): Test for strerror_l.
(gl_STRING_H_REQUIRE_DEFAULTS): Initialize GNULIB_STRERROR_L.
(gl_STRING_H_DEFAULTS): Initialize HAVE_STRERROR_L, REPLACE_STRERROR_L.
* modules/string-h (Makefile.am): Substitute GNULIB_STRERROR_L,
HAVE_STRERROR_L, REPLACE_STRERROR_L.
* modules/strerror_l: New file.
* tests/test-string-h-c++.cc: Check declaration of strerror_l.
* doc/posix-functions/strerror_l.texi: Mention the new module.
2025-02-18 12:22:07 +01:00
Bruno Haible f3436baf8e mbs_endswith: New module.
* lib/string.in.h (mbs_endswith): New declaration.
* lib/mbs_endswith.c: New file.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_MBS_ENDSWITH.
* modules/string-h (Makefile.am): Substitute GNULIB_MBS_ENDSWITH.
* modules/mbs_endswith: New file.
2025-01-03 13:32:32 +01:00
Bruno Haible 398ebac484 mbs_startswith: New module.
* lib/string.in.h (mbs_startswith): New declaration.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_MBS_STARTSWITH.
* modules/string-h (Makefile.am): Substitute GNULIB_MBS_STARTSWITH.
* modules/mbs_startswith: New file.
2025-01-03 11:17:16 +01:00
Bruno Haible d89ac9373d str_endswith: New module.
* lib/string.in.h (str_endswith): New declaration.
* lib/str_endswith.c: New file.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_STR_ENDSWITH.
* modules/string-h (Makefile.am): Substitute GNULIB_STR_ENDSWITH.
* modules/str_endswith: New file.
2025-01-03 09:55:01 +01:00
Bruno Haible 24010120fa str_startswith: New module.
* lib/string.in.h (str_startswith): New declaration.
* lib/str_startswith.c: New file.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Initialize
GNULIB_STR_STARTSWITH.
* modules/string-h (Makefile.am): Substitute GNULIB_STR_STARTSWITH.
* modules/str_startswith: New file.
2025-01-03 09:54:56 +01:00
Bruno Haible d93e96eb60 Rename module string to string-h.
* modules/string-h: Renamed from modules/string.
* modules/string-h-tests: Renamed from modules/string-tests.
* modules/string-h-c++-tests: Renamed from modules/string-c++-tests.
* tests/test-string-h.c: Renamed from tests/test-string.c.
* tests/test-string-h-c++.cc: Renamed from tests/test-string-c++.cc.
* tests/test-string-h-c++2.cc: Renamed from tests/test-string-c++2.cc.
* doc/posix-headers/string.texi: Update.
* doc/posix-functions/strcat.texi: Update.
* doc/posix-functions/strcpy.texi: Update.
* doc/posix-functions/strncpy.texi: Update.
* modules/* (Depends-on): Update.
* modules/string: New file.
2024-12-27 23:38:50 +01:00