Module: wine Branch: master Commit: 24dbdf8fa584bf374344e0a0b2fecedeb63edcaf URL: http://source.winehq.org/git/wine.git/?a=commit;h=24dbdf8fa584bf374344e0a0b2...
Author: Juan Lang juan_lang@yahoo.com Date: Mon Feb 5 15:34:31 2007 -0800
msvcrt: Implement _mbbtype according to MSDN.
---
dlls/msvcrt/mbcs.c | 26 ++++++++++++++++++++++++++ dlls/msvcrt/msvcrt.spec | 2 +- 2 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/dlls/msvcrt/mbcs.c b/dlls/msvcrt/mbcs.c index 6546ede..2e5310e 100644 --- a/dlls/msvcrt/mbcs.c +++ b/dlls/msvcrt/mbcs.c @@ -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 in }
/********************************************************************* + * _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) diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 9130322..9cdee2c 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -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)