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 *_mbgetcode( unsigned char *mbstr,
                               unsigned int *dbchp );
    unsigned char far *_fmbgetcode( unsigned char far *mbstr,
                                    unsigned int *dbchp );

Description:
    The _mbgetcode function places the next single- or double-byte character
    from the start of the Kanji string specified by mbstr in the wide
    character pointed to by dbchp.  If the second-half of a double-byte
    character is NULL, then the returned wide character is NULL.

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

Returns:
    The _mbgetcode function returns a pointer to the next character to be
    obtained from the string.  If mbstr points at a null character then
    mbstr is returned.

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

    unsigned char set[] = {
        "ab\x81\x41\x81\x42\cd\x81"
    };

    void main()
      {
        unsigned int c;
        unsigned char *str;

        _setmbcp( 932 );
        str = set;
        for( ; *str != '\0'; ) {
            str = _mbgetcode( str, &c );
            printf( "Character code 0x%2.2x\n", c );
        }
      }

    produces the following:

    Character code 0x61
    Character code 0x62
    Character code 0x8141
    Character code 0x8142
    Character code 0x63
    Character code 0x64
    Character code 0x00

Classification:
    WATCOM

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

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

See Also:
    _mbsnccnt, _mbputchar

See Also:

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