1 /*
2 * $Id: wnnerrmsg.c,v 1.6 2005/04/10 15:26:37 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
14 *
15 * Maintainer: FreeWnn Project <freewnn@tomo.gr.jp>
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 2 of the License, or (at your option) any later version.
21 *
22 * This library 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 GNU
25 * Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this library; if not, write to the
29 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
30 * Boston, MA 02111-1307, USA.
31 */
32 #ifdef HAVE_CONFIG_H
33 # include <config.h>
34 #endif
35
36 #include <stdio.h>
37 #if STDC_HEADERS
38 # include <string.h>
39 #elif HAVE_STRINGS_H
40 # include <strings.h>
41 #endif /* STDC_HEADERS */
42 #include "jslib.h"
43 #include "commonhd.h"
44 #include "wnn_os.h"
45 #include "msg.h"
46
47 #ifdef not_use
48 char *wnn_errormsg[] = {
49 "no_error 0",
50 "�ե����뤬¸�ߤ��ޤ���", /*WNN_NO_EXIST 1 */
51 "no_error 2",
52 "����alloc�Ǽ��Ԥ��ޤ�����", /*WNN_MALLOC_ERR 3 */
53 "no_error 4",
54 "����ǤϤ���ޤ���", /*WNN_NOT_A_DICT 5 */
55 "���٥ե�����ǤϤ���ޤ���", /*WNN_NOT_A_HINDO_FILE 6 */
56 "��°��ե�����ǤϤ���ޤ���", /*WNN_NOT_A_FUZOKUGO_FILE 7 */
57 "no_error 8",
58 "����ơ��֥뤬���դǤ���", /*WNN_JISHOTABLE_FULL 9 */
59 "���٥ե����뤬�����ꤵ�줿��������٥ե�����ǤϤ���ޤ���",
60 /*WNN_HINDO_NO_MATCH 10 */
61 "no_error 11",
62 "no_error 12",
63 "no_error 13",
64 "no_error 14",
65 "no_error 15",
66 "�ե����뤬�����ץ�Ǥ��ޤ���", /*WNN_OPENF_ERR 16 */
67 "���������٥ե�����ǤϤ���ޤ���", /* WNN_NOT_HINDO_FILE 17 */
68 "��������°��ե�����ǤϤ���ޤ���", /* WNN_NOT_FZK_FILE 18 */
69 "��°��θĿ����٥���Ĺ���ʤɤ�¿��ޤ���", /* WNN_FZK_TOO_DEF 19 */
70 "�����ֹ�μ���ϡ��Ȥ��Ƥ��ޤ���", /*WNN_DICT_NOT_USED 20 */
71 "no_error 21",
72 "no_error 22",
73 "no_error 23",
74 "��°��ե���������Ƥ�����������ޤ���", /* WNN_BAD_FZK_FILE 24 */
75 "�����ʻ��ֹ椬�۾�Ǥ�hinsi.data������������ޤ���", /*WNN_GIJI_HINSI_ERR 25 */
76 "̤������ʻ줬��ü�ʻ�Ȥ����������Ƥ��ޤ���", /*WNN_NO_DFE_HINSI 26 */
77 "��°��ե����뤬�ɤ߹��ޤ�Ƥ��ޤ���", /*WNN_FZK_FILE_NO_LOAD 27 */
78 "no_error 28",
79 "no_error 29",
80 "����Υ�����ȥ꤬¿��ޤ���", /*WNN_DIC_ENTRY_FULL 30 */
81 "�Ѵ����褦�Ȥ���ʸ����Ĺ��ޤ���", /*WNN_LONG_MOJIRETSU 31 */
82 "��°������ΰ褬�����Ƥ��ޤ���", /*WNN_WKAREA_FULL 32 */
83 "no_error 33",
84 "�������ΰ褬�����Ƥ��ޤ���", /* WNN_JKTAREA_FULL 34 */
85 "���䤬 1 �Ĥ���ޤ���Ǥ��� ", /* WNN_NO_KOUHO 35 */
86 "no_error 36",
87 "no_error 37",
88 "no_error 38",
89 "no_error 39",
90 "�ɤߤ�Ĺ��ޤ���", /*WNN_YOMI_LONG 40 */
91 "������Ĺ��ޤ���", /*WNN_KANJI_LONG 41 */
92 "���ꤵ�줿����ϡ���Ͽ��ǽ�ǤϤ���ޤ���", /*WNN_NOT_A_UD 42 */
93 "�ɤߤ�Ĺ����0�Ǥ���", /*WNN_NO_YOMI 43 */
94 "���ꤵ�줿����ϡ��հ�����ǽ�ǤϤ���ޤ���", /* WNN_NOT_A_REV 44 */
95 "��ɥ����μ������Ͽ/������褦�Ȥ��ޤ�����", /*WNN_RDONLY 45 */
96 "�Ķ���¸�ߤ��ʤ��������Ͽ���褦�Ȥ��ޤ�����", /* WNN_DICT_NOT_IN_ENV 46 */
97 "no_error 47",
98 "no_error 48",
99 "��ɥ��������٤��ѹ����褦�Ȥ��ޤ�����", /* WNN_RDONLY_HINDO 49 */
100 "���ꤵ�줿ñ�줬¸�ߤ��ޤ���", /*WNN_WORD_NO_EXIST 50 */
101 "no_error 51",
102 "no_error 52",
103 "no_error 53",
104 "no_error 54",
105 "no_error 55",
106 "no_error 56",
107 "no_error 57",
108 "no_error 58",
109 "no_error 59",
110 "����alloc�Ǽ��Ԥ��ޤ�����", /*WNN_MALLOC_INITIALIZE 60 */
111 "no_error 61",
112 "no_error 62",
113 "no_error 63",
114 "no_error 64",
115 "no_error 65",
116 "no_error 66",
117 "no_error 67",
118 "�����Υ��顼��������ޤ�����", /* WNN_SOME_ERROR 68 */
119 "�Х���ȯ�����Ƥ������ͤǤ���", /*WNN_SONOTA 69 */
120 "�����Ф����Ǥ��ޤ���", /*WNN_JSERVER_DEAD 70 */
121 "alloc�˼��Ԥ��ޤ�����", /*WNN_ALLOC_FAIL 71 */
122 "�����Ф���³�Ǥ��ޤ���Ǥ�����", /*WNN_SOCK_OPEN_FAIL 72 */
123 "�̿��ץ�ȥ���ΥС������äƤ��ޤ���", /* WNN_BAD_VERSION 73 */
124 "���饤����Ȥ����������Ķ��ǤϤ���ޤ���", /* WNN_BAD_ENV 74 */
125 "no_error 75",
126 "no_error 76",
127 "no_error 77",
128 "no_error 78",
129 "no_error 79",
130 "�ǥ��쥯�ȥ���뤳�Ȥ��Ǥ��ޤ���", /* WNN_MKDIR_FAIL 80 */
131 "no_error 81",
132 "no_error 82",
133 "no_error 83",
134 "no_error 84",
135 "no_error 85",
136 "no_error 86",
137 "no_error 87",
138 "no_error 88",
139 "no_error 89",
140 "�ե�������ɤ߹��ळ�Ȥ��Ǥ��ޤ���", /* WNN_FILE_READ_ERROR 90 */
141 "�ե������Ф����Ȥ��Ǥ��ޤ���", /* WNN_FILE_WRITE_ERROR 91 */
142 "���饤����Ȥ��ɤ߹�����ե�����ǤϤ���ޤ���", /* WNN_FID_ERROR 92 */
143 "����ʾ�ե�������ɤ߹��ळ�Ȥ��Ǥ��ޤ���", /* WNN_NO_MORE_FILE 93 */
144 "�ѥ���ɤ��ְ�äƤ��ޤ���", /* WNN_INCORRECT_PASSWD 94 */
145 "�ե����뤬�ɤ߹��ޤ�Ƥ��ޤ��� ", /*WNN_FILE_IN_USE 95 */
146 "�ե����뤬����Ǥ��ޤ��� ", /*WNN_UNLINK 96 */
147 "�ե����뤬��������ޤ���", /*WNN_FILE_CREATE_ERROR 97 */
148 "�ף��Υե�����Ǥ���ޤ���", /*WNN_NOT_A_FILE 98 */
149 "�ե������I-node��FILE_UNIQ����פ���������Ǥ��ޤ���", /*WNN_INODE_CHECK_ERROR 99 */
150
151 "�ʻ�ե����뤬�礭��ޤ���", /* WNN_TOO_BIG_HINSI_FILE 100 */
152 "�ʻ�ե����뤬�礭��ޤ���", /* WNN_TOO_LONG_HINSI_FILE_LINE 101 */
153 "�ʻ�ե����뤬¸�ߤ��ޤ���", /* WNN_NO_HINSI_DATA_FILE 102 */
154 "�ʻ�ե���������Ƥ��ְ�äƤ��ޤ���", /* WNN_BAD_HINSI_FILE 103 */
155 "no_error 104",
156 "�ʻ�ե����뤬�ɤ߹��ޤ�Ƥ��ޤ���", /* WNN_HINSI_NOT_LOADED 105 */
157 "�ʻ�̾���ְ�äƤ��ޤ���", /* WNN_BAD_HINSI_NAME 106 */
158 "�ʻ��ֹ椬�ְ�äƤ��ޤ���", /* WNN_BAD_HINSI_NO 107 */
159 "no_error 108",
160 "�������ϥ��ݡ��Ȥ���Ƥ��ޤ���", /*NOT_SUPPORTED_OPERATION 109 Not Used */
161 "�ѥ���ɤ����äƤ���ե����뤬�����ץ�Ǥ��ޤ���", /*WNN_CANT_OPEN_PASSWD_FILE 110 */
162 /* ��������Υ��顼 */
163 "uumrc�ե����뤬¸�ߤ��ޤ���", /*WNN_RC_FILE_NO_EXIST 111 Not Used */
164 "uumrc�ե�����η�������äƤ��ޤ���", /* WNN_RC_FILE_BAD_FORMAT 112 Not Used */
165 "����ʾ�Ķ����뤳�ȤϤǤ��ޤ���", /* WNN_NO_MORE_ENVS 113 */
166 "���Υ��饤����Ȥ��ɤ߹�����ե�����Ǥ���ޤ���", /* WNN_FILE_NOT_READ_FROM_CLIENT 114 */
167 "��������٥ե����뤬�Ĥ��Ƥ��ޤ���", /*WNN_NO_HINDO_FILE 115 */
168 "�ѥ���ɤΥե����뤬��������ޤ���" /*WNN_CANT_CREATE_PASSWD_FILE 116 */
169 };
170
171 int wnn_errormsg_len = sizeof (wnn_errormsg) / sizeof (char *);
172
173 extern int wnn_errorno;
174 static char msg[] = ":BAD ERRORNO!!! ";
175
176 char *
wnn_perror()177 wnn_perror ()
178 {
179 static char msgarea[100];
180
181 if ((wnn_errorno < 0) || (wnn_errorno > sizeof (wnn_errormsg) / sizeof (char *)))
182 {
183 sprintf (msgarea, "%d", wnn_errorno);
184 strcat (msgarea, msg);
185 return (msgarea);
186 }
187 return (wnn_errormsg[wnn_errorno]);
188 }
189 #endif /* not_use */
190
191 extern int wnn_errorno;
192 extern struct msg_cat *wnn_msg_cat;
193 static char msg[] = ":BAD ERRORNO!!! ";
194
195 char *
wnn_perror_lang(lang)196 wnn_perror_lang (lang)
197 char *lang;
198 {
199 static char msgarea[100];
200
201 sprintf (msgarea, "%d", wnn_errorno);
202 strcat (msgarea, msg);
203 return (msg_get (wnn_msg_cat, wnn_errorno, msgarea, lang));
204 }
205
206 char *
wnn_perror()207 wnn_perror ()
208 {
209 return (wnn_perror_lang (NULL));
210 }
211