mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:12:58 +00:00
This really needs to go in a branch. It needs heavy testing and can't coincide with the current shell32 due to PSDK interface changes
svn path=/branches/shell32_new-bringup/; revision=51893
This commit is contained in:
parent
4596e5e59b
commit
4019caae75
23116 changed files with 0 additions and 1109022 deletions
70
lib/sdk/crt/mbstring/mbsnset.c
Normal file
70
lib/sdk/crt/mbstring/mbsnset.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/msvcrt/mbstring/mbsnset.c
|
||||
* PURPOSE: Fills a string with a multibyte character
|
||||
* PROGRAMER: Ariadne
|
||||
* UPDATE HISTORY:
|
||||
* 12/04/99: Created
|
||||
*/
|
||||
#include <mbstring.h>
|
||||
|
||||
size_t _mbclen2(const unsigned int s);
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
unsigned char * _mbsnset(unsigned char *src, unsigned int val, size_t count)
|
||||
{
|
||||
unsigned char *char_src = (unsigned char *)src;
|
||||
unsigned short *short_src = (unsigned short *)src;
|
||||
|
||||
if ( _mbclen2(val) == 1 ) {
|
||||
|
||||
while(count > 0) {
|
||||
*char_src = val;
|
||||
char_src++;
|
||||
count--;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
while(count > 0) {
|
||||
*short_src = val;
|
||||
short_src++;
|
||||
count-=2;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
unsigned char * _mbsnbset(unsigned char *src, unsigned int val, size_t count)
|
||||
{
|
||||
unsigned char *char_src = (unsigned char *)src;
|
||||
unsigned short *short_src = (unsigned short *)src;
|
||||
|
||||
if ( _mbclen2(val) == 1 ) {
|
||||
|
||||
while(count > 0) {
|
||||
*char_src = val;
|
||||
char_src++;
|
||||
count--;
|
||||
}
|
||||
*char_src = 0;
|
||||
}
|
||||
else {
|
||||
while(count > 0) {
|
||||
*short_src = val;
|
||||
short_src++;
|
||||
count-=2;
|
||||
}
|
||||
*short_src = 0;
|
||||
}
|
||||
|
||||
return src;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue