+2025-01-04 Bruno Haible <bruno@clisp.org>
+
+ *_startswith, *_endswith: Change return type to 'bool'.
+ Suggested by Paul Eggert.
+ * lib/string.in.h (str_startswith, str_endswith, mbs_startswith,
+ mbs_endswith): Change return type to 'bool'.
+ * lib/str_startswith.c (str_startswith): Likewise.
+ * lib/str_endswith.c (str_endswith): Likewise.
+ * lib/mbs_endswith.c (mbs_endswith): Likewise.
+ * modules/str_startswith (Depends-on): Add bool.
+ * modules/str_endswith (Depends-on): Likewise.
+ * modules/mbs_startswith (Depends-on): Likewise.
+ * modules/mbs_endswith (Depends-on): Likewise.
+
2025-01-03 Bruno Haible <bruno@clisp.org>
doc: Mention the new modules.
#if @GNULIB_STR_STARTSWITH@
/* Returns true if STRING starts with PREFIX.
Returns false otherwise. */
-_GL_EXTERN_C int str_startswith (const char *string, const char *prefix)
+_GL_EXTERN_C bool str_startswith (const char *string, const char *prefix)
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2));
#endif
#if @GNULIB_STR_ENDSWITH@
/* Returns true if STRING ends with SUFFIX.
Returns false otherwise. */
-_GL_EXTERN_C int str_endswith (const char *string, const char *prefix)
+_GL_EXTERN_C bool str_endswith (const char *string, const char *prefix)
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2));
#endif
#if @GNULIB_MBS_STARTSWITH@
/* Returns true if STRING starts with PREFIX.
Returns false otherwise. */
-_GL_EXTERN_C int mbs_startswith (const char *string, const char *prefix)
+_GL_EXTERN_C bool mbs_startswith (const char *string, const char *prefix)
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2));
/* No extra code is needed for multibyte locales for this function. */
Returns false otherwise.
Unlike str_endswith(), this function works correctly in multibyte locales.
*/
-_GL_EXTERN_C int mbs_endswith (const char *string, const char *suffix)
+_GL_EXTERN_C bool mbs_endswith (const char *string, const char *suffix)
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1, 2));
#endif