msvcrt: Implement _mbbtype according to MSDN.

This commit is contained in:
Juan Lang 2007-02-05 15:34:31 -08:00 committed by Alexandre Julliard
parent dbef32e4ed
commit 24dbdf8fa5
2 changed files with 27 additions and 1 deletions

View file

@ -26,6 +26,7 @@
#include "msvcrt.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "msvcrt/mbctype.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
@ -739,6 +740,31 @@ unsigned int CDECL _mbbtombc(unsigned int c)
return c; /* ASCII CP or no MB char */
}
/*********************************************************************
* _mbbtype(MSVCRT.@)
*/
int CDECL _mbbtype(unsigned char c, int type)
{
if (type == 1)
{
if ((c >= 0x20 && c <= 0x7e) || (c >= 0xa1 && c <= 0xdf))
return _MBC_SINGLE;
else if ((c >= 0x40 && c <= 0x7e) || (c >= 0x80 && c <= 0xfc))
return _MBC_TRAIL;
else
return _MBC_ILLEGAL;
}
else
{
if ((c >= 0x20 && c <= 0x7e) || (c >= 0xa1 && c <= 0xdf))
return _MBC_SINGLE;
else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc))
return _MBC_LEAD;
else
return _MBC_ILLEGAL;
}
}
/*********************************************************************
* _ismbbkana(MSVCRT.@)
*/

View file

@ -338,7 +338,7 @@
@ cdecl _makepath(str str str str str)
@ cdecl _matherr(ptr) MSVCRT__matherr
@ cdecl _mbbtombc(long)
@ stub _mbbtype #(long long)
@ cdecl _mbbtype(long long)
# extern _mbcasemap
@ cdecl _mbccpy (str str)
@ stub _mbcjistojms #(long)