Blame lib/strings.in.h

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