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 <mbctype.h>
    int _ismbbkalnum( unsigned int ch );

Description:
    The _ismbbkalnum function tests if the argument ch is a non-ASCII text
    symbol other than punctuation.

    For example, in code page 932, _ismbbkalnum tests for a single-byte
    Katakana character (excluding the Katakana punctuation characters).
     Note that there are no Katakana digit characters.  A single-byte
    Katakana non-punctuation character is any character for which the
    following expression is true:


         0xA6 <= ch <= 0xDF

    Note:  The argument ch must represent a single-byte value (i.e., 0 <= ch
    <= 255 ).  Incorrect results occur if the argument is a double-byte
    character.  This is shown by the example below.

Returns:
    The _ismbbkalnum function returns a non-zero value if the argument
    satisfies the condition; otherwise a zero value is returned.


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

    unsigned int chars[] = {
        ' ',
        '.',
        '1',
        'A',
        0x8140, /* double-byte space */
        0x8260, /* double-byte A */
        0x82A6, /* double-byte Hiragana */
        0x8342, /* double-byte Katakana */
        0xA1,   /* single-byte Katakana punctuation */
        0xA6,   /* single-byte Katakana alphabetic */
        0xDF,   /* single-byte Katakana alphabetic */
        0xE0A1  /* double-byte Kanji */
    };

    #define SIZE sizeof( chars ) / sizeof( unsigned int )

    void main()
      {
        int   i;

        _setmbcp( 932 );
        for( i = 0; i < SIZE; i++ ) {
          printf( "%#6.4x is %sa single-byte "
                  "Katakana non-punctuation character\n",
                chars[i],
                ( _ismbbkalnum( chars[i] ) ) ? "" : "not " );
        }
      }

    produces the following:

    0x0020 is not a single-byte Katakana non-punctuation character
    0x002e is not a single-byte Katakana non-punctuation character
    0x0031 is not a single-byte Katakana non-punctuation character
    0x0041 is not a single-byte Katakana non-punctuation character
    0x8140 is not a single-byte Katakana non-punctuation character
    0x8260 is not a single-byte Katakana non-punctuation character
    0x82a6 is a single-byte Katakana non-punctuation character
    0x8342 is not a single-byte Katakana non-punctuation character
    0x00a1 is not a single-byte Katakana non-punctuation character
    0x00a6 is a single-byte Katakana non-punctuation character
    0x00df is a single-byte Katakana non-punctuation character
    0xe0a1 is not a single-byte Katakana non-punctuation character

Classification:
    WATCOM

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

See Also:
    _getmbcp, _mbbtombc, _mbcjistojms, _mbcjmstojis, _mbctombb, _ismbbalnum,
    _ismbbalpha, _ismbbgraph, _ismbbkalpha, _ismbbkana, _ismbbkprint,
    _ismbbkpunct, _ismbblead, _ismbbprint, _ismbbpunct, _ismbbtrail,
    _mbbtombc, _mbcjistojms, _mbcjmstojis, _mbctombb, _mbbtype, _setmbcp

See Also: _getmbcp _mbbtombc

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