0
|
1 /*
|
|
2 * $Id: header.c,v 1.6 2006/03/04 19:01:46 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, 2006
|
|
14 * Copyright Canna Project 2002
|
|
15 *
|
|
16 * Maintainer: FreeWnn Project
|
|
17 *
|
|
18 * This program is free software; you can redistribute it and/or modify
|
|
19 * it under the terms of the GNU General Public License as published by
|
|
20 * the Free Software Foundation; either version 2 of the License, or
|
|
21 * (at your option) any later version.
|
|
22 *
|
|
23 * This program is distributed in the hope that it will be useful,
|
|
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
26 * GNU General Public License for more details.
|
|
27 *
|
|
28 * You should have received a copy of the GNU General Public License
|
|
29 * along with this program; if not, write to the Free Software
|
|
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
31 */
|
|
32
|
|
33 #include <stdio.h>
|
|
34 #include "jllib.h"
|
|
35 #include "wnn_config.h"
|
|
36 #include "commonhd.h"
|
|
37 #include "sdefine.h"
|
|
38 #include "sheader.h"
|
|
39 #include "buffer.h"
|
|
40
|
|
41 int not_redraw;
|
|
42 w_char *input_buffer;
|
|
43 w_char *return_buf; /* return you mojiretsu buffer */
|
|
44 struct wnn_buf *bun_data_;
|
|
45
|
|
46 WnnEnv *normal_env = NULL;
|
|
47 WnnEnv *reverse_env = NULL;
|
|
48 WnnEnv *cur_normal_env = NULL;
|
|
49 WnnEnv *cur_reverse_env = NULL;
|
|
50
|
|
51 int cur_bnst_ = 0; /* current bunsetsu pointer */
|
|
52
|
|
53 int crow;
|
|
54 int disp_mode_length = WNN_DISP_MODE_LEN; /* モード表示に必要なcolumn数 */
|
|
55 char Term_Name[128];
|
|
56
|
|
57 int rubout_code = 127;
|
|
58 int kk_on = 0;
|
|
59 int quote_code = -1;
|
|
60 int quote_flag = 0;
|
|
61
|
|
62 int max_history;
|
|
63
|
|
64 int (*main_table[TBL_CNT][TBL_SIZE]) ();
|
|
65 char romkan_clear_tbl[TBL_CNT][TBL_SIZE];
|
|
66 w_char jishopath[64];
|
|
67 w_char hindopath[64];
|
|
68 w_char fuzokugopath[64];
|
|
69
|
|
70 struct buf *c_b;
|
|
71 short pty_c_flag;
|
|
72 short tty_c_flag;
|
|
73
|
|
74 int cursor_invisible_fun = 0;
|
|
75 int keypad_fun = 0;
|
|
76 int send_ascii_char = 0;
|
|
77 int excellent_delete = 1;
|
|
78 int convkey_on = 0;
|
|
79
|
|
80 int *bunsetsu;
|
|
81 int *bunsetsuend;
|
|
82 struct wnn_env **bunsetsu_env;
|
|
83 int *touroku_bnst;
|
|
84 int touroku_bnst_cnt;
|
|
85 /* int bunsetsucnt = 0; */
|
|
86 w_char *kill_buffer;
|
|
87 w_char *remember_buf;
|
|
88 int kill_buffer_offset = 0;
|
|
89
|
|
90 int touroku_comment = 0; /* Comment for Words in Word_add */
|
|
91
|
|
92 char lang_dir[LANGDIRLEN] = { '\0' };
|
|
93
|
|
94 char uumkey_name_in_uumrc[PATHNAMELEN] = { '\0' };
|
|
95 char convkey_name_in_uumrc[PATHNAMELEN] = { '\0' };
|
|
96 char rkfile_name_in_uumrc[PATHNAMELEN] = { '\0' };
|
|
97 short defined_by_option = 0;
|
|
98
|
|
99 int conv_lines = 1;
|
|
100 int flow_control = 0;
|
|
101 int henkan_off_flag = 0; /* 立ち上げ時に変換をoffにした状態にします */
|
|
102 int henkan_on_kuten = 0; /* 句点入力で変換しない */
|
|
103
|
|
104 char def_servername[PATHNAMELEN] = { '\0' }; /* V3.0 */
|
|
105 char def_reverse_servername[PATHNAMELEN] = { '\0' };
|
|
106 char username[PATHNAMELEN] = { '\0' }; /* V3.0 */
|
|
107
|
|
108 int remove_cs_from_termcap = 1;
|
|
109
|
|
110 int maxbunsetsu;
|
|
111 int max_ichiran_kosu;
|
|
112 int maxchg;
|
|
113 int maxlength;
|
|
114
|
|
115 /*
|
|
116 w_char kugiri_str[MAXKUGIRI] = {' ',0};
|
|
117 */
|
|
118
|
|
119 WNN_DIC_INFO *dicinfo;
|
|
120 int dic_list_size;
|
|
121
|
|
122 short internal_code;
|
|
123 short file_code;
|
|
124
|
|
125 int (**code_trans) ();
|
|
126
|
|
127 struct msg_cat *cd;
|
|
128
|
|
129 FuncDataBase *lang_db = NULL;
|
|
130
|
|
131 FunctionTable *f_table = NULL;
|
|
132
|
|
133 FuncDataBase function_db[] = {
|
|
134 #ifdef JAPANESE
|
|
135 {WNN_J_LANG,
|
|
136 {NULL, NULL, call_t_redraw_move_normal,
|
|
137 call_t_redraw_move_1_normal, call_t_redraw_move_2_normal,
|
|
138 call_t_print_l_normal, NULL, char_len_normal, char_q_len_normal,
|
|
139 t_redraw_move_normal, t_print_l_normal, c_top_normal, c_end_normal,
|
|
140 c_end_normal, call_redraw_line_normal, hani_settei_normal,
|
|
141 errorkeyin, call_jl_yomi_len},
|
|
142 TTY_KCODE, PTY_KCODE, J_IUJIS, J_EUJIS,
|
|
143 {
|
|
144 through, iujis_to_eujis, iujis_to_jis8, iujis_to_sjis,
|
|
145 eujis_to_iujis, through, eujis_to_jis8, eujis_to_sjis,
|
|
146 jis_to_iujis, jis_to_eujis, through, jis_to_sjis,
|
|
147 sjis_to_iujis, sjis_to_eujis, sjis_to_jis8, through},
|
|
148 "ujsUJS",
|
|
149 "ujsUJS",
|
|
150 {
|
|
151 do_u_opt, do_j_opt, do_s_opt, do_U_opt, do_J_opt, do_S_opt}
|
|
152 },
|
|
153 #endif /* JAPANESE */
|
|
154 #ifdef CHINESE
|
|
155 {WNN_C_LANG, /* Simplified Chinese */
|
|
156 {print_out_yincod, input_yincod, call_t_redraw_move_yincod,
|
|
157 call_t_redraw_move_1_yincod, call_t_redraw_move_2_yincod,
|
|
158 call_t_print_l_yincod, redraw_when_chmsig_yincod, char_len_yincod,
|
|
159 char_q_len_yincod, t_redraw_move_yincod,
|
|
160 t_print_l_yincod, c_top_yincod, c_end_yincod, c_end_nobi_yincod,
|
|
161 call_redraw_line_yincod, hani_settei_yincod, errorkeyin_q,
|
|
162 not_call_jl_yomi_len},
|
|
163 TTY_CCODE, PTY_CCODE, C_IUGB, C_EUGB,
|
|
164 {
|
|
165 through, iugb_to_eugb, through, through,
|
|
166 eugb_to_iugb, through, through, through,
|
|
167 through, through, through, through,
|
|
168 through, through, through, through},
|
|
169 "",
|
|
170 "",
|
|
171 {
|
|
172 NULL, NULL, NULL, NULL, NULL, NULL}
|
|
173 },
|
|
174 {WNN_T_LANG, /* Traditional Chinese */
|
|
175 {print_out_yincod, input_yincod, call_t_redraw_move_yincod,
|
|
176 call_t_redraw_move_1_yincod, call_t_redraw_move_2_yincod,
|
|
177 call_t_print_l_yincod, redraw_when_chmsig_yincod, char_len_yincod,
|
|
178 char_q_len_yincod, t_redraw_move_yincod,
|
|
179 t_print_l_yincod, c_top_yincod, c_end_yincod, c_end_nobi_yincod,
|
|
180 call_redraw_line_yincod, hani_settei_yincod, errorkeyin_q,
|
|
181 not_call_jl_yomi_len},
|
|
182 TTY_TCODE, PTY_TCODE, C_ICNS11643, C_ECNS11643,
|
|
183 {
|
|
184 through, icns_to_ecns, icns_to_big5, through,
|
|
185 ecns_to_icns, through, ecns_to_big5, through,
|
|
186 big5_to_icns, big5_to_ecns, through, through,
|
|
187 through, through, through, through},
|
|
188 "btBT",
|
|
189 "btBT",
|
|
190 {
|
|
191 do_b_opt, do_t_opt, do_B_opt, do_T_opt, NULL, NULL}
|
|
192 },
|
|
193 #endif /* CHINESE */
|
|
194 #ifdef KOREAN
|
|
195 {WNN_K_LANG,
|
|
196 {NULL, NULL, call_t_redraw_move_normal,
|
|
197 call_t_redraw_move_1_normal, call_t_redraw_move_2_normal,
|
|
198 call_t_print_l_normal, NULL, char_len_normal, char_q_len_normal,
|
|
199 t_redraw_move_normal, t_print_l_normal, c_top_normal, c_end_normal,
|
|
200 c_end_normal, call_redraw_line_normal, hani_settei_normal,
|
|
201 errorkeyin, call_jl_yomi_len},
|
|
202 TTY_HCODE, PTY_HCODE, K_IUKSC, K_EUKSC,
|
|
203 {
|
|
204 through, iuksc_to_euksc, through, through,
|
|
205 euksc_to_iuksc, through, through, through,
|
|
206 through, through, through, through,
|
|
207 through, through, through, through},
|
|
208 "uU",
|
|
209 "uU",
|
|
210 {
|
|
211 do_u_opt, do_U_opt, NULL, NULL, NULL, NULL}
|
|
212 },
|
|
213 #endif /* KOREAN */
|
|
214 {NULL,
|
|
215 {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
|
216 NULL, NULL, NULL, NULL, NULL, NULL, NULL},
|
|
217 0, 0, 0, 0,
|
|
218 {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
|
219 NULL, NULL, NULL, NULL, NULL, NULL},
|
|
220 NULL,
|
|
221 NULL,
|
|
222 {
|
|
223 NULL, NULL, NULL, NULL, NULL, NULL}
|
|
224 }
|
|
225 };
|
|
226
|
|
227 int (*default_code_trans[]) () =
|
|
228 {
|
|
229 through, through, through, through, through, through, through, through, through, through, through, through, through, through, through, through};
|