Started to port some of the support for IsCharAlphaNumeric et al from wine.
[reactos.git] / reactos / lib / user32 / windows / text.c
1 /*
2 * ReactOS kernel
3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19 /* $Id: text.c,v 1.5 2002/12/26 17:21:27 robd Exp $
20 *
21 * PROJECT: ReactOS user32.dll
22 * FILE: lib/user32/windows/input.c
23 * PURPOSE: Input
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
25 * UPDATE HISTORY:
26 * 09-05-2001 CSH Created
27 */
28
29 /* INCLUDES ******************************************************************/
30
31 #include <windows.h>
32 #include <user32.h>
33 #include <debug.h>
34
35 /* FUNCTIONS *****************************************************************/
36
37 LPSTR
38 STDCALL
39 CharLowerA(
40 LPSTR lpsz)
41 {
42 return (LPSTR)NULL;
43 }
44
45 DWORD
46 STDCALL
47 CharLowerBuffA(
48 LPSTR lpsz,
49 DWORD cchLength)
50 {
51 return 0;
52 }
53
54 DWORD
55 STDCALL
56 CharLowerBuffW(
57 LPWSTR lpsz,
58 DWORD cchLength)
59 {
60 return 0;
61 }
62
63 LPWSTR
64 STDCALL
65 CharLowerW(
66 LPWSTR lpsz)
67 {
68 return (LPWSTR)NULL;
69 }
70
71 LPSTR
72 STDCALL
73 CharNextA(
74 LPCSTR lpsz)
75 {
76 return (LPSTR)NULL;
77 }
78
79 LPSTR
80 STDCALL
81 CharNextExA(
82 WORD CodePage,
83 LPCSTR lpCurrentChar,
84 DWORD dwFlags)
85 {
86 return (LPSTR)NULL;
87 }
88
89 LPWSTR
90 STDCALL
91 CharNextW(
92 LPCWSTR lpsz)
93 {
94 return (LPWSTR)NULL;
95 }
96
97 LPSTR
98 STDCALL
99 CharPrevA(
100 LPCSTR lpszStart,
101 LPCSTR lpszCurrent)
102 {
103 return (LPSTR)NULL;
104 }
105
106 LPWSTR
107 STDCALL
108 CharPrevW(
109 LPCWSTR lpszStart,
110 LPCWSTR lpszCurrent)
111 {
112 return (LPWSTR)NULL;
113 }
114
115 LPSTR
116 STDCALL
117 CharPrevExA(
118 WORD CodePage,
119 LPCSTR lpStart,
120 LPCSTR lpCurrentChar,
121 DWORD dwFlags)
122 {
123 return (LPSTR)NULL;
124 }
125
126 WINBOOL
127 STDCALL
128 CharToOemA(
129 LPCSTR lpszSrc,
130 LPSTR lpszDst)
131 {
132 return FALSE;
133 }
134
135 WINBOOL
136 STDCALL
137 CharToOemBuffA(
138 LPCSTR lpszSrc,
139 LPSTR lpszDst,
140 DWORD cchDstLength)
141 {
142 return FALSE;
143 }
144
145 WINBOOL
146 STDCALL
147 CharToOemBuffW(
148 LPCWSTR lpszSrc,
149 LPSTR lpszDst,
150 DWORD cchDstLength)
151 {
152 return FALSE;
153 }
154
155 WINBOOL
156 STDCALL
157 CharToOemW(
158 LPCWSTR lpszSrc,
159 LPSTR lpszDst)
160 {
161 return FALSE;
162 }
163
164 LPSTR
165 STDCALL
166 CharUpperA(
167 LPSTR lpsz)
168 {
169 return (LPSTR)NULL;
170 }
171
172 DWORD
173 STDCALL
174 CharUpperBuffA(
175 LPSTR lpsz,
176 DWORD cchLength)
177 {
178 return 0;
179 }
180
181 DWORD
182 STDCALL
183 CharUpperBuffW(
184 LPWSTR lpsz,
185 DWORD cchLength)
186 {
187 return 0;
188 }
189
190 LPWSTR
191 STDCALL
192 CharUpperW(
193 LPWSTR lpsz)
194 {
195 return (LPWSTR)NULL;
196 }
197 WINBOOL
198 STDCALL
199 IsCharAlphaA(
200 CHAR ch)
201 {
202 return FALSE;
203 }
204
205 const char IsCharAlphaNumericA_lookup_table[] = {
206 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03,
207 0xfe, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07,
208 0x08, 0x54, 0x00, 0xd4, 0x00, 0x00, 0x0c, 0x02,
209 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff
210 };
211
212 WINBOOL
213 STDCALL
214 IsCharAlphaNumericA(CHAR ch)
215 {
216 // return (IsCharAlphaNumericA_lookup_table[ch / 8] & (1 << (ch % 8))) ? 1 : 0;
217
218 WCHAR wch;
219 MultiByteToWideChar(CP_ACP, 0, &ch, 1, &wch, 1);
220 return IsCharAlphaNumericW(wch);
221 //return FALSE;
222 }
223
224 WINBOOL
225 STDCALL
226 IsCharAlphaNumericW(WCHAR ch)
227 {
228 //return (get_char_typeW(ch) & (C1_ALPHA|C1_DIGIT)) != 0;
229 return FALSE;
230 }
231
232 WINBOOL
233 STDCALL
234 IsCharAlphaW(
235 WCHAR ch)
236 {
237 return FALSE;
238 }
239
240 WINBOOL
241 STDCALL
242 IsCharLowerA(
243 CHAR ch)
244 {
245 return FALSE;
246 }
247
248 WINBOOL
249 STDCALL
250 IsCharLowerW(
251 WCHAR ch)
252 {
253 return FALSE;
254 }
255
256 WINBOOL
257 STDCALL
258 IsCharUpperA(
259 CHAR ch)
260 {
261 return FALSE;
262 }
263
264 WINBOOL
265 STDCALL
266 IsCharUpperW(
267 WCHAR ch)
268 {
269 return FALSE;
270 }
271
272 WINBOOL
273 STDCALL
274 OemToCharA(
275 LPCSTR lpszSrc,
276 LPSTR lpszDst)
277 {
278 return FALSE;
279 }
280
281 WINBOOL
282 STDCALL
283 OemToCharBuffA(
284 LPCSTR lpszSrc,
285 LPSTR lpszDst,
286 DWORD cchDstLength)
287 {
288 return FALSE;
289 }
290
291 WINBOOL
292 STDCALL
293 OemToCharBuffW(
294 LPCSTR lpszSrc,
295 LPWSTR lpszDst,
296 DWORD cchDstLength)
297 {
298 return FALSE;
299 }
300
301 WINBOOL
302 STDCALL
303 OemToCharW(
304 LPCSTR lpszSrc,
305 LPWSTR lpszDst)
306 {
307 return FALSE;
308 }