blob: 8bd2b858acedfd6f28cbbc85fb4e175315bd9894 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
/***
*ismbprn.c - Test character for display character (MBCS)
*
* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
*
*Purpose:
* Test character for display character (MBCS)
*
*Revision History:
* 11-19-92 KRS Ported from 16-bit sources.
*
*******************************************************************************/
#ifdef _MBCS
#include <cruntime.h>
#include <ctype.h>
#include <mbdata.h>
#include <mbctype.h>
#include <mbstring.h>
/***
* _ismbcprint - Test character for display character (MBCS)
*
*Purpose:
* Test if the character is a display character.
* Handles MBCS chars correctly.
*
* Note: Use test against 0x00FF to ensure that we don't
* call SBCS routine with a two-byte value.
*
*Entry:
* unsigned int c = character to test
*
*Exit:
* Returns TRUE if character is display character, else FALSE
*
*Exceptions:
*
*******************************************************************************/
int _CRTAPI1 _ismbcprint(c)
unsigned int c;
{
if (_ISLEADBYTE(c>>8))
return (_ISTRAILBYTE(c&0x00ff));
else {
if (c > 0x00FF)
return(0);
else
#ifdef _KANJI
return ((isprint(c)) || (_ismbbkana(c)));
#else
return (isprint(c));
#endif
}
}
#endif /* _MBCS */
|