1 /*
2  *  $Id: sheader.h,v 1.13 2003/05/11 18:29:24 hiroo 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
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  * 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 /* ttyfdslot.c */
213 extern int  ttyfdslot (int fd);
214 
215 /* to be classified */
216 extern void b_s_off_raw (void);
217 extern void b_s_on_raw (void);
218 extern int backward (void);
219 extern int buffer_in (void);
220 extern int change_ascii_to_int (char*, int*);
221 extern void change_to_empty_mode (void);
222 extern void change_to_insert_mode (void);
223 extern void clr_end_screen ();
224 extern void clr_line ();
225 extern void clr_line_all ();
226 extern int connect_jserver (int);
227 extern int convert_getterm ();
228 extern int convert_key_setup ();
229 extern int cur_ichi (int, int);
230 extern void cursor_invisible_raw (void);
231 extern void cursor_normal_raw (void);
232 extern int dai_end (struct wnn_buf *, int);
233 extern int dai_top (struct wnn_buf *, int);
234 extern int dic_nickname (int, char*);
235 extern int disconnect_jserver (void);
236 extern int disp_mode (void);
237 extern void display_henkan_off_mode (void);
238 extern int empty_modep (void);
239 extern void epilogue (void);
240 extern void epilogue_no_close (void);
241 extern void errorkeyin (void);
242 extern int eu_columlen (unsigned char *);
243 extern int expand_argument (char *);
244 extern int expand_expr (char *);
245 extern void fill (char *, int);
246 extern int find_dic_by_no (int);
247 extern int find_end_of_tango (int);
248 extern int find_entry (char *);
249 extern void flushw_buf (void);
250 extern int forward_char (void);
251 extern int backward_char (void);
252 extern int getTermData ();
253 extern void get_end_of_history ();
254 extern void getfname ();
255 extern void h_r_off ();
256 extern void h_r_off_raw ();
257 extern void h_r_on ();
258 extern void h_r_on_raw ();
259 extern int henkan_gop ();
260 extern void henkan_if_maru ();
261 extern int henkan_off ();
262 extern int hextodec ();
263 extern int hinsi_in ();
264 extern int init_history ();
265 extern int init_key_table ();
266 extern void init_screen ();
267 extern int init_uum ();
268 extern int initial_message_out ();
269 extern void initialize_vars ();
270 extern int input_a_char_from_function ();
271 extern int insert_char ();
272 extern int insert_char_and_change_to_insert_mode ();
273 extern int insert_modep ();
274 extern int j_term_init ();
275 extern int flush_designate ();
276 extern int jtosj ();
277 extern int jutil ();
278 extern int kakutei ();
279 extern int kana_in ();
280 extern int kana_in_w_char_msg ();
281 extern int keyin1 ();
282 extern int kk ();
283 extern void kk_cursor_invisible ();
284 extern void kk_cursor_normal ();
285 extern void kk_restore_cursor ();
286 extern void kk_save_cursor ();
287 extern int make_history ();
288 extern int make_info_out ();
289 extern int make_jikouho_retu ();
290 extern void make_kanji_buffer ();
291 extern int make_string_for_ke ();
292 extern int next_history1 ();
293 extern int nobasi_tijimi_mode ();
294 extern int nobi_conv ();
295 extern void pop_cursor ();
296 extern void pop_hrus ();
297 extern int previous_history1 ();
298 extern void print_buf_msg ();
299 extern void reset_cursor ();
300 extern void push_cursor ();
301 extern void push_hrus ();
302 extern void putchar1 ();
303 extern void putchar_norm ();
304 extern void puteustring ();
305 extern int reconnect_jserver_body ();
306 extern int redraw_line ();
307 extern int redraw_nisemono ();
308 extern void remove_key_bind ();
309 extern int isconect_jserver ();
310 extern int ren_henkan0 ();
311 extern void reset_bold ();
312 extern void reset_cursor_status ();
313 extern int resetutmp ();
314 extern void restore_cursor_raw ();
315 extern void ring_bell ();
316 extern void save_cursor_raw ();
317 extern int saveutmp ();
318 extern void scroll_up ();
319 extern int select_jikouho1 ();
320 extern int select_line_element ();
321 extern int select_one_dict1 ();
322 extern int select_one_element ();
323 extern int set_TERMCAP ();
324 extern void set_bold ();
325 extern void set_cursor_status ();
326 extern void set_escape_code ();
327 extern void set_hanten_ul ();
328 extern void set_lc_offset ();
329 extern void set_screen_vars_default ();
330 extern void set_keypad_on ();
331 extern void set_keypad_off ();
332 extern void set_scroll_region ();
333 extern int setutmp ();
334 extern int st_colum ();
335 extern void t_cont_line_note_delete ();
336 extern int t_delete_char ();
337 extern int t_kill ();
338 extern int t_move ();
339 extern int t_print_l ();
340 extern void t_print_line ();
341 extern int t_redraw_move ();
342 extern int t_rubout ();
343 extern void t_throw ();
344 extern int t_yank ();
345 extern int tan_conv ();
346 extern int tan_henkan1 ();
347 extern void throw_col ();
348 extern void throw_cur_raw ();
349 extern void touroku ();
350 extern void u_s_off ();
351 extern void u_s_off_raw ();
352 extern void u_s_on ();
353 extern void u_s_on_raw ();
354 extern int update_dic_list ();
355 extern int uumrc_get_entries ();
356 extern void w_printf ();
357 extern int w_putchar ();
358 extern void w_sttost ();
359 extern int wchartochar ();
360 extern int yes_or_no ();
361 extern int yes_or_no_or_newline ();
362 extern int zenkouho_dai_c ();
363 extern void find_yomi_for_kanji ();
364 extern int check_vst ();
365 extern void t_redraw_one_line ();
366 extern void throw ();
367 extern int keyin ();
368 extern int push_unget_buf ();
369 extern unsigned int *get_unget_buf ();
370 extern int if_unget_buf ();
371 
372 extern int set_cur_env ();
373 extern char env_state ();
374 extern void get_new_env ();
375 
376 extern int call_t_redraw_move_normal ();
377 extern int call_t_redraw_move ();
378 extern int call_t_redraw_move_1_normal ();
379 extern int call_t_redraw_move_1 ();
380 extern int call_t_redraw_move_2_normal ();
381 extern int call_t_redraw_move_2 ();
382 extern int call_t_print_l_normal ();
383 extern int call_t_print_l ();
384 extern int c_top_normal ();
385 extern int c_end_normal ();
386 extern int c_end_nobi_normal ();
387 extern int char_q_len_normal ();
388 extern int char_len_normal ();
389 extern int t_redraw_move_normal ();
390 extern int t_print_l_normal ();
391 extern int call_redraw_line_normal ();
392 extern int call_redraw_line ();
393 extern int hani_settei_normal ();
394 extern void call_errorkeyin ();
395 extern int call_jl_yomi_len ();
396 extern int through ();
397 extern int sStrcpy ();
398 extern int Sstrcpy ();
399 extern char *sStrncpy ();
400 extern w_char *Strcat ();
401 extern w_char *Strncat ();
402 extern int Strncmp ();
403 extern w_char *Strcpy ();
404 extern w_char *Strncpy ();
405 extern int Strlen ();
406 extern void conv_ltr_to_ieuc ();
407 extern int get_cswidth_by_char ();
408 extern int eeuc_to_ieuc ();
409 extern int conv_keyin ();
410 
411 #ifdef  JAPANESE
412 extern int eujis_to_iujis ();
413 extern int jis_to_iujis ();
414 extern int sjis_to_iujis ();
415 extern int iujis_to_eujis ();
416 extern int jis_to_eujis ();
417 extern int sjis_to_eujis ();
418 extern int iujis_to_jis8 ();
419 extern int eujis_to_jis8 ();
420 extern int sjis_to_jis8 ();
421 extern int iujis_to_sjis ();
422 extern int eujis_to_sjis ();
423 extern int jis_to_sjis ();
424 extern int do_u_opt ();
425 extern int do_j_opt ();
426 extern int do_s_opt ();
427 extern int do_U_opt ();
428 extern int do_J_opt ();
429 extern int do_S_opt ();
430 #endif /* JAPANESE */
431 
432 #ifdef CHINESE
433 extern int call_t_redraw_move_yincod ();
434 extern int call_t_redraw_move_1_yincod ();
435 extern int call_t_redraw_move_2_yincod ();
436 extern int call_t_print_l_yincod ();
437 extern int input_yincod ();
438 extern int redraw_when_chmsig_yincod ();
439 extern int c_top_yincod ();
440 extern int c_end_yincod ();
441 extern int c_end_nobi_yincod ();
442 extern int print_out_yincod ();
443 extern int char_q_len_yincod ();
444 extern int char_len_yincod ();
445 extern int t_redraw_move_yincod ();
446 extern int t_print_l_yincod ();
447 extern int call_redraw_line_yincod ();
448 extern int hani_settei_yincod ();
449 extern void errorkeyin_q ();
450 extern int not_call_jl_yomi_len ();
451 extern int cwnn_pzy_yincod ();
452 extern int cwnn_yincod_pzy_str ();
453 
454 extern int icns_to_ecns ();
455 extern int icns_to_big5 ();
456 extern int ecns_to_icns ();
457 extern int ecns_to_big5 ();
458 extern int big5_to_icns ();
459 extern int big5_to_ecns ();
460 extern int iugb_to_eugb ();
461 extern int eugb_to_iugb ();
462 extern int do_b_opt ();
463 extern int do_t_opt ();
464 extern int do_B_opt ();
465 extern int do_T_opt ();
466 #endif /* CHINESE */
467 
468 #ifdef  KOREAN
469 extern int iuksc_to_ksc ();
470 extern int euksc_to_ksc ();
471 extern int iuksc_to_euksc ();
472 extern int ksc_to_euksc ();
473 extern int ksc_to_iuksc ();
474 extern int euksc_to_iuksc ();
475 extern int do_u_opt ();
476 extern int do_U_opt ();
477 #endif /* KOREAN */
478 
479 extern void romkan_set_lang ();
480