Added LGPL standard comment, and copyright notices where necessary.
[wine] / dlls / ole32 / ole2nls.c
1 /*
2  *      OLE2NLS library
3  *
4  *      Copyright 1995  Martin von Loewis
5  *      Copyright 1998  David Lee Lambert
6  *      Copyright 2000  Julio César Gázquez
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include "config.h"
24
25 #include <string.h>
26 #include <stdio.h>
27 #include <ctype.h>
28 #include <stdlib.h>
29 #include <locale.h>
30
31 #include "windef.h"
32 #include "winbase.h"
33 #include "winerror.h"
34 #include "winnls.h"
35 #include "winreg.h"
36 #include "winuser.h"
37 #include "winver.h"
38
39 #include "wine/winbase16.h"
40
41 #include "wine/debug.h"
42
43 WINE_DEFAULT_DEBUG_CHANNEL(ole);
44
45 static LPVOID lpNLSInfo = NULL;
46
47 /******************************************************************************
48  *              GetLocaleInfoA  [OLE2NLS.5]
49  * Is the last parameter really WORD for Win16?
50  */
51 INT16 WINAPI GetLocaleInfo16(LCID lcid,LCTYPE LCType,LPSTR buf,INT16 len)
52 {
53         return GetLocaleInfoA(lcid,LCType,buf,len);
54 }
55
56 /******************************************************************************
57  *              GetStringTypeA  [OLE2NLS.7]
58  */
59 BOOL16 WINAPI GetStringType16(LCID locale,DWORD dwInfoType,LPCSTR src,
60                               INT16 cchSrc,LPWORD chartype)
61 {
62         return GetStringTypeExA(locale,dwInfoType,src,cchSrc,chartype);
63 }
64
65 /******************************************************************************
66  *              GetUserDefaultLCID      [OLE2NLS.1]
67  */
68 LCID WINAPI GetUserDefaultLCID16(void)
69 {
70     return GetUserDefaultLCID();
71 }
72
73 /******************************************************************************
74  *              GetSystemDefaultLCID    [OLE2NLS.2]
75  */
76 LCID WINAPI GetSystemDefaultLCID16(void)
77 {
78     return GetSystemDefaultLCID();
79 }
80
81 /******************************************************************************
82  *              GetUserDefaultLangID    [OLE2NLS.3]
83  */
84 LANGID WINAPI GetUserDefaultLangID16(void)
85 {
86     return GetUserDefaultLangID();
87 }
88
89 /******************************************************************************
90  *              GetSystemDefaultLangID  [OLE2NLS.4]
91  */
92 LANGID WINAPI GetSystemDefaultLangID16(void)
93 {
94     return GetSystemDefaultLangID();
95 }
96
97 /******************************************************************************
98  *              LCMapStringA    [OLE2NLS.6]
99  */
100 INT16 LCMapString16(LCID lcid, DWORD mapflags, LPCSTR srcstr, INT16 srclen,
101                     LPSTR dststr, INT16 dstlen)
102 {
103     return LCMapStringA(lcid, mapflags, srcstr, srclen, dststr, dstlen);
104 }
105
106 /***********************************************************************
107  *           CompareStringA       (OLE2NLS.8)
108  */
109 UINT16 WINAPI CompareString16(DWORD lcid,DWORD fdwStyle,
110                               LPCSTR s1,DWORD l1,LPCSTR s2,DWORD l2)
111 {
112         return (UINT16)CompareStringA(lcid,fdwStyle,s1,l1,s2,l2);
113 }
114
115 /******************************************************************************
116  *      RegisterNLSInfoChanged  [OLE2NLS.9]
117  */
118 BOOL16 WINAPI RegisterNLSInfoChanged16(LPVOID lpNewNLSInfo) /* [???] FIXME */
119 {
120         FIXME("Fully implemented, but doesn't effect anything.\n");
121
122         if (!lpNewNLSInfo) {
123                 lpNLSInfo = NULL;
124                 return TRUE;
125         }
126         else {
127                 if (!lpNLSInfo) {
128                         lpNLSInfo = lpNewNLSInfo;
129                         return TRUE;
130                 }
131         }
132
133         return FALSE; /* ptr not set */
134
135