1 /*
2  * Copyright (C) 1991,1992 NEC Corporation.
3  * $Id: kanji.h,v 2.10 1994/04/19 10:16:45 uchida Exp $ (NEC)
4  */
5 #ifdef	KANJI
6 /* Internal Kanji Code
7  *	���������ɡ��������ץ���༫�Ȥ⡤������������줿�����ɤǤʤ����
8  *	�ʤ�ʤ���
9  */
10 #if	INTERNAL_CODE == CODE_EUC
11 /*
12  * ��������������EUC��
13  */
14 /* ���ѤǤ���		*/
15 #define	isZenkaku(str)		((*(str) & 0x80) == 0x80)
16 
17 /* ���ѥ��ڡ����Ǥ���		*/
18 #define	isZenkakuSpc(str)	(*(str) == (char)0xa1 && *((str)+1) == (char)0xa1)
19 
20 /* ���ѿ����餷��(���Х��ȤΤߤ�Ƚ��)	*/
21 #define	maybeZenkakuNum(str) 	(*(str) == (char)0xa3)
22 
23 /* ���ѿ�������(�����ģ�) �����	*/
24 #define	ZenkakuNumVal(str) 	(*((str)+1) & 0x0f)
25 
26 /* �٤��������Ҥ����Х��Ȥ˰��פ���	*/
27 #define	maybeThinKeisen(str) 	(*(str) == (char)0xa8)
28 
29 #else
30 #if	INTERNAL_CODE == CODE_SJIS
31 /*
32  *	��������������shift JIS��
33  */
34 typedef unsigned char	UCHAR;
35 
36 /* ���ѤǤ���		*/
37 #define	isZenkaku(str) (((UCHAR)0x80 <= (UCHAR)(*(str))&&(UCHAR)(*(str)) <= (UCHAR)0x9f)|| \
38 			((UCHAR)0xe0 <= (UCHAR)(*(str))&&(UCHAR)(*(str)) <= (UCHAR)0xff))
39 
40 /* ���ѥ��ڡ����Ǥ���		*/
41 #define	isZenkakuSpc(str) ((UCHAR)*(str) == (UCHAR)0x81 && (UCHAR)*((str)+1) == (UCHAR)0x40)
42 
43 /* ���ѿ��� */
44 #define	maybeZenkakuNum(str) (((UCHAR)*(str) == (UCHAR)0x82) && \
45 		   ((UCHAR)0x4f <= (UCHAR)(*(str)+1)||(UCHAR)(*(str)+1) <= (UCHAR)0x58) )
46 
47 /* ���ѿ�������(�����ģ�) �����	*/
48 #define	ZenkakuNumVal(str) 	((UCHAR)*((str)+1) - (UCHAR)0x4f)
49 
50 /* �٤��������Ҥ����Х��Ȥ˰��פ���	*/
51 #define	maybeThinKeisen(str) 	( ((UCHAR)*(str) == (UCHAR)0x84) && \
52                  ((UCHAR)0x9f <= (UCHAR)(*(str)+1) || (UCHAR)(*(str)+1) <= (UCHAR)0xa9))
53 
54 #else
55 unknown code;
56 #endif
57 #endif
58 #endif
59