ReactOS  0.4.14-dev-384-g5b37caa
mbsnccnt.c
Go to the documentation of this file.
1 #include <mbstring.h>
2 
3 /*
4  * @implemented
5  */
6 size_t _mbsnccnt(const unsigned char *str, size_t n)
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 }
21 
22 /*
23  * @implemented
24  */
25 size_t _mbsnbcnt(const unsigned char *str, size_t n)
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 n
Definition: glext.h:7729
const WCHAR * str
GLdouble s
Definition: gl.h:2039
size_t _mbsnccnt(const unsigned char *str, size_t n)
Definition: mbsnccnt.c:6
size_t _mbsnbcnt(const unsigned char *str, size_t n)
Definition: mbsnccnt.c:25
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20