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>
    int _mbcicmp( const unsigned char *s1,
                  const unsigned char *s2 );
    int _fmbcicmp( const unsigned char __far *s1,
                   const unsigned char __far *s2 );

Description:
    The _mbcicmp function compares one multibyte character from s1 to one
    multibyte character from s2 using a case-insensitive comparison.

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

Returns:
    The _mbcicmp and functions return the following values.

    Value     Meaning

< 0
    multibyte character at s1 less than multibyte character at s2

0
    multibyte character at s1 identical to multibyte character at s2

> 0
    multibyte character at s1 greater than multibyte character at s2

    On an error,  _NLSCMPERROR is returned (defined in <string.h> and
    <mbstring.h>).


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

    unsigned char mb1[2] = {
        0x41, 0x42
    };

    unsigned char mb2[2] = {
        0x61, 0x43
    };

    void main()
      {
        int     i;

        _setmbcp( 932 );
        i = _mbcicmp( mb1, mb2 );
        if( i == _NLSCMPERROR )
            printf( "Error in multibyte character\n" );
        else if( i < 0 )
            printf( "Less than\n" );
        else if( i == 0 )
            printf( "Equal to\n" );
        else
            printf( "Greater than\n" );

      }

    produces the following:

    Equal to

Classification:
    WATCOM

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

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

See Also:
    _mbccmp, _mbccpy, _mbcjistojms, _mbcjmstojis, _mbclen, _mbctohira,
    _mbctokata, _mbctolower, _mbctombb, _mbctoupper, mblen, mbrlen, mbrtowc,
    mbsrtowcs, mbstowcs, mbtowc, sisinit, wcrtomb, wcsrtombs, wcstombs,
    wctob, wctomb

See Also: _mbcjistojms _mbcjmstojis

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