Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <mbstring.h>
    unsigned char *_mbsnbset( unsigned char *str,
                              unsigned int fill,
                              size_t count );
    unsigned char __far *_fmbsnbset( unsigned char __far *str,
                                     unsigned int fill,
                                     size_t count );

Description:
    The _mbsnbset function fills the string str with the value of the
    argument fill, When the value of len is greater than the length of the
    string, the entire string is filled.  Otherwise, that number of
    characters at the start of the string are set to the fill character.

    _mbsnbset is similar to  _mbsnset, except that it fills in count bytes
    rather than count characters.  If the number of bytes to be filled is
    odd and fill is a double-byte character, the partial byte at the end is
    filled with an ASCII space character.

    The function is a data model independent form of the _mbsnbset function.
     It accepts far pointer arguments and returns a far pointer.  It is most
    useful in mixed memory model applications.

Returns:
    The address of the original string str is returned.

Example:
    #include <stdio.h>
    #include <string.h>
    #include <mbctype.h>
    #include <mbstring.h>

    void main()
      {
        unsigned char   big_string[10];
        int             i;

        _setmbcp( 932 );
        memset( (char *) big_string, 0xee, 10 );
        big_string[9] = 0x00;
        for( i = 0; i < 10; i++ )
            printf( "%2.2x ", big_string[i] );
        printf( "\n" );
        _mbsnbset( big_string, 0x8145, 5 );
        for( i = 0; i < 10; i++ )
            printf( "%2.2x ", big_string[i] );
        printf( "\n" );

      }

    produces the following:

    ee ee ee ee ee ee ee ee ee 00
    81 45 81 45 20 ee ee ee ee 00

Classification:
    WATCOM

Systems:
     _mbsnbset - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

    _fmbsnbset - DOS, Windows, Win386, Win32, OS/2 1.x(all), OS/2-32

See Also:
    strnset, strset

See Also:

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson