Blame gl/wchar.in.h

Packit 549fdc
/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
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
/* Written by Eric Blake.  */
Packit 549fdc
Packit 549fdc
/*
Packit 549fdc
 * ISO C 99 <wchar.h> for platforms that have issues.
Packit 549fdc
 * <http://www.opengroup.org/susv3xbd/wchar.h.html>
Packit 549fdc
 *
Packit 549fdc
 * For now, this just ensures proper prerequisite inclusion order and
Packit 549fdc
 * the declaration of wcwidth().
Packit 549fdc
 */
Packit 549fdc
Packit 549fdc
#if __GNUC__ >= 3
Packit 549fdc
@PRAGMA_SYSTEM_HEADER@
Packit 549fdc
#endif
Packit 549fdc
@PRAGMA_COLUMNS@
Packit 549fdc
Packit 549fdc
#if (((defined __need_mbstate_t || defined __need_wint_t)               \
Packit 549fdc
      && !defined __MINGW32__ && !defined __KLIBC__)                    \
Packit 549fdc
     || (defined __hpux                                                 \
Packit 549fdc
         && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
Packit 549fdc
             || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
Packit 549fdc
     || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
Packit 549fdc
     || defined _GL_ALREADY_INCLUDING_WCHAR_H)
Packit 549fdc
/* Special invocation convention:
Packit 549fdc
   - Inside glibc and uClibc header files, but not MinGW.
Packit 549fdc
   - On HP-UX 11.00 we have a sequence of nested includes
Packit 549fdc
     <wchar.h> -> <stdlib.h> -> <stdint.h>, and the latter includes <wchar.h>,
Packit 549fdc
     once indirectly <stdint.h> -> <sys/types.h> -> <inttypes.h> -> <wchar.h>
Packit 549fdc
     and once directly.  In both situations 'wint_t' is not yet defined,
Packit 549fdc
     therefore we cannot provide the function overrides; instead include only
Packit 549fdc
     the system's <wchar.h>.
Packit 549fdc
   - With MinGW 3.22, when <string.h> includes <wchar.h>, only some part of
Packit 549fdc
     <wchar.h> is actually processed, and that doesn't include 'mbstate_t'.
Packit 549fdc
   - On IRIX 6.5, similarly, we have an include <wchar.h> -> <wctype.h>, and
Packit 549fdc
     the latter includes <wchar.h>.  But here, we have no way to detect whether
Packit 549fdc
     <wctype.h> is completely included or is still being included.  */
Packit 549fdc
Packit 549fdc
#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
Packit 549fdc
Packit 549fdc
#else
Packit 549fdc
/* Normal invocation convention.  */
Packit 549fdc
Packit 549fdc
#ifndef _@GUARD_PREFIX@_WCHAR_H
Packit 549fdc
Packit 549fdc
#define _GL_ALREADY_INCLUDING_WCHAR_H
Packit 549fdc
Packit 549fdc
#if @HAVE_FEATURES_H@
Packit 549fdc
# include <features.h> /* for __GLIBC__ */
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
Packit 549fdc
   <wchar.h>.
Packit 549fdc
   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
Packit 549fdc
   included before <wchar.h>.
Packit 549fdc
   In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
Packit 549fdc
   by <stddef.h>.
Packit 549fdc
   But avoid namespace pollution on glibc systems.  */
Packit 549fdc
#if !(defined __GLIBC__ && !defined __UCLIBC__)
Packit 549fdc
# include <stddef.h>
Packit 549fdc
#endif
Packit 549fdc
#ifndef __GLIBC__
Packit 549fdc
# include <stdio.h>
Packit 549fdc
# include <time.h>
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* Include the original <wchar.h> if it exists.
Packit 549fdc
   Some builds of uClibc lack it.  */
Packit 549fdc
/* The include_next requires a split double-inclusion guard.  */
Packit 549fdc
#if @HAVE_WCHAR_H@
Packit 549fdc
# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
#undef _GL_ALREADY_INCLUDING_WCHAR_H
Packit 549fdc
Packit 549fdc
#ifndef _@GUARD_PREFIX@_WCHAR_H
Packit 549fdc
#define _@GUARD_PREFIX@_WCHAR_H
Packit 549fdc
Packit 549fdc
/* The __attribute__ feature is available in gcc versions 2.5 and later.
Packit 549fdc
   The attribute __pure__ was added in gcc 2.96.  */
