/***************************************************************************
 * FILE: wchar.h/cwchar (Wide character functions)
 *
 * =========================================================================
 *
 *                          Open Watcom Project
 *
 * Copyright (c) 2004-2025 The Open Watcom Contributors. All Rights Reserved.
 * Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
 *
 *    This file is automatically generated. Do not edit directly.
 *
 * =========================================================================
 *
 * Description: This header is part of the C/C++ standard library. It
 *              declares functions and types pertaining to the use of
 *              wide characters.
 ***************************************************************************/
#ifndef _CWCHAR_INCLUDED
#define _CWCHAR_INCLUDED

#ifndef _ENABLE_AUTODEPEND
 #pragma read_only_file
#endif

#ifndef __cplusplus
 #error This header file requires C++
#endif

#ifndef __COMDEF_H_INCLUDED
 #include <_comdef.h>
#endif

#ifndef _CSTDARG_INCLUDED
 #include <cstdarg>
#endif

extern "C" {

#ifndef NULL
  #define NULL 0
#endif

#define WCHAR_MIN       0
#define WCHAR_MAX       65535U

#define WEOF  ((std::wint_t)(-1)) /*  EOF equivalent for wide chars   */

#ifndef _STDWINT_T_DEFINED
#define _STDWINT_T_DEFINED
 namespace std {
   typedef wchar_t wint_t;
 }
 typedef std::wint_t __w_wint_t;
#endif

#if !defined( _NO_EXT_KEYS ) /* extensions enabled */
#endif /* extensions enabled */

#ifndef _STDWCTYPE_T_DEFINED
#define _STDWCTYPE_T_DEFINED
 namespace std {
   typedef wchar_t wctype_t;
 }
#endif

#ifndef _STDSIZE_T_DEFINED
#define _STDSIZE_T_DEFINED
 namespace std {
   typedef unsigned size_t;
 }
 typedef std::size_t __w_size_t;
#endif

#ifndef _STDMBSTATE_T_DEFINED
#define _STDMBSTATE_T_DEFINED
 namespace std {
   typedef int mbstate_t;
 }
 typedef std::mbstate_t __w_mbstate_t;
#endif


#ifndef _STDTM_DEFINED
#define _STDTM_DEFINED
 #define _STDTM_DEFINED_
 namespace std {
  struct tm;
 }
 typedef struct std::tm __w_tm;
#endif

#ifndef ___IOBUF_DEFINED
#define ___IOBUF_DEFINED
 struct __iobuf;
#endif
#ifndef _STDFILE_DEFINED
#define _STDFILE_DEFINED
 #define _STDFILE_DEFINED_
 namespace std {
  typedef struct __iobuf FILE;
 }
 typedef std::FILE __w_FILE;
#endif

namespace std {

_WCRTLINK extern wint_t     btowc( int __c );
_WCRTLINK extern wint_t     fgetwc( FILE *__strm );
_WCRTLINK extern wchar_t    *fgetws( wchar_t *__s, int __n, FILE *__strm );
_WCRTLINK extern wint_t     fputwc( wint_t __wc, FILE *__strm );
_WCRTLINK extern int        fputws( const wchar_t *__s, FILE *__strm );
_WCRTLINK extern int        fwide( FILE *__strm, int __mode );
_WCRTLINK extern int        fwprintf( FILE *__strm, const wchar_t *__format, ... );
_WCRTLINK extern int        fwscanf( FILE *__strm, const wchar_t *__format, ... );
_WCRTLINK extern wint_t     getwc( FILE *__strm );
_WCRTLINK extern wint_t     getwchar( void );
_WCRTLINK extern size_t     mbrlen( const char *__s, size_t __n, mbstate_t *__ps );
_WCRTLINK extern size_t     mbrtowc( wchar_t *__pwc, const char *__s, size_t __n, mbstate_t *__ps );
_WCRTLINK extern int        mbsinit( const mbstate_t *__ps );
_WCRTLINK extern size_t     mbsrtowcs( wchar_t *__dst, const char **__src, size_t __n, mbstate_t *__ps );
_WCRTLINK extern wint_t     putwc( wint_t __wc, FILE *__strm );
_WCRTLINK extern wint_t     putwchar( wint_t __wc );
_WCRTLINK extern int        swprintf( wchar_t *__s, size_t __n, const wchar_t *__format, ... );
_WCRTLINK extern int        swscanf( const wchar_t *__s, const wchar_t *__format, ... );
_WCRTLINK extern wint_t     ungetwc( wint_t __wc, FILE *__strm );
_WCRTLINK extern int        vfwprintf( FILE *__strm, const wchar_t *__format, va_list __arg );
_WCRTLINK extern int        vfwscanf( FILE *__strm, const wchar_t *__format, va_list __arg );
_WCRTLINK extern int        vswprintf( wchar_t *__s, size_t __n, const wchar_t *__format, va_list __arg );
_WCRTLINK extern int        vswscanf( const wchar_t *__s, const wchar_t *__format, va_list __arg );
_WCRTLINK extern int        vwprintf( const wchar_t *__format, va_list __arg );
_WCRTLINK extern int        vwscanf( const wchar_t *, __va_list );
_WCRTLINK extern size_t     wcrtomb( char *__s, wchar_t __wc, mbstate_t *__ps );
_WCRTLINK extern wchar_t    *wcscat( wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern wchar_t    *wcschr( const wchar_t *__s, wint_t __wc );
_WCRTLINK extern int        wcscmp( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern int        wcscoll( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern wchar_t    *wcscpy( wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern size_t     wcscspn( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern size_t     wcsftime( wchar_t *__s, size_t __maxsize, const wchar_t *__format, const struct tm *__timeptr );
_WCRTLINK extern size_t     wcslen( const wchar_t *__s );
_WCRTLINK extern wchar_t    *wcsncat( wchar_t *__s1, const wchar_t *__s2, size_t __n );
_WCRTLINK extern int        wcsncmp( const wchar_t *__s1, const wchar_t *__s2, size_t __n );
_WCRTLINK extern wchar_t    *wcsncpy( wchar_t *__s1, const wchar_t *__s2, size_t __n );
_WCRTLINK extern wchar_t    *wcspbrk( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern wchar_t    *wcsrchr( const wchar_t *__s, wint_t __wc );
_WCRTLINK extern size_t     wcsrtombs( char *__dst, const wchar_t **__src, size_t __n, mbstate_t *__ps );
_WCRTLINK extern size_t     wcsspn( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern wchar_t    *wcsstr( const wchar_t *__s1, const wchar_t *__s2 );
_WCRTLINK extern wchar_t    *wcstok( wchar_t *__s1, const wchar_t *__s2, wchar_t **__ptr );
_WCRTLINK extern size_t     wcsxfrm( wchar_t *__s1, const wchar_t *__s2, size_t __n );
_WCRTLINK extern int        wctob( wint_t __wc );
_WCRTLINK extern wchar_t    *wmemchr( const wchar_t *__s, wchar_t __wc, size_t __n );
_WCRTLINK extern int        wmemcmp( const wchar_t *__s1, const wchar_t *__s2, size_t __n );
_WCRTLINK extern wchar_t    *wmemcpy( wchar_t *__s1, const wchar_t *__s2, size_t __n );
_WCRTLINK extern wchar_t    *wmemmove( wchar_t *__s1, const wchar_t *__s2, size_t __n );
_WCRTLINK extern wchar_t    *wmemset( wchar_t *__s, wchar_t __wc, size_t __n );
_WCRTLINK extern int        wprintf( const wchar_t *__format, ... );
_WCRTLINK extern int        wscanf( const wchar_t *__format, ... );

#if !defined( _NO_EXT_KEYS ) || __STDC_VERSION__ >= 199901L /* extensions enabled or C99 */
_WMRTLINK extern double     wcstod( const wchar_t *, wchar_t ** );
_WMRTLINK extern float      wcstof( const wchar_t *, wchar_t ** );
_WMRTLINK extern long double wcstold( const wchar_t *, wchar_t ** );
_WCRTLINK extern long       wcstol( const wchar_t *, wchar_t **, int );
_WCRTLINK extern long long  wcstoll( const wchar_t *, wchar_t **, int );
_WCRTLINK extern unsigned long wcstoul( const wchar_t *, wchar_t **, int );
_WCRTLINK extern unsigned long long wcstoull( const wchar_t *, wchar_t **, int );
#endif /* extensions enabled */

} // namespace std

#if !defined( _NO_EXT_KEYS ) || __STDC_VERSION__ >= 199409L /* extensions enabled or C95 */
namespace std {

_WCRTLINK extern int        iswalnum( wint_t __wc );
_WCRTLINK extern int        iswalpha( wint_t __wc );
_WCRTLINK extern int        iswcntrl( wint_t __wc );
_WCRTLINK extern int        iswdigit( wint_t __wc );
_WCRTLINK extern int        iswgraph( wint_t __wc );
_WCRTLINK extern int        iswlower( wint_t __wc );
_WCRTLINK extern int        iswprint( wint_t __wc );
_WCRTLINK extern int        iswpunct( wint_t __wc );
_WCRTLINK extern int        iswspace( wint_t __wc );
_WCRTLINK extern int        iswupper( wint_t __wc );
_WCRTLINK extern int        iswxdigit( wint_t __wc );
_WCRTLINK extern int        iswctype( wint_t __wc, wctype_t __desc );
#if !defined( _NO_EXT_KEYS ) || __STDC_VERSION__ >= 199901L /* extensions enabled or C99 */
_WCRTLINK extern int        iswblank( wint_t __wc );
#endif /* extensions enabled */
_WCRTLINK extern wint_t     towlower( wint_t __wc );
_WCRTLINK extern wint_t     towupper( wint_t __wc );
_WCRTLINK extern wctype_t   wctype( const char *__property );

} // namespace std
#endif /* extensions enabled */

#if !defined( _NO_EXT_KEYS ) /* extensions enabled */

/* POSIX extension functions */

_WCRTLINK extern wchar_t    *wcsdup( const wchar_t * );

/* Open Watcom extension functions */

_WCRTLINK extern int        sisinit( const __w_mbstate_t *__ps );

_WCRTLINK extern int        _swprintf( wchar_t *__s, const wchar_t *__format, ... );
_WCRTLINK extern int        _vswprintf( wchar_t *__s, const wchar_t *__format, std::va_list __arg );

/* BSD 'safe' wide character string copy functions */

_WCRTLINK extern __w_size_t wcslcat( wchar_t *__s1, const wchar_t *__s2, __w_size_t __n );
_WCRTLINK extern __w_size_t wcslcpy( wchar_t *__s1, const wchar_t *__s2, __w_size_t __n );

#endif /* extensions enabled */

} /* extern "C" */

#endif
