Implemented mbsnbcnt, added stubs for _Gettnames and __lc_collate_cp.

This commit is contained in:
Marcus Meissner 2001-09-07 18:34:45 +00:00 committed by Alexandre Julliard
parent 91fc357226
commit 2378305c89
2 changed files with 28 additions and 1 deletions

View File

@ -446,6 +446,7 @@ unsigned char* _mbschr(const unsigned char* str, unsigned int c)
/*********************************************************************
* _mbsnccnt(MSVCRT.@)
* 'c' is for 'character'.
*/
unsigned int _mbsnccnt(const unsigned char *str, unsigned int len)
{
@ -468,6 +469,30 @@ unsigned int _mbsnccnt(const unsigned char *str, unsigned int len)
return min(strlen(str), len); /* ASCII CP */
}
/*********************************************************************
* _mbsnbcnt(MSVCRT.@)
* 'b' is for byte count.
*/
unsigned int _mbsnbcnt(const unsigned char *str, unsigned int len)
{
const unsigned char *xstr = str;
if(MSVCRT___mb_cur_max > 1)
{
while(*xstr && len-- > 0)
{
if(MSVCRT_isleadbyte(*xstr))
{
xstr++;
len--;
}
xstr++;
}
return xstr-str;
}
return min(strlen(str), len); /* ASCII CP */
}
/*********************************************************************
* _mbsncat(MSVCRT.@)

View File

@ -367,7 +367,7 @@ debug_channels (msvcrt)
@ cdecl _mbslwr(str) _mbslwr
@ stub _mbsnbcat #(str str long)
@ cdecl _mbsnbcmp(str str long) _mbsnbcmp
@ stub _mbsnbcnt #(ptr long)
@ cdecl _mbsnbcnt(ptr long) _mbsnbcnt
@ stub _mbsnbcoll #(str str long)
@ cdecl _mbsnbcpy(ptr str long) _mbsnbcpy
@ stub _mbsnbicmp #(str str long)
@ -768,3 +768,5 @@ debug_channels (msvcrt)
@ cdecl wctomb(ptr long) MSVCRT_wctomb
@ varargs wprintf(wstr) MSVCRT_wprintf
@ stub wscanf #(wstr) varargs
@ stub _Gettnames
@ stub __lc_collate_cp