Packit 549fdc
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
Packit 549fdc
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
Packit 549fdc
#else
Packit 549fdc
# define _GL_ATTRIBUTE_PURE /* empty */
Packit 549fdc
#endif
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
Packit 549fdc
/* Define wint_t and WEOF.  (Also done in wctype.in.h.)  */
Packit 549fdc
#if !@HAVE_WINT_T@ && !defined wint_t
Packit 549fdc
# define wint_t int
Packit 549fdc
# ifndef WEOF
Packit 549fdc
#  define WEOF -1
Packit 549fdc
# endif
Packit 549fdc
#else
Packit 549fdc
/* MSVC defines wint_t as 'unsigned short' in <crtdefs.h>.
Packit 549fdc
   This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
Packit 549fdc
   "unchanged by default argument promotions".  Override it.  */
Packit 549fdc
# if defined _MSC_VER
Packit 549fdc
#  if !GNULIB_defined_wint_t
Packit 549fdc
#   include <crtdefs.h>
Packit 549fdc
typedef unsigned int rpl_wint_t;
Packit 549fdc
#   undef wint_t
Packit 549fdc
#   define wint_t rpl_wint_t
Packit 549fdc
#   define GNULIB_defined_wint_t 1
Packit 549fdc
#  endif
Packit 549fdc
# endif
Packit 549fdc
# ifndef WEOF
Packit 549fdc
#  define WEOF ((wint_t) -1)
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Override mbstate_t if it is too small.
Packit 549fdc
   On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
Packit 549fdc
   implementing mbrtowc for encodings like UTF-8.  */
