tcc_preprocess: add gcc-style include-depth flags
[tinycc/k1w1.git] / win32 / include / wctype.h
blob1fb00fb3ca65db0a5a2e2d74b687835c8902b505
1 /*
2 * wctype.h
4 * Functions for testing wide character types and converting characters.
6 * This file is part of the Mingw32 package.
8 * Contributors:
9 * Created by Mumit Khan <khan@xraylith.wisc.edu>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 #ifndef _WCTYPE_H_
24 #define _WCTYPE_H_
26 /* All the headers include this file. */
27 #include <_mingw.h>
29 #define __need_wchar_t
30 #define __need_wint_t
31 #ifndef RC_INVOKED
32 #include <stddef.h>
33 #endif /* Not RC_INVOKED */
36 * The following flags are used to tell iswctype and _isctype what character
37 * types you are looking for.
39 #define _UPPER 0x0001
40 #define _LOWER 0x0002
41 #define _DIGIT 0x0004
42 #define _SPACE 0x0008
43 #define _PUNCT 0x0010
44 #define _CONTROL 0x0020
45 #define _BLANK 0x0040
46 #define _HEX 0x0080
47 #define _LEADBYTE 0x8000
49 #define _ALPHA 0x0103
51 #ifndef RC_INVOKED
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
57 #ifndef WEOF
58 #define WEOF (wchar_t)(0xFFFF)
59 #endif
61 #ifndef _WCTYPE_T_DEFINED
62 typedef wchar_t wctype_t;
63 #define _WCTYPE_T_DEFINED
64 #endif
66 /* Wide character equivalents - also in ctype.h */
67 int iswalnum(wint_t);
68 int iswalpha(wint_t);
69 int iswascii(wint_t);
70 int iswcntrl(wint_t);
71 int iswctype(wint_t, wctype_t);
72 int is_wctype(wint_t, wctype_t); /* Obsolete! */
73 int iswdigit(wint_t);
74 int iswgraph(wint_t);
75 int iswlower(wint_t);
76 int iswprint(wint_t);
77 int iswpunct(wint_t);
78 int iswspace(wint_t);
79 int iswupper(wint_t);
80 int iswxdigit(wint_t);
82 wchar_t towlower(wchar_t);
83 wchar_t towupper(wchar_t);
85 int isleadbyte (int);
87 /* Also in ctype.h */
89 __MINGW_IMPORT unsigned short _ctype[];
90 #ifdef __MSVCRT__
91 __MINGW_IMPORT unsigned short* _pctype;
92 #else
93 __MINGW_IMPORT unsigned short* _pctype_dll;
94 #define _pctype _pctype_dll
95 #endif
97 #if !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED))
98 #define __WCTYPE_INLINES_DEFINED
99 extern inline int iswalnum(wint_t wc) {return (iswctype(wc,_ALPHA|_DIGIT));}
100 extern inline int iswalpha(wint_t wc) {return (iswctype(wc,_ALPHA));}
101 extern inline int iswascii(wint_t wc) {return (((unsigned)wc & 0x7F) ==0);}
102 extern inline int iswcntrl(wint_t wc) {return (iswctype(wc,_CONTROL));}
103 extern inline int iswdigit(wint_t wc) {return (iswctype(wc,_DIGIT));}
104 extern inline int iswgraph(wint_t wc) {return (iswctype(wc,_PUNCT|_ALPHA|_DIGIT));}
105 extern inline int iswlower(wint_t wc) {return (iswctype(wc,_LOWER));}
106 extern inline int iswprint(wint_t wc) {return (iswctype(wc,_BLANK|_PUNCT|_ALPHA|_DIGIT));}
107 extern inline int iswpunct(wint_t wc) {return (iswctype(wc,_PUNCT));}
108 extern inline int iswspace(wint_t wc) {return (iswctype(wc,_SPACE));}
109 extern inline int iswupper(wint_t wc) {return (iswctype(wc,_UPPER));}
110 extern inline int iswxdigit(wint_t wc) {return (iswctype(wc,_HEX));}
111 extern inline int isleadbyte(int c) {return (_pctype[(unsigned char)(c)] & _LEADBYTE);}
112 #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
115 typedef wchar_t wctrans_t;
116 wint_t towctrans(wint_t, wctrans_t);
117 wctrans_t wctrans(const char*);
118 wctype_t wctype(const char*);
120 #ifdef __cplusplus
122 #endif
124 #endif /* Not RC_INVOKED */
126 #endif /* Not _WCTYPE_H_ */