changeset 11:aa17e2acfa01

add prototypes for function to jllib.h
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sun, 02 Mar 2008 04:48:21 +0900
parents fc3022f61fc7
children 1f16ab4b33e5
files Wnn/include/jllib.h Wnn/jlib/jl.c
diffstat 2 files changed, 198 insertions(+), 390 deletions(-) [+]
line wrap: on
line diff
--- a/Wnn/include/jllib.h	Fri Dec 21 17:23:36 2007 +0900
+++ b/Wnn/include/jllib.h	Sun Mar 02 04:48:21 2008 +0900
@@ -247,60 +247,60 @@
 #define jl_get_lang(buf)        js_get_lang((buf)->env)
 #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 ();
+
+/* prototypes */
+struct wnn_buf *jl_open_lang(char *env_n, char *server_n, char *lang, char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void), int timeout);
+struct wnn_env *jl_connect_lang(register char *env_n, register char *server_n, register char *lang, register char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void), int timeout);
+struct wnn_env *jl_env_get(register struct wnn_buf *buf);
+struct wnn_jdata *jl_word_info_e(register struct wnn_env *env, int dic_no, int entry);
+w_char *jl_hinsi_name_e (register struct wnn_env *env, register int no);
 
-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 char *wnn_perror ();
-extern char *wnn_perror_lang ();
+void jl_close(register struct wnn_buf *buf);
+int jl_dic_add_e(register struct wnn_env *env, char *dic_name, char *hindo_name, int rev, int prio, int rw, int hrw, char *pwd_dic, char *pwd_hindo, int (*error_handler)(void), int (*message_handler)(void));
+int jl_word_comment_set_e (register struct wnn_env *env, int dic_no, int entry, wchar *comment);
+int jl_dic_delete_e(register struct wnn_env *env, register int dic_no);
+int jl_dic_list_e (struct wnn_env *env, WNN_DIC_INFO **dicinfo);
+int jl_dic_save_all_e(struct wnn_env *env);
+int jl_dic_save_e(register struct wnn_env *env, int dic_no);
+int jl_dic_use_e(struct wnn_env *env, int dic_no, int flag);
+void jl_disconnect(register struct wnn_env *env);
+void jl_disconnect_if_server_dead(register struct wnn_env *env);
+void jl_env_set(register struct wnn_buf *buf, register struct wnn_env *env);
+int jl_fuzokugo_get_e(register struct wnn_env *env, char *fname);
+int jl_fuzokugo_set_e(struct wnn_env *env, char *fname);
+void jl_get_zenkouho_kanji (register struct wnn_buf *buf, int zen_num, w_char *area);
+int jl_hinsi_dicts_e(register struct wnn_env *env, int no, int **area);
+int jl_hinsi_list_e (register struct wnn_env *env, int dic_no, w_char *name, w_char ***area);
+int jl_hinsi_number_e (register struct wnn_env *env, w_char *name);
+int jl_isconnect_e(register struct wnn_env *env);
+int jl_kanji_len(struct wnn_buf *buf, register int bun_no, register int bun_no2);
+int jl_kill(struct wnn_buf *buf, register int bun_no, register int bun_no2);
+int jl_nobi_conv(register struct wnn_buf *buf, register int bun_no, int ichbn_len, register int bun_no2, int use_maep, int ich_shop);
+int jl_nobi_conv_e2(register struct wnn_buf *buf, struct wnn_env *env, register int bun_no, int ichbn_len, register int bun_no2, int use_maep, int ich_shop);
+int jl_param_get_e(struct wnn_env *env, struct wnn_param *para);
+int jl_param_set_e(register struct wnn_env *env, struct wnn_param *para);
+int jl_ren_conv (register struct wnn_buf *buf, register w_char *yomi, int bun_no, bun_no2, int use_maep);
+int jl_set_env_wnnrc(register struct wnn_env *env, char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void));
+int jl_set_env_wnnrc1(register struct wnn_env *env, char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void), int level);
+int jl_set_jikouho(register struct wnn_buf *buf, register int offset);
+int jl_set_jikouho_dai(register struct wnn_buf *buf, int offset);
+int jl_tan_conv (register struct wnn_buf *buf, w_char *yomi, register int bun_no, bun_no2, int use_maep, int ich_shop);
+int jl_update_hindo(register struct wnn_buf *buf, int bun_no, int bun_no2);
+int jl_word_add_e (struct wnn_env *env, int dic_no, w_char *yomi, w_char *kanji, w_char *comment, int hinsi, int init_hindo);
+int jl_word_comment_set_e (register struct wnn_env *env, int dic_no, int entry, wchar *comment);
+int jl_word_delete_e(struct wnn_env *env, int dic_no, int entry);
+int jl_word_search_by_env_e (register struct wnn_env *env, w_char *yomi, struct wnn_jdata **jdp);
+int jl_word_search_e (register struct wnn_env *env, int dic_no, w_char *yomi, struct wnn_jdata **jdp);
+int jl_word_use_e(register struct wnn_env *env, int dic_no, int entry);
+int jl_yomi_len(struct wnn_buf *buf, register int bun_no, register int bun_no2);
+int jl_zenkouho(register struct wnn_buf *buf, int bun_no, int use_maep, int uniq_level);
+int jl_zenkouho_dai(register struct wnn_buf *buf, int bun_no, int bun_no2, int use_maep, int uniq_level);
+int wnn_get_area (struct wnn_buf *buf, register int bun_no, register int bun_no2, w_char *area, int kanjip);
+char *wnn_perror(void);
+char *wnn_perror_lang(char *lang);
 
 #ifdef  CONVERT_by_STROKE
