Commit 24dbdf8f authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

msvcrt: Implement _mbbtype according to MSDN.

parent dbef32e4
......@@ -26,6 +26,7 @@
#include "msvcrt.h"
#include "wine/unicode.h"
#include "wine/debug.h"
#include "msvcrt/mbctype.h"
WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
......@@ -740,6 +741,31 @@ unsigned int CDECL _mbbtombc(unsigned int c)
}
/*********************************************************************
* _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.@)
*/
int CDECL _ismbbkana(unsigned int c)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment