1 /*
2  *  $Id: sdefine.h,v 1.3 2001/06/14 18:16:08 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 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 /*************************
33  * define of standard i/o
34  *************************/
35 
36 #define MAXCHG 80               /* ���ϲ�ǽʸ���� */
37         /*�����Хåե�(�����䡢ñ�측���ʤ�)���礭�� */
38 #define MAX_ICHIRAN_KOSU 36     /* ����ɽ������ɽ���Ŀ� */
39 #define MAXWORDS        MAXJIKOUHO      /* ñ�측���Ǥθ������ */
40 #define NBUN    2               /* nʸ����� */
41 #define JISHO_PRIO_DEFAULT 5    /*����ץ饤����ƥ��Υǥե������ */
42 
43 /* ɾ���ؿ��η��� */
44 #define HINDOVAL 3
45 #define LENGTHVAL 100
46 #define JIRITUGOVAL 1
47 #define FLAGVAL 200             /*���Ȥä���ӥåȤη��� */
48 #define JISHOPRIOVAL 5
49 
50 #define TBL_CNT 10              /* key_table no kazu */
51 /* Two tables are add. one is for selecting zenkouho's, and the other is jisho-ichiran. */
52 /* One more table is add, which is used in inspect */
53 /* Deleted table[7] because those are for Wnn3 */
54 #define TBL_SIZE 256
55 
56 #define ESCAPE_CHAR(c)  (((c) < ' ') || ((c) == 127))
57 #define NORMAL_CHAR(c)  (((c) >= ' ') && ((c) < 127))
58 #define NOT_NORMAL_CHAR(c)      (((c) >= 128) && ((c) < 160))
59 #define ONEBYTE_CHAR(c)         (!((c) & ~0xff))        /* added by Nide */
60 /*
61 #define NISEMONO(c)             ((c) & 0x80000000)
62 #define HONMONO(c)              (!NISEMONO(c))
63 #define KANJI_CHAR(c)           ((c) >= 256 )
64 */
65 #define KANJI_CHAR(c)           (((c) >= 256 ) && ((c) & 0xff00) != 0x8e00)
66 
67 #define zenkaku(x)(KANJI_CHAR(x) || ESCAPE_CHAR(x))
68 #define hankaku(x) (!zenkaku(x))
69 #define ZENKAKU_HYOUJI(x)     zenkaku(x)
70         /* CHANGE AFTERWARD TO BE ABLE TO TREAT hakaku katakana. */
71 
72 #ifndef min
73 #define max(a , b) (((a) > (b))?(a) : (b))
74 #define min(a , b) (((a) <= (b))?(a) : (b))
75 #endif
76 
77 #define numeric(x)      (((x >= S_NUM)&&(x <= E_NUM))? True : False)
78 #define ISKUTENCODE(x)  ((x) == 0xa1a3)
79 
80 struct jisho_
81 {                               /* ���������structure */
82   char name[1024];
83   char hname[1024];             /* ���٥ե�����̾ */
84   int dict_no;                  /* server ���֤��Ƥ��뼭��ʥ�С� */
85   int prio;
86   int rdonly;
87 };
88 
89 struct kansuu
90 {                               /* kansuu_hyo no entry */
91   char *kansuumei;
92   char *comment;
93   int romkan_flag;              /* Clear Romkan or Not.  */
94   int (*func[TBL_CNT]) ();
95 };
96 
97 #ifndef w_char
98 #define w_char  unsigned short
99 #endif
100 
101 #define printf        PRINTF
102 #define fprintf       FPRINTF
103 #define remove        REMOVE
104 
105 #define throw_c(col)  throw_col((col) + disp_mode_length)
106 
107 #define MAX_HISTORY 10
108 
109 
110 #define flush() fflush(stdout)
111 #define print_msg(X) {push_cursor();throw_c(0); clr_line();printf(X);flush();pop_cursor();}
112 #define print_msg_getc(X) {push_cursor();throw_c(0); clr_line();printf(X);flush();keyin();pop_cursor();}
113 
114 
115 #define UNDER_LINE_MODE (0x02 | 0x08 | 0x20)
116 
117 #define OPT_CONVKEY             0x01
118 #define OPT_RKFILE              0x02
119 #define OPT_WNNKEY              0x04
120 #define OPT_FLOW_CTRL           0x08
121 #define OPT_WAKING_UP_MODE      0x10
122 #define OPT_VERBOSE             0x20
123 
124 #define convkey_defined_by_option       (defined_by_option & OPT_CONVKEY)
125 #define rkfile_defined_by_option        (defined_by_option & OPT_RKFILE)
126 #define uumkey_defined_by_option        (defined_by_option & OPT_WNNKEY)
127 #define verbose_option                  (defined_by_option & OPT_VERBOSE)
128 
129 /*
130 #define char_len(X)((hankaku(X))? 1 : 2)
131 */
132 
133 /*
134   GETOPT string & ALL OPTIONS string for configuration.
135   see each config.h for detail.
136   NOTE: WHEN YOU MODIFY THESE, YOU ALSO MODIFY do_opt[] ARRAY AND
137   ALL config.h!!!!
138  */
139 
140 #define GETOPTSTR   "hHPxXk:c:r:l:D:n:v"
141 #define ALL_OPTIONS "hHujsUJSPxXkcrlDnvbtBT"
142 #define OPTIONS     "hHPxXkcrlDnv"
143 
144 /* for message file */
145 #include "msg.h"
146 #define MSG_GET(no)     msg_get(cd, no, NULL, NULL)
147 
148 #define CWNN_PINYIN             0
149 #define CWNN_ZHUYIN             1
150 
151 #define print_out_func          (f_table->print_out_function)
152 #define input_func              (f_table->input_function)
153 #define call_t_redraw_move_func (f_table->call_t_redraw_move_function)
154 #define call_t_redraw_move_1_func (f_table->call_t_redraw_move_1_function)
155 #define call_t_redraw_move_2_func (f_table->call_t_redraw_move_2_function)
156 #define call_t_print_l_func     (f_table->call_t_print_l_function)
157 #define redraw_when_chmsig_func (f_table->redraw_when_chmsig_function)
158 #define char_len_func           (f_table->char_len_function)
159 #define char_q_len_func         (f_table->char_q_len_function)
160 #define t_redraw_move_func      (f_table->t_redraw_move_function)
161 #define t_print_l_func          (f_table->t_print_l_function)
162 #define c_top_func              (f_table->c_top_function)
163 #define c_end_func              (f_table->c_end_function)
164 #define c_end_nobi_func         (f_table->c_end_nobi_function)
165 #define call_redraw_line_func   (f_table->call_redraw_line_function)
166 #define hani_settei_func        (f_table->hani_settei_function)
167 #define errorkeyin_func         (f_table->errorkeyin_function)
168 #define call_jl_yomi_len_func   (f_table->call_jl_yomi_len_function)
169 
170 #define env_normal               (cur_normal_env->env)
171 #define env_reverse              (cur_reverse_env->env)
172 
173 #define envrcname               (cur_normal_env->envrc_name)
174 #define reverse_envrcname       (cur_reverse_env->envrc_name)
175 
176 #define env_name_s               (cur_normal_env->env_name_str)
177 #define reverse_env_name_s       (cur_reverse_env->env_name_str)
178 
179 #define servername              (cur_normal_env->host_name)
180 #define reverse_servername      (cur_reverse_env->host_name)
181 
182 #define normal_sticky           (cur_normal_env->sticky)
183 #define reverse_sticky          (cur_reverse_env->sticky)
184