win64: use new headers from mingw
This commit is contained in:
@ -1,127 +1,172 @@
|
||||
/*
|
||||
* wctype.h
|
||||
*
|
||||
* Functions for testing wide character types and converting characters.
|
||||
*
|
||||
* This file is part of the Mingw32 package.
|
||||
*
|
||||
* Contributors:
|
||||
* Created by Mumit Khan <khan@xraylith.wisc.edu>
|
||||
*
|
||||
* THIS SOFTWARE IS NOT COPYRIGHTED
|
||||
*
|
||||
* This source code is offered for use in the public domain. You may
|
||||
* use, modify or distribute it freely.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful but
|
||||
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
||||
* DISCLAIMED. This includes but is not limited to warranties of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the w64 mingw-runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||
*/
|
||||
#ifndef _INC_WCTYPE
|
||||
#define _INC_WCTYPE
|
||||
|
||||
#ifndef _WCTYPE_H_
|
||||
#define _WCTYPE_H_
|
||||
#ifndef _WIN32
|
||||
#error Only Win32 target is supported!
|
||||
#endif
|
||||
|
||||
/* All the headers include this file. */
|
||||
#include <_mingw.h>
|
||||
|
||||
#define __need_wchar_t
|
||||
#define __need_wint_t
|
||||
#ifndef RC_INVOKED
|
||||
#include <stddef.h>
|
||||
#endif /* Not RC_INVOKED */
|
||||
|
||||
/*
|
||||
* The following flags are used to tell iswctype and _isctype what character
|
||||
* types you are looking for.
|
||||
*/
|
||||
#define _UPPER 0x0001
|
||||
#define _LOWER 0x0002
|
||||
#define _DIGIT 0x0004
|
||||
#define _SPACE 0x0008
|
||||
#define _PUNCT 0x0010
|
||||
#define _CONTROL 0x0020
|
||||
#define _BLANK 0x0040
|
||||
#define _HEX 0x0080
|
||||
#define _LEADBYTE 0x8000
|
||||
|
||||
#define _ALPHA 0x0103
|
||||
|
||||
#ifndef RC_INVOKED
|
||||
#pragma pack(push,_CRT_PACKING)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef WEOF
|
||||
#define WEOF (wchar_t)(0xFFFF)
|
||||
#ifndef _CRTIMP
|
||||
#define _CRTIMP __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
typedef unsigned short wchar_t;
|
||||
#define _WCHAR_T_DEFINED
|
||||
#endif
|
||||
|
||||
#ifndef _WCTYPE_T_DEFINED
|
||||
typedef wchar_t wctype_t;
|
||||
typedef unsigned short wint_t;
|
||||
typedef unsigned short wctype_t;
|
||||
#define _WCTYPE_T_DEFINED
|
||||
#endif
|
||||
|
||||
/* Wide character equivalents - also in ctype.h */
|
||||
int iswalnum(wint_t);
|
||||
int iswalpha(wint_t);
|
||||
int iswascii(wint_t);
|
||||
int iswcntrl(wint_t);
|
||||
int iswctype(wint_t, wctype_t);
|
||||
int is_wctype(wint_t, wctype_t); /* Obsolete! */
|
||||
int iswdigit(wint_t);
|
||||
int iswgraph(wint_t);
|
||||
int iswlower(wint_t);
|
||||
int iswprint(wint_t);
|
||||
int iswpunct(wint_t);
|
||||
int iswspace(wint_t);
|
||||
int iswupper(wint_t);
|
||||
int iswxdigit(wint_t);
|
||||
|
||||
wchar_t towlower(wchar_t);
|
||||
wchar_t towupper(wchar_t);
|
||||
|
||||
int isleadbyte (int);
|
||||
|
||||
/* Also in ctype.h */
|
||||
|
||||
__MINGW_IMPORT unsigned short _ctype[];
|
||||
#ifdef __MSVCRT__
|
||||
__MINGW_IMPORT unsigned short* _pctype;
|
||||
#else
|
||||
__MINGW_IMPORT unsigned short* _pctype_dll;
|
||||
#define _pctype _pctype_dll
|
||||
#ifndef WEOF
|
||||
#define WEOF (wint_t)(0xFFFF)
|
||||
#endif
|
||||
|
||||
#if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
|
||||
#define __WCTYPE_INLINES_DEFINED
|
||||
extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
|
||||
extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
|
||||
extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
|
||||
extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
|
||||
extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
|
||||
extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
|
||||
extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
|
||||
extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
|
||||
extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
|
||||
extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
|
||||
extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
|
||||
extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
|
||||
extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
|
||||
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
|
||||
#ifndef _CRT_CTYPEDATA_DEFINED
|
||||
#define _CRT_CTYPEDATA_DEFINED
|
||||
#ifndef _CTYPE_DISABLE_MACROS
|
||||
|
||||
#ifndef __PCTYPE_FUNC
|
||||
#define __PCTYPE_FUNC __pctype_func()
|
||||
#ifdef _MSVCRT_
|
||||
#define __pctype_func() (_pctype)
|
||||
#else
|
||||
#define __pctype_func() (*_imp___pctype)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef wchar_t wctrans_t;
|
||||
wint_t towctrans(wint_t, wctrans_t);
|
||||
wctrans_t wctrans(const char*);
|
||||
wctype_t wctype(const char*);
|
||||
#ifndef _pctype
|
||||
#ifdef _MSVCRT_
|
||||
extern unsigned short *_pctype;
|
||||
#else
|
||||
extern unsigned short **_imp___pctype;
|
||||
#define _pctype (*_imp___pctype)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _CRT_WCTYPEDATA_DEFINED
|
||||
#define _CRT_WCTYPEDATA_DEFINED
|
||||
#ifndef _CTYPE_DISABLE_MACROS
|
||||
#ifndef _wctype
|
||||
#ifdef _MSVCRT_
|
||||
extern unsigned short *_wctype;
|
||||
#else
|
||||
extern unsigned short **_imp___wctype;
|
||||
#define _wctype (*_imp___wctype)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _pwctype
|
||||
#ifdef _MSVCRT_
|
||||
extern unsigned short *_pwctype;
|
||||
#else
|
||||
extern unsigned short **_imp___pwctype;
|
||||
#define _pwctype (*_imp___pwctype)
|
||||
#define __pwctype_func() (*_imp___pwctype)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define _UPPER 0x1
|
||||
#define _LOWER 0x2
|
||||
#define _DIGIT 0x4
|
||||
#define _SPACE 0x8
|
||||
|
||||
#define _PUNCT 0x10
|
||||
#define _CONTROL 0x20
|
||||
#define _BLANK 0x40
|
||||
#define _HEX 0x80
|
||||
|
||||
#define _LEADBYTE 0x8000
|
||||
#define _ALPHA (0x0100|_UPPER|_LOWER)
|
||||
|
||||
#ifndef _WCTYPE_DEFINED
|
||||
#define _WCTYPE_DEFINED
|
||||
|
||||
int __cdecl iswalpha(wint_t);
|
||||
int __cdecl iswupper(wint_t);
|
||||
int __cdecl iswlower(wint_t);
|
||||
int __cdecl iswdigit(wint_t);
|
||||
int __cdecl iswxdigit(wint_t);
|
||||
int __cdecl iswspace(wint_t);
|
||||
int __cdecl iswpunct(wint_t);
|
||||
int __cdecl iswalnum(wint_t);
|
||||
int __cdecl iswprint(wint_t);
|
||||
int __cdecl iswgraph(wint_t);
|
||||
int __cdecl iswcntrl(wint_t);
|
||||
int __cdecl iswascii(wint_t);
|
||||
int __cdecl isleadbyte(int);
|
||||
wint_t __cdecl towupper(wint_t);
|
||||
wint_t __cdecl towlower(wint_t);
|
||||
int __cdecl iswctype(wint_t,wctype_t);
|
||||
_CRTIMP int __cdecl __iswcsymf(wint_t);
|
||||
_CRTIMP int __cdecl __iswcsym(wint_t);
|
||||
int __cdecl is_wctype(wint_t,wctype_t);
|
||||
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
|
||||
int __cdecl isblank(int _C);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef _WCTYPE_INLINE_DEFINED
|
||||
#define _WCTYPE_INLINE_DEFINED
|
||||
#ifndef __cplusplus
|
||||
#define iswalpha(_c) (iswctype(_c,_ALPHA))
|
||||
#define iswupper(_c) (iswctype(_c,_UPPER))
|
||||
#define iswlower(_c) (iswctype(_c,_LOWER))
|
||||
#define iswdigit(_c) (iswctype(_c,_DIGIT))
|
||||
#define iswxdigit(_c) (iswctype(_c,_HEX))
|
||||
#define iswspace(_c) (iswctype(_c,_SPACE))
|
||||
#define iswpunct(_c) (iswctype(_c,_PUNCT))
|
||||
#define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT))
|
||||
#define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
|
||||
#define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT))
|
||||
#define iswcntrl(_c) (iswctype(_c,_CONTROL))
|
||||
#define iswascii(_c) ((unsigned)(_c) < 0x80)
|
||||
#define isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE)
|
||||
#else
|
||||
__CRT_INLINE int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); }
|
||||
__CRT_INLINE int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); }
|
||||
__CRT_INLINE int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); }
|
||||
__CRT_INLINE int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); }
|
||||
__CRT_INLINE int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); }
|
||||
__CRT_INLINE int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); }
|
||||
__CRT_INLINE int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); }
|
||||
__CRT_INLINE int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); }
|
||||
__CRT_INLINE int __cdecl iswprint(wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); }
|
||||
__CRT_INLINE int __cdecl iswgraph(wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); }
|
||||
__CRT_INLINE int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); }
|
||||
__CRT_INLINE int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); }
|
||||
__CRT_INLINE int __cdecl isleadbyte(int _C) {return (__pctype_func()[(unsigned char)(_C)] & _LEADBYTE); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef wchar_t wctrans_t;
|
||||
wint_t __cdecl towctrans(wint_t,wctrans_t);
|
||||
wctrans_t __cdecl wctrans(const char *);
|
||||
wctype_t __cdecl wctype(const char *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* Not RC_INVOKED */
|
||||
|
||||
#endif /* Not _WCTYPE_H_ */
|
||||
|
||||
#pragma pack(pop)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user