Blame lib/strings.in.h

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