9a14d50062
- Modify FreeWnn-prototypes_3.patch . I found a bug in make_hinsi_list() at Wnn/jserver/hinsi_list.c, then fixed it . - Add FreeWnn-prototypes_3.patch . Prototype declarations for reducing compilation warnings . - Add FreeWnn-prototypes_msg.patch . Bugfix: In openSUSE 13.1 Milestone 3, uum could not get error messages . This issue's cause is that we forgot prototype declaration of msg_get() in Wnn/include/msg.h . Then I added "FreeWnn-prototypes_msg.patch" as %Patch15 . http://lists.opensuse.org/opensuse-ja/2013-08/msg00014.html http://sourceforge.jp/projects/freewnn/lists/archive/users/2013-August/000140.html - I added %configure --with-libwrap option . The [jctk]server s were linked -lwrap . Then we can use /etc/hosts.allow /etc/hosts.deny . - Degrade fix: In "FreeWnn-prototypes.patch", I invalidated the patch of "FreeWnn-sighandler.patch" . Then I deleted a wrong patch to "Wnn/jserver/de.c" from "FreeWnn-prototypes.patch" . http://sourceforge.jp/projects/freewnn/lists/archive/users/2013-August/000141.html - Change: In "FreeWnn-sighandler.patch", I changed from _exit(-1) to _exit(255) . This change effects [jctk]server's exit status . - SLE_11 and openSUSE 12.2 does not provide libwrap0, then I could not build FreeWnn on them . So, I deleted %configure --with-libwrap option OBS-URL: https://build.opensuse.org/request/show/195772 OBS-URL: https://build.opensuse.org/package/show/M17N/fwnn?expand=0&rev=11
346 lines
12 KiB
Plaintext
346 lines
12 KiB
Plaintext
--- FreeWnn-1.1.1-a022.bak/Wnn/jlib/jl.c 2013-08-06 20:02:27.258462915 +0900
|
||
+++ FreeWnn-1.1.1-a022/Wnn/jlib/jl.c 2013-08-06 18:59:37.294514823 +0900
|
||
@@ -52,6 +52,7 @@
|
||
# include <malloc.h>
|
||
# endif
|
||
#endif /* STDC_HEADERS */
|
||
+#include <stdarg.h>
|
||
#include <sys/types.h>
|
||
#include <sys/file.h>
|
||
#include <sys/stat.h>
|
||
@@ -159,7 +160,7 @@
|
||
static void make_space_for ();
|
||
static void make_space_for_bun ();
|
||
static void make_space_for_zenkouho ();
|
||
-static void message_out ();
|
||
+static void message_out (int (*) (const char *), const char *, ...);
|
||
static int ren_conv1 ();
|
||
static void set_dai ();
|
||
static void set_sho ();
|
||
@@ -275,7 +276,7 @@
|
||
static struct wnn_env *
|
||
find_same_env (js, env_n, lang)
|
||
register WNN_JSERVER_ID *js;
|
||
- register char *env_n;
|
||
+ register const char *env_n;
|
||
char *lang;
|
||
{
|
||
register int k;
|
||
@@ -314,7 +315,7 @@
|
||
add_new_env (js, env, env_n, server_n, lang)
|
||
register WNN_JSERVER_ID *js;
|
||
register struct wnn_env *env;
|
||
- char *env_n, *server_n, *lang;
|
||
+ const char *env_n, *server_n, *lang;
|
||
{
|
||
register int k;
|
||
|
||
@@ -435,15 +436,16 @@
|
||
|
||
struct wnn_env *
|
||
jl_connect_lang (env_n, server_n, lang, wnnrc_n, error_handler, message_handler, timeout)
|
||
- register char *env_n, *server_n, *wnnrc_n, *lang;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ register const char *env_n, *server_n, *wnnrc_n, *lang;
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
int timeout;
|
||
{
|
||
register WNN_JSERVER_ID *js = NULL;
|
||
struct wnn_env *env;
|
||
int env_exist;
|
||
char p_lang[16];
|
||
- register char *p, *l;
|
||
+ register char *p;
|
||
+ const char *l;
|
||
extern char *getenv ();
|
||
extern char *_wnn_get_machine_of_serv_defs ();
|
||
|
||
@@ -576,8 +578,8 @@
|
||
|
||
struct wnn_buf *
|
||
jl_open_lang (env_n, server_n, lang, wnnrc_n, error_handler, message_handler, timeout)
|
||
- char *env_n, *server_n, *wnnrc_n, *lang;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ const char *env_n, *server_n, *wnnrc_n, *lang;
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
int timeout;
|
||
{
|
||
register int k, dmy;
|
||
@@ -1504,7 +1506,7 @@
|
||
int prio;
|
||
int rw, hrw, rev;
|
||
char *pwd_dic, *pwd_hindo;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
{
|
||
char tmp[256];
|
||
char pwd[WNN_PASSWD_LEN], hpwd[WNN_PASSWD_LEN];
|
||
@@ -1519,7 +1521,7 @@
|
||
jl_disconnect (env);
|
||
return (-1);
|
||
}
|
||
- if ((int) error_handler == WNN_NO_CREATE || (rw == WNN_DIC_RDONLY))
|
||
+ if (error_handler == (int (*) (const char *)) WNN_NO_CREATE || (rw == WNN_DIC_RDONLY))
|
||
{
|
||
sprintf (tmp, "%s \"%s\" %s", msg_get (wnn_msg_cat, 200, NULL, env->lang), dic_name, msg_get (wnn_msg_cat, 201, NULL, env->lang));
|
||
/*
|
||
@@ -1533,7 +1535,7 @@
|
||
/*
|
||
"<22><><EFBFBD><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD> \"%s\" <20><>̵<EFBFBD><CCB5><EFBFBD>衣<EFBFBD><E8A1A3><EFBFBD><EFBFBD>?(Y/N)",
|
||
*/
|
||
- if ((int) error_handler == WNN_CREATE || call_error_handler (error_handler, tmp))
|
||
+ if (error_handler == WNN_CREATE || call_error_handler (error_handler, tmp))
|
||
{
|
||
if (create_file (env, dic_name, JISHO, -1, /* -1 is dummy */
|
||
pwd_dic, (hindo_name && *hindo_name) ? "" : pwd_hindo, error_handler, message_handler) == -1)
|
||
@@ -1558,7 +1560,7 @@
|
||
jl_disconnect (env);
|
||
return (-1);
|
||
}
|
||
- if ((int) error_handler == WNN_NO_CREATE || (hrw == WNN_DIC_RDONLY))
|
||
+ if (error_handler == (int (*) (const char *)) WNN_NO_CREATE || (hrw == WNN_DIC_RDONLY))
|
||
{
|
||
sprintf (tmp, "%s \"%s\" %s", msg_get (wnn_msg_cat, 203, NULL, env->lang), hindo_name, msg_get (wnn_msg_cat, 201, NULL, env->lang));
|
||
/*
|
||
@@ -1572,7 +1574,7 @@
|
||
/*
|
||
"<22><><EFBFBD>٥ե<D9A5><D5A5><EFBFBD><EFBFBD><EFBFBD> \"%s\" <20><>̵<EFBFBD><CCB5><EFBFBD>衣<EFBFBD><E8A1A3><EFBFBD><EFBFBD>?(Y/N)",
|
||
*/
|
||
- if ((int) error_handler == WNN_CREATE || call_error_handler (error_handler, tmp))
|
||
+ if (error_handler == WNN_CREATE || call_error_handler (error_handler, tmp))
|
||
{
|
||
if (create_file (env, hindo_name, HINDO, fid, "", pwd_hindo, error_handler, message_handler) == -1)
|
||
return (-1);
|
||
@@ -1601,7 +1603,7 @@
|
||
}
|
||
else if (wnn_errorno == WNN_HINDO_NO_MATCH)
|
||
{
|
||
- if ((int) error_handler == WNN_NO_CREATE)
|
||
+ if (error_handler == (int (*) (const char *)) WNN_NO_CREATE)
|
||
{
|
||
return (-1);
|
||
}
|
||
@@ -1609,7 +1611,7 @@
|
||
/*
|
||
"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \"%s\" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD>衣<EFBFBD><E8A1A3><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE>?(Y/N)",
|
||
*/
|
||
- if (!((int) error_handler == WNN_CREATE || call_error_handler (error_handler, tmp)))
|
||
+ if (!(error_handler == (int (*) (const char *)) WNN_CREATE || call_error_handler (error_handler, tmp)))
|
||
{
|
||
return (-1);
|
||
}
|
||
@@ -1685,7 +1687,7 @@
|
||
create_pwd_file (env, pwd_file, error_handler, message_handler)
|
||
register struct wnn_env *env;
|
||
char *pwd_file;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
{
|
||
FILE *fp;
|
||
char gomi[256];
|
||
@@ -2749,17 +2751,17 @@
|
||
int
|
||
jl_set_env_wnnrc (env, wnnrc_n, error_handler, message_handler)
|
||
register struct wnn_env *env;
|
||
- char *wnnrc_n;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ const char *wnnrc_n;
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
{
|
||
int level = 0;
|
||
int x;
|
||
wnn_errorno = 0;
|
||
- if ((int) error_handler == WNN_CREATE)
|
||
+ if (error_handler == (int (*) (const char *)) WNN_CREATE)
|
||
{
|
||
confirm_state = CREATE_WITHOUT_CONFIRM;
|
||
}
|
||
- else if ((int) error_handler == WNN_NO_CREATE)
|
||
+ else if (error_handler == (int (*) (const char *)) WNN_NO_CREATE)
|
||
{
|
||
confirm_state = NO_CREATE;
|
||
}
|
||
@@ -2775,9 +2777,8 @@
|
||
int
|
||
jl_set_env_wnnrc1 (env, wnnrc_n, error_handler, message_handler, level)
|
||
register struct wnn_env *env;
|
||
- char *wnnrc_n;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
- int level;
|
||
+ const char *wnnrc_n;
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *); int level;
|
||
{
|
||
register int num;
|
||
char s[20][EXPAND_PATH_LENGTH];
|
||
@@ -2829,7 +2830,7 @@
|
||
{
|
||
/* dic_add */
|
||
int prio, rdonly, hrdonly, rev;
|
||
- int (*error_handler1) () = (int (*)()) 0;
|
||
+ int (*error_handler1) (const char *) = NULL;
|
||
expand_expr_all (s[0], env);
|
||
if (num < 3 || !REAL_PARAM (s[1]))
|
||
{
|
||
@@ -2855,11 +2856,11 @@
|
||
else if (confirm_state == CREATE_WITHOUT_CONFIRM)
|
||
{
|
||
|
||
- error_handler1 = (int (*)()) WNN_CREATE;
|
||
+ error_handler1 = (int (*) (const char *)) WNN_CREATE;
|
||
}
|
||
else if (confirm_state == NO_CREATE)
|
||
{
|
||
- error_handler1 = (int (*)()) WNN_NO_CREATE;
|
||
+ error_handler1 = (int (*) (const char *)) WNN_NO_CREATE;
|
||
}
|
||
if (jl_dic_add_e (env, s[0], s[1], rev, prio, rdonly, hrdonly, s[5], s[6], error_handler1, message_handler) == -1 && wnn_errorno != 0)
|
||
{
|
||
@@ -2990,7 +2991,7 @@
|
||
|
||
if (*s != '~' && *s != '@')
|
||
return (0);
|
||
- if ((int) strlen (s) >= EXPAND_PATH_LENGTH)
|
||
+ if (strlen (s) >= EXPAND_PATH_LENGTH)
|
||
return (-1);
|
||
|
||
s1 = s;
|
||
@@ -3008,12 +3009,12 @@
|
||
{
|
||
if (*s1)
|
||
{
|
||
- noerr = expandsuc = (NULL != (u = getpwnam (s1)) && (int) strlen (p = u->pw_dir) + (int) strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
+ noerr = expandsuc = (NULL != (u = getpwnam (s1)) && strlen (p = u->pw_dir) + strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
|
||
}
|
||
else
|
||
{
|
||
- noerr = expandsuc = (NULL != (p = getenv ("HOME")) && (int) strlen (p) + (int) strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
+ noerr = expandsuc = (NULL != (p = getenv ("HOME")) && strlen (p) + strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
}
|
||
|
||
}
|
||
@@ -3021,13 +3022,13 @@
|
||
{ /* then, *s must be '@' */
|
||
if (!strcmp (s1, "HOME"))
|
||
{
|
||
- noerr = expandsuc = (NULL != (p = getenv ("HOME")) && (int) strlen (p) + (int) strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
+ noerr = expandsuc = (NULL != (p = getenv ("HOME")) && strlen (p) + strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
}
|
||
else if (!strcmp (s1, "WNN_DIC_DIR"))
|
||
{
|
||
char buf[EXPAND_PATH_LENGTH];
|
||
expandsuc = 1;
|
||
- noerr = (NULL != (p = getenv ("HOME")) && (int) strlen (p) + (int) strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
+ noerr = (NULL != (p = getenv ("HOME")) && strlen (p) + strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
strcpy (buf, p);
|
||
strcat (buf, "/");
|
||
|
||
@@ -3044,15 +3045,15 @@
|
||
}
|
||
else if (!strcmp (s1, "LIBDIR"))
|
||
{
|
||
- noerr = expandsuc = ((int) strlen (p = LIBDIR) + (int) strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
+ noerr = expandsuc = (strlen (p = LIBDIR) + strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
}
|
||
else if (!strcmp (s1, "ENV"))
|
||
{ /* Added */
|
||
- noerr = expandsuc = (NULL != (p = env_name (env)) && (int) strlen (p) + (int) strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
+ noerr = expandsuc = (NULL != (p = env_name (env)) && strlen (p) + strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
}
|
||
else if (!strcmp (s1, "USR"))
|
||
{
|
||
- noerr = expandsuc = (NULL != (p = getlogname ()) && (int) strlen (p) + (int) strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
+ noerr = expandsuc = (NULL != (p = getlogname ()) && strlen (p) + strlen (tmp) < EXPAND_PATH_LENGTH);
|
||
}
|
||
else
|
||
{ /* @HOME, @LIBDIR @ENV igai ha kaenai */
|
||
@@ -3076,7 +3077,7 @@
|
||
|
||
total = 0;
|
||
flag = 0;
|
||
- while (*st != NULL)
|
||
+ while (*st != 0)
|
||
{
|
||
if (isdigit (*st))
|
||
{
|
||
@@ -3135,7 +3136,7 @@
|
||
int d;
|
||
int fid;
|
||
char *pwd_dic, *pwd_hindo;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
{
|
||
char pwd[WNN_PASSWD_LEN], hpwd[WNN_PASSWD_LEN];
|
||
int rev_dict_type;
|
||
@@ -3243,7 +3244,7 @@
|
||
make_dir_rec1 (env, path, error_handler, message_handler)
|
||
struct wnn_env *env;
|
||
register char *path;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
{
|
||
char gomi[128];
|
||
register char *c;
|
||
@@ -3266,7 +3267,7 @@
|
||
make_dir1 (env, dirname, error_handler, message_handler)
|
||
register struct wnn_env *env;
|
||
register char *dirname;
|
||
- int (*error_handler) (), (*message_handler) ();
|
||
+ int (*error_handler) (const char *), (*message_handler) (const char *);
|
||
{
|
||
char gomi[128];
|
||
if (dirname[0] == C_LOCAL)
|
||
@@ -3287,7 +3288,7 @@
|
||
return (0); /* dir already exists */
|
||
}
|
||
}
|
||
- if ((int) error_handler != WNN_CREATE)
|
||
+ if (error_handler != (int (*) (const char *)) WNN_CREATE)
|
||
{
|
||
sprintf (gomi, "%s \"%s\" %s%s", msg_get (wnn_msg_cat, 210, NULL, env->lang), dirname, msg_get (wnn_msg_cat, 201, NULL, env->lang), msg_get (wnn_msg_cat, 202, NULL, env->lang));
|
||
/*
|
||
@@ -3324,8 +3325,8 @@
|
||
|
||
static int
|
||
call_error_handler (error_handler, c)
|
||
- int (*error_handler) ();
|
||
- char *c;
|
||
+ int (*error_handler) (const char *);
|
||
+ const char *c;
|
||
{
|
||
register int x;
|
||
x = error_handler (c);
|
||
@@ -3340,16 +3341,16 @@
|
||
}
|
||
|
||
static void
|
||
-message_out (message_handler, format, s1, s2, s3, s4, s5, s6, s7, s8)
|
||
- int (*message_handler) ();
|
||
- char *format;
|
||
- int s1, s2, s3, s4, s5, s6, s7, s8;
|
||
+message_out (int (*message_handler) (const char *), const char *format, ...)
|
||
{
|
||
char buf[256];
|
||
+ va_list args;
|
||
|
||
if (message_handler)
|
||
{
|
||
- sprintf (buf, format, s1, s2, s3, s4, s5, s6, s7, s8);
|
||
+ va_start (args, format);
|
||
+ vsprintf (buf, format, args);
|
||
+ va_end (args);
|
||
(*message_handler) (buf);
|
||
}
|
||
}
|
||
--- FreeWnn-1.1.1-a022.bak/Wnn/jlib/js.c 2005-04-11 00:26:37.000000000 +0900
|
||
+++ FreeWnn-1.1.1-a022/Wnn/jlib/js.c 2013-08-06 19:12:48.783918101 +0900
|
||
@@ -979,7 +979,7 @@
|
||
free((char *)env);
|
||
*/
|
||
set_current_js (env->js_id);
|
||
- handler_of_jserver_dead (NULL);
|
||
+ handler_of_jserver_dead (-1);
|
||
snd_env_head (&tmp_env, JS_DISCONNECT);
|
||
snd_flush ();
|
||
x = get4com ();
|