summaryrefslogtreecommitdiffstats
path: root/private/crt32/mbstring/mbclevel.c
blob: 340f734d11faed8e46f37c1dc5449c31ff61c914 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*** 
*mbclevel.c - Tests if char is hiragana, katakana, alphabet or digit.
*
*	Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved.
*
*Purpose:
*	Tests for the various industry defined levels of Microsoft Kanji
*	Code.
*
*Revision History:
*	11-19-92  KRS	Ported from 16-bit sources.
*
*******************************************************************************/

#ifdef _MBCS
#ifdef _KANJI
#include <cruntime.h>
#include <mbdata.h>
#include <mbstring.h>


/***
*int _ismbcl0(c) - Tests if char is hiragana, katakana, alphabet or digit.
*
*Purpose:
*	Tests if a given char is hiragana, katakana, alphabet, digit or symbol
*	of Microsoft Kanji code.
*
*Entry:
*	unsigned int c - Character to test.
*
*Exit:
*	Returns non-zero if 0x8140 <= c <= 0x889E, else 0.
*
*Exceptions:
*
*******************************************************************************/

int _CRTAPI1 _ismbcl0(c)
unsigned int c;
{
	return(_ismbclegal(c) && c < 0x889f);
}


/***
*int _ismbcl1(c) - Tests for 1st-level Microsoft Kanji code set.
*
*Purpose:
*	Tests if a given char belongs to Microsoft 1st-level Kanji code set.
*
*Entry:
*	unsigned int c - character to test.
*
*Exit:
*	Returns non-zero if 1st-level, else 0.
*
*Exceptions:
*
*******************************************************************************/

int _CRTAPI1 _ismbcl1(c)
unsigned int c;
{
	return(_ismbclegal(c) && c >= 0x889f && c <= 0x9872);
}


/***
*int _ismbcl2(c) - Tests for a 2nd-level Microsoft Kanji code character.
*
*Purpose:
*	Tests if a given char belongs to the Microsoft 2nd-level Kanji code set.
*
*Entry:
*	unsigned int c - character to test.
*
*Exit:
*	Returns non-zero if 2nd-level, else 0.
*
*Exceptions:
*
*******************************************************************************/

int _CRTAPI1 _ismbcl2(c)
unsigned int c;
{
	return(_ismbclegal(c) && c >= 0x989f && c <= 0xea9e);
}

#endif	/* _KANJI */
#endif	/* _MBCS */