Mercurial > freewnn
annotate Wnn/include/commonhd.h @ 17:a3fdd8ad75dc
2ch dictionary has been added
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Mon, 14 Apr 2008 17:01:14 +0900 |
parents | fc3022f61fc7 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 * $Id: commonhd.h,v 1.13 2006/03/04 19:01:45 aonoto Exp $ | |
3 */ | |
4 | |
5 /* | |
6 * FreeWnn is a network-extensible Kana-to-Kanji conversion system. | |
7 * This file is part of FreeWnn. | |
8 * | |
9 * Copyright Kyoto University Research Institute for Mathematical Sciences | |
10 * 1987, 1988, 1989, 1990, 1991, 1992 | |
11 * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999 | |
12 * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992 | |
13 * Copyright FreeWnn Project 1999, 2000, 2001, 2002, 2005, 2006 | |
14 * | |
15 * Maintainer: FreeWnn Project | |
16 * | |
17 * This library is free software; you can redistribute it and/or | |
18 * modify it under the terms of the GNU Lesser General Public | |
19 * License as published by the Free Software Foundation; either | |
20 * version 2 of the License, or (at your option) any later version. | |
21 * | |
22 * This library is distributed in the hope that it will be useful, | |
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
25 * Lesser General Public License for more details. | |
26 * | |
27 * You should have received a copy of the GNU Lesser General Public | |
28 * License along with this library; if not, write to the | |
29 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
30 * Boston, MA 02111-1307, USA. | |
31 */ | |
32 | |
33 #ifndef WNN_COMMONHD_H | |
34 #define WNN_COMMONHD_H | |
35 | |
36 /**************** | |
37 * Common header | |
38 ****************/ | |
39 #include <stdio.h> | |
40 | |
41 #define JSERVER_VERSION 0x4200 /* minor version */ | |
9
bcc6b3ca758e
now _SERVER_VERSION includes revision from hg.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
8
diff
changeset
|
42 #include "build_stamp.h" |
0 | 43 |
44 #include "wnnerror.h" | |
45 | |
46 #ifndef JS | |
47 typedef unsigned int UINT; | |
48 typedef unsigned char UCHAR; | |
49 #ifndef w_char | |
50 # define w_char unsigned short | |
51 #endif /* w_char */ | |
52 #endif /*JS */ | |
53 | |
54 #ifdef TAIWANESE | |
55 #ifndef CHINESE | |
56 #define CHINESE | |
57 #endif | |
58 #endif | |
59 | |
60 #ifdef CHINESE | |
61 #define CONVERT_from_TOP | |
62 #define CONVERT_by_STROKE /* É®·Á(Bi Xing) */ | |
63 #define CONVERT_with_SiSheng /* »ÍÀ¼(Si Sheng) */ | |
64 #define NO_FZK /* ÉÕ°¸ì¤Ï¡¢¤Ê¤¤ */ | |
65 #define NO_KANA /* ¤Ò¤é¤¬¤Ê(ÆɤߤÈƱ¤¸¸õÊä)¤Ï¡¢¤Ê¤¤ */ | |
66 #endif | |
67 | |
68 #ifdef KOREAN | |
69 #define CONVERT_from_TOP | |
70 #define NO_FZK | |
71 #endif | |
72 | |
73 #ifdef luna | |
74 #ifdef uniosu | |
75 # ifndef SYSVR2 | |
76 # define SYSVR2 | |
77 # endif | |
78 #else /* if defined(MACH) || defined(uniosb) */ | |
79 # ifndef BSD42 | |
80 # define BSD42 | |
81 # endif | |
82 # ifndef BSD43 | |
83 # define BSD43 | |
84 # endif | |
85 # if defined(luna68k) | |
86 # ifndef BSD44 | |
87 # define BSD44 | |
88 # endif | |
89 # endif /* defined(luna68k) */ | |
90 #endif | |
91 #else /* defined(luna) */ | |
92 #if defined(sun) && !defined(SVR4) | |
93 # ifndef BSD42 | |
94 # define BSD42 | |
95 # endif | |
96 #else /* sun else */ | |
97 #if defined(DGUX) || defined(linux) | |
98 # ifndef SYSVR2 | |
99 # define SYSVR2 | |
100 # endif | |
101 #else | |
102 #if defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) | |
103 # ifndef SYSVR2 | |
104 # define SYSVR2 | |
105 # endif | |
106 # ifdef sun | |
107 # define SOLARIS | |
108 # endif | |
109 #else | |
110 # ifndef BSD43 | |
111 # define BSD43 | |
112 # endif | |
113 # ifndef BSD42 | |
114 # define BSD42 | |
115 # endif | |
116 #endif /* defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) */ | |
117 #endif /* DGUX */ | |
118 #endif /* sun */ | |
119 #endif /* luna */ | |
120 | |
121 #if defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) | |
122 #ifndef F_OK | |
123 #define F_OK 0 | |
124 #endif | |
125 #ifndef R_OK | |
126 #define R_OK 4 | |
127 #endif | |
128 #endif /* defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) */ | |
129 | |
130 #define MAXBUNSETSU 80 | |
131 #define LIMITBUNSETSU 400 | |
132 #define MAXJIKOUHO 400 | |
133 | |
134 #define J_IUJIS 0 | |
135 #define J_EUJIS 1 | |
136 #define J_JIS 2 | |
137 #define J_SJIS 3 | |
138 | |
139 #define C_IUGB 0 | |
140 #define C_EUGB 1 | |
141 | |
142 #define C_ICNS11643 0 | |
143 #define C_ECNS11643 1 | |
144 #define C_BIG5 2 | |
145 | |
146 #define K_IUKSC 0 | |
147 #define K_EUKSC 1 | |
148 #define K_KSC 2 | |
149 | |
150 #ifndef True | |
151 #define True 1 | |
152 #endif | |
153 #ifndef False | |
154 #define False 0 | |
155 #endif | |
156 | |
157 #define KANJI(x) ((x) & 0x80) | |
158 | |
159 | |
160 #define Ctrl(X) ((X) & 0x1f) | |
161 | |
162 #define NEWLINE Ctrl('J') | |
163 #define CR Ctrl('M') | |
164 #define ESC '\033' | |
165 | |
166 #ifdef luna | |
167 #ifdef uniosu | |
168 #define RUBOUT 0x08 /* BS */ | |
169 #else | |
170 #define RUBOUT '\177' | |
171 #endif | |
172 #else | |
173 #define RUBOUT '\177' | |
174 #endif | |
175 #define SPACE ' ' | |
176 | |
177 | |
178 #define JSPACE 0xa1a1 | |
179 #ifdef KOREAN | |
180 #define BAR 0xA1aa /* ¡¼ */ | |
181 #else | |
182 #define BAR 0xA1BC /* ¡¼ */ | |
183 #endif | |
184 #define KUTEN_NUM 0xA1A3 /* ¡£ */ | |
185 #define TOUTEN_NUM 0xA1A2 /* ¡¢ */ | |
186 #define S_NUM 0xA3B0 /* £° */ | |
187 #define E_NUM 0xA3B9 /* £¹ */ | |
188 #ifdef KOREAN | |
189 #define S_HIRA 0xAAA1 /* ¤¡ */ | |
190 #define E_HIRA 0xAAF3 /* ¤ó */ | |
191 #define S_KATA 0xABA1 /* ¥¡ */ | |
192 #define E_KATA 0xABF6 /* ¥ö */ | |
193 #else | |
194 #define S_HIRA 0xA4A1 /* ¤¡ */ | |
195 #define E_HIRA 0xA4F3 /* ¤ó */ | |
196 #define S_KATA 0xA5A1 /* ¥¡ */ | |
197 #define E_KATA 0xA5F6 /* ¥ö */ | |
198 #endif | |
199 #define S_HANKATA 0x00A1 /* Ž¡ */ | |
200 #define E_HANKATA 0x00DF /* Žß */ | |
201 | |
202 #ifdef KOREAN | |
203 #define S_JUMO 0xa4a1 /* ¤¡ */ | |
204 #define E_JUMO 0xa4fe /* ¤þ */ | |
205 #define S_HANGUL 0xb0a1 /* °¡ */ | |
206 #define E_HANGUL 0xc8fe /* Èþ */ | |
207 #define S_HANJA 0xcaa1 /* Ê¡ */ | |
208 #define E_HANJA 0xfdfe /* ýþ */ | |
209 | |
210 #define ishanja(x) ((unsigned)((x) - S_HANJA) <= (E_HANJA - S_HANJA)) | |
211 #define ishangul(x) ((unsigned)((x) - S_HANGUL) <= (E_HANGUL - S_HANGUL)) | |
212 #endif | |
213 | |
214 #define HIRAP(X) ((X) >= S_HIRA && (X) <= E_HIRA) | |
215 #define KATAP(X) (((X) >= S_KATA && (X) <= E_KATA) || ((X) == BAR)) | |
216 #define ASCIIP(X) ((X) < 0x7f) | |
217 #define KANJIP(X) (!(HIRAP(X) || KATAP(X) || ASCIIP(X))) | |
218 | |
219 #define YOMICHAR(X) ((HIRAP(X)) || \ | |
220 ('0'<=(X)&&'9'>=(X)) || \ | |
221 ('A'<=(X)&&'Z'>=(X)) || \ | |
222 ('a'<=(X)&&'z'>=(X)) || \ | |
223 (BAR == X) \ | |
224 ) | |
225 #define HIRA_OF(X) ((KATAP(X) && !(BAR == (X)))? ((X) & ~0x0100) : (X)) | |
226 | |
227 #ifdef CONVERT_by_STROKE | |
228 # define Q_MARK '?' | |
229 #endif /* CONVERT_by_STROKE */ | |
230 | |
231 #define LENGTHYOMI 256 /* jisho ni touroku suru yomi no nagasa */ | |
232 #define LENGTHKANJI 256 /* jisho ni touroku suru kanji no nagasa */ | |
233 #define LENGTHBUNSETSU 264 /* ʸÀá¤ÎºÇÂçĹ */ | |
234 #define LENGTHCONV 512 /* ÊÑ´¹²ÄǽºÇÂçʸ»ú¿ô */ | |
235 | |
236 #define JISHOKOSUU 20 | |
237 | |
238 #define DIC_RDONLY 1 /* ¼½ñ¤¬¥ê¡¼¥É¡¦¥ª¥ó¥ê¡¼¤Ç¤¢¤ë¡£ */ | |
239 | |
240 | |
241 /* Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤Ë¤Þ¤¿¤¬¤Ã¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎÄêµÁ */ | |
242 #define EXPAND_PATH_LENGTH 256 /* expand_expr()¤¬ÍѤ¤¤ë¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º */ | |
243 | |
244 | |
245 #define WNN_FILE_STRING "£×£î£î¤Î¥Õ¥¡¥¤¥ë" | |
246 #define WNN_FILE_STRING_LEN 16 | |
247 | |
248 | |
249 #define F_STAMP_NUM 64 | |
250 #define FILE_ALREADY_READ -2 | |
251 #define FILE_NOT_READ -3 | |
252 | |
253 /* file ID */ | |
254 | |
255 #endif /* WNN_COMMONHD_H */ |