_mbbtype

int_mbbtype(unsignedcharc**,int**type );

Routine Required Header Optional Headers Compatibility
_mbbtype <mbstring.h> <mbctype.h>1 Win 95, Win NT

1 For definitions of manifest constants used as return values.

For additional compatibility information, see Compatibility in the Introduction.

Libraries

LIBC.LIB Single thread static library, retail version
LIBCMT.LIB Multithread static library, retail version
MSVCRT.LIB Import library for MSVCRT.DLL, retail version

Return Value

_mbbtype returns the type of byte within a string. This decision is context-sensitive as specified by the value of type, which provides the control test condition. type is the type of the previous byte in the string.The manifest constants in the following table are defined in MBCTYPE.H.


Value of type
_mbbtype
Tests For

Return Value

c
Any value except 1 Valid single byte or lead byte _MBC_SINGLE (0) Single byte (0x20 – 0x7E, 0xA1 – 0xDF)
Any value except 1 Valid single byte or lead byte _MBC_LEAD (1) Lead byte of multibyte character (0x81 – 0x9F, 0xE0 – 0xFC)
Any value except 1 Valid single-byte or lead byte _MBC_ILLEGAL

( –1)

Invalid character (any value except 0x20 – 0x7E, 0xA1 – 0xDF, 0x81 – 0x9F, 0xE0 – 0xFC
1 Valid trail byte _MBC_TRAIL (2) Trailing byte of multibyte character (0x40 – 0x7E, 0x80 – 0xFC)
1 Valid trail byte _MBC_ILLEGAL

( –1)

Invalid character (any value except 0x20 – 0x7E, 0xA1 – 0xDF, 0x81 – 0x9F, 0xE0 – 0xFC

Parameters

c

Character to test

type

Type of byte to test for

Remarks

The _mbbtype function determines the type of a byte in a multibyte character. If the value of type is any value except 1, _mbbtype tests for a valid single-byte or lead byte of a multibyte character. If the value of type is 1, _mbbtype tests for a valid trail byte of a multibyte character.

In earlier versions, _mbbtype was called chkctype. For new code, _mbbtype use instead.

Byte Classification