ReactOS 0.4.16-dev-300-g2aadf2e
mbsnccnt.c File Reference
#include <mbstring.h>
Include dependency graph for mbsnccnt.c:

Go to the source code of this file.

Functions

size_t _mbsnccnt (const unsigned char *str, size_t n)
 
size_t _mbsnbcnt (const unsigned char *str, size_t n)
 

Function Documentation

◆ _mbsnbcnt()

size_t _mbsnbcnt ( const unsigned char str,
size_t  n 
)

Definition at line 25 of file mbsnccnt.c.

26{
27 unsigned char *s = (unsigned char *)str;
28 while(*s != 0 && n > 0) {
29 if (!_ismbblead(*s) )
30 n--;
31 s++;
32 }
33
34 return (size_t)(s - str);
35}
GLdouble s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20
const WCHAR * str

◆ _mbsnccnt()

size_t _mbsnccnt ( const unsigned char str,
size_t  n 
)

Definition at line 6 of file mbsnccnt.c.

7{
8 unsigned char *s = (unsigned char *)str;
9 size_t cnt = 0;
10 while(*s != 0 && n > 0) {
11 if (_ismbblead(*s) )
12 s++;
13 else
14 n--;
15 s++;
16 cnt++;
17 }
18
19 return cnt;
20}