1 /*
2  *  $Id: header.c,v 1.5 2001/09/16 11:42:58 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
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 #include <stdio.h>
33 #include "jllib.h"
34 #include "wnn_config.h"
35 #include "commonhd.h"
36 #include "sdefine.h"
37 #include "sheader.h"
38 #include "buffer.h"
39 
40 int not_redraw;
41 w_char *input_buffer;
42 w_char *return_buf;             /* return you mojiretsu buffer */
43 struct wnn_buf *bun_data_;
44 
45 WnnEnv *normal_env = NULL;
46 WnnEnv *reverse_env = NULL;
47 WnnEnv *cur_normal_env = NULL;
48 WnnEnv *cur_reverse_env = NULL;
49 
50 int cur_bnst_ = 0;              /* current bunsetsu pointer */
51 
52 int crow;
53 int disp_mode_length = WNN_DISP_MODE_LEN;       /* �⡼��ɽ����ɬ�פ�column�� */
54 char Term_Name[128];
55 
56 int rubout_code = 127;
57 int kk_on = 0;
58 int quote_code = -1;
59 int quote_flag = 0;
60 
61 int max_history;
62 
63 int (*main_table[TBL_CNT][TBL_SIZE]) ();
64 char romkan_clear_tbl[TBL_CNT][TBL_SIZE];
65 w_char jishopath[64];
66 w_char hindopath[64];
67 w_char fuzokugopath[64];
68 
69 struct buf *c_b;
70 short pty_c_flag;
71 short tty_c_flag;
72 
73 int cursor_invisible_fun = 0;
74 int keypad_fun = 0;
75 int send_ascii_char = 0;
76 int excellent_delete = 1;
77 int convkey_on = 0;
78 
79 int *bunsetsu;
80 int *bunsetsuend;
81 struct wnn_env **bunsetsu_env;
82 int *touroku_bnst;
83 int touroku_bnst_cnt;
84 /* int bunsetsucnt = 0; */
85 w_char *kill_buffer;
86 w_char *remember_buf;
87 int kill_buffer_offset = 0;
88 
89 int touroku_comment = 0;        /* Comment for Words in Word_add */
90 
91 char lang_dir[LANGDIRLEN] = { '\0' };
92 
93 char uumkey_name_in_uumrc[PATHNAMELEN] = { '\0' };
94 char convkey_name_in_uumrc[PATHNAMELEN] = { '\0' };
95 char rkfile_name_in_uumrc[PATHNAMELEN] = { '\0' };
96 short defined_by_option = 0;
97 
98 int conv_lines = 1;
99 int flow_control = 0;
100 int henkan_off_flag = 0;        /* Ω���夲�����Ѵ���off�ˤ������֤ˤ��ޤ� */
101 int henkan_on_kuten = 0;        /* �������Ϥ��Ѵ����ʤ� */
102 
103 char def_servername[PATHNAMELEN] = { '\0' };    /* V3.0 */
104 char def_reverse_servername[PATHNAMELEN] = { '\0' };
105 char username[PATHNAMELEN] = { '\0' };  /* V3.0 */
106 
107 int remove_cs_from_termcap = 1;
108 
109 int maxbunsetsu;
110 int max_ichiran_kosu;
111 int maxchg;
112 int maxlength;
113 
114 /*
115 w_char kugiri_str[MAXKUGIRI] = {' ',0};
116 */
117 
118 WNN_DIC_INFO *dicinfo;
119 int dic_list_size;
120 
121 short internal_code;
122 short file_code;
123 
124 int (**code_trans) ();
125 
126 struct msg_cat *cd;
127 
128 FuncDataBase *lang_db = NULL;
129 
130 FunctionTable *f_table = NULL;
131 
132 FuncDataBase function_db[] = {
133 #ifdef JAPANESE
134   {"ja_JP",
135    {NULL, NULL, call_t_redraw_move_normal,
136     call_t_redraw_move_1_normal, call_t_redraw_move_2_normal,
137     call_t_print_l_normal, NULL, char_len_normal, char_q_len_normal,
138     t_redraw_move_normal, t_print_l_normal, c_top_normal, c_end_normal,
139     c_end_normal, call_redraw_line_normal, hani_settei_normal,
140     errorkeyin, call_jl_yomi_len},
141    TTY_KCODE, PTY_KCODE, J_IUJIS, J_EUJIS,
142    {
143     through, iujis_to_eujis, iujis_to_jis8, iujis_to_sjis,
144     eujis_to_iujis, through, eujis_to_jis8, eujis_to_sjis,
145     jis_to_iujis, jis_to_eujis, through, jis_to_sjis,
146     sjis_to_iujis, sjis_to_eujis, sjis_to_jis8, through},
147    "ujsUJS",
148    "ujsUJS",
149    {
150     do_u_opt, do_j_opt, do_s_opt, do_U_opt, do_J_opt, do_S_opt}
151    },
152 #endif /* JAPANESE */
153 #ifdef CHINESE
154   {"zh_CN",                     /* Simplified Chinese */
155    {print_out_yincod, input_yincod, call_t_redraw_move_yincod,
156     call_t_redraw_move_1_yincod, call_t_redraw_move_2_yincod,
157     call_t_print_l_yincod, redraw_when_chmsig_yincod, char_len_yincod,
158     char_q_len_yincod, t_redraw_move_yincod,
159     t_print_l_yincod, c_top_yincod, c_end_yincod, c_end_nobi_yincod,
160     call_redraw_line_yincod, hani_settei_yincod, errorkeyin_q,
161     not_call_jl_yomi_len},
162    TTY_CCODE, PTY_CCODE, C_IUGB, C_EUGB,
163    {
164     through, iugb_to_eugb, through, through,
165     eugb_to_iugb, through, through, through,
166     through, through, through, through,
167     through, through, through, through},
168    "",
169    "",
170    {
171     NULL, NULL, NULL, NULL, NULL, NULL}
172    },
173   {"zh_TW",                     /* Traditional Chinese */
174    {print_out_yincod, input_yincod, call_t_redraw_move_yincod,
175     call_t_redraw_move_1_yincod, call_t_redraw_move_2_yincod,
176     call_t_print_l_yincod, redraw_when_chmsig_yincod, char_len_yincod,
177     char_q_len_yincod, t_redraw_move_yincod,
178     t_print_l_yincod, c_top_yincod, c_end_yincod, c_end_nobi_yincod,
179     call_redraw_line_yincod, hani_settei_yincod, errorkeyin_q,
180     not_call_jl_yomi_len},
181    TTY_TCODE, PTY_TCODE, C_ICNS11643, C_ECNS11643,
182    {
183     through, icns_to_ecns, icns_to_big5, through,
184     ecns_to_icns, through, ecns_to_big5, through,
185     big5_to_icns, big5_to_ecns, through, through,
186     through, through, through, through},
187    "btBT",
188    "btBT",
189    {
190     do_b_opt, do_t_opt, do_B_opt, do_T_opt, NULL, NULL}
191    },
192 #endif /* CHINESE */
193 #ifdef   KOREAN
194   {"ko_KR",
195    {NULL, NULL, call_t_redraw_move_normal,
196     call_t_redraw_move_1_normal, call_t_redraw_move_2_normal,
197     call_t_print_l_normal, NULL, char_len_normal, char_q_len_normal,
198     t_redraw_move_normal, t_print_l_normal, c_top_normal, c_end_normal,
199     c_end_normal, call_redraw_line_normal, hani_settei_normal,
200     errorkeyin, call_jl_yomi_len},
201    TTY_HCODE, PTY_HCODE, K_IUKSC, K_EUKSC,
202    {
203     through, iuksc_to_euksc, through, through,
204     euksc_to_iuksc, through, through, through,
205     through, through, through, through,
206     through, through, through, through},
207    "uU",
208    "uU",
209    {
210     do_u_opt, do_U_opt, NULL, NULL, NULL, NULL}
211    },
212 #endif /* KOREAN */
213   {NULL,
214    {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
215     NULL, NULL, NULL, NULL, NULL, NULL, NULL},
216    0, 0, 0, 0,
217    {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
218     NULL, NULL, NULL, NULL, NULL, NULL},
219    NULL,
220    NULL,
221    {
222     NULL, NULL, NULL, NULL, NULL, NULL}
223    }
224 };
225 
226 int (*default_code_trans[]) () =
227 {
228 through, through, through, through, through, through, through, through, through, through, through, through, through, through, through, through};
229