Packit 549fdc
#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
Packit 549fdc
# if !GNULIB_defined_mbstate_t
Packit 549fdc
typedef int rpl_mbstate_t;
Packit 549fdc
#  undef mbstate_t
Packit 549fdc
#  define mbstate_t rpl_mbstate_t
Packit 549fdc
#  define GNULIB_defined_mbstate_t 1
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a single-byte character to a wide character.  */
Packit 549fdc
#if @GNULIB_BTOWC@
Packit 549fdc
# if @REPLACE_BTOWC@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef btowc
Packit 549fdc
#   define btowc rpl_btowc
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
Packit 549fdc
_GL_CXXALIAS_RPL (btowc, wint_t, (int c));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_BTOWC@
Packit 549fdc
_GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (btowc);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef btowc
Packit 549fdc
# if HAVE_RAW_DECL_BTOWC
Packit 549fdc
_GL_WARN_ON_USE (btowc, "btowc is unportable - "
Packit 549fdc
                 "use gnulib module btowc for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a wide character to a single-byte character.  */
Packit 549fdc
#if @GNULIB_WCTOB@
Packit 549fdc
# if @REPLACE_WCTOB@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef wctob
Packit 549fdc
#   define wctob rpl_wctob
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
Packit 549fdc
_GL_CXXALIAS_RPL (wctob, int, (wint_t wc));
Packit 549fdc
# else
Packit 549fdc
#  if !defined wctob && !@HAVE_DECL_WCTOB@
Packit 549fdc
/* wctob is provided by gnulib, or wctob exists but is not declared.  */
Packit 549fdc
_GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (wctob);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wctob
Packit 549fdc
# if HAVE_RAW_DECL_WCTOB
Packit 549fdc
_GL_WARN_ON_USE (wctob, "wctob is unportable - "
Packit 549fdc
                 "use gnulib module wctob for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Test whether *PS is in the initial state.  */
Packit 549fdc
#if @GNULIB_MBSINIT@
Packit 549fdc
# if @REPLACE_MBSINIT@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef mbsinit
Packit 549fdc
#   define mbsinit rpl_mbsinit
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (mbsinit, int, (const mbstate_t *ps));
Packit 549fdc
_GL_CXXALIAS_RPL (mbsinit, int, (const mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_MBSINIT@
Packit 549fdc
_GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (mbsinit);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef mbsinit
Packit 549fdc
# if HAVE_RAW_DECL_MBSINIT
Packit 549fdc
_GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
Packit 549fdc
                 "use gnulib module mbsinit for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a multibyte character to a wide character.  */
Packit 549fdc
#if @GNULIB_MBRTOWC@
Packit 549fdc
# if @REPLACE_MBRTOWC@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef mbrtowc
Packit 549fdc
#   define mbrtowc rpl_mbrtowc
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (mbrtowc, size_t,
Packit 549fdc
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
_GL_CXXALIAS_RPL (mbrtowc, size_t,
Packit 549fdc
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_MBRTOWC@
Packit 549fdc
_GL_FUNCDECL_SYS (mbrtowc, size_t,
Packit 549fdc
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (mbrtowc, size_t,
Packit 549fdc
                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (mbrtowc);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef mbrtowc
Packit 549fdc
# if HAVE_RAW_DECL_MBRTOWC
Packit 549fdc
_GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
Packit 549fdc
                 "use gnulib module mbrtowc for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Recognize a multibyte character.  */
Packit 549fdc
#if @GNULIB_MBRLEN@
Packit 549fdc
# if @REPLACE_MBRLEN@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef mbrlen
Packit 549fdc
#   define mbrlen rpl_mbrlen
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_MBRLEN@
Packit 549fdc
_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (mbrlen);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef mbrlen
Packit 549fdc
# if HAVE_RAW_DECL_MBRLEN
Packit 549fdc
_GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
Packit 549fdc
                 "use gnulib module mbrlen for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a string to a wide string.  */
Packit 549fdc
#if @GNULIB_MBSRTOWCS@
Packit 549fdc
# if @REPLACE_MBSRTOWCS@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef mbsrtowcs
Packit 549fdc
#   define mbsrtowcs rpl_mbsrtowcs
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (mbsrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (mbsrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_MBSRTOWCS@
Packit 549fdc
_GL_FUNCDECL_SYS (mbsrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (mbsrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (mbsrtowcs);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef mbsrtowcs
Packit 549fdc
# if HAVE_RAW_DECL_MBSRTOWCS
Packit 549fdc
_GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
Packit 549fdc
                 "use gnulib module mbsrtowcs for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a string to a wide string.  */
Packit 549fdc
#if @GNULIB_MBSNRTOWCS@
Packit 549fdc
# if @REPLACE_MBSNRTOWCS@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef mbsnrtowcs
Packit 549fdc
#   define mbsnrtowcs rpl_mbsnrtowcs
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_MBSNRTOWCS@
Packit 549fdc
_GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
Packit 549fdc
                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (mbsnrtowcs);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef mbsnrtowcs
Packit 549fdc
# if HAVE_RAW_DECL_MBSNRTOWCS
Packit 549fdc
_GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
Packit 549fdc
                 "use gnulib module mbsnrtowcs for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a wide character to a multibyte character.  */
Packit 549fdc
#if @GNULIB_WCRTOMB@
Packit 549fdc
# if @REPLACE_WCRTOMB@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef wcrtomb
Packit 549fdc
#   define wcrtomb rpl_wcrtomb
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
Packit 549fdc
_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_WCRTOMB@
Packit 549fdc
_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (wcrtomb);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcrtomb
Packit 549fdc
# if HAVE_RAW_DECL_WCRTOMB
Packit 549fdc
_GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
Packit 549fdc
                 "use gnulib module wcrtomb for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a wide string to a string.  */
Packit 549fdc
#if @GNULIB_WCSRTOMBS@
Packit 549fdc
# if @REPLACE_WCSRTOMBS@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef wcsrtombs
Packit 549fdc
#   define wcsrtombs rpl_wcsrtombs
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (wcsrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (wcsrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_WCSRTOMBS@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (wcsrtombs);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsrtombs
Packit 549fdc
# if HAVE_RAW_DECL_WCSRTOMBS
Packit 549fdc
_GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
Packit 549fdc
                 "use gnulib module wcsrtombs for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Convert a wide string to a string.  */
Packit 549fdc
#if @GNULIB_WCSNRTOMBS@
Packit 549fdc
# if @REPLACE_WCSNRTOMBS@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef wcsnrtombs
Packit 549fdc
#   define wcsnrtombs rpl_wcsnrtombs
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (wcsnrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
_GL_CXXALIAS_RPL (wcsnrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_WCSNRTOMBS@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsnrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps)
Packit 549fdc
                  _GL_ARG_NONNULL ((2)));
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsnrtombs, size_t,
Packit 549fdc
                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
Packit 549fdc
                   mbstate_t *ps));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (wcsnrtombs);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsnrtombs
Packit 549fdc
# if HAVE_RAW_DECL_WCSNRTOMBS
Packit 549fdc
_GL_WARN_ON_USE (wcsnrtombs, "wcsnrtombs is unportable - "
Packit 549fdc
                 "use gnulib module wcsnrtombs for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Return the number of screen columns needed for WC.  */
Packit 549fdc
#if @GNULIB_WCWIDTH@
Packit 549fdc
# if @REPLACE_WCWIDTH@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef wcwidth
Packit 549fdc
#   define wcwidth rpl_wcwidth
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
Packit 549fdc
_GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_DECL_WCWIDTH@
Packit 549fdc
/* wcwidth exists but is not declared.  */
Packit 549fdc
_GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
Packit 549fdc
#  elif defined __KLIBC__
Packit 549fdc
/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
Packit 549fdc
   static inline function.  The implementation of wcwidth in wcwidth.c
Packit 549fdc
   causes a "conflicting types" error. */
Packit 549fdc
#   undef wcwidth
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (wcwidth);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcwidth
Packit 549fdc
# if HAVE_RAW_DECL_WCWIDTH
Packit 549fdc
_GL_WARN_ON_USE (wcwidth, "wcwidth is unportable - "
Packit 549fdc
                 "use gnulib module wcwidth for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Search N wide characters of S for C.  */
Packit 549fdc
#if @GNULIB_WMEMCHR@
Packit 549fdc
# if !@HAVE_WMEMCHR@
Packit 549fdc
_GL_FUNCDECL_SYS (wmemchr, wchar_t *, (const wchar_t *s, wchar_t c, size_t n)
Packit 549fdc
                                      _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
  /* On some systems, this function is defined as an overloaded function:
Packit 549fdc
       extern "C++" {
Packit 549fdc
         const wchar_t * std::wmemchr (const wchar_t *, wchar_t, size_t);
Packit 549fdc
         wchar_t * std::wmemchr (wchar_t *, wchar_t, size_t);
Packit 549fdc
       }  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST2 (wmemchr,
Packit 549fdc
                        wchar_t *, (const wchar_t *, wchar_t, size_t),
Packit 549fdc
                        const wchar_t *, (const wchar_t *, wchar_t, size_t));
Packit 549fdc
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
Packit 549fdc
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
Packit 549fdc
_GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
Packit 549fdc
_GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
Packit 549fdc
                   (const wchar_t *s, wchar_t c, size_t n));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIASWARN (wmemchr);
Packit 549fdc
# endif
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wmemchr
Packit 549fdc
# if HAVE_RAW_DECL_WMEMCHR
Packit 549fdc
_GL_WARN_ON_USE (wmemchr, "wmemchr is unportable - "
Packit 549fdc
                 "use gnulib module wmemchr for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Compare N wide characters of S1 and S2.  */
Packit 549fdc
#if @GNULIB_WMEMCMP@
Packit 549fdc
# if !@HAVE_WMEMCMP@
Packit 549fdc
_GL_FUNCDECL_SYS (wmemcmp, int,
Packit 549fdc
                  (const wchar_t *s1, const wchar_t *s2, size_t n)
Packit 549fdc
                  _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wmemcmp, int,
Packit 549fdc
                  (const wchar_t *s1, const wchar_t *s2, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wmemcmp);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wmemcmp
Packit 549fdc
# if HAVE_RAW_DECL_WMEMCMP
Packit 549fdc
_GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
Packit 549fdc
                 "use gnulib module wmemcmp for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Copy N wide characters of SRC to DEST.  */
Packit 549fdc
#if @GNULIB_WMEMCPY@
Packit 549fdc
# if !@HAVE_WMEMCPY@
Packit 549fdc
_GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wmemcpy);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wmemcpy
Packit 549fdc
# if HAVE_RAW_DECL_WMEMCPY
Packit 549fdc
_GL_WARN_ON_USE (wmemcpy, "wmemcpy is unportable - "
Packit 549fdc
                 "use gnulib module wmemcpy for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Copy N wide characters of SRC to DEST, guaranteeing correct behavior for
Packit 549fdc
   overlapping memory areas.  */
Packit 549fdc
#if @GNULIB_WMEMMOVE@
Packit 549fdc
# if !@HAVE_WMEMMOVE@
Packit 549fdc
_GL_FUNCDECL_SYS (wmemmove, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wmemmove, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wmemmove);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wmemmove
Packit 549fdc
# if HAVE_RAW_DECL_WMEMMOVE
Packit 549fdc
_GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
Packit 549fdc
                 "use gnulib module wmemmove for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Set N wide characters of S to C.  */
Packit 549fdc
#if @GNULIB_WMEMSET@
Packit 549fdc
# if !@HAVE_WMEMSET@
Packit 549fdc
_GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wmemset);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wmemset
Packit 549fdc
# if HAVE_RAW_DECL_WMEMSET
Packit 549fdc
_GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
Packit 549fdc
                 "use gnulib module wmemset for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Return the number of wide characters in S.  */
Packit 549fdc
#if @GNULIB_WCSLEN@
Packit 549fdc
# if !@HAVE_WCSLEN@
Packit 549fdc
_GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
Packit 549fdc
_GL_CXXALIASWARN (wcslen);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcslen
Packit 549fdc
# if HAVE_RAW_DECL_WCSLEN
Packit 549fdc
_GL_WARN_ON_USE (wcslen, "wcslen is unportable - "
Packit 549fdc
                 "use gnulib module wcslen for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Return the number of wide characters in S, but at most MAXLEN.  */
Packit 549fdc
#if @GNULIB_WCSNLEN@
Packit 549fdc
# if !@HAVE_WCSNLEN@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen)
Packit 549fdc
                                   _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsnlen, size_t, (const wchar_t *s, size_t maxlen));
Packit 549fdc
_GL_CXXALIASWARN (wcsnlen);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsnlen
Packit 549fdc
# if HAVE_RAW_DECL_WCSNLEN
Packit 549fdc
_GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
Packit 549fdc
                 "use gnulib module wcsnlen for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Copy SRC to DEST.  */
Packit 549fdc
#if @GNULIB_WCSCPY@
Packit 549fdc
# if !@HAVE_WCSCPY@
Packit 549fdc
_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
Packit 549fdc
_GL_CXXALIASWARN (wcscpy);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcscpy
Packit 549fdc
# if HAVE_RAW_DECL_WCSCPY
Packit 549fdc
_GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
Packit 549fdc
                 "use gnulib module wcscpy for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
Packit 549fdc
#if @GNULIB_WCPCPY@
Packit 549fdc
# if !@HAVE_WCPCPY@
Packit 549fdc
_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
Packit 549fdc
_GL_CXXALIASWARN (wcpcpy);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcpcpy
Packit 549fdc
# if HAVE_RAW_DECL_WCPCPY
Packit 549fdc
_GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
Packit 549fdc
                 "use gnulib module wcpcpy for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Copy no more than N wide characters of SRC to DEST.  */
Packit 549fdc
#if @GNULIB_WCSNCPY@
Packit 549fdc
# if !@HAVE_WCSNCPY@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wcsncpy);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsncpy
Packit 549fdc
# if HAVE_RAW_DECL_WCSNCPY
Packit 549fdc
_GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
Packit 549fdc
                 "use gnulib module wcsncpy for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Copy no more than N characters of SRC to DEST, returning the address of
Packit 549fdc
   the last character written into DEST.  */
Packit 549fdc
#if @GNULIB_WCPNCPY@
Packit 549fdc
# if !@HAVE_WCPNCPY@
Packit 549fdc
_GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wcpncpy);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcpncpy
Packit 549fdc
# if HAVE_RAW_DECL_WCPNCPY
Packit 549fdc
_GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
Packit 549fdc
                 "use gnulib module wcpncpy for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Append SRC onto DEST.  */
Packit 549fdc
#if @GNULIB_WCSCAT@
Packit 549fdc
# if !@HAVE_WCSCAT@
Packit 549fdc
_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
Packit 549fdc
_GL_CXXALIASWARN (wcscat);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcscat
Packit 549fdc
# if HAVE_RAW_DECL_WCSCAT
Packit 549fdc
_GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
Packit 549fdc
                 "use gnulib module wcscat for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Append no more than N wide characters of SRC onto DEST.  */
Packit 549fdc
#if @GNULIB_WCSNCAT@
Packit 549fdc
# if !@HAVE_WCSNCAT@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsncat, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsncat, wchar_t *,
Packit 549fdc
                  (wchar_t *dest, const wchar_t *src, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wcsncat);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsncat
Packit 549fdc
# if HAVE_RAW_DECL_WCSNCAT
Packit 549fdc
_GL_WARN_ON_USE (wcsncat, "wcsncat is unportable - "
Packit 549fdc
                 "use gnulib module wcsncat for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Compare S1 and S2.  */
Packit 549fdc
#if @GNULIB_WCSCMP@
Packit 549fdc
# if !@HAVE_WCSCMP@
Packit 549fdc
_GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
Packit 549fdc
                               _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
Packit 549fdc
_GL_CXXALIASWARN (wcscmp);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcscmp
Packit 549fdc
# if HAVE_RAW_DECL_WCSCMP
Packit 549fdc
_GL_WARN_ON_USE (wcscmp, "wcscmp is unportable - "
Packit 549fdc
                 "use gnulib module wcscmp for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Compare no more than N wide characters of S1 and S2.  */
Packit 549fdc
#if @GNULIB_WCSNCMP@
Packit 549fdc
# if !@HAVE_WCSNCMP@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsncmp, int,
Packit 549fdc
                  (const wchar_t *s1, const wchar_t *s2, size_t n)
Packit 549fdc
                  _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsncmp, int,
Packit 549fdc
                  (const wchar_t *s1, const wchar_t *s2, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wcsncmp);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsncmp
Packit 549fdc
# if HAVE_RAW_DECL_WCSNCMP
Packit 549fdc
_GL_WARN_ON_USE (wcsncmp, "wcsncmp is unportable - "
Packit 549fdc
                 "use gnulib module wcsncmp for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Compare S1 and S2, ignoring case.  */
Packit 549fdc
#if @GNULIB_WCSCASECMP@
Packit 549fdc
# if !@HAVE_WCSCASECMP@
Packit 549fdc
_GL_FUNCDECL_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2)
Packit 549fdc
                                   _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcscasecmp, int, (const wchar_t *s1, const wchar_t *s2));
Packit 549fdc
_GL_CXXALIASWARN (wcscasecmp);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcscasecmp
Packit 549fdc
# if HAVE_RAW_DECL_WCSCASECMP
Packit 549fdc
_GL_WARN_ON_USE (wcscasecmp, "wcscasecmp is unportable - "
Packit 549fdc
                 "use gnulib module wcscasecmp for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Compare no more than N chars of S1 and S2, ignoring case.  */
Packit 549fdc
#if @GNULIB_WCSNCASECMP@
Packit 549fdc
# if !@HAVE_WCSNCASECMP@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsncasecmp, int,
Packit 549fdc
                  (const wchar_t *s1, const wchar_t *s2, size_t n)
Packit 549fdc
                  _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsncasecmp, int,
Packit 549fdc
                  (const wchar_t *s1, const wchar_t *s2, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wcsncasecmp);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsncasecmp
Packit 549fdc
# if HAVE_RAW_DECL_WCSNCASECMP
Packit 549fdc
_GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
Packit 549fdc
                 "use gnulib module wcsncasecmp for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Compare S1 and S2, both interpreted as appropriate to the LC_COLLATE
Packit 549fdc
   category of the current locale.  */
Packit 549fdc
#if @GNULIB_WCSCOLL@
Packit 549fdc
# if !@HAVE_WCSCOLL@
Packit 549fdc
_GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
Packit 549fdc
_GL_CXXALIASWARN (wcscoll);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcscoll
Packit 549fdc
# if HAVE_RAW_DECL_WCSCOLL
Packit 549fdc
_GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
Packit 549fdc
                 "use gnulib module wcscoll for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Transform S2 into array pointed to by S1 such that if wcscmp is applied
Packit 549fdc
   to two transformed strings the result is the as applying 'wcscoll' to the
Packit 549fdc
   original strings.  */
Packit 549fdc
#if @GNULIB_WCSXFRM@
Packit 549fdc
# if !@HAVE_WCSXFRM@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
Packit 549fdc
_GL_CXXALIASWARN (wcsxfrm);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsxfrm
Packit 549fdc
# if HAVE_RAW_DECL_WCSXFRM
Packit 549fdc
_GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
Packit 549fdc
                 "use gnulib module wcsxfrm for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Duplicate S, returning an identical malloc'd string.  */
Packit 549fdc
#if @GNULIB_WCSDUP@
Packit 549fdc
# if !@HAVE_WCSDUP@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
Packit 549fdc
_GL_CXXALIASWARN (wcsdup);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsdup
Packit 549fdc
# if HAVE_RAW_DECL_WCSDUP
Packit 549fdc
_GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
Packit 549fdc
                 "use gnulib module wcsdup for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Find the first occurrence of WC in WCS.  */
Packit 549fdc
#if @GNULIB_WCSCHR@
Packit 549fdc
# if !@HAVE_WCSCHR@
Packit 549fdc
_GL_FUNCDECL_SYS (wcschr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
Packit 549fdc
                                     _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
  /* On some systems, this function is defined as an overloaded function:
Packit 549fdc
       extern "C++" {
Packit 549fdc
         const wchar_t * std::wcschr (const wchar_t *, wchar_t);
Packit 549fdc
         wchar_t * std::wcschr (wchar_t *, wchar_t);
Packit 549fdc
       }  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST2 (wcschr,
Packit 549fdc
                        wchar_t *, (const wchar_t *, wchar_t),
Packit 549fdc
                        const wchar_t *, (const wchar_t *, wchar_t));
Packit 549fdc
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
Packit 549fdc
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
Packit 549fdc
_GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
Packit 549fdc
_GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIASWARN (wcschr);
Packit 549fdc
# endif
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcschr
Packit 549fdc
# if HAVE_RAW_DECL_WCSCHR
Packit 549fdc
_GL_WARN_ON_USE (wcschr, "wcschr is unportable - "
Packit 549fdc
                 "use gnulib module wcschr for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Find the last occurrence of WC in WCS.  */
Packit 549fdc
#if @GNULIB_WCSRCHR@
Packit 549fdc
# if !@HAVE_WCSRCHR@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsrchr, wchar_t *, (const wchar_t *wcs, wchar_t wc)
Packit 549fdc
                                      _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
  /* On some systems, this function is defined as an overloaded function:
Packit 549fdc
       extern "C++" {
Packit 549fdc
         const wchar_t * std::wcsrchr (const wchar_t *, wchar_t);
Packit 549fdc
         wchar_t * std::wcsrchr (wchar_t *, wchar_t);
Packit 549fdc
       }  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST2 (wcsrchr,
Packit 549fdc
                        wchar_t *, (const wchar_t *, wchar_t),
Packit 549fdc
                        const wchar_t *, (const wchar_t *, wchar_t));
Packit 549fdc
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
Packit 549fdc
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
Packit 549fdc
_GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
Packit 549fdc
_GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIASWARN (wcsrchr);
Packit 549fdc
# endif
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsrchr
Packit 549fdc
# if HAVE_RAW_DECL_WCSRCHR
Packit 549fdc
_GL_WARN_ON_USE (wcsrchr, "wcsrchr is unportable - "
Packit 549fdc
                 "use gnulib module wcsrchr for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Return the length of the initial segmet of WCS which consists entirely
Packit 549fdc
   of wide characters not in REJECT.  */
Packit 549fdc
#if @GNULIB_WCSCSPN@
Packit 549fdc
# if !@HAVE_WCSCSPN@
Packit 549fdc
_GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
Packit 549fdc
                                   _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
Packit 549fdc
_GL_CXXALIASWARN (wcscspn);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcscspn
Packit 549fdc
# if HAVE_RAW_DECL_WCSCSPN
Packit 549fdc
_GL_WARN_ON_USE (wcscspn, "wcscspn is unportable - "
Packit 549fdc
                 "use gnulib module wcscspn for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Return the length of the initial segmet of WCS which consists entirely
Packit 549fdc
   of wide characters in ACCEPT.  */
Packit 549fdc
#if @GNULIB_WCSSPN@
Packit 549fdc
# if !@HAVE_WCSSPN@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
Packit 549fdc
                                  _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
Packit 549fdc
_GL_CXXALIASWARN (wcsspn);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsspn
Packit 549fdc
# if HAVE_RAW_DECL_WCSSPN
Packit 549fdc
_GL_WARN_ON_USE (wcsspn, "wcsspn is unportable - "
Packit 549fdc
                 "use gnulib module wcsspn for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Find the first occurrence in WCS of any character in ACCEPT.  */
Packit 549fdc
#if @GNULIB_WCSPBRK@
Packit 549fdc
# if !@HAVE_WCSPBRK@
Packit 549fdc
_GL_FUNCDECL_SYS (wcspbrk, wchar_t *,
Packit 549fdc
                  (const wchar_t *wcs, const wchar_t *accept)
Packit 549fdc
                  _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
  /* On some systems, this function is defined as an overloaded function:
Packit 549fdc
       extern "C++" {
Packit 549fdc
         const wchar_t * std::wcspbrk (const wchar_t *, const wchar_t *);
Packit 549fdc
         wchar_t * std::wcspbrk (wchar_t *, const wchar_t *);
Packit 549fdc
       }  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST2 (wcspbrk,
Packit 549fdc
                        wchar_t *, (const wchar_t *, const wchar_t *),
Packit 549fdc
                        const wchar_t *, (const wchar_t *, const wchar_t *));
Packit 549fdc
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
Packit 549fdc
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
Packit 549fdc
_GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
Packit 549fdc
                   (wchar_t *wcs, const wchar_t *accept));
Packit 549fdc
_GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
Packit 549fdc
                   (const wchar_t *wcs, const wchar_t *accept));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIASWARN (wcspbrk);
Packit 549fdc
# endif
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcspbrk
Packit 549fdc
# if HAVE_RAW_DECL_WCSPBRK
Packit 549fdc
_GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
Packit 549fdc
                 "use gnulib module wcspbrk for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Find the first occurrence of NEEDLE in HAYSTACK.  */
Packit 549fdc
#if @GNULIB_WCSSTR@
Packit 549fdc
# if !@HAVE_WCSSTR@
Packit 549fdc
_GL_FUNCDECL_SYS (wcsstr, wchar_t *,
Packit 549fdc
                  (const wchar_t *haystack, const wchar_t *needle)
Packit 549fdc
                  _GL_ATTRIBUTE_PURE);
Packit 549fdc
# endif
Packit 549fdc
  /* On some systems, this function is defined as an overloaded function:
Packit 549fdc
       extern "C++" {
Packit 549fdc
         const wchar_t * std::wcsstr (const wchar_t *, const wchar_t *);
Packit 549fdc
         wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
Packit 549fdc
       }  */
Packit 549fdc
_GL_CXXALIAS_SYS_CAST2 (wcsstr,
Packit 549fdc
                        wchar_t *, (const wchar_t *, const wchar_t *),
Packit 549fdc
                        const wchar_t *, (const wchar_t *, const wchar_t *));
Packit 549fdc
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
Packit 549fdc
     && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
Packit 549fdc
_GL_CXXALIASWARN1 (wcsstr, wchar_t *,
Packit 549fdc
                   (wchar_t *haystack, const wchar_t *needle));
Packit 549fdc
_GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
Packit 549fdc
                   (const wchar_t *haystack, const wchar_t *needle));
Packit 549fdc
# else
Packit 549fdc
_GL_CXXALIASWARN (wcsstr);
Packit 549fdc
# endif
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcsstr
Packit 549fdc
# if HAVE_RAW_DECL_WCSSTR
Packit 549fdc
_GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
Packit 549fdc
                 "use gnulib module wcsstr for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Divide WCS into tokens separated by characters in DELIM.  */
Packit 549fdc
#if @GNULIB_WCSTOK@
Packit 549fdc
# if !@HAVE_WCSTOK@
Packit 549fdc
_GL_FUNCDECL_SYS (wcstok, wchar_t *,
Packit 549fdc
                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcstok, wchar_t *,
Packit 549fdc
                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
Packit 549fdc
_GL_CXXALIASWARN (wcstok);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcstok
Packit 549fdc
# if HAVE_RAW_DECL_WCSTOK
Packit 549fdc
_GL_WARN_ON_USE (wcstok, "wcstok is unportable - "
Packit 549fdc
                 "use gnulib module wcstok for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
/* Determine number of column positions required for first N wide
Packit 549fdc
   characters (or fewer if S ends before this) in S.  */
Packit 549fdc
#if @GNULIB_WCSWIDTH@
Packit 549fdc
# if @REPLACE_WCSWIDTH@
Packit 549fdc
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit 549fdc
#   undef wcswidth
Packit 549fdc
#   define wcswidth rpl_wcswidth
Packit 549fdc
#  endif
Packit 549fdc
_GL_FUNCDECL_RPL (wcswidth, int, (const wchar_t *s, size_t n)
Packit 549fdc
                                 _GL_ATTRIBUTE_PURE);
Packit 549fdc
_GL_CXXALIAS_RPL (wcswidth, int, (const wchar_t *s, size_t n));
Packit 549fdc
# else
Packit 549fdc
#  if !@HAVE_WCSWIDTH@
Packit 549fdc
_GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
Packit 549fdc
                                 _GL_ATTRIBUTE_PURE);
Packit 549fdc
#  endif
Packit 549fdc
_GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
Packit 549fdc
# endif
Packit 549fdc
_GL_CXXALIASWARN (wcswidth);
Packit 549fdc
#elif defined GNULIB_POSIXCHECK
Packit 549fdc
# undef wcswidth
Packit 549fdc
# if HAVE_RAW_DECL_WCSWIDTH
Packit 549fdc
_GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
Packit 549fdc
                 "use gnulib module wcswidth for portability");
Packit 549fdc
# endif
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
Packit 549fdc
#endif /* _@GUARD_PREFIX@_WCHAR_H */
Packit 549fdc
#endif /* _@GUARD_PREFIX@_WCHAR_H */
Packit 549fdc
#endif