aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string.in.h
diff options
context:
space:
mode:
authorPaul Eggert2025-01-15 19:31:07 -0800
committerPaul Eggert2025-01-15 19:31:39 -0800
commit74dc2bd28007e68532d9813a57d3ec7da0c390e3 (patch)
tree1dbf3c1106bfe8b240165710e73c18f3f1940f89 /lib/string.in.h
parent4f946a652278cc72a777fe56999bc4525f53e03a (diff)
downloademacs-74dc2bd28007e68532d9813a57d3ec7da0c390e3.tar.gz
emacs-74dc2bd28007e68532d9813a57d3ec7da0c390e3.zip
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'lib/string.in.h')
-rw-r--r--lib/string.in.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/string.in.h b/lib/string.in.h
index 1bae32ad465..ce488299006 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -1077,6 +1077,22 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
1077/* The following functions are not specified by POSIX. They are gnulib 1077/* The following functions are not specified by POSIX. They are gnulib
1078 extensions. */ 1078 extensions. */
1079 1079
1080#if @GNULIB_STR_STARTSWITH@
1081/* Returns true if STRING starts with PREFIX.
1082 Returns false otherwise. */
1083_GL_EXTERN_C bool str_startswith (const char *string, const char *prefix)
1084 _GL_ATTRIBUTE_PURE
1085 _GL_ARG_NONNULL ((1, 2));
1086#endif
1087
1088#if @GNULIB_STR_ENDSWITH@
1089/* Returns true if STRING ends with SUFFIX.
1090 Returns false otherwise. */
1091_GL_EXTERN_C bool str_endswith (const char *string, const char *prefix)
1092 _GL_ATTRIBUTE_PURE
1093 _GL_ARG_NONNULL ((1, 2));
1094#endif
1095
1080#if @GNULIB_MBSLEN@ 1096#if @GNULIB_MBSLEN@
1081/* Return the number of multibyte characters in the character string STRING. 1097/* Return the number of multibyte characters in the character string STRING.
1082 This considers multibyte characters, unlike strlen, which counts bytes. */ 1098 This considers multibyte characters, unlike strlen, which counts bytes. */
@@ -1301,6 +1317,26 @@ _GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
1301 _GL_ARG_NONNULL ((2, 3)); 1317 _GL_ARG_NONNULL ((2, 3));
1302#endif 1318#endif
1303 1319
1320#if @GNULIB_MBS_STARTSWITH@
1321/* Returns true if STRING starts with PREFIX.
1322 Returns false otherwise. */
1323_GL_EXTERN_C bool mbs_startswith (const char *string, const char *prefix)
1324 _GL_ATTRIBUTE_PURE
1325 _GL_ARG_NONNULL ((1, 2));
1326/* No extra code is needed for multibyte locales for this function. */
1327# define mbs_startswith str_startswith
1328#endif
1329
1330#if @GNULIB_MBS_ENDSWITH@
1331/* Returns true if STRING ends with SUFFIX.
1332 Returns false otherwise.
1333 Unlike str_endswith(), this function works correctly in multibyte locales.
1334 */
1335_GL_EXTERN_C bool mbs_endswith (const char *string, const char *suffix)
1336 _GL_ATTRIBUTE_PURE
1337 _GL_ARG_NONNULL ((1, 2));
1338#endif
1339
1304/* Map any int, typically from errno, into an error message. */ 1340/* Map any int, typically from errno, into an error message. */
1305#if @GNULIB_STRERROR@ 1341#if @GNULIB_STRERROR@
1306# if @REPLACE_STRERROR@ 1342# if @REPLACE_STRERROR@