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