fwnn/FreeWnn-1.1.1-a017.dif

548 lines
19 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- Xsi/PubdicPlus/pod.c
+++ Xsi/PubdicPlus/pod.c 2001/09/04 16:59:45
@@ -26,13 +26,15 @@
#include <stdio.h>
-#define bzero(a, c) memset(a, 0, c)
-
#if __STDC__
#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
#else
extern char *malloc ();
#endif
+
+#define bzero(a, c) memset(a, 0, c)
#define POD_WCHAR
--- Xsi/Wnn/include/jllib.h
+++ Xsi/Wnn/include/jllib.h 2001/09/04 18:55:55
@@ -248,58 +248,58 @@
#define jl_set_lang(buf, lang) js_set_lang((buf)->env, lang)
/* extern function defines */
-extern struct wnn_buf *jl_open_lang ();
-extern struct wnn_env *jl_connect_lang ();
-extern struct wnn_env *jl_env_get ();
-extern struct wnn_jdata *jl_word_info_e ();
-extern w_char *jl_hinsi_name_e ();
+extern struct wnn_buf *jl_open_lang (const char *, const char *, const char *, const char *, int (*) (const char *), int (*) (const char *), int);
+extern struct wnn_env *jl_connect_lang (const char *, const char *, const char *, const char *, int (*) (const char *), int (*) (const char *), int);
+extern struct wnn_env *jl_env_get (struct wnn_buf *);
+extern struct wnn_jdata *jl_word_info_e (struct wnn_env *, int, int);
+extern w_char *jl_hinsi_name_e (struct wnn_env *, int);
-extern void jl_close ();
-extern int jl_dic_add_e ();
-extern int jl_dic_comment_set_e ();
-extern int jl_dic_delete_e ();
-extern int jl_dic_list_e ();
-extern int jl_dic_save_all_e ();
-extern int jl_dic_save_e ();
-extern int jl_dic_use_e ();
-extern void jl_disconnect ();
-extern void jl_disconnect_if_server_dead ();
-extern void jl_env_set ();
-extern int jl_fuzokugo_get_e ();
-extern int jl_fuzokugo_set_e ();
-extern void jl_get_zenkouho_kanji ();
-extern int jl_hinsi_dicts_e ();
-extern int jl_hinsi_list_e ();
-extern int jl_hinsi_number_e ();
-extern int jl_isconnect_e ();
-extern int jl_kanji_len ();
-extern int jl_kill ();
-extern int jl_nobi_conv ();
-extern int jl_nobi_conv_e2 ();
-extern int jl_param_get_e ();
-extern int jl_param_set_e ();
-extern int jl_ren_conv ();
-extern int jl_set_env_wnnrc ();
-extern int jl_set_env_wnnrc1 ();
-extern int jl_set_jikouho ();
-extern int jl_set_jikouho_dai ();
-extern int jl_tan_conv ();
-extern int jl_update_hindo ();
-extern int jl_word_add_e ();
-extern int jl_word_comment_set_e ();
-extern int jl_word_delete_e ();
-extern int jl_word_search_by_env_e ();
-extern int jl_word_search_e ();
-extern int jl_word_use_e ();
-extern int jl_yomi_len ();
-extern int jl_zenkouho ();
-extern int jl_zenkouho_dai ();
-extern int wnn_get_area ();
+extern void jl_close (struct wnn_buf *);
+extern int jl_dic_add_e (struct wnn_env *, char *, char *, int, int, int, int, char *, char *, int (*) (const char *), int (*) (const char *));
+extern int jl_dic_comment_set_e (struct wnn_env *, int, w_char *);
+extern int jl_dic_delete_e (struct wnn_env *, int);
+extern int jl_dic_list_e (struct wnn_env *, WNN_DIC_INFO **);
+extern int jl_dic_save_all_e (struct wnn_env *);
+extern int jl_dic_save_e (struct wnn_env *, int);
+extern int jl_dic_use_e (struct wnn_env *, int, int);
+extern void jl_disconnect (struct wnn_env *);
+extern void jl_disconnect_if_server_dead (struct wnn_env *);
+extern void jl_env_set (struct wnn_buf *, struct wnn_env *);
+extern int jl_fuzokugo_get_e (struct wnn_env *, char *);
+extern int jl_fuzokugo_set_e (struct wnn_env *, char *);
+extern void jl_get_zenkouho_kanji (struct wnn_buf *, int, w_char *);
+extern int jl_hinsi_dicts_e (struct wnn_env *, int, int **);
+extern int jl_hinsi_list_e (struct wnn_env *, int, w_char *, w_char ***);
+extern int jl_hinsi_number_e (struct wnn_env *, w_char *);
+extern int jl_isconnect_e (struct wnn_env *);
+extern int jl_kanji_len (struct wnn_buf *, int, int);
+extern int jl_kill (struct wnn_buf *, int, int);
+extern int jl_nobi_conv (struct wnn_buf *, int, int, int, int, int);
+extern int jl_nobi_conv_e2 (struct wnn_buf *, struct wnn_env *, int, int, int, int, int);
+extern int jl_param_get_e (struct wnn_env *, struct wnn_param *);
+extern int jl_param_set_e (struct wnn_env *, struct wnn_param *);
+extern int jl_ren_conv (struct wnn_buf *, w_char *, int, int, int);
+extern int jl_set_env_wnnrc (struct wnn_env *, const char *, int (*) (const char *), int (*) (const char *));
+extern int jl_set_env_wnnrc1 (struct wnn_env *, const char *, int (*) (const char *), int (*) (const char *), int);
+extern int jl_set_jikouho (struct wnn_buf *, int);
+extern int jl_set_jikouho_dai (struct wnn_buf *, int);
+extern int jl_tan_conv (struct wnn_buf *, w_char *, int, int, int, int);
+extern int jl_update_hindo (struct wnn_buf *, int, int);
+extern int jl_word_add_e (struct wnn_env *, int, w_char *, w_char *, w_char *, int, int);
+extern int jl_word_comment_set_e (struct wnn_env *, int, int, w_char *);
+extern int jl_word_delete_e (struct wnn_env *, int, int);
+extern int jl_word_search_by_env_e (struct wnn_env *, w_char *, struct wnn_jdata **);
+extern int jl_word_search_e (struct wnn_env *, int, w_char *, struct wnn_jdata **);
+extern int jl_word_use_e (struct wnn_env *, int, int);
+extern int jl_yomi_len (struct wnn_buf *, int, int);
+extern int jl_zenkouho (struct wnn_buf *, int, int, int);
+extern int jl_zenkouho_dai (struct wnn_buf *, int, int, int, int);
+extern int wnn_get_area (struct wnn_buf *, int, int, w_char *, int);
-extern char *wnn_perror ();
-extern char *wnn_perror_lang ();
+extern char *wnn_perror (void);
+extern char *wnn_perror_lang (char *);
#ifdef CONVERT_by_STROKE
-extern void jl_get_zenkouho_yomi ();
+extern void jl_get_zenkouho_yomi (struct wnn_buf *, int, w_char *);
#endif
#endif /* JLLIB */
--- Xsi/Wnn/jlib/jl.c
+++ Xsi/Wnn/jlib/jl.c 2001/09/04 19:06:21
@@ -38,6 +38,8 @@
#include "commonhd.h"
#include "wnn_config.h"
#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
#include <sys/types.h>
#ifdef SYSVR2
# include <string.h>
@@ -145,7 +147,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 ();
@@ -261,7 +263,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;
@@ -300,7 +302,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;
@@ -421,15 +423,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 ();
@@ -562,8 +565,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;
@@ -1490,7 +1493,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];
@@ -1505,7 +1508,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));
/*
@@ -1519,7 +1522,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 == (int (*) (const char *)) 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)
@@ -1544,7 +1547,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));
/*
@@ -1558,7 +1561,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 == (int (*) (const char *)) 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);
@@ -1587,7 +1590,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);
}
@@ -1595,7 +1598,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);
}
@@ -1671,7 +1674,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];
@@ -2731,17 +2734,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;
}
@@ -2757,8 +2760,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) ();
+ const char *wnnrc_n;
+ int (*error_handler) (const char *), (*message_handler) (const char *);
int level;
{
register int num;
@@ -2811,7 +2814,7 @@
{
/* dic_add */
int prio, rdonly, hrdonly, rev;
- int (*error_handler1) () = (int (*)()) 0;
+ int (*error_handler1) (const char *) = (int (*) (const char *)) 0;
expand_expr_all (s[0], env);
if (num < 3 || !REAL_PARAM (s[1]))
{
@@ -2837,11 +2840,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)
{
@@ -2972,7 +2975,7 @@
if (*s != '~' && *s != '@')
return (0);
- if ((int) strlen (s) >= EXPAND_PATH_LENGTH)
+ if (strlen (s) >= EXPAND_PATH_LENGTH)
return (-1);
s1 = s;
@@ -2995,12 +2998,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);
}
}
@@ -3008,13 +3011,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, "/");
@@ -3031,15 +3034,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 */
@@ -3063,7 +3066,7 @@
total = 0;
flag = 0;
- while (*st != NULL)
+ while (*st != 0)
{
if (isdigit (*st))
{
@@ -3122,7 +3125,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;
@@ -3230,7 +3233,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;
@@ -3253,7 +3256,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)
@@ -3274,7 +3277,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));
/*
@@ -3311,8 +3314,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);
@@ -3327,16 +3330,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);
}
}
--- Xsi/Wnn/jlib/js.c
+++ Xsi/Wnn/jlib/js.c 2001/09/04 17:34:48
@@ -900,7 +900,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 ();
--- Xsi/Wnn/jutil/atod.c
+++ Xsi/Wnn/jutil/atod.c 2001/09/04 16:59:45
@@ -39,6 +39,8 @@
#include <stdio.h>
#include <ctype.h>
+#include <string.h>
+#include <stdlib.h>
#include "commonhd.h"
#include "wnn_config.h"
#include "jslib.h"
--- Xsi/Wnn/jutil/atorev.c
+++ Xsi/Wnn/jutil/atorev.c 2001/09/04 16:59:45
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <ctype.h>
+#include <stdlib.h>
#include "commonhd.h"
#include "jslib.h"
#include "jh.h"
--- Xsi/Wnn/jutil/dtoa.c
+++ Xsi/Wnn/jutil/dtoa.c 2001/09/04 16:59:45
@@ -38,6 +38,8 @@
#endif /* lint */
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
#include "commonhd.h"
#include "wnn_config.h"
#include "jslib.h"
--- Xsi/Wnn/jutil/wddel.c
+++ Xsi/Wnn/jutil/wddel.c 2001/09/04 16:59:45
@@ -38,6 +38,7 @@
#endif /* lint */
#include <stdio.h>
+#include <stdlib.h>
#include "commonhd.h"
#include "wnn_config.h"
#include "jllib.h"
--- Xsi/Wnn/jutil/wdreg.c
+++ Xsi/Wnn/jutil/wdreg.c 2001/09/04 16:59:45
@@ -38,6 +38,7 @@
#endif /* lint */
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/file.h>
#include "commonhd.h"
--- Xsi/Wnn/uum/history.c
+++ Xsi/Wnn/uum/history.c 2001/09/04 16:59:45
@@ -30,6 +30,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include "commonhd.h"
#include "sdefine.h"
#include "sheader.h"
--- Xsi/Wnn/uum/sheader.h
+++ Xsi/Wnn/uum/sheader.h 2001/09/04 16:59:45
@@ -320,6 +320,7 @@
extern void set_keypad_on ();
extern void set_keypad_off ();
extern void set_scroll_region ();
+#define setenv fwnn_setenv
extern void setenv ();
extern int setutmp ();
extern int st_colum ();