ismbcsym.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 73 行
GML
73 行
.func _ismbcsymbol
#include <mbstring.h>
int _ismbcsymbol( unsigned int ch );
.funcend
.desc begin
The &func function tests for a valid multibyte symbol character
(punctuation and other special graphical symbols).
For example, in code page 932, &func tests for a double-byte Kigou
character and returns true if and only if
.millust begin
0x8141 <= ch <= 0x81AC && ch != 0x817F
.millust end
.desc end
.return begin
The &func function returns a non-zero value when the argument is a
member of this set of characters; otherwise, zero is returned.
.return end
.see begin
.im seeismbc &function.
.see end
.exmp begin
#include <stdio.h>
#include <mbctype.h>
#include <mbstring.h>
.exmp break
unsigned int chars[] = {
'.',
' ',
'1',
'A',
0x8140, /* double-byte space */
0x8143, /* double-byte , */
0x8254, /* double-byte 5 */
0x8260, /* double-byte A */
0x8279, /* double-byte Z */
0x8281, /* double-byte a */
0x829A, /* double-byte z */
0x989F, /* double-byte L2 character */
0xA6
};
.exmp break
#define SIZE sizeof( chars ) / sizeof( unsigned int )
.exmp break
void main()
{
int i;
.exmp break
_setmbcp( 932 );
for( i = 0; i < SIZE; i++ ) {
printf( "%#6.4x is %sa valid "
"multibyte symbol character\n",
chars[i],
( _ismbcsymbol( chars[i] ) ) ? "" : "not " );
}
}
.exmp output
0x002e is not a valid multibyte symbol character
0x0020 is not a valid multibyte symbol character
0x0031 is not a valid multibyte symbol character
0x0041 is not a valid multibyte symbol character
0x8140 is not a valid multibyte symbol character
0x8143 is a valid multibyte symbol character
0x8254 is not a valid multibyte symbol character
0x8260 is not a valid multibyte symbol character
0x8279 is not a valid multibyte symbol character
0x8281 is not a valid multibyte symbol character
0x829a is not a valid multibyte symbol character
0x989f is not a valid multibyte symbol character
0x00a6 is not a valid multibyte symbol character
.exmp end
.class WATCOM
.system
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?