-extern void jl_get_zenkouho_yomi ();
+void jl_get_zenkouho_yomi (register struct wnn_buf *buf, int zen_num, w_char *area);
 #endif
 
 #endif  /* WNN_JLLIB_H */
--- a/Wnn/jlib/jl.c	Fri Dec 21 17:23:36 2007 +0900
+++ b/Wnn/jlib/jl.c	Sun Mar 02 04:48:21 2008 +0900
@@ -193,8 +193,7 @@
  */
 
 static struct wnn_jl_env *
-find_jl_env (env)
-     register struct wnn_env *env;
+find_jl_env (register struct wnn_env *env)
 {
   register int k;
   for (k = 0; k < MAXENVS; k++)
@@ -294,8 +293,7 @@
 }
 
 static char *
-env_name (env)
-     register struct wnn_env *env;
+env_name (register struct wnn_env *env)
 {
   register int k;
 
@@ -335,9 +333,8 @@
     }
 }
 
-static int
-delete_env (env)
-     register struct wnn_env *env;
+static int 
+delete_env (register struct wnn_env *env)
 {
   register int k;
 
@@ -366,11 +363,8 @@
 
 /* Routines to manipulate files */
 
-static int
-add_file_to_env (env, id, name)
-     struct wnn_env *env;
-     int id;
-     register char *name;
+static int 
+add_file_to_env (struct wnn_env *env, int id, register char *name)
 {
   register struct wnn_file_name_id *f, *f1;
   if ((f = (struct wnn_file_name_id *) malloc (sizeof (struct wnn_file_name_id) + strlen (name) + 1)) == NULL)
@@ -387,9 +381,7 @@
 }
 
 static char *
-find_file_name_from_id (env, id)
-     struct wnn_env *env;
-     register int id;
+find_file_name_from_id (struct wnn_env *env, register int id)
 {
   register struct wnn_file_name_id *f;
   f = find_jl_env (env)->file;
@@ -404,10 +396,8 @@
   return (NULL);
 }
 
-static int
-delete_file_from_env (env, id)
-     struct wnn_env *env;
-     register int id;
+static int 
+delete_file_from_env (struct wnn_env *env, register int id)
 {
   struct wnn_file_name_id *f;
   register struct wnn_file_name_id **prev;
@@ -434,10 +424,7 @@
  */
 
 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) ();
-     int timeout;
+jl_connect_lang (register char *env_n, register char *server_n, register char *lang, register char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void), int timeout)
 {
   register WNN_JSERVER_ID *js = NULL;
   struct wnn_env *env;
@@ -514,9 +501,8 @@
   return (env);
 }
 
-void
-jl_disconnect (env)
-     register struct wnn_env *env;
+void 
+jl_disconnect (register struct wnn_env *env)
 {
   int ret;
   wnn_errorno = 0;
@@ -535,9 +521,8 @@
     }
 }
 
-int
-jl_isconnect_e (env)
-     register struct wnn_env *env;
+int 
+jl_isconnect_e (register struct wnn_env *env)
 {
   if (js_isconnect (env) == 0)
     return (1);
@@ -546,9 +531,8 @@
 }
 
 /* JSERVER が死んだら env を disconnect して回る */
-void
-jl_disconnect_if_server_dead (env)
-     register struct wnn_env *env;
+void 
+jl_disconnect_if_server_dead (register struct wnn_env *env)
 {
   register struct wnn_env *same_env;
   int ret;
@@ -575,10 +559,7 @@
 
 
 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) ();
