mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 09:41:47 +00:00
Create a branch for Aleksandar Andrejevic for his work on NTVDM. See http://jira.reactos.org/browse/CORE-7250 for more details.
svn path=/branches/ntvdm/; revision=59241
This commit is contained in:
parent
3e3200acef
commit
4f0b8d3db0
20620 changed files with 0 additions and 1232833 deletions
37
lib/sdk/crt/mbstring/mbstrlen.c
Normal file
37
lib/sdk/crt/mbstring/mbstrlen.c
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/sdk/crt/mbstring/mbstrlen.c
|
||||
* PURPOSE: Determines the length of a multi byte string, current locale
|
||||
* PROGRAMERS:
|
||||
* Copyright 1999 Alexandre Julliard
|
||||
* Copyright 2000 Jon Griffths
|
||||
*
|
||||
*/
|
||||
|
||||
#include <mbstring.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef _LIBCNT_
|
||||
unsigned short *NlsLeadByteInfo;
|
||||
#define isleadbyte(c) NlsLeadByteInfo[c]
|
||||
#else
|
||||
int isleadbyte(int byte);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
size_t _mbstrlen( const char *str )
|
||||
{
|
||||
size_t len = 0;
|
||||
while(*str)
|
||||
{
|
||||
/* FIXME: According to the documentation we are supposed to test for
|
||||
* multi-byte character validity. Whatever that means
|
||||
*/
|
||||
str += isleadbyte((unsigned char)*str) ? 2 : 1;
|
||||
len++;
|
||||
}
|
||||
return len;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue