1 | /* $Id: char.cpp,v 1.1 1999-05-24 20:20:01 ktk Exp $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | * Win32 character API functions for OS/2
|
---|
5 | *
|
---|
6 | * Copyright 1998 Sander van Leeuwen
|
---|
7 | * Copyright 1998 Patrick Haller
|
---|
8 | * Copyright 1998 Peter Fitzsimmons
|
---|
9 | *
|
---|
10 | *
|
---|
11 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
12 | *
|
---|
13 | */
|
---|
14 | #include "user32.h"
|
---|
15 |
|
---|
16 |
|
---|
17 | //******************************************************************************
|
---|
18 | //******************************************************************************
|
---|
19 | LPSTR WIN32API CharLowerA( LPSTR arg1)
|
---|
20 | {
|
---|
21 | dprintf(("USER32: OS2CharLowerA\n"));
|
---|
22 | return O32_CharLower(arg1);
|
---|
23 | }
|
---|
24 | //******************************************************************************
|
---|
25 | //******************************************************************************
|
---|
26 | DWORD WIN32API CharLowerBuffA( LPSTR arg1, DWORD arg2)
|
---|
27 | {
|
---|
28 | dprintf(("USER32: OS2CharLowerBuffA\n"));
|
---|
29 | return O32_CharLowerBuff(arg1, arg2);
|
---|
30 | }
|
---|
31 | //******************************************************************************
|
---|
32 | //******************************************************************************
|
---|
33 | DWORD WIN32API CharLowerBuffW( LPWSTR arg1, DWORD arg2)
|
---|
34 | {
|
---|
35 | dprintf(("USER32: OS2CharLowerBuffW DOESN'T WORK\n"));
|
---|
36 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
37 | return 0;
|
---|
38 | // return O32_CharLowerBuff(arg1, arg2);
|
---|
39 | }
|
---|
40 | //******************************************************************************
|
---|
41 | //******************************************************************************
|
---|
42 | LPWSTR WIN32API CharLowerW( LPWSTR arg1)
|
---|
43 | {
|
---|
44 | dprintf(("USER32: OS2CharLowerW DOESN'T WORK\n"));
|
---|
45 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
46 | return NULL;
|
---|
47 | // return O32_CharLower(arg1);
|
---|
48 | }
|
---|
49 | //******************************************************************************
|
---|
50 | //******************************************************************************
|
---|
51 | LPSTR WIN32API CharNextA( LPCSTR arg1)
|
---|
52 | {
|
---|
53 | dprintf(("USER32: OS2CharNextA\n"));
|
---|
54 | return O32_CharNext(arg1);
|
---|
55 | }
|
---|
56 | //******************************************************************************
|
---|
57 | //******************************************************************************
|
---|
58 | LPWSTR WIN32API CharNextW( LPCWSTR arg1)
|
---|
59 | {
|
---|
60 | dprintf(("USER32: OS2CharNextW DOESN'T WORK\n"));
|
---|
61 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
62 | return 0;
|
---|
63 | // return O32_CharNext(arg1);
|
---|
64 | }
|
---|
65 | //******************************************************************************
|
---|
66 | //******************************************************************************
|
---|
67 | LPSTR WIN32API CharPrevA( LPCSTR arg1, LPCSTR arg2)
|
---|
68 | {
|
---|
69 | dprintf(("USER32: OS2CharPrevA\n"));
|
---|
70 | return O32_CharPrev(arg1, arg2);
|
---|
71 | }
|
---|
72 | //******************************************************************************
|
---|
73 | //******************************************************************************
|
---|
74 | LPWSTR WIN32API CharPrevW( LPCWSTR arg1, LPCWSTR arg2)
|
---|
75 | {
|
---|
76 | dprintf(("USER32: OS2CharPrevW DOESN'T WORK\n"));
|
---|
77 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
78 | return 0;
|
---|
79 | // return O32_CharPrev(arg1, arg2);
|
---|
80 | }
|
---|
81 | //******************************************************************************
|
---|
82 | //******************************************************************************
|
---|
83 | BOOL WIN32API CharToOemA( LPCSTR arg1, LPSTR arg2)
|
---|
84 | {
|
---|
85 | dprintf(("USER32: OS2CharToOemA\n"));
|
---|
86 | return O32_CharToOem(arg1, arg2);
|
---|
87 | }
|
---|
88 | //******************************************************************************
|
---|
89 | //******************************************************************************
|
---|
90 | BOOL WIN32API CharToOemBuffA( LPCSTR arg1, LPSTR arg2, DWORD arg3)
|
---|
91 | {
|
---|
92 | dprintf(("USER32: OS2CharToOemBuffA\n"));
|
---|
93 | return O32_CharToOemBuff(arg1, arg2, arg3);
|
---|
94 | }
|
---|
95 | //******************************************************************************
|
---|
96 | //******************************************************************************
|
---|
97 | BOOL WIN32API CharToOemBuffW( LPCWSTR arg1, LPSTR arg2, DWORD arg3)
|
---|
98 | {
|
---|
99 | dprintf(("USER32: OS2CharToOemBuffW DOESN'T WORK\n"));
|
---|
100 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
101 | return 0;
|
---|
102 | // return O32_CharToOemBuff(arg1, arg2, arg3);
|
---|
103 | }
|
---|
104 | //******************************************************************************
|
---|
105 | //******************************************************************************
|
---|
106 | BOOL WIN32API CharToOemW( LPCWSTR arg1, LPSTR arg2)
|
---|
107 | {
|
---|
108 | dprintf(("USER32: OS2CharToOemW DOESN'T WORK\n"));
|
---|
109 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
110 | return 0;
|
---|
111 | // return O32_CharToOem(arg1, arg2);
|
---|
112 | }
|
---|
113 | //******************************************************************************
|
---|
114 | //******************************************************************************
|
---|
115 | LPSTR WIN32API CharUpperA( LPSTR arg1)
|
---|
116 | {
|
---|
117 | LPSTR rc;
|
---|
118 |
|
---|
119 | if((int)arg1 >> 16 != 0) {
|
---|
120 | dprintf(("USER32: OS2CharUpperA %s\n", arg1));
|
---|
121 | }
|
---|
122 | else {
|
---|
123 | dprintf(("USER32: OS2CharUpperA %X\n", arg1));
|
---|
124 | }
|
---|
125 |
|
---|
126 | rc = O32_CharUpper(arg1);
|
---|
127 |
|
---|
128 | if((int)rc >> 16 != 0) {
|
---|
129 | dprintf(("USER32: OS2CharUpperA %s\n", rc));
|
---|
130 | }
|
---|
131 | else {
|
---|
132 | dprintf(("USER32: OS2CharUpperA %X\n", rc));
|
---|
133 | }
|
---|
134 |
|
---|
135 | return(rc);
|
---|
136 | }
|
---|
137 | //******************************************************************************
|
---|
138 | //******************************************************************************
|
---|
139 | DWORD WIN32API CharUpperBuffA( LPSTR arg1, DWORD arg2)
|
---|
140 | {
|
---|
141 | dprintf(("USER32: OS2CharUpperBuffA\n"));
|
---|
142 | return O32_CharUpperBuff(arg1, arg2);
|
---|
143 | }
|
---|
144 | //******************************************************************************
|
---|
145 | //******************************************************************************
|
---|
146 | DWORD WIN32API CharUpperBuffW( LPWSTR arg1, DWORD arg2)
|
---|
147 | {
|
---|
148 | dprintf(("USER32: OS2CharUpperBuffW DOESN'T WORK\n"));
|
---|
149 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
150 | return 0;
|
---|
151 | // return O32_CharUpperBuff(arg1, arg2);
|
---|
152 | }
|
---|
153 | //******************************************************************************
|
---|
154 | //******************************************************************************
|
---|
155 | LPWSTR WIN32API CharUpperW( LPWSTR arg1)
|
---|
156 | {
|
---|
157 | dprintf(("USER32: OS2CharUpperW DOESN'T WORK\n"));
|
---|
158 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
159 | return 0;
|
---|
160 | // return O32_CharUpper(arg1);
|
---|
161 | }
|
---|
162 | //******************************************************************************
|
---|
163 | //******************************************************************************
|
---|
164 | LPSTR WIN32API CharNextExA( WORD codepage, LPCSTR ptr, DWORD flags )
|
---|
165 | {
|
---|
166 | if (!*ptr) return (LPSTR)ptr;
|
---|
167 | // if (O32_IsDBCSLeadByteEx( codepage, *ptr )) return (LPSTR)(ptr + 2);
|
---|
168 | return (LPSTR)(ptr + 1);
|
---|
169 | }
|
---|
170 | //******************************************************************************
|
---|
171 | //******************************************************************************
|
---|
172 | LPSTR WIN32API CharPrevExA(WORD codepage, LPCSTR start, LPCSTR ptr, DWORD flags)
|
---|
173 | {
|
---|
174 | while (*start && (start < ptr))
|
---|
175 | {
|
---|
176 | LPCSTR next = CharNextExA(codepage, start, flags);
|
---|
177 | if (next > ptr) break;
|
---|
178 | start = next;
|
---|
179 | }
|
---|
180 | return (LPSTR)start;
|
---|
181 | }
|
---|
182 | /*****************************************************************************
|
---|
183 | * Name : LPSTR WIN32API CharNextExW
|
---|
184 | * Purpose : The CharNextExA function retrieves the address of the next
|
---|
185 | * character in a string. This function can handle strings
|
---|
186 | * consisting of either single- or multi-byte characters.
|
---|
187 | * Parameters:
|
---|
188 | * Variables :
|
---|
189 | * Result : If the function succeeds, the return value is a pointer to the
|
---|
190 | * next character in the string, or to the terminating null character
|
---|
191 | * if at the end of the string.
|
---|
192 | * If lpCurrentChar points to the terminating null character, the
|
---|
193 | * return value is equal to lpCurrentChar.
|
---|
194 | * Remark :
|
---|
195 | * Status : UNTESTED STUB
|
---|
196 | *
|
---|
197 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
198 | *****************************************************************************/
|
---|
199 |
|
---|
200 | LPWSTR WIN32API CharNextExW(WORD CodePage,
|
---|
201 | LPCWSTR lpCurrentChar,
|
---|
202 | DWORD dwFlags)
|
---|
203 | {
|
---|
204 | dprintf(("USER32:CharNextExW(%u,%08xh,%08x) not implemented.\n",
|
---|
205 | CodePage,
|
---|
206 | lpCurrentChar,
|
---|
207 | dwFlags));
|
---|
208 |
|
---|
209 | return (NULL);
|
---|
210 | }
|
---|
211 |
|
---|
212 |
|
---|
213 | /*****************************************************************************
|
---|
214 | * Name : LPSTR WIN32API CharPrevExW
|
---|
215 | * Purpose : The CharPrevExA function retrieves the address of the preceding
|
---|
216 | * character in a string. This function can handle strings
|
---|
217 | * consisting of either single- or multi-byte characters.
|
---|
218 | * Parameters:
|
---|
219 | * Variables :
|
---|
220 | * Result : If the function succeeds, the return value is a pointer to the
|
---|
221 | * preceding character in the string, or to the first character in
|
---|
222 | * the string if the lpCurrentChar parameter equals the lpStart parameter.
|
---|
223 | * Remark :
|
---|
224 | * Status : UNTESTED STUB
|
---|
225 | *
|
---|
226 | * Author : Patrick Haller [Thu, 1998/02/26 11:55]
|
---|
227 | *****************************************************************************/
|
---|
228 |
|
---|
229 | LPWSTR WIN32API CharPrevExW(WORD CodePage,
|
---|
230 | LPCWSTR lpStart,
|
---|
231 | LPCWSTR lpCurrentChar,
|
---|
232 | DWORD dwFlags)
|
---|
233 | {
|
---|
234 | dprintf(("USER32:CharPrevExW(%u,%08xh,%08xh,%08x) not implemented.\n",
|
---|
235 | CodePage,
|
---|
236 | lpStart,
|
---|
237 | lpCurrentChar,
|
---|
238 | dwFlags));
|
---|
239 |
|
---|
240 | return (NULL);
|
---|
241 | }
|
---|
242 | //******************************************************************************
|
---|
243 | //******************************************************************************
|
---|
244 | BOOL WIN32API IsCharAlphaA( CHAR arg1)
|
---|
245 | {
|
---|
246 | #ifdef DEBUG
|
---|
247 | WriteLog("USER32: OS2IsCharAlphaA\n");
|
---|
248 | #endif
|
---|
249 | return O32_IsCharAlpha(arg1);
|
---|
250 | }
|
---|
251 | //******************************************************************************
|
---|
252 | //******************************************************************************
|
---|
253 | BOOL WIN32API IsCharAlphaNumericA( CHAR arg1)
|
---|
254 | {
|
---|
255 | #ifdef DEBUG
|
---|
256 | WriteLog("USER32: OS2IsCharAlphaNumericA\n");
|
---|
257 | #endif
|
---|
258 | return O32_IsCharAlphaNumeric(arg1);
|
---|
259 | }
|
---|
260 | //******************************************************************************
|
---|
261 | //******************************************************************************
|
---|
262 | BOOL WIN32API IsCharAlphaNumericW( WCHAR arg1)
|
---|
263 | {
|
---|
264 | #ifdef DEBUG
|
---|
265 | WriteLog("USER32: OS2IsCharAlphaNumericW\n");
|
---|
266 | #endif
|
---|
267 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
268 | return O32_IsCharAlphaNumeric((CHAR)arg1);
|
---|
269 | }
|
---|
270 | //******************************************************************************
|
---|
271 | //******************************************************************************
|
---|
272 | BOOL WIN32API IsCharAlphaW( WCHAR arg1)
|
---|
273 | {
|
---|
274 | #ifdef DEBUG
|
---|
275 | WriteLog("USER32: OS2IsCharAlphaW\n");
|
---|
276 | #endif
|
---|
277 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
278 | return O32_IsCharAlpha((CHAR)arg1);
|
---|
279 | }
|
---|
280 | //******************************************************************************
|
---|
281 | //******************************************************************************
|
---|
282 | BOOL WIN32API IsCharLowerA( CHAR arg1)
|
---|
283 | {
|
---|
284 | #ifdef DEBUG
|
---|
285 | WriteLog("USER32: OS2IsCharLowerA\n");
|
---|
286 | #endif
|
---|
287 | return O32_IsCharLower(arg1);
|
---|
288 | }
|
---|
289 | //******************************************************************************
|
---|
290 | //******************************************************************************
|
---|
291 | BOOL WIN32API IsCharLowerW( WCHAR arg1)
|
---|
292 | {
|
---|
293 | #ifdef DEBUG
|
---|
294 | WriteLog("USER32: OS2IsCharLowerW\n");
|
---|
295 | #endif
|
---|
296 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
297 | return O32_IsCharLower((CHAR)arg1);
|
---|
298 | }
|
---|
299 | //******************************************************************************
|
---|
300 | //******************************************************************************
|
---|
301 | BOOL WIN32API IsCharUpperA( CHAR arg1)
|
---|
302 | {
|
---|
303 | #ifdef DEBUG
|
---|
304 | WriteLog("USER32: OS2IsCharUpperA\n");
|
---|
305 | #endif
|
---|
306 | return O32_IsCharUpper(arg1);
|
---|
307 | }
|
---|
308 | //******************************************************************************
|
---|
309 | //******************************************************************************
|
---|
310 | BOOL WIN32API IsCharUpperW( WCHAR arg1)
|
---|
311 | {
|
---|
312 | #ifdef DEBUG
|
---|
313 | WriteLog("USER32: OS2IsCharUpperW\n");
|
---|
314 | #endif
|
---|
315 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
316 | return O32_IsCharUpper((CHAR)arg1);
|
---|
317 | }
|
---|
318 | //******************************************************************************
|
---|
319 | //******************************************************************************
|
---|
320 | BOOL WIN32API OemToCharA( LPCSTR arg1, LPSTR arg2)
|
---|
321 | {
|
---|
322 | #ifdef DEBUG
|
---|
323 | WriteLog("USER32: OS2OemToCharA\n");
|
---|
324 | #endif
|
---|
325 | return O32_OemToChar(arg1, arg2);
|
---|
326 | }
|
---|
327 | //******************************************************************************
|
---|
328 | //******************************************************************************
|
---|
329 | BOOL WIN32API OemToCharBuffA( LPCSTR arg1, LPSTR arg2, DWORD arg3)
|
---|
330 | {
|
---|
331 | #ifdef DEBUG
|
---|
332 | WriteLog("USER32: OS2OemToCharBuffA\n");
|
---|
333 | #endif
|
---|
334 | return O32_OemToCharBuff(arg1, arg2, arg3);
|
---|
335 | }
|
---|
336 | //******************************************************************************
|
---|
337 | //******************************************************************************
|
---|
338 | BOOL WIN32API OemToCharBuffW(LPCSTR arg1, LPWSTR arg2, DWORD arg3)
|
---|
339 | {
|
---|
340 | #ifdef DEBUG
|
---|
341 | WriteLog("USER32: OemToCharBuffW DOESN'T WORK \n");
|
---|
342 | #endif
|
---|
343 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
344 | return 0;
|
---|
345 | // return O32_OemToCharBuff(arg1, arg2, arg3);
|
---|
346 | }
|
---|
347 | //******************************************************************************
|
---|
348 | //******************************************************************************
|
---|
349 | BOOL WIN32API OemToCharW( LPCSTR arg1, LPWSTR arg2)
|
---|
350 | {
|
---|
351 | #ifdef DEBUG
|
---|
352 | WriteLog("USER32: OS2OemToCharW DOESN'T WORK\n");
|
---|
353 | #endif
|
---|
354 | // NOTE: This will not work as is (needs UNICODE support)
|
---|
355 | return 0;
|
---|
356 | // return O32_OemToChar(arg1, arg2);
|
---|
357 | }
|
---|