ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

mbsnset.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS system libraries
00004  * FILE:        lib/msvcrt/mbstring/mbsnset.c
00005  * PURPOSE:     Fills a string with a multibyte character
00006  * PROGRAMER:   Ariadne
00007  * UPDATE HISTORY:
00008  *              12/04/99: Created
00009  */
00010 #include <mbstring.h>
00011 
00012 size_t _mbclen2(const unsigned int s);
00013 
00014 /*
00015  * @implemented
00016  */
00017 unsigned char * _mbsnset(unsigned char *src, unsigned int val, size_t count)
00018 {
00019     unsigned char *char_src = (unsigned char *)src;
00020     unsigned short *short_src = (unsigned short *)src;
00021 
00022     if ( _mbclen2(val) == 1 ) {
00023 
00024         while(count > 0) {
00025             *char_src = val;
00026             char_src++;
00027             count--;
00028         }
00029         *char_src = 0;
00030     }
00031     else {
00032         while(count > 0) {
00033             *short_src = val;
00034             short_src++;
00035             count-=2;
00036         }
00037         *short_src = 0;
00038     }
00039 
00040     return src;
00041 }
00042 
00043 /*
00044  * @implemented
00045  */
00046 unsigned char * _mbsnbset(unsigned char *src, unsigned int val, size_t count)
00047 {
00048     unsigned char *char_src = (unsigned char *)src;
00049     unsigned short *short_src = (unsigned short *)src;
00050 
00051     if ( _mbclen2(val) == 1 ) {
00052 
00053         while(count > 0) {
00054             *char_src = val;
00055             char_src++;
00056             count--;
00057         }
00058         *char_src = 0;
00059     }
00060     else {
00061         while(count > 0) {
00062             *short_src = val;
00063             short_src++;
00064             count-=2;
00065         }
00066         *short_src = 0;
00067     }
00068 
00069     return src;
00070 }

Generated on Sun May 27 2012 04:36:29 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.