0
|
1 /*
|
|
2 * $Id: jlib.h,v 1.4 2001/06/18 09:09:33 ura 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
|
|
14 *
|
|
15 * Maintainer: FreeWnn Project <freewnn@tomo.gr.jp>
|
|
16 *
|
|
17 * This program is free software; you can redistribute it and/or modify
|
|
18 * it under the terms of the GNU General Public License as published by
|
|
19 * the Free Software Foundation; either version 2 of the License, or
|
|
20 * (at your option) any later version.
|
|
21 *
|
|
22 * This program 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
|
|
25 * GNU General Public License for more details.
|
|
26 *
|
|
27 * You should have received a copy of the GNU General Public License
|
|
28 * along with this program; if not, write to the Free Software
|
|
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
30 */
|
|
31
|
|
32 /*
|
|
33 Nihongo Henkan Library Header File
|
|
34
|
|
35 08/Jul/1987 (wnn_errorno)
|
|
36 24/Apr/1987
|
|
37 09/Mar/1987 (update server_dead)
|
|
38 25/Feb/1987 (update wchar_t)
|
|
39 18/Feb/1987 (update Comment)
|
|
40 28/Nov/1986
|
|
41 23/Oct/1986
|
|
42 */
|
|
43
|
|
44 #ifndef WNN_JLIB_H
|
|
45 #define WNN_JLIB_H
|
|
46
|
|
47 #include <setjmp.h>
|
|
48
|
|
49 #ifndef w_char
|
|
50 #define w_char unsigned short
|
|
51 #endif /* w_char */
|
|
52 #ifndef WCHAR_T
|
|
53 #define wchar_t w_char
|
|
54 #define wchar w_char
|
|
55 #define WCHAR_T
|
|
56 #endif /* WCHAR_T */
|
|
57
|
|
58 #define JLIB
|
|
59
|
|
60 #define S_BUF_SIZ 1024 /* NEVER change this */
|
|
61 #define R_BUF_SIZ 1024 /* NEVER change this */
|
|
62
|
|
63
|
|
64
|
|
65 struct kouho_entry
|
|
66 {
|
|
67 int s_ichi; /* かなバッファへのオフセット */
|
|
68 int jl; /* 自立語の長さ */
|
|
69 int fl; /* 付属語の長さ */
|
|
70 int pl; /* ディスプレイ時の長さ */
|
|
71 int jishono; /* 自立語の辞書番号 */
|
|
72 int serial; /* 自立語の番号 */
|
|
73 w_char *k_data; /* 漢字バッファへのポインタ */
|
|
74 };
|
|
75 #define KOUHO_ENT struct kouho_entry
|
|
76
|
|
77
|
|
78 struct jikouho_entry
|
|
79 {
|
|
80 int jl; /* 自立語の長さ */
|
|
81 int jishono; /* 自立語の辞書番号 */
|
|
82 int serial; /* 自立語の番号 */
|
|
83 w_char *k_data; /* 漢字バッファへのポインタ */
|
|
84 };
|
|
85 #define JIKOUHO_ENT struct jikouho_entry
|
|
86
|
|
87
|
|
88 struct bunjoho
|
|
89 {
|
|
90 w_char *kana_buf; /* かなバッファ */
|
|
91 int kana_size; /* かなバッファの長さ */
|
|
92 KOUHO_ENT *klist; /* 候補リスト・バッファ */
|
|
93 int klist_size; /* 候補リスト・バッファの長さ */
|
|
94 w_char *kanji_buf; /* 漢字バッファ */
|
|
95 int kanji_buf_size; /* 漢字バッファ の長さ */
|
|
96 };
|
|
97
|
|
98
|
|
99 struct jikouhojoho
|
|
100 {
|
|
101 JIKOUHO_ENT *jlist; /* 次候補バッファ */
|
|
102 int jlist_size; /* 次候補バッファの長さ */
|
|
103 w_char *kanji_buf; /* 漢字バッファ */
|
|
104 int kanji_buf_size; /* 漢字バッファの長さ */
|
|
105 };
|
|
106 #define JIKOUHOJOHO struct jikouhojoho
|
|
107
|
|
108
|
|
109 struct jishojoho
|
|
110 {
|
|
111 w_char *k_data; /* 漢字バッファへのポインタ */
|
|
112 int bumpo; /* 文法情報 */
|
|
113 int hindo; /* 頻度 */
|
|
114 int jisho; /* 辞書番号 */
|
|
115 int serial; /* 項目番号 */
|
|
116 };
|
|
117 #define JISHOJOHO struct jishojoho
|
|
118
|
|
119
|
|
120 struct dicinfo
|
|
121 {
|
|
122 int dic_no; /* 辞書番号 */
|
|
123 int dic_size; /* 単語数 */
|
|
124 int ttl_hindo; /* 頻度総数 */
|
|
125 int dic_type; /* 1:ユーザ,2:システム */
|
|
126 int udp; /* 0:使用中でない,1:使用中 */
|
|
127 int prio; /* 辞書プライオリティ */
|
|
128 int rdonly; /* 0:ライト可能,1:リードオンリー */
|
|
129 char *file_name; /* 辞書ファイル名 */
|
|
130 char *h_file_name; /* 頻度ファイル名 */
|
|
131 };
|
|
132 #define DICINFO struct dicinfo
|
|
133
|
|
134 extern jmp_buf jd_server_dead_env; /* サーバが死んだ時に飛んでいくenv */
|
|
135 extern int jd_server_dead_env_flg; /* jd_server_dead_envが有効か否か */
|
|
136 extern int wnn_errorno; /* Wnnのエラーはこの変数に報告される */
|
|
137
|
|
138 /* header file for dic_syurui */
|
|
139 #define NO_EXIST -1
|
|
140 #define NOT_A_JISHO 0
|
|
141 #define USER_DIC 1
|
|
142 #define SYSTEM_DIC 3
|
|
143
|
|
144 struct jwho
|
|
145 {
|
|
146 int sd; /* socket discripter in jserver */
|
|
147 char *user_name; /* user name */
|
|
148 char *host_name; /* host name */
|
|
149 };
|
|
150
|
|
151 #define JWHO struct jwho
|
|
152
|
|
153
|
|
154 #endif /* WNN_JLIB_H */
|