Blame gl/strings.in.h

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