Blame gl/strings.in.h

Packit aea12f
/* A substitute <strings.h>.
Packit aea12f
Packit Service 991b93
   Copyright (C) 2007-2020 Free Software Foundation, Inc.
Packit aea12f
Packit aea12f
   This program is free software; you can redistribute it and/or modify
Packit Service 991b93
   it under the terms of the GNU Lesser General Public License as published by
Packit Service 991b93
   the Free Software Foundation; either version 2.1, or (at your option)
Packit aea12f
   any later version.
Packit aea12f
Packit aea12f
   This program is distributed in the hope that it will be useful,
Packit aea12f
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service 991b93
   GNU Lesser General Public License for more details.
Packit aea12f
Packit Service 991b93
   You should have received a copy of the GNU Lesser General Public License
Packit aea12f
   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
Packit aea12f
Packit aea12f
#ifndef _@GUARD_PREFIX@_STRINGS_H
Packit aea12f
Packit aea12f
#if __GNUC__ >= 3
Packit aea12f
@PRAGMA_SYSTEM_HEADER@
Packit aea12f
#endif
Packit aea12f
@PRAGMA_COLUMNS@
Packit aea12f
Packit aea12f
/* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>.
Packit aea12f
   But avoid namespace pollution on glibc systems.  */
Packit aea12f
#if defined __minix && !defined __GLIBC__
Packit aea12f
# include <sys/types.h>
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* The include_next requires a split double-inclusion guard.  */
Packit aea12f
#if @HAVE_STRINGS_H@
Packit aea12f
# @INCLUDE_NEXT@ @NEXT_STRINGS_H@
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#ifndef _@GUARD_PREFIX@_STRINGS_H
Packit aea12f
#define _@GUARD_PREFIX@_STRINGS_H
Packit aea12f
Packit aea12f
#if ! @HAVE_DECL_STRNCASECMP@
Packit aea12f
/* Get size_t.  */
Packit aea12f
# include <stddef.h>
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit aea12f
Packit aea12f
/* The definition of _GL_ARG_NONNULL is copied here.  */
Packit aea12f
Packit aea12f
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit aea12f
Packit aea12f
#ifdef __cplusplus
Packit aea12f
extern "C" {
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
  /* Find the index of the least-significant set bit.  */
Packit aea12f
#if @GNULIB_FFS@
Packit aea12f
# if !@HAVE_FFS@
Packit aea12f
_GL_FUNCDECL_SYS (ffs, int, (int i));
Packit aea12f
# endif
Packit aea12f
_GL_CXXALIAS_SYS (ffs, int, (int i));
Packit aea12f
_GL_CXXALIASWARN (ffs);
Packit aea12f
#elif defined GNULIB_POSIXCHECK
Packit aea12f
# undef ffs
Packit aea12f
# if HAVE_RAW_DECL_FFS
Packit aea12f
_GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
Packit aea12f
   greater than zero if S1 is lexicographically less than, equal to or greater
Packit aea12f
   than S2.
Packit aea12f
   Note: This function does not work in multibyte locales.  */
Packit aea12f
#if ! @HAVE_STRCASECMP@
Packit aea12f
extern int strcasecmp (char const *s1, char const *s2)
Packit aea12f
     _GL_ARG_NONNULL ((1, 2));
Packit aea12f
#endif
Packit aea12f
#if defined GNULIB_POSIXCHECK
Packit aea12f
/* strcasecmp() does not work with multibyte strings:
Packit aea12f
   POSIX says that it operates on "strings", and "string" in POSIX is defined
Packit aea12f
   as a sequence of bytes, not of characters.   */
Packit aea12f
# undef strcasecmp
Packit aea12f
# if HAVE_RAW_DECL_STRCASECMP
Packit aea12f
_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
Packit aea12f
                 "strings in multibyte locales - "
Packit aea12f
                 "use mbscasecmp if you care about "
Packit aea12f
                 "internationalization, or use c_strcasecmp , "
Packit aea12f
                 "gnulib module c-strcase) if you want a locale "
Packit aea12f
                 "independent function");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
/* Compare no more than N bytes of strings S1 and S2, ignoring case,
Packit aea12f
   returning less than, equal to or greater than zero if S1 is
Packit aea12f
   lexicographically less than, equal to or greater than S2.
Packit aea12f
   Note: This function cannot work correctly in multibyte locales.  */
Packit aea12f
#if ! @HAVE_DECL_STRNCASECMP@
Packit aea12f
extern int strncasecmp (char const *s1, char const *s2, size_t n)
Packit aea12f
     _GL_ARG_NONNULL ((1, 2));
Packit aea12f
#endif
Packit aea12f
#if defined GNULIB_POSIXCHECK
Packit aea12f
/* strncasecmp() does not work with multibyte strings:
Packit aea12f
   POSIX says that it operates on "strings", and "string" in POSIX is defined
Packit aea12f
   as a sequence of bytes, not of characters.  */
Packit aea12f
# undef strncasecmp
Packit aea12f
# if HAVE_RAW_DECL_STRNCASECMP
Packit aea12f
_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
Packit aea12f
                 "strings in multibyte locales - "
Packit aea12f
                 "use mbsncasecmp or mbspcasecmp if you care about "
Packit aea12f
                 "internationalization, or use c_strncasecmp , "
Packit aea12f
                 "gnulib module c-strcase) if you want a locale "
Packit aea12f
                 "independent function");
Packit aea12f
# endif
Packit aea12f
#endif
Packit aea12f
Packit aea12f
Packit aea12f
#ifdef __cplusplus
Packit aea12f
}
Packit aea12f
#endif
Packit aea12f
Packit aea12f
#endif /* _@GUARD_PREFIX@_STRING_H */
Packit aea12f
#endif /* _@GUARD_PREFIX@_STRING_H */