1 /*
2  * Copyright (c) 1991-1994  Sony Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL SONY CORPORATION BE LIABLE FOR ANY CLAIM,
19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
21  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * Except as contained in this notice, the name of Sony Corporation
24  * shall not be used in advertising or otherwise to promote the sale, use
25  * or other dealings in this Software without prior written authorization
26  * from Sony Corporation.
27  *
28  */
29 
30 /*
31  * $SonyRCSfile: sj_dict.h,v $
32  * $SonyRevision: 1.1 $
33  * $SonyDate: 1994/06/03 08:01:03 $
34  */
35 
36 
37 
38 
39 
40 #ifndef	_SJ_DICT
41 
42 #define	_SJ_DICT
43 
44 
45 
46 #define	DIC_MAIN		0
47 #define	DIC_USER		1
48 
49 
50 
51 
52 #define	DicSegBase		0
53 #define	MaxDouonBlk		0xfff
54 #define	DouonBlkSizeNumber	3
55 #define	DicSegTerm		0xff
56 #define	DouonBlkTerm		0xff
57 #define	HinsiBlkTerm		0xff
58 #define	MaxSegmentNumber	0xffff
59 
60 
61 
62 #define NormalKanjiMask         0x7f
63 #define SS3Kanji                0x0080
64 #define	ZenHiraAssyuku		0x80
65 #define	OffsetAssyuku		0x90
66 #define	ZenKataAssyuku		0xa0
67 #define	AiAttribute		0xb0
68 #define	KanjiAssyuku		0xc0
69 #define	LeadingHankaku		0xd0
70 #define	KanjiStrEnd		0x00
71 #define IsAssyuku               0x80
72 #define AssukuUse2byte          0x90
73 #define KnjAssyukuMask          0x0f
74 #define KanjiCodeMask           0x0f
75 #define KanjiModeMask           0xf0
76 #define AtrMsKanjiOfs           0xc0c0
77 
78 #define	MaxKnjAskNumber		16
79 #define	MaxYomiAskNumber	16
80 
81 #define	MaxWdYomiLen		31
82 #define	MaxWdKanjiLen		64
83 
84 #define	AssyukuYomiTop		0x80
85 #define	NokoriYomiTop		0x40
86 
87 
88 
89 
90 #define getsize(p)	(((Int)(*(p) & 0x0f) * 0x100) + *((p) + 1))
91 
92 
93 
94 #define	getntag(p)	((*(p) == DicSegTerm) ? (p) : (p) + getsize(p))
95 
96 
97 
98 #define	getplen(p)	(((*(p) & AssyukuYomiTop)?0x10:0) + (*((p)+2) >> 4))
99 
100 
101 
102 #define	getnlen(p)	(((*(p) & NokoriYomiTop)?0x10:0) + (*((p)+2) & 0x0f))
103 
104 
105 
106 #define	segtop()	(dicbuf + *dicbuf + 1)
107 
108 
109 
110 #define	segend(p)	(*(p) == DicSegTerm || (p) >= dicbuf + curdict->seglen)
111 
112 #endif
113 
114