ReactOS 0.4.16-dev-122-g325d74c
mbsnset.c File Reference
#include <mbstring.h>
Include dependency graph for mbsnset.c:

Go to the source code of this file.

Functions

size_t _mbclen2 (const unsigned int s)
 
unsigned char_mbsnset (unsigned char *src, unsigned int val, size_t count)
 
unsigned char_mbsnbset (unsigned char *src, unsigned int val, size_t count)
 

Function Documentation

◆ _mbclen2()

size_t _mbclen2 ( const unsigned int  s)

Definition at line 23 of file mbclen.c.

24{
25 return (_ismbblead(s>>8) && _ismbbtrail(s&0x00FF)) ? 2 : 1;
26}
GLdouble s
Definition: gl.h:2039
_Check_return_ _CRTIMP int __cdecl _ismbbtrail(_In_ unsigned int _C)
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20

Referenced by _mbsnbset(), and _mbsnset().

◆ _mbsnbset()

unsigned char * _mbsnbset ( unsigned char src,
unsigned int  val,
size_t  count 
)

Definition at line 46 of file mbsnset.c.

47{
48 unsigned char *char_src = (unsigned char *)src;
49 unsigned short *short_src = (unsigned short *)src;
50
51 if ( _mbclen2(val) == 1 ) {
52
53 while(count > 0) {
54 *char_src = val;
55 char_src++;
56 count--;
57 }
58 *char_src = 0;
59 }
60 else {
61 while(count > 0) {
62 *short_src = val;
63 short_src++;
64 count-=2;
65 }
66 *short_src = 0;
67 }
68
69 return src;
70}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
GLuint GLfloat * val
Definition: glext.h:7180
size_t _mbclen2(const unsigned int s)
Definition: mbclen.c:23

◆ _mbsnset()

unsigned char * _mbsnset ( unsigned char src,
unsigned int  val,
size_t  count 
)

Definition at line 17 of file mbsnset.c.

18{
19 unsigned char *char_src = (unsigned char *)src;
20 unsigned short *short_src = (unsigned short *)src;
21
22 if ( _mbclen2(val) == 1 ) {
23
24 while(count > 0) {
25 *char_src = val;
26 char_src++;
27 count--;
28 }
29 *char_src = 0;
30 }
31 else {
32 while(count > 0) {
33 *short_src = val;
34 short_src++;
35 count-=2;
36 }
37 *short_src = 0;
38 }
39
40 return src;
41}