source: trunk/src/kernel32/lang.cpp@ 46

Last change on this file since 46 was 46, checked in by sandervl, 26 years ago

* empty log message *

File size: 10.5 KB
Line 
1/*
2 *
3 * Project Odin Software License can be found in LICENSE.TXT
4 *
5 */
6/*
7 * Win32 language API functions for OS/2
8 *
9 * Copyright 1998 Sander van Leeuwen
10 * Copyright 1998 Patrick Haller
11 *
12 */
13#include <os2win.h>
14#include <winnls.h>
15#include "unicode.h"
16
17
18//******************************************************************************
19//******************************************************************************
20BOOL WIN32API IsValidCodePage(UINT CodePage)
21{
22 dprintf(("KERNEL32: IsValidCodePage not implemented\n"));
23 return(TRUE);
24}
25//******************************************************************************
26//******************************************************************************
27LCID WIN32API GetUserDefaultLCID(void)
28{
29 dprintf(("KERNEL32: OS2GetUserDefaultLCID: always retuns US English!\n"));
30 return(0x409); //US English
31}
32//******************************************************************************
33//******************************************************************************
34LCID WIN32API GetSystemDefaultLCID(void)
35{
36 dprintf(("KERNEL32: OS2GetSystemDefaultLCID: always retuns US English!\n"));
37 return(0x409); //US English
38}
39//******************************************************************************
40//******************************************************************************
41LANGID WIN32API GetUserDefaultLangID()
42{
43 dprintf(("KERNEL32: OS2GetUserDefaultLangID, always returns US English\n"));
44 return(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
45}
46//******************************************************************************
47//******************************************************************************
48LANGID WIN32API GetSystemDefaultLangID(void)
49{
50 dprintf(("KERNEL32: OS2GetSystemDefaultLangID, always returns US English\n"));
51 return(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
52}
53//******************************************************************************
54//TODO: Not complete (far from actually)!!
55//******************************************************************************
56int WIN32API GetLocaleInfoA(LCID lcid, LCTYPE LCType, LPSTR lpLCData, int cchData)
57{
58 dprintf(("KERNEL32: OS2GetLocaleInfoA: Not complete!\n"));
59 if(cchData == 0)
60 return(1);
61 *lpLCData = '1';
62 return(1);
63}
64//******************************************************************************
65//******************************************************************************
66int WIN32API GetLocaleInfoW(LCID lcid, LCTYPE LCType, LPWSTR lpLCData, int cchData)
67{
68 dprintf(("KERNEL32: OS2GetLocaleInfoA: Not complete!\n"));
69 if(cchData == 0)
70 return(1*sizeof(USHORT));
71 *lpLCData = (USHORT)'1';
72 return(sizeof(USHORT));
73}
74//******************************************************************************
75//******************************************************************************
76BOOL WIN32API IsValidLocale(LCID Locale, DWORD dwFlags)
77{
78 dprintf(("KERNEL32: OS2IsValidLocale, always returns TRUE\n"));
79 return(TRUE);
80}
81//******************************************************************************
82//******************************************************************************
83LCID WIN32API GetThreadLocale()
84{
85 dprintf(("KERNEL32: OS2GetThreadLocale always return US English!\n"));
86 return(0x409); //US English
87}
88//******************************************************************************
89//******************************************************************************
90//******************************************************************************
91BOOL WIN32API SetThreadLocale( LCID locale )
92{
93 dprintf(("KERNEL32: OS2SetThreadLocale not implemented!\n"));
94 return(TRUE);
95}
96//******************************************************************************
97//******************************************************************************
98BOOL WIN32API EnumSystemLocalesA(LOCALE_ENUMPROCA lpLocaleEnumProc,
99 DWORD dwFlags)
100{
101 dprintf(("EnumSystemLocalesA %X %X\n", lpLocaleEnumProc, dwFlags));
102 if(lpLocaleEnumProc == NULL || ((dwFlags & LCID_INSTALLED) && (dwFlags & LCID_SUPPORTED))) {
103 dprintf(("Invalid parameter\n"));
104 SetLastError(ERROR_INVALID_PARAMETER);
105 return(FALSE);
106 }
107 lpLocaleEnumProc("OS/2 US English");
108 return(TRUE);
109}
110//******************************************************************************
111//******************************************************************************
112BOOL WIN32API EnumSystemLocalesW(LOCALE_ENUMPROCW lpLocaleEnumProc,
113 DWORD dwFlags)
114{
115 WCHAR locStr[32];
116
117 dprintf(("EnumSystemLocalesW %X %X\n", lpLocaleEnumProc, dwFlags));
118 if(lpLocaleEnumProc == NULL || ((dwFlags & LCID_INSTALLED) && (dwFlags & LCID_SUPPORTED))) {
119 dprintf(("Invalid parameter\n"));
120 SetLastError(ERROR_INVALID_PARAMETER);
121 return(FALSE);
122 }
123 AsciiToUnicode("OS/2 US English", locStr);
124 lpLocaleEnumProc(locStr);
125 return(TRUE);
126}
127//******************************************************************************
128//******************************************************************************
129
130
131/*****************************************************************************
132 * Name : BOOL SetLocaleInfoA
133 * Purpose : The SetLocaleInfoA function sets an item of locale information.
134 * It does so by making an entry in the process portion of the
135 * locale table. This setting only affects the user override portion
136 * of the locale settings; it does not set the system defaults.
137 * Only certain types of locale information, or LCTYPE values, can
138 * be set by this function. See the following Remarks section for a
139 * list of valid LCTYPE values.
140 * The locale information is always passed in as a null-terminated
141 * Unicode string in the Unicode (W) version of the function, and as
142 * a null-terminated ANSI string in the ANSI (A) version. No integers
143 * are allowed by this function; any numeric values must be specified
144 * as Unicode or ANSI text. Each LCTYPE has a particular format, as
145 * noted in Locale Identifiers.
146 * Parameters: LCID Locale locale identifier
147 * LCTYPE LCType type of information to set
148 * LPCTSTR lpLCData pointer to information to set
149 * Variables :
150 * Result : TRUE / FALSE
151 * Remark :
152 * Status : UNTESTED STUB
153 *
154 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
155 *****************************************************************************/
156
157BOOL WIN32API SetLocaleInfoA(LCID Locale,
158 LCTYPE LCType,
159 LPCSTR lpLCData)
160{
161 dprintf(("KERNEL32: SetLocaleInfoA(%08xh,%08xh,%08xh) not implemented.\n",
162 Locale,
163 LCType,
164 lpLCData));
165
166 return (FALSE);
167}
168
169
170/*****************************************************************************
171 * Name : BOOL SetLocaleInfoW
172 * Purpose : The SetLocaleInfoW function sets an item of locale information.
173 * It does so by making an entry in the process portion of the
174 * locale table. This setting only affects the user override portion
175 * of the locale settings; it does not set the system defaults.
176 * Only certain types of locale information, or LCTYPE values, can
177 * be set by this function. See the following Remarks section for a
178 * list of valid LCTYPE values.
179 * The locale information is always passed in as a null-terminated
180 * Unicode string in the Unicode (W) version of the function, and as
181 * a null-terminated ANSI string in the ANSI (A) version. No integers
182 * are allowed by this function; any numeric values must be specified
183 * as Unicode or ANSI text. Each LCTYPE has a particular format, as
184 * noted in Locale Identifiers.
185 * Parameters: LCID Locale locale identifier
186 * LCTYPE LCType type of information to set
187 * LPCTSTR lpLCData pointer to information to set
188 * Variables :
189 * Result : TRUE / FALSE
190 * Remark :
191 * Status : UNTESTED STUB
192 *
193 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
194 *****************************************************************************/
195
196BOOL WIN32API SetLocaleInfoW(LCID Locale,
197 LCTYPE LCType,
198 LPCWSTR lpLCData)
199{
200 dprintf(("KERNEL32: SetLocaleInfoW(%08xh,%08xh,%08xh) not implemented.\n",
201 Locale,
202 LCType,
203 lpLCData));
204
205 return (FALSE);
206}
207
208
209/*****************************************************************************
210 * Name : DWORD VerLanguageNameA
211 * Purpose : The VerLanguageNameA function converts the specified binary
212 * Microsoft language identifier into a text representation of the language.
213 * Parameters: DWORD idLang Microsoft language identifier
214 * LPTSTR lpszLang address of buffer for language string
215 * DWORD cbLang size of buffer
216 * Variables :
217 * Result : size of target buffer
218 * Remark :
219 * Status : UNTESTED STUB
220 *
221 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
222 *****************************************************************************/
223
224DWORD WIN32API VerLanguageNameA(UINT idLang,
225 LPSTR lpszLang,
226 UINT cbLang)
227{
228 dprintf(("KERNEL32: VerLanguageNameA(%08x,%08x,%08x) not implemented.\n",
229 idLang,
230 lpszLang,
231 cbLang));
232
233 return (0);
234}
235
236
237/*****************************************************************************
238 * Name : DWORD VerLanguageNameW
239 * Purpose : The VerLanguageNameW function converts the specified binary
240 * Microsoft language identifier into a text representation of the language.
241 * Parameters: DWORD idLang Microsoft language identifier
242 * LPTSTR lpszLang address of buffer for language string
243 * DWORD cbLang size of buffer
244 * Variables :
245 * Result : size of target buffer
246 * Remark :
247 * Status : UNTESTED STUB
248 *
249 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
250 *****************************************************************************/
251
252DWORD WIN32API VerLanguageNameW(UINT idLang,
253 LPWSTR lpszLang,
254 UINT cbLang)
255{
256 dprintf(("KERNEL32: VerLanguageNameW(%08x,%08x,%08x) not implemented.\n",
257 idLang,
258 lpszLang,
259 cbLang));
260
261 return (0);
262}
263
264
Note: See TracBrowser for help on using the repository browser.