0
|
1 /*
|
|
2 * $Id: sheader.h,v 1.15 2006/06/18 16:49:41 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, 2002, 2003, 2006
|
|
14 *
|
|
15 * Maintainer: FreeWnn Project
|
|
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 * header of standard i/o
|
|
34 **************************/
|
|
35
|
|
36 #include "jslib.h"
|
|
37 #include "wnn_os.h"
|
|
38
|
|
39 typedef struct _WnnEnv
|
|
40 {
|
|
41 char *host_name; /* server name */
|
|
42 struct wnn_env *env; /* env */
|
|
43 int sticky; /* sticky bit */
|
|
44 char *envrc_name; /* envrc name */
|
|
45 char env_name_str[32]; /* env name */
|
|
46 struct _WnnEnv *next;
|
|
47 }
|
|
48 WnnEnv;
|
|
49
|
|
50 typedef struct _FunctionTable
|
|
51 {
|
|
52 /* functions depends on lang */
|
|
53 int (*print_out_function) ();
|
|
54 int (*input_function) ();
|
|
55 int (*call_t_redraw_move_function) ();
|
|
56 int (*call_t_redraw_move_1_function) ();
|
|
57 int (*call_t_redraw_move_2_function) ();
|
|
58 int (*call_t_print_l_function) ();
|
|
59 int (*redraw_when_chmsig_function) ();
|
|
60 int (*char_len_function) ();
|
|
61 int (*char_q_len_function) ();
|
|
62 int (*t_redraw_move_function) ();
|
|
63 int (*t_print_l_function) ();
|
|
64 int (*c_top_function) ();
|
|
65 int (*c_end_function) ();
|
|
66 int (*c_end_nobi_function) ();
|
|
67 int (*call_redraw_line_function) ();
|
|
68 int (*hani_settei_function) ();
|
|
69 void (*errorkeyin_function) ();
|
|
70 int (*call_jl_yomi_len_function) ();
|
|
71 }
|
|
72 FunctionTable;
|
|
73
|
|
74 typedef struct _FuncDadaBase
|
|
75 {
|
|
76 char *lang;
|
|
77 FunctionTable f_table;
|
|
78 short tty_code, pty_code, internal_code, file_code;
|
|
79 int (*code_trans[16]) ();
|
|
80 char *ostr;
|
|
81 char *getoptstr;
|
|
82 int (*do_opt[6]) ();
|
|
83 }
|
|
84 FuncDataBase;
|
|
85
|
|
86
|
|
87 extern int not_redraw; /* c_b->bufferを用いていない時(エラーメッセージを
|
|
88 表示しているなど)に、リドローがかかってもリドローしないためのフラグ */
|
|
89 extern int maxchg; /*一度に変換できる文字数 */
|
|
90
|
|
91 extern int maxlength; /* 画面の横幅を表す */
|
|
92 extern w_char *input_buffer; /* 画面制御に使うバッファ */
|
|
93
|
|
94 extern struct wnn_buf *bun_data_;
|
|
95
|
|
96 extern WnnEnv *normal_env;
|
|
97 extern WnnEnv *reverse_env;
|
|
98 extern WnnEnv *cur_normal_env;
|
|
99 extern WnnEnv *cur_reverse_env;
|
|
100
|
|
101 extern int cur_bnst_; /* current bunsetsu pointer */
|
|
102
|
|
103 /*extern int b_suu_; *//* hold bunsetsu suu */
|
|
104 /* Use jl_bun_suu(bun_data_) */
|
|
105
|
|
106 extern char romkan_clear_tbl[TBL_CNT][TBL_SIZE];
|
|
107 extern int (*main_table[TBL_CNT][TBL_SIZE]) (); /* holding commands */
|
|
108
|
|
109 /* extern w_char *p_holder; *//* points the end of data in buffer. */
|
|
110
|
|
111 extern w_char *knj_buffer; /* 辞書ユーティリティー使用時の漢字バッファ */
|
|
112
|
|
113
|
|
114 extern int crow;
|
|
115 /* holding row where i/f uses to display kanji line */
|
|
116
|
|
117 extern w_char *return_buf;
|
|
118 /* 確定した漢字かな混じり文を返すためのバッファ */
|
|
119
|
|
120
|
|
121 extern char Term_Name[];
|
|
122
|
|
123 extern int rubout_code; /* rubout に使われるコードを保持する */
|
|
124 extern int kk_on; /* 仮名漢字変換可能モードか否かを示すフラグ */
|
|
125 extern int quote_code;
|
|
126 extern int quote_flag;
|
|
127
|
|
128 extern int max_history;
|
|
129 extern w_char jishopath[];
|
|
130 extern w_char hindopath[];
|
|
131 extern w_char fuzokugopath[];
|
|
132
|
|
133
|
|
134 extern short tty_c_flag;
|
|
135 extern short pty_c_flag;
|
|
136
|
|
137 extern int cursor_invisible_fun; /* flag that cursor_invisible is in the termcap entry */
|
|
138 extern int keypad_fun; /* flag that keypad is in the termcap entry */
|
|
139 extern int send_ascii_char; /* flag that if send ascii characters when the buffer is empty */
|
|
140 extern int excellent_delete;
|
|
141 extern int convkey_on;
|
|
142
|
|
143 #define LANGDIRLEN 32
|
|
144 extern char lang_dir[];
|
|
145
|
|
146 extern char uumkey_name_in_uumrc[];
|
|
147 extern char convkey_name_in_uumrc[];
|
|
148 extern char rkfile_name_in_uumrc[];
|
|
149 extern short defined_by_option;
|
|
150
|
|
151 extern int conv_lines;
|
|
152 extern int flow_control;
|
|
153 extern int henkan_off_flag; /* 立ち上げ時に変換をon/offにした状態にします */
|
|
154 extern int henkan_on_kuten; /* 句点入力で変換する/しない */
|
|
155
|
|
156 extern char def_servername[]; /* V3.0 */
|
|
157 extern char def_reverse_servername[];
|
|
158 extern char username[]; /* V3.0 */
|
|
159 extern char user_dic_dir[]; /* V3.0 */
|
|
160
|
|
161 extern int remove_cs_from_termcap;
|
|
162
|
|
163 extern int disp_mode_length; /* V3.0 Alternate for MHL */
|
|
164
|
|
165
|
|
166 extern int kanji_buf_size;
|
|
167 extern int maxbunsetsu;
|
|
168 extern int max_ichiran_kosu;
|
|
169
|
|
170 /*
|
|
171 #define MAXKUGIRI 32
|
|
172 extern w_char kugiri_str[];
|
|
173 */
|
|
174
|
|
175 extern WNN_DIC_INFO *dicinfo;
|
|
176 extern int dic_list_size;
|
|
177
|
|
178 extern int touroku_comment;
|
|
179
|
|
180 extern short internal_code;
|
|
181 extern short file_code;
|
|
182
|
|
183 extern int (**code_trans) ();
|
|
184
|
|
185 extern struct msg_cat *cd;
|
|
186
|
|
187 extern FuncDataBase *lang_db;
|
|
188
|
|
189 extern FunctionTable *f_table;
|
|
190
|
|
191 extern FuncDataBase function_db[];
|
|
192
|
|
193 extern int (*default_code_trans[]) ();
|
|
194
|
|
195 /* ============================================================
|
|
196 * extern function prototypes
|
|
197 * ============================================================ */
|
|
198 #include "rk_spclval.h"
|
|
199 #include "rk_fundecl.h"
|
|
200 #include "wnn_string.h"
|
|
201
|
|
202 /* jhlp.c */
|
|
203 extern void uum_err (char *);
|
|
204 #if !(HAVE_SETENV)
|
|
205 extern int setenv();
|
|
206 #endif
|
|
207
|
|
208 /* printf.c */
|
|
209 extern void FPRINTF ();
|
|
210 extern void PRINTF ();
|
|
211
|
|
212 /* setutmp.c */
|
|
213 extern int saveutmp (void);
|
|
214 extern int resetutmp (int ttyFd);
|
|
215 extern int setutmp (int ttyFd);
|
|
216
|
|
217 /* ttyfdslot.c */
|
|
218 extern int ttyfdslot (int fd);
|
|
219
|
|
220 /* to be classified */
|
|
221 extern void b_s_off_raw (void);
|
|
222 extern void b_s_on_raw (void);
|
|
223 extern int backward (void);
|
|
224 extern int buffer_in (void);
|
|
225 extern int change_ascii_to_int (char*, int*);
|
|
226 extern void change_to_empty_mode (void);
|
|
227 extern void change_to_insert_mode (void);
|
|
228 extern void clr_end_screen ();
|
|
229 extern void clr_line ();
|
|
230 extern void clr_line_all ();
|
|
231 extern int connect_jserver (int);
|
|
232 extern int convert_getterm ();
|
|
233 extern int convert_key_setup ();
|
|
234 extern int cur_ichi (int, int);
|
|
235 extern void cursor_invisible_raw (void);
|
|
236 extern void cursor_normal_raw (void);
|
|
237 extern int dai_end (struct wnn_buf *, int);
|
|
238 extern int dai_top (struct wnn_buf *, int);
|
|
239 extern int dic_nickname (int, char*);
|
|
240 extern int disconnect_jserver (void);
|
|
241 extern int disp_mode (void);
|
|
242 extern void display_henkan_off_mode (void);
|
|
243 extern int empty_modep (void);
|
|
244 extern void epilogue (void);
|
|
245 extern void epilogue_no_close (void);
|
|
246 extern void errorkeyin (void);
|
|
247 extern int eu_columlen (unsigned char *);
|
|
248 extern int expand_argument (char *);
|
|
249 extern int expand_expr (char *);
|
|
250 extern void fill (char *, int);
|
|
251 extern int find_dic_by_no (int);
|
|
252 extern int find_end_of_tango (int);
|
|
253 extern int find_entry (char *);
|
|
254 extern void flushw_buf (void);
|
|
255 extern int forward_char (void);
|
|
256 extern int backward_char (void);
|
|
257 extern int getTermData ();
|
|
258 extern void get_end_of_history ();
|
|
259 extern void getfname ();
|
|
260 extern void h_r_off ();
|
|
261 extern void h_r_off_raw ();
|
|
262 extern void h_r_on ();
|
|
263 extern void h_r_on_raw ();
|
|
264 extern int henkan_gop ();
|
|
265 extern void henkan_if_maru ();
|
|
266 extern int henkan_off ();
|
|
267 extern int hextodec ();
|
|
268 extern int hinsi_in ();
|
|
269 extern int init_history ();
|
|
270 extern int init_key_table ();
|
|
271 extern void init_screen ();
|
|
272 extern int init_uum ();
|
|
273 extern int initial_message_out ();
|
|
274 extern void initialize_vars ();
|
|
275 extern int input_a_char_from_function ();
|
|
276 extern int insert_char ();
|
|
277 extern int insert_char_and_change_to_insert_mode ();
|
|
278 extern int insert_modep ();
|
|
279 extern int j_term_init ();
|
|
280 extern int flush_designate ();
|
|
281 extern int jtosj ();
|
|
282 extern int jutil ();
|
|
283 extern int kakutei ();
|
|
284 extern int kana_in ();
|
|
285 extern int kana_in_w_char_msg ();
|
|
286 extern int keyin1 ();
|
|
287 extern int kk ();
|
|
288 extern void kk_cursor_invisible ();
|
|
289 extern void kk_cursor_normal ();
|
|
290 extern void kk_restore_cursor ();
|
|
291 extern void kk_save_cursor ();
|
|
292 extern int make_history ();
|
|
293 extern int make_info_out ();
|
|
294 extern int make_jikouho_retu ();
|
|
295 extern void make_kanji_buffer ();
|
|
296 extern int make_string_for_ke ();
|
|
297 extern int next_history1 ();
|
|
298 extern int nobasi_tijimi_mode ();
|
|
299 extern int nobi_conv ();
|
|
300 extern void pop_cursor ();
|
|
301 extern void pop_hrus ();
|
|
302 extern int previous_history1 ();
|
|
303 extern void print_buf_msg ();
|
|
304 extern void reset_cursor ();
|
|
305 extern void push_cursor ();
|
|
306 extern void push_hrus ();
|
|
307 extern void putchar1 ();
|
|
308 extern void putchar_norm ();
|
|
309 extern void puteustring ();
|
|
310 extern int reconnect_jserver_body ();
|
|
311 extern int redraw_line ();
|
|
312 extern int redraw_nisemono ();
|
|
313 extern void remove_key_bind ();
|
|
314 extern int isconect_jserver ();
|
|
315 extern int ren_henkan0 ();
|
|
316 extern void reset_bold ();
|
|
317 extern void reset_cursor_status ();
|
|
318 extern void restore_cursor_raw ();
|
|
319 extern void ring_bell ();
|
|
320 extern void save_cursor_raw ();
|
|
321 extern void scroll_up ();
|
|
322 extern int select_jikouho1 ();
|
|
323 extern int select_line_element ();
|
|
324 extern int select_one_dict1 ();
|
|
325 extern int select_one_element ();
|
|
326 extern int set_TERMCAP ();
|
|
327 extern void set_bold ();
|
|
328 extern void set_cursor_status ();
|
|
329 extern void set_escape_code ();
|
|
330 extern void set_hanten_ul ();
|
|
331 extern void set_lc_offset ();
|
|
332 extern void set_screen_vars_default ();
|
|
333 extern void set_keypad_on ();
|
|
334 extern void set_keypad_off ();
|
|
335 extern void set_scroll_region ();
|
|
336 extern int st_colum ();
|
|
337 extern void t_cont_line_note_delete ();
|
|
338 extern int t_delete_char ();
|
|
339 extern int t_kill ();
|
|
340 extern int t_move ();
|
|
341 extern int t_print_l ();
|
|
342 extern void t_print_line ();
|
|
343 extern int t_redraw_move ();
|
|
344 extern int t_rubout ();
|
|
345 extern void t_throw ();
|
|
346 extern int t_yank ();
|
|
347 extern int tan_conv ();
|
|
348 extern int tan_henkan1 ();
|
|
349 extern void throw_col ();
|
|
350 extern void throw_cur_raw ();
|
|
351 extern void touroku ();
|
|
352 extern void u_s_off ();
|
|
353 extern void u_s_off_raw ();
|
|
354 extern void u_s_on ();
|
|
355 extern void u_s_on_raw ();
|
|
356 extern int update_dic_list ();
|
|
357 extern int uumrc_get_entries ();
|
|
358 extern void w_printf ();
|
|
359 extern int w_putchar ();
|
|
360 extern void w_sttost ();
|
|
361 extern int wchartochar ();
|
|
362 extern int yes_or_no ();
|
|
363 extern int yes_or_no_or_newline ();
|
|
364 extern int zenkouho_dai_c ();
|
|
365 extern void find_yomi_for_kanji ();
|
|
366 extern int check_vst ();
|
|
367 extern void t_redraw_one_line ();
|
|
368 extern void throw ();
|
|
369 extern int keyin ();
|
|
370 extern int push_unget_buf ();
|
|
371 extern unsigned int *get_unget_buf ();
|
|
372 extern int if_unget_buf ();
|
|
373
|
|
374 extern int set_cur_env ();
|
|
375 extern char env_state ();
|
|
376 extern void get_new_env ();
|
|
377
|
|
378 extern int call_t_redraw_move_normal ();
|
|
379 extern int call_t_redraw_move ();
|
|
380 extern int call_t_redraw_move_1_normal ();
|
|
381 extern int call_t_redraw_move_1 ();
|
|
382 extern int call_t_redraw_move_2_normal ();
|
|
383 extern int call_t_redraw_move_2 ();
|
|
384 extern int call_t_print_l_normal ();
|
|
385 extern int call_t_print_l ();
|
|
386 extern int c_top_normal ();
|
|
387 extern int c_end_normal ();
|
|
388 extern int c_end_nobi_normal ();
|
|
389 extern int char_q_len_normal ();
|
|
390 extern int char_len_normal ();
|
|
391 extern int t_redraw_move_normal ();
|
|
392 extern int t_print_l_normal ();
|
|
393 extern int call_redraw_line_normal ();
|
|
394 extern int call_redraw_line ();
|
|
395 extern int hani_settei_normal ();
|
|
396 extern void call_errorkeyin ();
|
|
397 extern int call_jl_yomi_len ();
|
|
398 extern int through ();
|
|
399 extern int sStrcpy ();
|
|
400 extern int Sstrcpy ();
|
|
401 extern char *sStrncpy ();
|
|
402 extern w_char *Strcat ();
|
|
403 extern w_char *Strncat ();
|
|
404 extern int Strncmp ();
|
|
405 extern w_char *Strcpy ();
|
|
406 extern w_char *Strncpy ();
|
|
407 extern int Strlen ();
|
|
408 extern void conv_ltr_to_ieuc ();
|
|
409 extern int get_cswidth_by_char ();
|
|
410 extern int eeuc_to_ieuc ();
|
|
411 extern int conv_keyin ();
|
|
412
|
|
413 #ifdef JAPANESE
|
|
414 extern int eujis_to_iujis ();
|
|
415 extern int jis_to_iujis ();
|
|
416 extern int sjis_to_iujis ();
|
|
417 extern int iujis_to_eujis ();
|
|
418 extern int jis_to_eujis ();
|
|
419 extern int sjis_to_eujis ();
|
|
420 extern int iujis_to_jis8 ();
|
|
421 extern int eujis_to_jis8 ();
|
|
422 extern int sjis_to_jis8 ();
|
|
423 extern int iujis_to_sjis ();
|
|
424 extern int eujis_to_sjis ();
|
|
425 extern int jis_to_sjis ();
|
|
426 extern int do_u_opt ();
|
|
427 extern int do_j_opt ();
|
|
428 extern int do_s_opt ();
|
|
429 extern int do_U_opt ();
|
|
430 extern int do_J_opt ();
|
|
431 extern int do_S_opt ();
|
|
432 #endif /* JAPANESE */
|
|
433
|
|
434 #ifdef CHINESE
|
|
435 extern int call_t_redraw_move_yincod ();
|
|
436 extern int call_t_redraw_move_1_yincod ();
|
|
437 extern int call_t_redraw_move_2_yincod ();
|
|
438 extern int call_t_print_l_yincod ();
|
|
439 extern int input_yincod ();
|
|
440 extern int redraw_when_chmsig_yincod ();
|
|
441 extern int c_top_yincod ();
|
|
442 extern int c_end_yincod ();
|
|
443 extern int c_end_nobi_yincod ();
|
|
444 extern int print_out_yincod ();
|
|
445 extern int char_q_len_yincod ();
|
|
446 extern int char_len_yincod ();
|
|
447 extern int t_redraw_move_yincod ();
|
|
448 extern int t_print_l_yincod ();
|
|
449 extern int call_redraw_line_yincod ();
|
|
450 extern int hani_settei_yincod ();
|
|
451 extern void errorkeyin_q ();
|
|
452 extern int not_call_jl_yomi_len ();
|
|
453 extern int cwnn_pzy_yincod ();
|
|
454 extern int cwnn_yincod_pzy_str ();
|
|
455
|
|
456 extern int icns_to_ecns ();
|
|
457 extern int icns_to_big5 ();
|
|
458 extern int ecns_to_icns ();
|
|
459 extern int ecns_to_big5 ();
|
|
460 extern int big5_to_icns ();
|
|
461 extern int big5_to_ecns ();
|
|
462 extern int iugb_to_eugb ();
|
|
463 extern int eugb_to_iugb ();
|
|
464 extern int do_b_opt ();
|
|
465 extern int do_t_opt ();
|
|
466 extern int do_B_opt ();
|
|
467 extern int do_T_opt ();
|
|
468 #endif /* CHINESE */
|
|
469
|
|
470 #ifdef KOREAN
|
|
471 extern int iuksc_to_ksc ();
|
|
472 extern int euksc_to_ksc ();
|
|
473 extern int iuksc_to_euksc ();
|
|
474 extern int ksc_to_euksc ();
|
|
475 extern int ksc_to_iuksc ();
|
|
476 extern int euksc_to_iuksc ();
|
|
477 extern int do_u_opt ();
|
|
478 extern int do_U_opt ();
|
|
479 #endif /* KOREAN */
|
|
480
|
|
481 extern void romkan_set_lang ();
|