wctype.mh

来自「开放源码的编译器open watcom 1.6.0版的源代码」· MH 代码 · 共 128 行

MH
128
字号
/***************************************************************************
 * FILE: wctype.h/cwctype (Wide character classification functions)
 *
:include crwat.sp
 *
 * Description: This header is part of the C/C++ standard library. It
 *              declares functions and types used to classify wide
 *              characters.
 ***************************************************************************/
:segment CNAME
#ifndef _CWCTYPE_INCLUDED
#define _CWCTYPE_INCLUDED

#ifndef __cplusplus
#error The header cwctype requires C++
#endif
:elsesegment
#ifndef _WCTYPE_H_INCLUDED
#define _WCTYPE_H_INCLUDED
:endsegment

:include readonly.sp
::
:: The following segment only appears in wctype.h.
:segment !CNAME
#ifdef __cplusplus
#include <cwctype>

// C99 types in wctype.h
#ifndef _WCTYPE_T_DEFINED
#define _WCTYPE_T_DEFINED
#define _WCTYPE_T_DEFINED_
using std::wint_t;
using std::wctype_t;
#endif

// C99 functions in wctype.h
using std::iswalnum;
using std::iswalpha;
using std::iswcntrl;
using std::iswdigit;
using std::iswgraph;
using std::iswlower;
using std::iswprint;
using std::iswpunct;
using std::iswspace;
using std::iswupper;
using std::iswxdigit;
using std::iswctype;
using std::wctype;
using std::towlower;
using std::towupper;

:: Now the extensions section.
:include ext.sp
// C99 functions in ctype.h that are currently considered extensions.
using std::iswblank;
#endif

#else /* __cplusplus not defined */
:: End of segment that is only in wctype.h
:endsegment

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

:: Only need extern "C" in cwctype
:segment CNAME
:include cpluspro.sp
:endsegment

:include wchar_t.sp

:include wctypet.sp

#ifndef _WCTRANS_T_DEFINED
  #define _WCTRANS_T_DEFINED
  typedef wchar_t wctrans_t;
#endif

:segment CNAME
#define WEOF ((std::wint_t)(-1))
:elsesegment
#define WEOF ((wint_t)(-1))
:endsegment

:segment CNAME
namespace std {
:endsegment
_WCRTLINK extern int      iswalnum( wint_t __wc );
_WCRTLINK extern int      iswalpha( wint_t __wc );
_WCRTLINK extern int      iswascii( 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 );
_WCRTLINK extern wctype_t wctype( const char *__property );
_WCRTLINK extern wint_t   towctrans( wint_t __wc, wctrans_t __desc );
_WCRTLINK extern wint_t   towlower( wint_t __wc );
_WCRTLINK extern wint_t   towupper( wint_t __wc );
_WCRTLINK extern wctrans_t wctrans( const char *__property );

:include ext.sp
/* These names are in ctype.h according to C99. */
_WCRTLINK extern int      iswblank( wint_t __wc );
#endif
:segment CNAME
}
:endsegment

:segment CNAME
:include cplusepi.sp
:endsegment

:: This #endif closes the #ifdef __cplusplus in wctype.h
:segment !CNAME
#endif
:endsegment

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?