Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenmbstrlen.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS system libraries 00004 * FILE: lib/sdk/crt/mbstring/mbstrlen.c 00005 * PURPOSE: Determines the length of a multi byte string, current locale 00006 * PROGRAMERS: 00007 * Copyright 1999 Alexandre Julliard 00008 * Copyright 2000 Jon Griffths 00009 * 00010 */ 00011 00012 #include <mbstring.h> 00013 #include <stdlib.h> 00014 00015 #ifdef _LIBCNT_ 00016 unsigned short *NlsLeadByteInfo; 00017 #define isleadbyte(c) NlsLeadByteInfo[c] 00018 #else 00019 int isleadbyte(int byte); 00020 #endif 00021 00022 /* 00023 * @implemented 00024 */ 00025 size_t _mbstrlen( const char *str ) 00026 { 00027 size_t len = 0; 00028 while(*str) 00029 { 00030 /* FIXME: According to the documentation we are supposed to test for 00031 * multi-byte character validity. Whatever that means 00032 */ 00033 str += isleadbyte(*str) ? 2 : 1; 00034 len++; 00035 } 00036 return len; 00037 } Generated on Sat May 26 2012 04:35:28 for ReactOS by
1.7.6.1
|