ReactOS
0.4.16-dev-847-g386fccd
_mbsnlen.c
Go to the documentation of this file.
1
/*
2
* COPYRIGHT: See COPYING in the top level directory
3
* PROJECT: ReactOS CRT
4
* PURPOSE: Implementation of _mbsnlen
5
* FILE: lib/sdk/crt/string/_mbsnlen.c
6
* PROGRAMMER: Timo Kreuzer
7
*/
8
9
#include <mbstring.h>
10
11
_Check_return_
12
_CRTIMP
13
size_t
14
__cdecl
15
_mbsnlen
(
16
_In_z_
const
unsigned
char
*pmbstr,
17
_In_
size_t
cjMaxLen)
18
{
19
size_t
cchCount = 0;
20
unsigned
char
jMbsByte;
21
22
/* Loop while we have bytes to process */
23
while
(cjMaxLen-- > 0)
24
{
25
/* Get next mb byte */
26
jMbsByte = *pmbstr++;
27
28
/* If this is 0, we're done */
29
if
(jMbsByte == 0)
break
;
30
31
/* Don't count lead bytes */
32
if
(!
_ismbblead
(jMbsByte)) cchCount++;
33
}
34
35
return
cchCount;
36
}
_mbsnlen
_Check_return_ _CRTIMP size_t __cdecl _mbsnlen(_In_z_ const unsigned char *pmbstr, _In_ size_t cjMaxLen)
Definition:
_mbsnlen.c:15
__cdecl
#define __cdecl
Definition:
accygwin.h:79
_ismbblead
int __cdecl _ismbblead(unsigned int)
Definition:
ismblead.c:20
_In_z_
#define _In_z_
Definition:
no_sal2.h:164
_Check_return_
#define _Check_return_
Definition:
no_sal2.h:60
_In_
#define _In_
Definition:
no_sal2.h:158
_CRTIMP
#define _CRTIMP
Definition:
vcruntime.h:54
sdk
lib
crt
string
_mbsnlen.c
Generated on Sat Mar 22 2025 06:14:16 for ReactOS by
1.9.6