ole2nls.c 3.69 KB
Newer Older
1 2 3 4 5 6
/*
 *	OLE2NLS library
 *
 *	Copyright 1995	Martin von Loewis
 *      Copyright 1998  David Lee Lambert
 *      Copyright 2000  Julio Csar Gzquez
7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21
 */
22 23 24

#include "config.h"

25
#include <string.h>
26
#include <stdarg.h>
27 28 29 30
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <locale.h>
31

32
#include "windef.h"
33
#include "winbase.h"
34
#include "winerror.h"
35 36
#include "winnls.h"
#include "winreg.h"
37 38 39 40 41
#include "winuser.h"
#include "winver.h"

#include "wine/winbase16.h"

42
#include "wine/debug.h"
43

44
WINE_DEFAULT_DEBUG_CHANNEL(ole);
45 46 47 48

static LPVOID lpNLSInfo = NULL;

/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
49
 *		GetLocaleInfoA	[OLE2NLS.5]
50 51 52 53 54 55 56 57
 * Is the last parameter really WORD for Win16?
 */
INT16 WINAPI GetLocaleInfo16(LCID lcid,LCTYPE LCType,LPSTR buf,INT16 len)
{
	return GetLocaleInfoA(lcid,LCType,buf,len);
}

/******************************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
58
 *		GetStringTypeA	[OLE2NLS.7]
59 60 61 62 63 64 65
 */
BOOL16 WINAPI GetStringType16(LCID locale,DWORD dwInfoType,LPCSTR src,
                              INT16 cchSrc,LPWORD chartype)
{
	return GetStringTypeExA(locale,dwInfoType,src,cchSrc,chartype);
}

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
/******************************************************************************
 *		GetUserDefaultLCID	[OLE2NLS.1]
 */
LCID WINAPI GetUserDefaultLCID16(void)
{
    return GetUserDefaultLCID();
}

/******************************************************************************
 *		GetSystemDefaultLCID	[OLE2NLS.2]
 */
LCID WINAPI GetSystemDefaultLCID16(void)
{
    return GetSystemDefaultLCID();
}

/******************************************************************************
 *		GetUserDefaultLangID	[OLE2NLS.3]
 */
LANGID WINAPI GetUserDefaultLangID16(void)
{
    return GetUserDefaultLangID();
}

/******************************************************************************
 *		GetSystemDefaultLangID	[OLE2NLS.4]
 */
LANGID WINAPI GetSystemDefaultLangID16(void)
{
    return GetSystemDefaultLangID();
}

/******************************************************************************
 *		LCMapStringA	[OLE2NLS.6]
 */
101 102
INT16 WINAPI LCMapString16(LCID lcid, DWORD mapflags, LPCSTR srcstr, INT16 srclen,
			   LPSTR dststr, INT16 dstlen)
103 104 105 106
{
    return LCMapStringA(lcid, mapflags, srcstr, srclen, dststr, dstlen);
}

107
/***********************************************************************
Patrik Stridvall's avatar
Patrik Stridvall committed
108
 *           CompareStringA       (OLE2NLS.8)
109 110 111 112 113 114 115 116
 */
UINT16 WINAPI CompareString16(DWORD lcid,DWORD fdwStyle,
                              LPCSTR s1,DWORD l1,LPCSTR s2,DWORD l2)
{
	return (UINT16)CompareStringA(lcid,fdwStyle,s1,l1,s2,l2);
}

/******************************************************************************
117
 *      RegisterNLSInfoChanged  [OLE2NLS.9]
118
 */
119
BOOL16 WINAPI RegisterNLSInfoChanged16(LPVOID lpNewNLSInfo) /* [???] FIXME */
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
{
	FIXME("Fully implemented, but doesn't effect anything.\n");

	if (!lpNewNLSInfo) {
		lpNLSInfo = NULL;
		return TRUE;
	}
	else {
		if (!lpNLSInfo) {
			lpNLSInfo = lpNewNLSInfo;
			return TRUE;
		}
	}

	return FALSE; /* ptr not set */
135
}