1 /*
2  * $Id: header.c,v 1.2 2001/06/14 18:16:15 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 OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
10  * Copyright 1991, 1992 by Massachusetts Institute of Technology
11  *
12  * Author: OMRON SOFTWARE Co., Ltd. <freewnn@rd.kyoto.omronsoft.co.jp>
13  *
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with GNU Emacs; see the file COPYING.  If not, write to the
26  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  *
28  * Commentary:
29  *
30  * Change log:
31  *
32  * Last modified date: 8,Feb.1999
33  *
34  * Code:
35  *
36  */
37 /*
38  * Copyright Kyoto University Research Institute for Mathematical Sciences
39  *                 1987, 1988, 1989, 1990, 1991, 1992
40  * Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992
41  * Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992
42  *
43  * Permission to use, copy, modify, distribute, and sell this software
44  * and its documentation for any purpose is hereby granted without fee,
45  * provided that all of the following conditions are satisfied:
46  *
47  * 1) The above copyright notices appear in all copies
48  * 2) Both those copyright notices and this permission notice appear
49  *    in supporting documentation
50  * 3) The name of "Wnn" isn't changed unless substantial modifications
51  *    are made, or
52  * 3') Following words followed by the above copyright notices appear
53  *    in all supporting documentation of software based on "Wnn":
54  *
55  *   "This software is based on the original version of Wnn developed by
56  *    Kyoto University Research Institute for Mathematical Sciences (KURIMS),
57  *    OMRON Corporation and ASTEC Inc."
58  *
59  * 4) The names KURIMS, OMRON and ASTEC not be used in advertising or
60  *    publicity pertaining to distribution of the software without
61  *    specific, written prior permission
62  *
63  * KURIMS, OMRON and ASTEC make no representations about the suitability
64  * of this software for any purpose.  It is provided "as is" without
65  * express or implied warranty.
66  *
67  * Wnn consortium is one of distributors of the official Wnn source code
68  * release.  Wnn consortium also makes no representations about the
69  * suitability of this software for any purpose.  It is provided "as is"
70  * without express or implied warranty.
71  *
72  * KURIMS, OMRON, ASTEC AND WNN CONSORTIUM DISCLAIM ALL WARRANTIES WITH
73  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
74  * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KURIMS, OMRON, ASTEC OR
75  * WNN CONSORTIUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
76  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
77  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
78  * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
79  * PERFORMANCE OF THIS SOFTWARE.
80  *
81  */
82 /*      Version 4.0
83  */
84 #include <stdio.h>
85 #include "sdefine.h"
86 #include "xim.h"
87 #include "sheader.h"
88 #include "ext.h"
89 
90 int rubout_code = 127;
91 int kk_on = 0;
92 int quote_code = -1;
93 
94 char *ximrc_file = NULL;
95 char *cvt_key_file = NULL;
96 char *cvt_fun_file = NULL;
97 char *cvt_meta_file = NULL;
98 int defined_by_option = 0;
99 
100 WNN_DIC_INFO *dicinfo;
101 int dic_list_size;
102 
103 char *prgname;                  /* program name (argv[0])       */
104 
105 char *xim_title = NULL;         /* title string when henkan-off */
106 
107 char *display_name = NULL;      /* display string               */
108 #ifdef  USING_XJUTIL
109 char *xjutil_name = NULL;       /* xjutil string                */
110 #endif /* USING_XJUTIL */
111 
112 /*
113  * Default env
114  */
115 char *def_lang;
116 char *def_locale = NULL;
117 char *world_locale = NULL;
118 
119 XIMLangDataBase *cur_lang = NULL;
120 
121 WnnClientRec *c_c = NULL;
122 XIMClientRec *cur_p = NULL;
123 XIMClientRec *cur_x = NULL;
124 XIMInputRec *cur_input = NULL;
125 XInputManager *xim = NULL;
126 XIMInputList input_list = NULL;
127 WnnClientList wnnclient_list = NULL;
128 XIMClientList ximclient_list = NULL;
129 ReadRkfileList read_rkfile_list = NULL;
130 BoxRec *box_list = NULL;
131 
132 Romkan *cur_rk = NULL;
133 RomkanTable *cur_rk_table = NULL;
134 
135 char read_rk_file[MAX_LANGS][62];
136 
137 struct msg_cat *cd;
138 
139 char *root_def_servername = NULL;
140 char *root_def_reverse_servername = NULL;
141 char *root_username = NULL;
142 Bool root_henkan_off_def = 1;
143 char *root_uumkeyname = NULL;
144 char *root_rkfilename = NULL;
145 
146 char *world_lang = NULL;
147 char *arg_string = NULL;
148 
149 wchar *wc_buf = NULL;
150 unsigned char *ct_buf = NULL;
151 unsigned char *c_buf = NULL;
152 int wc_buf_max = 0;
153 int ct_buf_max = 0;
154 int c_buf_max = 0;
155 #ifndef X_WCHAR
156 wchar_t *wt_buf = NULL;
157 int wt_buf_max = 0;
158 #endif /* !X_WCHAR */
159 
160 ConvCode cvt_key_tbl[MAX_CVT_ENTRY_CNT];
161 int cvt_key_tbl_cnt = 0;        /* convert table count */
162 
163 XIMLangDataBase *language_db = NULL;
164 XIMLcNameRec *lc_name_list = NULL;
165 
166 FunctionTable function_db[] = {
167   {"Normal",
168    NULL, NULL, call_t_redraw_move_normal,
169    call_t_redraw_move_1_normal, call_t_redraw_move_2_normal,
170    call_t_print_l_normal, NULL, char_len_normal, char_q_len_normal,
171    t_redraw_move_normal, t_print_l_normal, c_top_normal, c_end_normal,
172    c_end_normal, NULL, errorkeyin, call_jl_yomi_len},
173 #ifdef  CHINESE
174   {"Yincoding",
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    NULL, errorkeyin_q, not_call_jl_yomi_len},
181 #endif /* CHINESE */
182   {NULL,
183    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
184    NULL, NULL, NULL, NULL, NULL, NULL}
185 };
186