Blame gl/strings.in.h

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