Mercurial > freewnn
annotate Wnn/include/commonhd.h @ 9:bcc6b3ca758e
now _SERVER_VERSION includes revision from hg.
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Fri, 21 Dec 2007 17:22:21 +0900 |
parents | 76281fa7934f |
children | fc3022f61fc7 |
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 //#define _SERVER_VERSION "FreeWnn mercurial" |
bcc6b3ca758e
now _SERVER_VERSION includes revision from hg.
Yoshiki Yazawa <yaz@cc.rim.or.jp>
parents:
8
diff
changeset
|
43 #include "build_stamp.h" |
0 | 44 |
45 #include "wnnerror.h" | |
46 | |
47 #ifndef JS | |
48 typedef unsigned int UINT; | |
49 typedef unsigned char UCHAR; | |
50 #ifndef w_char | |
51 # define w_char unsigned short | |
52 #endif /* w_char */ | |
53 #endif /*JS */ | |
54 | |
55 #ifdef TAIWANESE | |
56 #ifndef CHINESE | |
57 #define CHINESE | |
58 #endif | |
59 #endif | |
60 | |
61 #ifdef CHINESE | |
62 #define CONVERT_from_TOP | |
63 #define CONVERT_by_STROKE /* É®·Á(Bi Xing) */ | |
64 #define CONVERT_with_SiSheng /* »ÍÀ¼(Si Sheng) */ | |
65 #define NO_FZK /* ÉÕ°¸ì¤Ï¡¢¤Ê¤¤ */ | |
66 #define NO_KANA /* ¤Ò¤é¤¬¤Ê(ÆɤߤÈƱ¤¸¸õÊä)¤Ï¡¢¤Ê¤¤ */ | |
67 #endif | |
68 | |
69 #ifdef KOREAN | |
70 #define CONVERT_from_TOP | |
71 #define NO_FZK | |
72 #endif | |
73 | |
74 #ifdef luna | |
75 #ifdef uniosu | |
76 # ifndef SYSVR2 | |
77 # define SYSVR2 | |
78 # endif | |
79 #else /* if defined(MACH) || defined(uniosb) */ | |
80 # ifndef BSD42 | |
81 # define BSD42 | |
82 # endif | |
83 # ifndef BSD43 | |
84 # define BSD43 | |
85 # endif | |
86 # if defined(luna68k) | |
87 # ifndef BSD44 | |
88 # define BSD44 | |
89 # endif | |
90 # endif /* defined(luna68k) */ | |
91 #endif | |
92 #else /* defined(luna) */ | |
93 #if defined(sun) && !defined(SVR4) | |
94 # ifndef BSD42 | |
95 # define BSD42 | |
96 # endif | |
97 #else /* sun else */ | |
98 #if defined(DGUX) || defined(linux) | |
99 # ifndef SYSVR2 | |
100 # define SYSVR2 | |
101 # endif | |
102 #else | |
103 #if defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) | |
104 # ifndef SYSVR2 | |
105 # define SYSVR2 | |
106 # endif | |
107 # ifdef sun | |
108 # define SOLARIS | |
109 # endif | |
110 #else | |
111 # ifndef BSD43 | |
112 # define BSD43 | |
113 # endif | |
114 # ifndef BSD42 | |
115 # define BSD42 | |
116 # endif | |
117 #endif /* defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) */ | |
118 #endif /* DGUX */ | |
119 #endif /* sun */ | |
120 #endif /* luna */ | |
121 | |
122 #if defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) | |
123 #ifndef F_OK | |
124 #define F_OK 0 | |
125 #endif | |
126 #ifndef R_OK | |
127 #define R_OK 4 | |
128 #endif | |
129 #endif /* defined(SVR4) || defined(hpux) || defined(SYSV) || defined(USG) */ | |
130 | |
131 #define MAXBUNSETSU 80 | |
132 #define LIMITBUNSETSU 400 | |
133 #define MAXJIKOUHO 400 | |
134 | |
135 #define J_IUJIS 0 | |
136 #define J_EUJIS 1 | |
137 #define J_JIS 2 | |
138 #define J_SJIS 3 | |
139 | |
140 #define C_IUGB 0 | |
141 #define C_EUGB 1 | |
142 | |
143 #define C_ICNS11643 0 | |
144 #define C_ECNS11643 1 | |
145 #define C_BIG5 2 | |
146 | |
147 #define K_IUKSC 0 | |
148 #define K_EUKSC 1 | |
149 #define K_KSC 2 | |
150 | |
151 #ifndef True | |
152 #define True 1 | |
153 #endif | |
154 #ifndef False | |
155 #define False 0 | |
156 #endif | |
157 | |
158 #define KANJI(x) ((x) & 0x80) | |
159 | |
160 | |
161 #define Ctrl(X) ((X) & 0x1f) | |
162 | |
163 #define NEWLINE Ctrl('J') | |
164 #define CR Ctrl('M') | |
165 #define ESC '\033' | |
166 | |
167 #ifdef luna | |
168 #ifdef uniosu | |
169 #define RUBOUT 0x08 /* BS */ | |
170 #else | |
171 #define RUBOUT '\177' | |
172 #endif | |
173 #else | |
174 #define RUBOUT '\177' | |
175 #endif | |
176 #define SPACE ' ' | |
177 | |
178 | |
179 #define JSPACE 0xa1a1 | |
180 #ifdef KOREAN | |
181 #define BAR 0xA1aa /* ¡¼ */ | |
182 #else | |
183 #define BAR 0xA1BC /* ¡¼ */ | |
184 #endif | |
185 #define KUTEN_NUM 0xA1A3 /* ¡£ */ | |
186 #define TOUTEN_NUM 0xA1A2 /* ¡¢ */ | |
187 #define S_NUM 0xA3B0 /* £° */ | |
188 #define E_NUM 0xA3B9 /* £¹ */ | |
189 #ifdef KOREAN | |
190 #define S_HIRA 0xAAA1 /* ¤¡ */ | |
191 #define E_HIRA 0xAAF3 /* ¤ó */ | |
192 #define S_KATA 0xABA1 /* ¥¡ */ | |
193 #define E_KATA 0xABF6 /* ¥ö */ | |
194 #else | |
195 #define S_HIRA 0xA4A1 /* ¤¡ */ | |
196 #define E_HIRA 0xA4F3 /* ¤ó */ | |
197 #define S_KATA 0xA5A1 /* ¥¡ */ | |
198 #define E_KATA 0xA5F6 /* ¥ö */ | |
199 #endif | |
200 #define S_HANKATA 0x00A1 /* Ž¡ */ | |
201 #define E_HANKATA 0x00DF /* Žß */ | |
202 | |
203 #ifdef KOREAN | |
204 #define S_JUMO 0xa4a1 /* ¤¡ */ | |
205 #define E_JUMO 0xa4fe /* ¤þ */ | |
206 #define S_HANGUL 0xb0a1 /* °¡ */ | |
207 #define E_HANGUL 0xc8fe /* Èþ */ | |
208 #define S_HANJA 0xcaa1 /* Ê¡ */ | |
209 #define E_HANJA 0xfdfe /* ýþ */ | |
210 | |
211 #define ishanja(x) ((unsigned)((x) - S_HANJA) <= (E_HANJA - S_HANJA)) | |
212 #define ishangul(x) ((unsigned)((x) - S_HANGUL) <= (E_HANGUL - S_HANGUL)) | |
213 #endif | |
214 | |
215 #define HIRAP(X) ((X) >= S_HIRA && (X) <= E_HIRA) | |
216 #define KATAP(X) (((X) >= S_KATA && (X) <= E_KATA) || ((X) == BAR)) | |
217 #define ASCIIP(X) ((X) < 0x7f) | |
218 #define KANJIP(X) (!(HIRAP(X) || KATAP(X) || ASCIIP(X))) | |
219 | |
220 #define YOMICHAR(X) ((HIRAP(X)) || \ | |
221 ('0'<=(X)&&'9'>=(X)) || \ | |
222 ('A'<=(X)&&'Z'>=(X)) || \ | |
223 ('a'<=(X)&&'z'>=(X)) || \ | |
224 (BAR == X) \ | |
225 ) | |
226 #define HIRA_OF(X) ((KATAP(X) && !(BAR == (X)))? ((X) & ~0x0100) : (X)) | |
227 | |
228 #ifdef CONVERT_by_STROKE | |
229 # define Q_MARK '?' | |
230 #endif /* CONVERT_by_STROKE */ | |
231 | |
232 #define LENGTHYOMI 256 /* jisho ni touroku suru yomi no nagasa */ | |
233 #define LENGTHKANJI 256 /* jisho ni touroku suru kanji no nagasa */ | |
234 #define LENGTHBUNSETSU 264 /* ʸÀá¤ÎºÇÂçĹ */ | |
235 #define LENGTHCONV 512 /* ÊÑ´¹²ÄǽºÇÂçʸ»ú¿ô */ | |
236 | |
237 #define JISHOKOSUU 20 | |
238 | |
239 #define DIC_RDONLY 1 /* ¼½ñ¤¬¥ê¡¼¥É¡¦¥ª¥ó¥ê¡¼¤Ç¤¢¤ë¡£ */ | |
240 | |
241 | |
242 /* Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤Ë¤Þ¤¿¤¬¤Ã¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÎÄêµÁ */ | |
243 #define EXPAND_PATH_LENGTH 256 /* expand_expr()¤¬ÍѤ¤¤ë¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º */ | |
244 | |
245 | |
246 #define WNN_FILE_STRING "£×£î£î¤Î¥Õ¥¡¥¤¥ë" | |
247 #define WNN_FILE_STRING_LEN 16 | |
248 | |
249 | |
250 #define F_STAMP_NUM 64 | |
251 #define FILE_ALREADY_READ -2 | |
252 #define FILE_NOT_READ -3 | |
253 | |
254 /* file ID */ | |
255 | |
256 #endif /* WNN_COMMONHD_H */ |