-     int timeout;
+jl_open_lang (char *env_n, char *server_n, char *lang, char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void), int timeout)
 {
   register int k, dmy;
   register struct wnn_buf *buf;
@@ -631,10 +612,8 @@
 }
 
 
-static int
-alloc_heap (buf, len)
-     struct wnn_buf *buf;
-     register int len;
+static int 
+alloc_heap (struct wnn_buf *buf, register int len)
 {
   char **c;
   register WNN_BUN *d;
@@ -657,9 +636,8 @@
   return (0);
 }
 
-void
-jl_close (buf)
-     register struct wnn_buf *buf;
+void 
+jl_close (register struct wnn_buf *buf)
 {
   register char *c, *next;
 
@@ -694,11 +672,7 @@
  */
 
 int
-jl_ren_conv (buf, yomi, bun_no, bun_no2, use_maep)
-     register struct wnn_buf *buf;
-     register w_char *yomi;
-     int bun_no, bun_no2;
-     int use_maep;
+jl_ren_conv (register struct wnn_buf *buf, register w_char *yomi, int bun_no, bun_no2, int use_maep)
 {
   wnn_errorno = 0;
   if (bun_no < 0)
@@ -781,11 +755,7 @@
 }
 
 int
-jl_tan_conv (buf, yomi, bun_no, bun_no2, use_maep, ich_shop)
-     register struct wnn_buf *buf;
-     w_char *yomi;
-     register int bun_no, bun_no2;
-     int use_maep, ich_shop;
+jl_tan_conv (register struct wnn_buf *buf, w_char *yomi, register int bun_no, bun_no2, int use_maep, int ich_shop)
 {
   wnn_errorno = 0;
   if (bun_no < 0)
@@ -881,11 +851,8 @@
   return (ret);
 }
 
-int
-jl_nobi_conv (buf, bun_no, ichbn_len, bun_no2, use_maep, ich_shop)
-     register struct wnn_buf *buf;
-     int ichbn_len, use_maep, ich_shop;
-     register int bun_no, bun_no2;
+int 
+jl_nobi_conv (register struct wnn_buf *buf, register int bun_no, int ichbn_len, register int bun_no2, int use_maep, int ich_shop)
 {
   w_char yomi[LENGTHCONV], ytmp;
   int ret;
@@ -948,12 +915,8 @@
   return (buf->bun_suu);
 }
 
-int
-jl_nobi_conv_e2 (buf, env, bun_no, ichbn_len, bun_no2, use_maep, ich_shop)
-     register struct wnn_buf *buf;
-     struct wnn_env *env;
-     int ichbn_len, use_maep, ich_shop;
-     register int bun_no, bun_no2;
+int 
+jl_nobi_conv_e2 (register struct wnn_buf *buf, struct wnn_env *env, register int bun_no, int ichbn_len, register int bun_no2, int use_maep, int ich_shop)
 {
   w_char yomi[LENGTHCONV], ytmp;
   int ret;
@@ -1021,10 +984,8 @@
   return (buf->bun_suu);
 }
 
-int
-jl_kill (buf, bun_no, bun_no2)
-     struct wnn_buf *buf;
-     register int bun_no, bun_no2;
+int 
+jl_kill (struct wnn_buf *buf, register int bun_no, register int bun_no2)
 {
   wnn_errorno = 0;
   if (bun_no < 0)
@@ -1040,10 +1001,8 @@
   return (buf->bun_suu);
 }
 
-int
-jl_zenkouho (buf, bun_no, use_maep, uniq_level)
-     register struct wnn_buf *buf;
-     int bun_no, use_maep, uniq_level;
+int 
+jl_zenkouho (register struct wnn_buf *buf, int bun_no, int use_maep, int uniq_level)
 {
   int cnt;
   w_char yomi[LENGTHBUNSETSU], yomi1[LENGTHBUNSETSU];
@@ -1137,10 +1096,8 @@
   return (buf->c_zenkouho);
 }
 
-int
-jl_zenkouho_dai (buf, bun_no, bun_no2, use_maep, uniq_level)
-     register struct wnn_buf *buf;
-     int bun_no, bun_no2, use_maep, uniq_level;
+int 
+jl_zenkouho_dai (register struct wnn_buf *buf, int bun_no, int bun_no2, int use_maep, int uniq_level)
 {
   int cnt;
   w_char yomi[LENGTHBUNSETSU], yomi1[LENGTHBUNSETSU];
@@ -1249,10 +1206,8 @@
   return (buf->c_zenkouho);
 }
 
-int
-jl_set_jikouho (buf, offset)
-     register struct wnn_buf *buf;
-     register int offset;
+int 
+jl_set_jikouho (register struct wnn_buf *buf, register int offset)
 {
   wnn_errorno = 0;
   if (buf->zenkouho_suu <= 0)
@@ -1271,10 +1226,8 @@
 }
 
 
-int
-jl_set_jikouho_dai (buf, offset)
-     register struct wnn_buf *buf;
-     int offset;
+int 
+jl_set_jikouho_dai (register struct wnn_buf *buf, int offset)
 {
   register int st, end, bun, k;
 
@@ -1301,10 +1254,8 @@
   return (offset);
 }
 
-int
-jl_update_hindo (buf, bun_no, bun_no2)
-     register struct wnn_buf *buf;
-     int bun_no, bun_no2;
+int 
+jl_update_hindo (register struct wnn_buf *buf, int bun_no, int bun_no2)
 {
   register int k;
   register WNN_BUN *wb;
@@ -1409,10 +1360,8 @@
   return (area);
 }
 
-static int
-dai_end (buf, bun_no)
-     register struct wnn_buf *buf;
-     register int bun_no;
+static int 
+dai_end (register struct wnn_buf *buf, register int bun_no)
 {
   bun_no++;
   for (; bun_no < buf->bun_suu && !buf->bun[bun_no]->dai_top; bun_no++);
@@ -1424,10 +1373,7 @@
 #ifdef  CONVERT_by_STROKE
 /* 筆形 (Bi Xing) */
 void
-jl_get_zenkouho_yomi (buf, zen_num, area)
-     register struct wnn_buf *buf;
-     int zen_num;
-     w_char *area;
+jl_get_zenkouho_yomi (register struct wnn_buf *buf, int zen_num, w_char *area)
 {
   register int k, end;
 
@@ -1448,10 +1394,7 @@
 #endif
 
 void
-jl_get_zenkouho_kanji (buf, zen_num, area)
-     register struct wnn_buf *buf;
-     int zen_num;
-     w_char *area;
+jl_get_zenkouho_kanji (register struct wnn_buf *buf, int zen_num, w_char *area)
 {
   register int k, end;
 
@@ -1471,11 +1414,7 @@
 }
 
 int
-wnn_get_area (buf, bun_no, bun_no2, area, kanjip)
-     struct wnn_buf *buf;
-     register int bun_no, bun_no2;
-     w_char *area;
-     int kanjip;
+wnn_get_area (struct wnn_buf *buf, register int bun_no, register int bun_no2, w_char *area, int kanjip)
 {
   register int k;
   w_char *area1 = area;
@@ -1496,15 +1435,8 @@
 #define HINDO 2
 
 /*********************************/
-int
-jl_dic_add_e (env, dic_name, hindo_name, rev, prio, rw, hrw, pwd_dic, pwd_hindo, error_handler, message_handler)
-     register struct wnn_env *env;
-     char *dic_name;
-     char *hindo_name;
-     int prio;
-     int rw, hrw, rev;
-     char *pwd_dic, *pwd_hindo;
-     int (*error_handler) (), (*message_handler) ();
+int 
+jl_dic_add_e (register struct wnn_env *env, char *dic_name, char *hindo_name, int rev, int prio, int rw, int hrw, char *pwd_dic, char *pwd_hindo, int (*error_handler)(void), int (*message_handler)(void))
 {
   char tmp[256];
   char pwd[WNN_PASSWD_LEN], hpwd[WNN_PASSWD_LEN];
@@ -1629,10 +1561,8 @@
 }
 
 
-int
-jl_dic_delete_e (env, dic_no)
-     register struct wnn_env *env;
-     register int dic_no;
+int 
+jl_dic_delete_e (register struct wnn_env *env, register int dic_no)
 {
   WNN_DIC_INFO dic;
 
@@ -1658,9 +1588,8 @@
   return (0);
 }
 
-static int
-get_pwd (pwd_dic, pwd)
-     register char *pwd_dic, *pwd;
+static int 
+get_pwd (register char *pwd_dic, register char *pwd)
 {
   FILE *fp;
 
@@ -1681,11 +1610,8 @@
   return (0);
 }
 
-static int
-create_pwd_file (env, pwd_file, error_handler, message_handler)
-     register struct wnn_env *env;
-     char *pwd_file;
-     int (*error_handler) (), (*message_handler) ();
+static int 
+create_pwd_file (register struct wnn_env *env, char *pwd_file, int (*error_handler)(void), int (*message_handler)(void))
 {
   FILE *fp;
   char gomi[256];
@@ -1719,10 +1645,8 @@
 
 
 /**     jl_fuzokugo_set **/
-int
-jl_fuzokugo_set_e (env, fname)
-     struct wnn_env *env;
-     char *fname;
+int 
+jl_fuzokugo_set_e (struct wnn_env *env, char *fname)
 {
   register int fid, orgfid;
   int ret;
@@ -1744,10 +1668,8 @@
 }
 
 /**     jl_fuzokugo_get **/
-int
-jl_fuzokugo_get_e (env, fname)
-     register struct wnn_env *env;
-     char *fname;
+int 
+jl_fuzokugo_get_e (register struct wnn_env *env, char *fname)
 {
   WNN_FILE_INFO_STRUCT file;
   int fid;
@@ -1769,10 +1691,8 @@
 }
 
 /**     jl_dic_save     **/
-int
-jl_dic_save_e (env, dic_no)
-     register struct wnn_env *env;
-     int dic_no;
+int 
+jl_dic_save_e (register struct wnn_env *env, int dic_no)
 {
   WNN_DIC_INFO dic;
   WNN_FILE_INFO_STRUCT file;
@@ -1853,9 +1773,8 @@
   return (0);
 }
 
-int
-jl_dic_save_all_e (env)
-     struct wnn_env *env;
+int 
+jl_dic_save_all_e (struct wnn_env *env)
 {
   register WNN_DIC_INFO *dic;
   register int k;
@@ -1976,9 +1895,8 @@
   *wbp = NULL;
 }
 
-static void
-free_zenkouho (buf)
-     register struct wnn_buf *buf;
+static void 
+free_zenkouho (register struct wnn_buf *buf)
 {
   register int k;
 
@@ -1993,10 +1911,8 @@
   buf->zenkouho_end_bun = -1;
 }
 
-static void
-free_bun (buf, bun_no, bun_no2)
-     struct wnn_buf *buf;
-     register int bun_no, bun_no2;
+static void 
+free_bun (struct wnn_buf *buf, register int bun_no, register int bun_no2)
 {
   register int k;
 
@@ -2006,10 +1922,8 @@
     }
 }
 
-static void
-free_down (buf, bun_no, bun_no2)
-     struct wnn_buf *buf;
-     int bun_no, bun_no2;
+static void 
+free_down (struct wnn_buf *buf, int bun_no, int bun_no2)
 {
   register WNN_BUN **wbp, **wbp1;
   int k;
@@ -2126,11 +2040,8 @@
   return (wb);
 }
 
-static void
-make_space_for (buf, zenp, bun_no, bun_no2, cnt)
-     register struct wnn_buf *buf;
-     int bun_no, bun_no2, zenp;
-     int cnt;
+static void 
+make_space_for (register struct wnn_buf *buf, int zenp, int bun_no, int bun_no2, int cnt)
 {
   switch (zenp)
     {
@@ -2142,11 +2053,8 @@
     }
 }
 
-static void
-make_space_for_bun (buf, bun_no, bun_no2, cnt)
-     register struct wnn_buf *buf;
-     int bun_no, bun_no2;
-     int cnt;
+static void 
+make_space_for_bun (register struct wnn_buf *buf, int bun_no, int bun_no2, int cnt)
 {
   int newsize;
   register int k;
@@ -2176,11 +2084,8 @@
   buf->bun_suu = newsize;
 }
 
-static void
-make_space_for_zenkouho (buf, bun_no, bun_no2, cnt)
-     struct wnn_buf *buf;
-     int bun_no, bun_no2;
-     register int cnt;
+static void 
+make_space_for_zenkouho (struct wnn_buf *buf, int bun_no, int bun_no2, register int cnt)
 {
   register int newsize;
 
@@ -2197,15 +2102,17 @@
 }
 
 
-static int
-insert_sho (buf, zenp, bun_no, bun_no2, sp, cnt, uniq_level)
-     struct wnn_buf *buf;
-     int bun_no, bun_no2;
-     register struct wnn_sho_bunsetsu *sp;
-     int cnt;
-     int zenp;                  /* daip */
-     int uniq_level;            /* uniq is only supported when bun_no = -1
+static int 
+insert_sho (
+    struct wnn_buf *buf,
+    int zenp,                  /* daip */
+    int bun_no,
+    int bun_no2,
+    register struct wnn_sho_bunsetsu *sp,
+    int cnt,
+    int uniq_level            /* uniq is only supported when bun_no = -1
                                    and zenp == ZENKOUHO */
+)
 {
   register WNN_BUN **b;
   register int k;
@@ -2249,14 +2156,8 @@
 }
 
         /* for zenkouho, assume bun_no = bun_no2 = zenkouho_suu */
-static int
-insert_dai (buf, zenp, bun_no, bun_no2, dp, dcnt, uniq_level)
-     struct wnn_buf *buf;
-     int bun_no, bun_no2;
-     struct wnn_dai_bunsetsu *dp;
-     int dcnt;
-     int zenp;
-     int uniq_level;
+static int 
+insert_dai (struct wnn_buf *buf, int zenp, int bun_no, int bun_no2, struct wnn_dai_bunsetsu *dp, int dcnt, int uniq_level)
 {
   register WNN_BUN **b, **b0;
   register int k, l, m;
@@ -2521,12 +2422,8 @@
   return (0);
 }
 
-static int
-find_same_kouho_dai (dp, buf, top, level)
-     struct wnn_dai_bunsetsu *dp;
-     struct wnn_buf *buf;
-     int top;
-     int level;
+static int 
+find_same_kouho_dai (struct wnn_dai_bunsetsu *dp, struct wnn_buf *buf, int top, int level)
 {
   int len;
   register int k, l;
@@ -2558,9 +2455,8 @@
   return (0);
 }
 
-int
-wnn_cnt_free (buf)
-     struct wnn_buf *buf;
+int 
+wnn_cnt_free (struct wnn_buf *buf)
 {
   register int n;
   register WNN_BUN *b;
@@ -2571,9 +2467,7 @@
 
 
 struct wnn_jdata *
-jl_word_info_e (env, dic_no, entry)
-     register struct wnn_env *env;
-     int dic_no, entry;
+jl_word_info_e (register struct wnn_env *env, int dic_no, int entry)
 {
   wnn_errorno = 0;
   if (js_word_info (env, dic_no, entry, &wordrb) < 0)
@@ -2582,9 +2476,7 @@
 }
 
 int
-jl_dic_list_e (env, dicinfo)
-     struct wnn_env *env;
-     WNN_DIC_INFO **dicinfo;
+jl_dic_list_e (struct wnn_env *env, WNN_DIC_INFO **dicinfo)
 {
   WNN_DIC_INFO *info;
   int cnt;
@@ -2617,9 +2509,8 @@
 }
 
 
-static int
-sort_func_ws (a, b)
-     register char *a, *b;
+static int 
+sort_func_ws (register char *a, register char *b)
 {
   int ah, bh, ai, bi, iah, ibh, iai, ibi;
   ah = ((struct wnn_jdata *) a)->hindo;
@@ -2659,11 +2550,7 @@
 }
 
 int
-jl_word_search_e (env, dic_no, yomi, jdp)
-     register struct wnn_env *env;
-     int dic_no;
-     w_char *yomi;
-     struct wnn_jdata **jdp;
+jl_word_search_e (register struct wnn_env *env, int dic_no, w_char *yomi, struct wnn_jdata **jdp)
 {
   register int cnt;
   struct wnn_jdata *jd;
@@ -2679,10 +2566,7 @@
 }
 
 int
-jl_word_search_by_env_e (env, yomi, jdp)
-     register struct wnn_env *env;
-     struct wnn_jdata **jdp;
-     w_char *yomi;
+jl_word_search_by_env_e (register struct wnn_env *env, w_char *yomi, struct wnn_jdata **jdp)
 {
   register int cnt;
   struct wnn_jdata *jd;
@@ -2732,9 +2616,8 @@
 }
 
 #ifdef JL_DEBUG
-static void
-print_jdata (jd)
-     struct wnn_jdata *jd;
+static void 
+print_jdata (struct wnn_jdata *jd)
 {
   putws (jd->kanji);
   printf ("\tDict:%d Serial:%d Hinsi:%s Hindo:%c%d ExHindo:%c%d\n",
@@ -2746,11 +2629,8 @@
 
 
 /** wnnrc を見てのパラメータの設定 */
-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) ();
+int 
+jl_set_env_wnnrc (register struct wnn_env *env, char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void))
 {
   int level = 0;
   int x;
@@ -2772,12 +2652,8 @@
   return (x);
 }
 
-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;
+int 
+jl_set_env_wnnrc1 (register struct wnn_env *env, char *wnnrc_n, int (*error_handler)(void), int (*message_handler)(void), int level)
 {
   register int num;
   char s[20][EXPAND_PATH_LENGTH];
@@ -2946,10 +2822,8 @@
   return (-1);
 }
 
-static int
-expand_expr_all (s, env)
-     struct wnn_env *env;
-     register char *s;
+static int 
+expand_expr_all (register char *s, struct wnn_env *env)
 {
   register char *c;
 
@@ -2966,20 +2840,15 @@
 
 /* copy of js.c */
 static char *
-getlogname ()
+getlogname (void)
 {
   struct passwd *getpwuid ();
   return getpwuid (getuid ())->pw_name;
 }
 
 
-static int
-expand_expr (s, env)
-     struct wnn_env *env;
- /**    ~user、@HOME、@LIBDIR @ENV @USR の展開(但し、文字列の先頭のみ)。
-   できない時は-1が
-   返り、その場合sの中身は着々とそのまんま。sの長さ<256と仮定してる。*/
-     register char *s;
+static int 
+expand_expr (register char *s, struct wnn_env *env)
 {
   char *p, *s1;
   char tmp[EXPAND_PATH_LENGTH];
@@ -3067,10 +2936,8 @@
   return (noerr ? 0 : -1);
 }
 
-static int
-change_ascii_to_int (st, dp)
-     register char *st;
-     int *dp;
+static int 
+change_ascii_to_int (register char *st, int *dp)
 {
   register int total, flag;
 
@@ -3112,10 +2979,8 @@
   return (1);
 }
 
-static int
-file_exist (env, n)
-     struct wnn_env *env;
-     char *n;
+static int 
+file_exist (struct wnn_env *env, char *n)
 {
   if (n[0] == C_LOCAL)
     {
@@ -3128,14 +2993,8 @@
     }
 }
 
-static int
-create_file (env, n, d, fid, pwd_dic, pwd_hindo, error_handler, message_handler)
-     register struct wnn_env *env;
-     char *n;
-     int d;
-     int fid;
-     char *pwd_dic, *pwd_hindo;
-     int (*error_handler) (), (*message_handler) ();
+static int 
+create_file (register struct wnn_env *env, char *n, int d, int fid, char *pwd_dic, char *pwd_hindo, int (*error_handler)(void), int (*message_handler)(void))
 {
   char pwd[WNN_PASSWD_LEN], hpwd[WNN_PASSWD_LEN];
   int rev_dict_type;
@@ -3239,11 +3098,8 @@
     }
 }
 
-static int
-make_dir_rec1 (env, path, error_handler, message_handler)
-     struct wnn_env *env;
-     register char *path;
-     int (*error_handler) (), (*message_handler) ();
+static int 
+make_dir_rec1 (struct wnn_env *env, register char *path, int (*error_handler)(void), int (*message_handler)(void))
 {
   char gomi[128];
   register char *c;
@@ -3262,11 +3118,8 @@
   return (0);
 }
 
-static int
-make_dir1 (env, dirname, error_handler, message_handler)
-     register struct wnn_env *env;
-     register char *dirname;
-     int (*error_handler) (), (*message_handler) ();
+static int 
+make_dir1 (register struct wnn_env *env, register char *dirname, int (*error_handler)(void), int (*message_handler)(void))
 {
   char gomi[128];
   if (dirname[0] == C_LOCAL)
@@ -3322,10 +3175,8 @@
 }
 
 
-static int
-call_error_handler (error_handler, c)
-     int (*error_handler) ();
-     char *c;
+static int 
+call_error_handler (int (*error_handler)(void), char *c)
 {
   register int x;
   x = error_handler (c);
@@ -3339,11 +3190,8 @@
   return (x);
 }
 
-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;
+static void 
+message_out (int (*message_handler)(void), char *format, int s1, int s2, int s3, int s4, int s5, int s6, int s7, int s8)
 {
   char buf[256];
 
@@ -3355,10 +3203,8 @@
 }
 
 
-int
-jl_yomi_len (buf, bun_no, bun_no2)
-     struct wnn_buf *buf;
-     register int bun_no, bun_no2;
+int 
+jl_yomi_len (struct wnn_buf *buf, register int bun_no, register int bun_no2)
 {
   register int len = 0;
 
@@ -3373,10 +3219,8 @@
 }
 
 
-int
-jl_kanji_len (buf, bun_no, bun_no2)
-     struct wnn_buf *buf;
-     register int bun_no, bun_no2;
+int 
+jl_kanji_len (struct wnn_buf *buf, register int bun_no, register int bun_no2)
 {
   register int len = 0;
 
@@ -3394,10 +3238,8 @@
 
 int wnn_word_use_initial_hindo = 0;
 
-int
-jl_word_use_e (env, dic_no, entry)
-     register struct wnn_env *env;
-     int dic_no, entry;
+int 
+jl_word_use_e (register struct wnn_env *env, int dic_no, int entry)
 {
   register struct wnn_jdata *jd;
 
@@ -3422,10 +3264,8 @@
   return (0);
 }
 
-void
-jl_env_set (buf, env)
-     register struct wnn_env *env;
-     register struct wnn_buf *buf;
+void 
+jl_env_set (register struct wnn_buf *buf, register struct wnn_env *env)
 {
   wnn_errorno = 0;
   buf->env = env;
@@ -3433,8 +3273,7 @@
 
 
 struct wnn_env *
-jl_env_get (buf)
-     register struct wnn_buf *buf;
+jl_env_get (register struct wnn_buf *buf)
 {
 
   wnn_errorno = 0;
@@ -3442,10 +3281,8 @@
 }
 
 
-int
-jl_param_set_e (env, para)
-     register struct wnn_env *env;
-     struct wnn_param *para;
+int 
+jl_param_set_e (register struct wnn_env *env, struct wnn_param *para)
 {
   register int x;
 
@@ -3455,10 +3292,8 @@
   return (x);
 }
 
-int
-jl_param_get_e (env, para)
-     struct wnn_env *env;
-     struct wnn_param *para;
+int 
+jl_param_get_e (struct wnn_env *env, struct wnn_param *para)
 {
   register int x;
   wnn_errorno = 0;
@@ -3468,10 +3303,8 @@
 }
 
 
-int
-jl_dic_use_e (env, dic_no, flag)
-     struct wnn_env *env;
-     int dic_no, flag;
+int 
+jl_dic_use_e (struct wnn_env *env, int dic_no, int flag)
 {
   register int x;
   wnn_errorno = 0;
@@ -3481,11 +3314,7 @@
 }
 
 int
-jl_word_add_e (env, dic_no, yomi, kanji, comment, hinsi, init_hindo)
-     struct wnn_env *env;
-     int dic_no;
-     w_char *yomi, *kanji, *comment;
-     int hinsi, init_hindo;
+jl_word_add_e (struct wnn_env *env, int dic_no, w_char *yomi, w_char *kanji, w_char *comment, int hinsi, int init_hindo)
 
 {
   register int x;
@@ -3495,11 +3324,8 @@
   return (x);
 }
 
-int
-jl_word_delete_e (env, dic_no, entry)
-     struct wnn_env *env;
-     int dic_no;
-     int entry;
+int 
+jl_word_delete_e (struct wnn_env *env, int dic_no, int entry)
 {
   register int x;
   wnn_errorno = 0;
@@ -3508,10 +3334,8 @@
   return (x);
 }
 
-static int
-file_read (env, fname)
-     struct wnn_env *env;
-     char *fname;
+static int 
+file_read (struct wnn_env *env, char *fname)
 {
   register int fid;
   if (fname[0] == C_LOCAL)
@@ -3546,19 +3370,15 @@
 }
 
 
-static int
-file_discard (env, fid)
-     register struct wnn_env *env;
-     register int fid;
+static int 
+file_discard (register struct wnn_env *env, register int fid)
 {
   delete_file_from_env (env, fid);
   return (js_file_discard (env, fid));
 }
 
 int
-jl_hinsi_number_e (env, name)
-     register struct wnn_env *env;
-     w_char *name;
+jl_hinsi_number_e (register struct wnn_env *env, w_char *name)
 {
   register int x;
   wnn_errorno = 0;
@@ -3568,9 +3388,7 @@
 }
 
 w_char *
-jl_hinsi_name_e (env, no)
-     register struct wnn_env *env;
-     register int no;
+jl_hinsi_name_e (register struct wnn_env *env, register int no)
 {
   wnn_errorno = 0;
   if (js_hinsi_name (env->js_id, no, &rb) == -1)
@@ -3579,11 +3397,7 @@
 }
 
 int
-jl_hinsi_list_e (env, dic_no, name, area)
-     register struct wnn_env *env;
-     int dic_no;
-     w_char *name;
-     w_char ***area;
+jl_hinsi_list_e (register struct wnn_env *env, int dic_no, w_char *name, w_char ***area)
 {
   int x;
   wnn_errorno = 0;
@@ -3593,11 +3407,8 @@
   return (x);
 }
 
-int
-jl_hinsi_dicts_e (env, no, area)
-     register struct wnn_env *env;
-     int no;
-     int **area;
+int 
+jl_hinsi_dicts_e (register struct wnn_env *env, int no, int **area)
 {
   int x;
   wnn_errorno = 0;
@@ -3609,10 +3420,7 @@
 
 
 int
-jl_word_comment_set_e (env, dic_no, entry, comment)
-     register struct wnn_env *env;
-     int dic_no, entry;
-     w_char *comment;
+jl_word_comment_set_e (register struct wnn_env *env, int dic_no, int entry, wchar *comment)
 {
   register int x;
   wnn_errorno = 0;