_ismbb 例程_ismbb Routines

使用当前区域设置或指定 LC_CTYPE 转换状态类别,针对特定条件测试给定整数值 cTests the given integer value c for a particular condition, by using the current locale or a specified LC_CTYPE conversion state category.

_ismbbalnum、_ismbbalnum_l_ismbbalnum, _ismbbalnum_l _ismbbkprint、_ismbbkprint_l_ismbbkprint, _ismbbkprint_l
_ismbbalpha、_ismbbalpha_l_ismbbalpha, _ismbbalpha_l _ismbbkpunct、_ismbbkpunct_l_ismbbkpunct, _ismbbkpunct_l
_ismbbblank、_ismbbblank_l_ismbbblank, _ismbbblank_l _ismbblead、_ismbblead_l_ismbblead, _ismbblead_l
_ismbbgraph、_ismbbgraph_l_ismbbgraph, _ismbbgraph_l _ismbbprint、_ismbbprint_l_ismbbprint, _ismbbprint_l
_ismbbkalnum、_ismbbkalnum_l_ismbbkalnum, _ismbbkalnum_l _ismbbpunct、_ismbbpunct_l_ismbbpunct, _ismbbpunct_l
_ismbbkana、_ismbbkana_l_ismbbkana, _ismbbkana_l _ismbbtrail、_ismbbtrail_l_ismbbtrail, _ismbbtrail_l

备注Remarks

_ismbb 系列中的每个例程会针对特定条件测试给定整数值 cEvery routine in the _ismbb family tests the given integer value c for a particular condition. 测试结果取决于有效的多字节代码页。The test result depends on the multibyte code page that's in effect. 默认情况下,多字节代码页设置为在程序启动时从操作系统获取的 ANSI 代码页。By default, the multibyte code page is set to the ANSI code page that's obtained from the operating system at program startup. 可使用 _getmbcp 查询所使用的多字节代码页,或使用 _setmbcp 更改它。You can use _getmbcp to query for the multibyte code page that's in use, or _setmbcp to change it.

输出值受区域设置的 LC_CTYPE 类别设置的影响;有关详细信息,请参阅 setlocale、_wsetlocaleThe output value is affected by the setting of the LC_CTYPE category setting of the locale; for more information, see setlocale, _wsetlocale. 这些不带 _l 后缀的函数的版本将当前区域设置用于此依赖于区域设置的行为;带有 _l 后缀的版本与之相同,只不过它们改用传入的区域设置参数。The versions of these functions that don't have the _l suffix use the current locale for this locale-dependent behavior; the versions that do have the _l suffix are identical except that instead they use the locale parameter that's passed in.

_ismbb 系列中的例程按如下所示测试给定整数 cThe routines in the _ismbb family test the given integer c as follows.

例程Routine 字节测试条件Byte test condition
_ismbbalnum_ismbbalnum isalnum || _ismbbkalnum.isalnum || _ismbbkalnum.
_ismbbalpha_ismbbalpha isalpha || _ismbbkalnum.isalpha || _ismbbkalnum.
_ismbbblank_ismbbblank isblank
_ismbbgraph_ismbbgraph _ismbbprint相同,但是 _ismbbgraph 不包含空格字符 (0x20)。Same as _ismbbprint, but _ismbbgraph does not include the space character (0x20).
_ismbbkalnum_ismbbkalnum 标点以外的非 ASCII 文本符号。Non-ASCII text symbol other than punctuation. 例如,仅在代码页 932 中, _ismbbkalnum 测试片假名字母数字。For example, in code page 932 only, _ismbbkalnum tests for katakana alphanumeric.
_ismbbkana_ismbbkana 片假名 (0xA1 - 0xDF)。Katakana (0xA1 - 0xDF). 特定于代码页 932。Specific to code page 932.
_ismbbkprint_ismbbkprint 非 ASCII 文本或非 ASCII 标点符号。Non-ASCII text or non-ASCII punctuation symbol. 例如,仅在代码页 932 中,_ismbbkprint 测试片假名字母数字或片假名标点(范围:0xA1 - 0xDF)。For example, in code page 932 only, _ismbbkprint tests for katakana alphanumeric or katakana punctuation (range: 0xA1 - 0xDF).
_ismbbkpunct_ismbbkpunct 非 ASCII 标点。Non-ASCII punctuation. 例如,仅在代码页 932 中, _ismbbkpunct 测试片假名标点。For example, in code page 932 only, _ismbbkpunct tests for katakana punctuation.
_ismbblead_ismbblead 多字节字符的第一个字节。First byte of multibyte character. 例如,仅在代码页 932 中,有效范围为 0x81 - 0x9F 以及 0xE0 - 0xFC。For example, in code page 932 only, valid ranges are 0x81 - 0x9F, 0xE0 - 0xFC.
_ismbbprint_ismbbprint isprint || _ismbbkprint.isprint || _ismbbkprint. ismbbprint 包含空白字符 (0x20)。ismbbprint includes the space character (0x20).
_ismbbpunct_ismbbpunct ispunct || _ismbbkpunct.ispunct || _ismbbkpunct.
_ismbbtrail_ismbbtrail 多字节字符的第二个字节。Second byte of multibyte character. 例如,仅在代码页 932 中,有效范围为 0x40 - 0x7E 以及 0x80 - 0xEC。For example, in code page 932 only, valid ranges are 0x40 - 0x7E, 0x80 - 0xEC.

下表显示组成这些例程测试条件的经过“或”运算的值。The following table shows the ORed values that compose the test conditions for these routines. 清单常量 _BLANK_DIGIT_LOWER_PUNCT_UPPER 在 Ctype.h 中进行定义。The manifest constants _BLANK, _DIGIT, _LOWER, _PUNCT, and _UPPER are defined in Ctype.h.

例程Routine _BLANK_BLANK _DIGIT_DIGIT LOWERLOWER _PUNCT_PUNCT UPPERUPPER Non-Non-

ASCIIASCII

文本text
Non-Non-

ASCIIASCII

punctpunct
_ismbbalnum xx xx xx xx
_ismbbalpha xx xx xx
_ismbbblank xx
_ismbbgraph xx xx xx xx xx xx
_ismbbkalnum xx
_ismbbkprint xx xx
_ismbbkpunct xx
_ismbbprint xx xx xx xx xx xx xx
_ismbbpunct xx xx

_ismbb 例程同时以函数和宏的形式来实现。The _ismbb routines are implemented both as functions and as macros. 若要深入了解如何选择任一实现,请参阅关于选择函数和宏的建议For more information about how to choose either implementation, see Recommendations for Choosing Between Functions and Macros.

另请参阅See Also

字节分类 Byte Classification
is、isw 例程 is, isw Routines
_mbbtombc、_mbbtombc_l _mbbtombc, _mbbtombc_l
_mbctombb、_mbctombb_l_mbctombb, _mbctombb_l