SHA256
1
0
forked from pool/fwnn
fwnn/FreeWnn-prototypes_3.patch
Fuminobu Takeyama 9a14d50062 Accepting request 195772 from home:Mitsutoshi:branches:M17N
- 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
2013-08-21 14:26:34 +00:00

3826 lines
127 KiB
Diff
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.

From: Mitsutoshi NAKANO <bkbin005@rinku.zaq.ne.jp>
Date: 2013-08-17 14:07:45 +0900
Subject: input: prototype declarations for reducing compilation warnings
References: http://lists.opensuse.org/opensuse-ja/2013-08/msg00035.html
Upstream: sent
1. prototype declarations for reducing compilation warnings
2. I found a bug in make_hinsi_list() at Wnn/jserver/hinsi_list.c,
then fixed it .
---
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/conv/cvt_key.c FreeWnn-1.1.1-a022.new/Wnn/conv/cvt_key.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/conv/cvt_key.c 2002-05-13 07:47:03.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/conv/cvt_key.c 2013-08-15 08:07:45.978839734 +0900
@@ -215,7 +215,7 @@
/** コード変換を伴うキー入力関数 */
int
keyin1 (get_ch, in_buf)
- int (*get_ch) (); /* getchar() と同様の関数 */
+ int (*get_ch) (void); /* getchar() と同様の関数 */
char *in_buf;
{
int ret;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/conv/cvt_read.c FreeWnn-1.1.1-a022.new/Wnn/conv/cvt_read.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/conv/cvt_read.c 2006-03-05 04:01:45.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/conv/cvt_read.c 2013-08-14 15:44:50.679468396 +0900
@@ -138,6 +138,8 @@
#include "wnn_os.h"
#include "cvt_head.h"
+#include "conv.h"
+
#define ENTRY_LEN 10 /* コンバート表のエントリ名の最大長 */
/*
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/bdic.c FreeWnn-1.1.1-a022.new/Wnn/etc/bdic.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/bdic.c 2005-06-13 02:14:22.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/bdic.c 2013-08-13 15:30:47.558466717 +0900
@@ -69,6 +69,8 @@
#include "wnn_os.h"
#include "wnn_string.h"
+#include "etc.h"
+
#ifdef JSERVER
# ifndef BDIC_WRITE_CHECK
# define vputc(X, pt) ((pt)? putc((X), (pt)):xputc_cur(X))
@@ -88,8 +90,8 @@
#endif /* !JSERVER */
#ifndef min
-# define min(a, b) ((a > b)? b:a)
-# define max(a, b) ((a < b)? b:a)
+# define min(a, b) (((a) > (b))? (b) : (a))
+# define max(a, b) (((a) < (b))? (b) : (a))
#endif
/* XXX: function prototypes to be moved to some header file. */
@@ -142,7 +144,7 @@
#ifndef JS
void Get_knj2 (UCHAR* kptr, int kanji2, w_char* kouho, w_char* yomi, w_char* comment);
-void get_kanji_str (UCHAR* kptr, w_char* kanji, w_char* yomi, w_char* comment);
+
void Get_kanji_str_r (UCHAR* kptr, w_char** tmpk, w_char** tmpy, w_char** tmpc);
UCHAR kanjiaddr (UCHAR* d0, w_char* kanji, w_char* yomi, w_char* comment);
#endif /* !JS */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/dic_atojis.c FreeWnn-1.1.1-a022.new/Wnn/etc/dic_atojis.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/dic_atojis.c 2002-07-14 13:26:57.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/dic_atojis.c 2013-08-13 07:41:09.616520023 +0900
@@ -47,6 +47,8 @@
#include "wnn_os.h"
#include "wnn_string.h"
+#include "etc.h"
+
static int keta_4;
static w_char _tatojis[] = {
@@ -417,8 +419,6 @@
w_char *kanji, *comment, *yomi, *oy;
int oyl;
{
- extern void get_kanji_str ();
-
get_kanji_str (kptr, kanji, yomi, comment);
if (kanji)
{
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/gethinsi.c FreeWnn-1.1.1-a022.new/Wnn/etc/gethinsi.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/gethinsi.c 2002-03-24 10:25:13.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/gethinsi.c 2013-08-13 07:50:40.045772351 +0900
@@ -48,6 +48,7 @@
#include "hinsi_file.h"
#include "wnn_os.h"
#include "wnn_string.h"
+#include "etc.h"
/*
wnn_loadhinsi(NULL) 品詞の情報を読み込む
@@ -89,8 +90,7 @@
extern int wnn_errorno;
#ifdef JSERVER
-/* must be #include "de_header.h" ? */
-extern void log_debug ();
+#include "de_header.h"
#define error1 log_debug
#endif
@@ -298,7 +298,6 @@
int h;
unsigned short *c;
char tmp[256];
- extern int wnn_find_hinsi_by_name ();
if (fname == NULL)
{
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/hindo.c FreeWnn-1.1.1-a022.new/Wnn/etc/hindo.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/hindo.c 2001-06-15 03:15:55.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/hindo.c 2013-08-12 14:24:20.889251190 +0900
@@ -56,6 +56,9 @@
9/1/89 H.T.
*/
+#include "etc.h"
+
+
/** 整数引数の平方根関数。但し引数<0の時のエラーチェックはなし0を返す。*/
static int
isqrt (i)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/msg.c FreeWnn-1.1.1-a022.new/Wnn/etc/msg.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/msg.c 2013-08-15 14:44:15.323965119 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/msg.c 2013-08-12 11:07:54.192828534 +0900
@@ -70,10 +70,10 @@
static char *
getlang (lang)
- char *lang;
+ const char *lang;
{
static char tmp[32];
- char *p;
+ const char *p;
int i;
if (lang == NULL || *lang == '\0')
@@ -258,7 +258,7 @@
msg_open (name, nlspath, lang)
char *name;
char *nlspath;
- char *lang;
+ const char *lang;
{
struct msg_cat *cd;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/pwd.c FreeWnn-1.1.1-a022.new/Wnn/etc/pwd.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/pwd.c 2004-07-13 02:53:02.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/pwd.c 2013-08-15 20:18:34.086149932 +0900
@@ -46,6 +46,8 @@
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
+#include <time.h>
+
#include "commonhd.h"
#include "jslib.h"
#include "wnn_os.h"
@@ -75,7 +77,7 @@
bzero (encd, WNN_PASSWD_LEN);
return;
}
- x = time (NULL);
+ x = time ((time_t *) NULL);
xx[0] = x & 0x3f;
xx[1] = (x & 0x3f00) >> 8;
xx[2] = '\0'; /* for MD5 (that requires terminator) */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/revdic.c FreeWnn-1.1.1-a022.new/Wnn/etc/revdic.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/revdic.c 2004-05-22 01:39:32.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/revdic.c 2013-08-13 08:15:05.777681844 +0900
@@ -35,10 +35,18 @@
#include "jh.h"
#include "jdata.h"
+#include "etc.h"
+
+void rev_w_char (w_char *, int);
+int rev_ud (struct JT *, int);
+int rev_rd (struct JT *, int);
+int rev_sd (struct JT *, int);
+void rev_common (struct JT *, int);
+
#ifndef min
-#define min(a, b) ((a > b)? b:a)
-#define max(a, b) ((a < b)? b:a)
+#define min(a, b) (((a) > (b))? (b) : (a))
+#define max(a, b) (((a) < (b))? (b) : (a))
#endif
@@ -150,8 +158,8 @@
#define match_machine(x) (*(unsigned short *)(x) & 0xff)
-void travel_next_nodes ();
-void rev_sd_node ();
+void travel_next_nodes (UCHAR *, UCHAR *, int);
+void rev_sd_node (UCHAR *, UCHAR *, int);
void
rev_sd_hontai0 (hopter, hostart, match)
@@ -321,8 +329,6 @@
}
}
-void rev_w_char ();
-
void
rev_kanji (kpter, maxk, match)
UCHAR *kpter;
@@ -361,7 +367,6 @@
struct JT *jtl;
int match;
{
- extern int rev_ud (), rev_rd (), rev_sd ();
int syurui = jtl->syurui;
syurui = jtl->syurui & 0xff;
@@ -384,8 +389,6 @@
return (0);
}
-void rev_common ();
-
int
rev_ud (jtl, match)
struct JT *jtl;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/sstrings.c FreeWnn-1.1.1-a022.new/Wnn/etc/sstrings.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/sstrings.c 2002-07-14 13:26:57.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/sstrings.c 2013-08-12 12:00:23.887634044 +0900
@@ -45,8 +45,7 @@
#include "wnn_os.h"
#include "wnn_string.h"
-extern int eeuc_to_ieuc ();
-extern int ieuc_to_eeuc ();
+#include "etc.h"
int
wnn_sStrcpy (c, w)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/xutoj.c FreeWnn-1.1.1-a022.new/Wnn/etc/xutoj.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/xutoj.c 2002-03-24 10:25:13.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/xutoj.c 2013-08-15 21:01:52.437163627 +0900
@@ -42,10 +42,16 @@
# include <strings.h>
#endif /* STDC_HEADERS */
+#if !STDC_HEADERS
+extern char *getenv (const char *);
+#endif /* !STDC_HEADERS */
+
#include "commonhd.h"
#include "wnn_config.h"
#include "wnn_os.h"
+#include "etc.h"
+
#define ECNS_IS_UCNS 1 /* The trust CNS is CNS11643 based on ISO2022,
but the CNS is binded on EUC */
@@ -472,11 +478,10 @@
char *
get_cswidth_name (lang)
- register char *lang;
+ const char *lang;
{
register cswidth_name_struct *p;
register char *name;
- extern char *getenv ();
if (!lang || !*lang)
{
@@ -852,7 +857,7 @@
#ifdef JIS7
/* 内部 U-jis を 7bit jis コードに変換します
文字列の長さを返します */
-extern int
+int
iujis_to_jis (jis, iujis, iusiz)
unsigned char *jis; /* jisコードになったものをおくbuf */
w_char *iujis; /* iujisコードのものをおいてくるbuf */
@@ -894,7 +899,7 @@
/* 内部 U-jis を 8bit jis コードに変換します
文字列の長さを返します */
-extern int
+int
iujis_to_jis8 (jis, iujis, iusiz)
unsigned char *jis; /* jisコードになったものをおくbuf */
w_char *iujis; /* iujisコードのものをおいてくるbuf */
@@ -1126,7 +1131,7 @@
/* 外部 U-jis を S-jis コードに変換します
文字列の長さを返します */
-extern int
+int
eujis_to_sjis (sjis, eujis, eusiz)
unsigned char *sjis; /* sjisコードになったものをおくbuf */
unsigned char *eujis; /* eujisコードのものをおいてくるbuf */
@@ -2220,7 +2225,6 @@
}
static int oks_mode = ASCII; /* 出力時のKSCコードのモード */
-extern int euksc_to_iuksc ();
static void
ksc_change_mode (mode, new_mode)
@@ -2283,7 +2287,7 @@
/* 外部 U-ksc を ksc コードに変換します */
-extern int
+int
euksc_to_ksc (ksc, euksc, eusiz)
unsigned char *ksc, *euksc;
int eusiz;
@@ -2341,7 +2345,7 @@
}
/* 内部 U-ksc を 外部 U-ksc コードに変換します */
-extern int
+int
iuksc_to_euksc (euksc, iuksc, iusiz)
unsigned char *euksc;
w_char *iuksc;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/yincoding.c FreeWnn-1.1.1-a022.new/Wnn/etc/yincoding.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/etc/yincoding.c 2005-04-11 00:26:37.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/etc/yincoding.c 2013-08-15 11:27:09.809902791 +0900
@@ -50,6 +50,8 @@
#include "jh.h"
#include "wnn_string.h"
+#include "etc.h"
+
extern char *py_table[];
extern char *zy_table[];
unsigned char last_mark; /* Using to reme previous auto_state() */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/conv.h FreeWnn-1.1.1-a022.new/Wnn/include/conv.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/conv.h 1970-01-01 09:00:00.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/conv.h 2013-08-14 19:51:33.191546415 +0900
@@ -0,0 +1,15 @@
+#ifndef FRWNN_CONV_H
+#define FRWNN_CONV_H 1
+
+#if __STDC__
+#define FRWNN_PARAMS(paramlist) paramlist
+#else
+#define FRWNN_PARAMS(paramlist) ()
+#endif /* __STDC__ */
+
+extern int convert_key_setup FRWNN_PARAMS((char *, int));
+#ifdef TERMCAP
+extern int convert_getterm FRWNN_PARAMS((char *termname, int flg));
+#endif /* TERMCAP */
+
+#endif /* FRWNN_CONV_H */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/etc.h FreeWnn-1.1.1-a022.new/Wnn/include/etc.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/etc.h 1970-01-01 09:00:00.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/etc.h 2013-08-15 23:50:42.008217016 +0900
@@ -0,0 +1,185 @@
+#ifndef FRWNN_ETC_H
+#define FRWNN_ETC_H 1
+
+#include "commonhd.h"
+#include "jlib.h"
+#include "jdata.h"
+#include "rk_spclval.h"
+
+
+#if __STDC__
+#define FRWNN_PARAMS(paramlist) paramlist
+#else
+#define FRWNN_PARAMS(paramlist) ()
+#endif /* __STDC__ */
+
+/* gethinsi.c */
+extern int wnn_find_hinsi_by_name FRWNN_PARAMS((register char *c));
+
+
+/* xutoj.c */
+extern int through FRWNN_PARAMS((char *, char *, int));
+extern int flush_designate FRWNN_PARAMS((w_char *));
+extern int extc_to_intc FRWNN_PARAMS((w_char *, unsigned char *, int));
+extern int ibit8_to_ebit8 FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern unsigned int create_cswidth FRWNN_PARAMS((char *s));
+extern void set_cswidth FRWNN_PARAMS((register unsigned int));
+extern char *get_cswidth_name FRWNN_PARAMS((const char *));
+extern int get_cswidth FRWNN_PARAMS((int));
+extern int get_cswidth_by_char FRWNN_PARAMS((register unsigned char));
+extern int get_cs_mask FRWNN_PARAMS((int));
+extern int columnlen FRWNN_PARAMS((unsigned char *));
+extern int columnlen_w FRWNN_PARAMS((w_char *));
+extern int ieuc_to_eeuc FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int eeuc_to_ieuc FRWNN_PARAMS((w_char *, unsigned char *, register int));
+#ifdef nodef
+extern void wnn_delete_ss2 FRWNN_PARAMS((register unsigned int *, register int n));
+extern int wnn_byte_count FRWNN_PARAMS((register int));
+#endif /* nodef */
+extern void wnn_delete_w_ss2 FRWNN_PARAMS((register w_char *, register int));
+#ifdef JAPANESE
+#ifdef JIS7
+extern int iujis_to_jis FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int eujis_to_jis FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int sjis_to_jis FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+#endif /* JIS7 */
+extern int eujis_to_jis8 FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int iujis_to_jis8 FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int jis_to_eujis FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int eujis_to_sjis FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int iujis_to_sjis FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int sjis_to_iujis FRWNN_PARAMS((w_char *, unsigned char *, int));
+extern int sjis_to_eujis FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int sjis_to_jis8 FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int jis_to_iujis FRWNN_PARAMS((w_char *, unsigned char *, int));
+extern int jis_to_sjis FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int eujis_to_iujis FRWNN_PARAMS((w_char *, unsigned char *, int));
+#endif /* JAPANESE */
+#ifdef CHINESE
+extern int ecns_to_icns FRWNN_PARAMS((w_char *, unsigned char *, int));
+extern int icns_to_ecns FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int icns_to_big5 FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int ecns_to_big5 FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int big5_to_icns FRWNN_PARAMS((w_char *, unsigned char *, int));
+extern int big5_to_ecns FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int iugb_to_eugb FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int eugb_to_iugb FRWNN_PARAMS((w_char *, unsigned char *, int));
+#endif /* CHINESE */
+#ifdef KOREAN
+extern int iuksc_to_ksc FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int euksc_to_ksc FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int iuksc_to_euksc FRWNN_PARAMS((unsigned char *, w_char *, int));
+extern int ksc_to_euksc FRWNN_PARAMS((unsigned char *, unsigned char *, int));
+extern int ksc_to_iuksc FRWNN_PARAMS((w_char *, unsigned char *, int));
+extern int euksc_to_iuksc FRWNN_PARAMS((w_char *, unsigned char *, int));
+#endif /* KOREAN */
+
+/* hindo.c */
+extern int asshuku FRWNN_PARAMS((int));
+extern int motoni2 FRWNN_PARAMS((int));
+
+/* gethinsi.c */
+extern int wnn_loadhinsi FRWNN_PARAMS((unsigned char *fname));
+#ifdef JSERVER
+extern w_char *wnn_hinsi_name FRWNN_PARAMS((int));
+extern int wnn_hinsi_number FRWNN_PARAMS((w_char *));
+extern int wnn_hinsi_list FRWNN_PARAMS((w_char *, w_char **, struct wnn_hinsi_node *, int));
+extern int wnn_has_hinsi FRWNN_PARAMS((struct wnn_hinsi_node *, int, w_char *));
+#endif /* JSERVER */
+extern int wnn_find_hinsi_by_name FRWNN_PARAMS((register char *));
+extern char *wnn_get_hinsi_name FRWNN_PARAMS((int));
+#ifdef JSERVER
+extern int wnn_get_fukugou_component_body FRWNN_PARAMS((register int, register unsigned short **));
+#endif /* JSERVER */
+extern int wnn_get_fukugou_component FRWNN_PARAMS((register int, register unsigned short **));
+
+/* dic_atojis.c */
+extern void Get_kanji FRWNN_PARAMS((UCHAR *, w_char *, int, w_char *, w_char *, w_char *));
+extern void Get_knj1 FRWNN_PARAMS((UCHAR *, w_char *, int, int, w_char *, w_char *, w_char *));
+extern int substr FRWNN_PARAMS((char *, w_char *));
+extern w_char *kanji_giji_str FRWNN_PARAMS((w_char *, int, w_char *, w_char *));
+extern void kanji_esc_str FRWNN_PARAMS((w_char *, w_char *, int oyl));
+
+
+/* bdic.c */
+#ifndef JS
+extern int put_n_EU_str FRWNN_PARAMS((FILE* ofpter, w_char* c, int n));
+extern int put_null FRWNN_PARAMS((FILE* ofpter, int n));
+extern int put_nstring FRWNN_PARAMS((FILE* ofpter, char* c, int n));
+extern int put_n_EU_str FRWNN_PARAMS((FILE* ofpter, w_char* c, int n));
+extern int put_short FRWNN_PARAMS((FILE* ofpter, int i));
+extern int put_int FRWNN_PARAMS((FILE* ofpter, int i));
+extern int get_null FRWNN_PARAMS((FILE* ifpter, int n));
+extern int get_nstring FRWNN_PARAMS((FILE* ifpter, int n, char* st));
+extern int get_int FRWNN_PARAMS((int* ip, FILE* ifpter));
+#ifdef BDIC_WRITE_CHECK
+extern void check_backup FRWNN_PARAMS((char* n));
+extern void delete_tmp_file FRWNN_PARAMS((char* n));
+extern char* make_backup_file FRWNN_PARAMS((char* n));
+extern char* make_tmp_file FRWNN_PARAMS((char* n, int copy, FILE** ret_fp));
+extern void move_tmp_to_org FRWNN_PARAMS((char* tmp_name, char* org_name, int copy));
+#endif /* BDIC_WRITE_CHECK */
+
+extern int create_file_header FRWNN_PARAMS((FILE* ofpter, int file_type, char* file_passwd));
+extern int output_file_header FRWNN_PARAMS((FILE* ofpter, struct wnn_file_head* hp));
+extern int input_file_header FRWNN_PARAMS((FILE* ifpter, struct wnn_file_head* hp));
+extern int output_file_uniq FRWNN_PARAMS((struct wnn_file_uniq* funiq, FILE* ofpter));
+extern int input_file_uniq FRWNN_PARAMS((struct wnn_file_uniq* funiq, FILE* ifpter));
+extern int check_inode FRWNN_PARAMS((FILE* f, struct wnn_file_head* fh));
+extern int change_file_uniq FRWNN_PARAMS((struct wnn_file_head* fh, char* n));
+extern int change_file_uniq1 FRWNN_PARAMS((
+ FILE* ofpter, int file_type, char* file_passwd,
+ struct wnn_file_uniq* file_uniq));
+
+#ifdef JSERVER
+int f_uniq_cmp FRWNN_PARAMS((struct wnn_file_uniq *a, struct wnn_file_uniq* b));
+#endif /* JSERVER */
+
+#if !defined(JSERVER)
+void vputs FRWNN_PARAMS((char* c, FILE* fp));
+int vputws FRWNN_PARAMS((w_char* w, FILE* fp));
+int put_yomi_str FRWNN_PARAMS((w_char* yomi, FILE* ofpter));
+#endif /* !JSERVER */
+
+void Get_knj2 FRWNN_PARAMS((UCHAR* kptr, int kanji2, w_char* kouho, w_char* yomi, w_char* comment));
+void Get_kanji_str_r FRWNN_PARAMS((UCHAR* kptr, w_char** tmpk, w_char** tmpy, w_char** tmpc));
+UCHAR kanjiaddr FRWNN_PARAMS((UCHAR* d0, w_char* kanji, w_char* yomi, w_char* comment));
+extern int create_null_dic FRWNN_PARAMS((
+ char* fn, w_char* comm, char* passwd, char* hpasswd, int which));
+extern int create_hindo_file FRWNN_PARAMS((
+ struct wnn_file_uniq* funiq,
+ char* fn, w_char* comm, char* passwd, int serial));
+
+/* XXX: input_* are not used in JSlib */
+extern int input_header_jt FRWNN_PARAMS((FILE* ifpter, struct JT* jt1));
+extern int output_header_jt FRWNN_PARAMS((FILE* ofpter, struct JT* jt1));
+extern int input_header_hjt FRWNN_PARAMS((FILE* ifpter, struct HJT* hjt1));
+extern int output_header_hjt FRWNN_PARAMS((FILE* ofpter, struct HJT* hjt1));
+
+#if !defined(JSERVER)
+/* Only used in JUTIL */
+void Print_entry FRWNN_PARAMS((
+ w_char* yomi, w_char* kstr, w_char* cstr,
+ int hindo, int ima, int hinsi, int serial,
+ FILE* ofpter, int esc_exp));
+#endif /* !JSERVER */
+
+#endif /* ndef JS */
+extern void udytoS FRWNN_PARAMS((w_char* yomi, int tnum, char* hostart, struct uind1 * tary));
+extern void get_kanji_str FRWNN_PARAMS((UCHAR*, w_char*, w_char*, w_char*));
+
+/* revdic.c */
+extern int little_endian ();
+extern int revdic FRWNN_PARAMS((struct JT *, int));
+
+/* yincoding.c */
+extern int cwnn_pzy_yincod FRWNN_PARAMS((letter *, letter *, int));
+#ifdef CHINESE
+extern void cwnn_zy_str_analysis FRWNN_PARAMS((register char *, register char *, w_char *, w_char *));
+extern void cwnn_py_str_analysis FRWNN_PARAMS((register char *, register char *, register w_char *, register w_char *));
+#endif /* CHINESE */
+#ifdef CONVERT_with_SiSheng
+extern int cwnn_yincod_pzy_str FRWNN_PARAMS((register w_char *, register w_char *, int, int));
+#endif /* CONVERT_with_SiSheng */
+
+#endif /* FRWNN_ETC_H */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jdata.h FreeWnn-1.1.1-a022.new/Wnn/include/jdata.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jdata.h 2005-04-11 00:26:37.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/jdata.h 2013-08-12 19:51:54.412492124 +0900
@@ -33,6 +33,8 @@
#ifndef WNN_JDATA_H
#define WNN_JDATA_H
+#include "jslib.h"
+
#ifndef JS
struct jdata
{
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jlib_hide.h FreeWnn-1.1.1-a022.new/Wnn/include/jlib_hide.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jlib_hide.h 1970-01-01 09:00:00.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/jlib_hide.h 2013-08-13 11:09:17.978796990 +0900
@@ -0,0 +1,19 @@
+#ifndef FRWNN_JLIB_HIDE_H
+#define FRWNN_JLIB_HIDE_H 1
+
+#include "jslib.h"
+
+/* defined in jlib/js.c */
+#if DEBUG
+extern void xerror FRWNN_PARAMS((char *));
+extern void dmp FRWNN_PARAMS((char *, int));
+#endif /* DEBUG */
+
+
+#ifdef nodef
+extern void js_set_lang FRWNN_PARAMS((struct wnn_env *, register char *));
+#endif /* nodef */
+
+extern char *_wnn_get_machine_of_serv_defs FRWNN_PARAMS((const char *));
+
+#endif /* FRWNN_JLIB_HIDE_H */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jllib.h FreeWnn-1.1.1-a022.new/Wnn/include/jllib.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jllib.h 2013-08-15 14:44:15.359965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/jllib.h 2013-08-11 22:53:36.961715350 +0900
@@ -254,7 +254,7 @@
/* Note: FRWNN_PARAMS is defined in jslib.h . */
extern struct wnn_buf *jl_open_lang FRWNN_PARAMS((const char *, const char *, const char *, const char *, int (*) (const char *), int (*) (const char *), int));
-extern struct wnn_env *jl_connect_lang FRWNN_PARAMS((register const char *, register const char *, register const char *, register const char *, int (*) (const char *), int (*) (const char *), int timeout));
+extern struct wnn_env *jl_connect_lang FRWNN_PARAMS((const register char *, const register char *, const register char *, const register char *, int (*) (const char *), int (*) (const char *), int timeout));
extern struct wnn_env *jl_env_get FRWNN_PARAMS((register struct wnn_buf *buf));
extern struct wnn_jdata *jl_word_info_e FRWNN_PARAMS((register struct wnn_env *env, int dic_no, int entry));
extern w_char *jl_hinsi_name_e FRWNN_PARAMS((register struct wnn_env *env, register int no));
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jslib.h FreeWnn-1.1.1-a022.new/Wnn/include/jslib.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jslib.h 2013-08-15 14:44:15.359965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/jslib.h 2013-08-11 23:22:11.327609490 +0900
@@ -416,10 +416,10 @@
#define js_connect(server,env_name) js_connect_lang((server), (env_name), "ja")
-extern WNN_JSERVER_ID *js_open_lang FRWNN_PARAMS((register char *server, register char *lang, register int timeout));
+extern WNN_JSERVER_ID *js_open_lang FRWNN_PARAMS((const register char *server, const register char *lang, register int timeout));
extern int js_close FRWNN_PARAMS((WNN_JSERVER_ID *server));
/* extern WNN_JSERVER_ID *js_change_current_jserver (); */ /* Not exist? */
-extern struct wnn_env *js_connect_lang FRWNN_PARAMS((WNN_JSERVER_ID *server, register char *env_name, char *lang));
+extern struct wnn_env *js_connect_lang FRWNN_PARAMS((WNN_JSERVER_ID *server, const register char *env_name, const char *lang));
extern int js_disconnect FRWNN_PARAMS((register struct wnn_env *env));
extern int js_env_list FRWNN_PARAMS((WNN_JSERVER_ID *server, struct wnn_ret_buf *ret));
extern int js_param_set FRWNN_PARAMS((struct wnn_env *env, register struct wnn_param *para));
@@ -435,7 +435,7 @@
extern int js_dic_list FRWNN_PARAMS((struct wnn_env *env, struct wnn_ret_buf *ret));
extern int js_dic_list_all FRWNN_PARAMS((WNN_JSERVER_ID *server, struct wnn_ret_buf *ret));
extern int js_dic_use FRWNN_PARAMS((struct wnn_env *env, int dic_no, int flag));
-extern int js_env_exist FRWNN_PARAMS((register WNN_JSERVER_ID *server, register char *env_name));
+extern int js_env_exist FRWNN_PARAMS((register WNN_JSERVER_ID *server, const register char *env_name));
extern int js_env_sticky FRWNN_PARAMS((register struct wnn_env *env));
extern int js_env_un_sticky FRWNN_PARAMS((register struct wnn_env *env));
extern int js_file_comment_set FRWNN_PARAMS((struct wnn_env *env, int fid, w_char *comment));
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jutil.h FreeWnn-1.1.1-a022.new/Wnn/include/jutil.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/jutil.h 1970-01-01 09:00:00.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/jutil.h 2013-08-13 20:02:09.558498371 +0900
@@ -0,0 +1,81 @@
+#ifndef FRWNN_JUTIL_H
+#define FRWNN_JUTIL_H 1
+
+#include <stdio.h>
+
+#if __STDC__
+#define FRWNN_PARAMS(paramlist) paramlist
+#else
+#define FRWNN_PARAMS(paramlist) ()
+#endif /* __STDC__ */
+
+/* -- macro -- */
+/* ujisf.c */
+#define WNN_HINSI_LEN 4096
+
+/* -- extern -- */
+/* wdreg.c */
+extern struct JT jt;
+/* ujisf.c */
+extern w_char file_comment[WNN_COMMENT_LEN];
+extern w_char hinsi_list[WNN_HINSI_LEN];
+extern struct je **jeary;
+extern int wnnerror;
+extern int lc;
+#ifdef CHINESE
+extern int pzy_flag;
+#endif /* CHINESE */
+
+/* atod.c */
+
+/* -- function -- */
+/* ujisf.c */
+extern int init_heap FRWNN_PARAMS((int, int, int, int, FILE *));
+extern void exit1 ();
+extern int get_line FRWNN_PARAMS((register char *));
+extern void unget_line FRWNN_PARAMS((char *));
+extern char *get_string FRWNN_PARAMS((register char *, char *));
+extern void bad_line FRWNN_PARAMS((char *));
+extern void error_no_heap FRWNN_PARAMS((void));
+extern int w_stradd FRWNN_PARAMS((register w_char *, register w_char **));
+
+#ifdef CHINESE
+extern void ujis_header FRWNN_PARAMS((int *));
+#else
+extern void ujis_header FRWNN_PARAMS((void));
+#endif /* CHINESE */
+
+extern void read_ujis FRWNN_PARAMS((int, int, int));
+extern void reverse_yomi FRWNN_PARAMS((void));
+extern void print_je FRWNN_PARAMS((register struct je *, register FILE *, int, int));
+#ifdef nodef
+extern kprint FRWNN_PARAMS((register FILE *, register w_char *));
+#endif /* nodef */
+extern void output_ujis FRWNN_PARAMS((register FILE *, int, int));
+extern int init_heap FRWNN_PARAMS((int, int, int, int, FILE *));
+extern void init_jeary FRWNN_PARAMS((void));
+extern void exit1 FRWNN_PARAMS((void));
+extern int sort_func_je FRWNN_PARAMS((char *, char *));
+extern int sort_func_je_kanji FRWNN_PARAMS((char *, char *));
+extern int sort_func FRWNN_PARAMS((register char *, register char *, int));
+extern void sort FRWNN_PARAMS((void));
+extern void sort_if_not_sorted FRWNN_PARAMS((void));
+extern void sort_kanji FRWNN_PARAMS((void));
+extern void uniq_je FRWNN_PARAMS((int (*) ()));
+#ifdef nodef
+extern int make_kanji_str FRWNN_PARAMS((register UCHAR *, register UCHAR *));
+#endif /* nodef */
+extern int Sorted FRWNN_PARAMS((register char *, register int, int, int (*) ()));
+extern int is_katakana FRWNN_PARAMS((register char *, register char *));
+
+/* dic_head.c */
+/* extern int output_header FRWNN_PARAMS((FILE *, struct JT *, struct wnn_file_head *)); */
+extern int input_header FRWNN_PARAMS((FILE *, struct JT *, struct wnn_file_head *));
+extern int input_hindo_header FRWNN_PARAMS((FILE *, struct HJT *, struct wnn_file_head *));
+
+/* atod.c */
+extern void upd_kanjicount FRWNN_PARAMS((int));
+extern void output_dic_data FRWNN_PARAMS((void));
+
+
+#endif /* FRWNN_JUTIL_H */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/msg.h FreeWnn-1.1.1-a022.new/Wnn/include/msg.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/msg.h 2013-08-15 14:44:15.374965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/msg.h 2013-08-12 10:24:11.899296971 +0900
@@ -70,7 +70,7 @@
#define FRWNN_PARAMS(paramlist) ()
#endif
-extern struct msg_cat *msg_open FRWNN_PARAMS((char *, char *, char *));
+extern struct msg_cat *msg_open FRWNN_PARAMS((char *, char *, const char *));
extern char *msg_get FRWNN_PARAMS((struct msg_cat *, int id, char *, register char *lang));
extern void msg_close FRWNN_PARAMS((register struct msg_cat *));
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/include/romkan.h FreeWnn-1.1.1-a022.new/Wnn/include/romkan.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/include/romkan.h 1970-01-01 09:00:00.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/include/romkan.h 2013-08-14 15:24:52.534462081 +0900
@@ -0,0 +1,13 @@
+#ifndef FRWNN_ROMKAN_H
+#define FRWNN_ROMKAN_H 1
+
+#if __STDC__
+#define FRWNN_PARAMS(paramlist) paramlist
+#else
+#define FRWNN_PARAMS(paramlist) ()
+#endif /* __STDC__ */
+
+
+extern void romkan_set_lang FRWNN_PARAMS((char *lang));
+
+#endif /* FRWNN_ROMKAN_H */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jlib/jl.c FreeWnn-1.1.1-a022.new/Wnn/jlib/jl.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jlib/jl.c 2013-08-15 14:44:15.360965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jlib/jl.c 2013-08-12 10:10:30.689347679 +0900
@@ -67,6 +67,9 @@
#include "jd_sock.h"
#include "jslib.h"
#include "jllib.h"
+
+#include "jlib_hide.h"
+
#include "msg.h"
#include "wnn_string.h"
#include "wnn_os.h"
@@ -130,42 +133,43 @@
int confirm_state;
-static void add_down_bnst ();
-static int alloc_heap ();
+static void add_down_bnst FRWNN_PARAMS((register struct wnn_buf *, register int, register WNN_BUN *));
+static int alloc_heap FRWNN_PARAMS((struct wnn_buf *, register int));
static int call_error_handler FRWNN_PARAMS((int (*) (const char *), const char *));
-static int change_ascii_to_int ();
-static int create_file ();
-static int dai_end ();
-static int expand_expr ();
-static int expand_expr_all ();
-static int file_discard ();
-static int file_exist ();
-static int file_read ();
-static int file_remove ();
-static int find_same_kouho ();
-static int find_same_kouho_dai ();
-static void free_bun ();
-static void free_down ();
-static void free_sho ();
-static void free_zenkouho ();
-static int get_c_jikouho ();
-static int get_c_jikouho_dai ();
-static int get_c_jikouho_from_zenkouho ();
-static int get_c_jikouho_from_zenkouho_dai ();
-static int get_pwd ();
-static int insert_dai ();
-static int insert_sho ();
-static int make_dir1 ();
-static int make_dir_rec1 ();
-static void make_space_for ();
-static void make_space_for_bun ();
-static void make_space_for_zenkouho ();
-static void message_out (int (*) (const char *), const char *, ...);
-static int ren_conv1 ();
-static void set_dai ();
-static void set_sho ();
-static int tan_conv1 ();
-
+static int change_ascii_to_int FRWNN_PARAMS((register char *, int *));
+static int create_file FRWNN_PARAMS((register struct wnn_env *, char *, int, int, char *, char *, int (*) (const char *), int (*) (const char *)));
+static int dai_end FRWNN_PARAMS((register struct wnn_buf *, register int));
+static int expand_expr FRWNN_PARAMS((register char *, struct wnn_env *));
+static int expand_expr_all FRWNN_PARAMS((register char *, struct wnn_env *));
+static int file_discard FRWNN_PARAMS((register struct wnn_env *, register int));
+static int file_exist FRWNN_PARAMS((struct wnn_env *, char *));
+static int file_read FRWNN_PARAMS((struct wnn_env *, char *));
+static int file_remove FRWNN_PARAMS((register WNN_JSERVER_ID *, char *, char *));
+static int find_same_kouho FRWNN_PARAMS((struct wnn_sho_bunsetsu *, register WNN_BUN **, register WNN_BUN **, int level));
+static int find_same_kouho_dai FRWNN_PARAMS((struct wnn_dai_bunsetsu *, struct wnn_buf *, int, int));
+static void free_bun FRWNN_PARAMS((struct wnn_buf *, register int, register int));
+static void free_down FRWNN_PARAMS((struct wnn_buf *, int, int));
+static void free_sho FRWNN_PARAMS((register struct wnn_buf *, WNN_BUN **));
+static void free_zenkouho FRWNN_PARAMS((register struct wnn_buf *));
+static int get_c_jikouho FRWNN_PARAMS((struct wnn_sho_bunsetsu *, int, WNN_BUN *));
+static int get_c_jikouho_dai FRWNN_PARAMS((struct wnn_dai_bunsetsu *, int, WNN_BUN **, int));
+static int get_c_jikouho_from_zenkouho FRWNN_PARAMS((struct wnn_buf *, WNN_BUN *));
+static int get_c_jikouho_from_zenkouho_dai FRWNN_PARAMS((struct wnn_buf *, WNN_BUN *));
+static int get_pwd FRWNN_PARAMS((register char *, register char *));
+static int insert_dai FRWNN_PARAMS((struct wnn_buf *buf, int zenp, int bun_no, int bunno2, struct wnn_dai_bunsetsu *dp, int dcnt, int uniq_level));
+static int insert_sho FRWNN_PARAMS((struct wnn_buf *, int, int, int, register struct wnn_sho_bunsetsu *, int, int));
+
+static int make_dir1 FRWNN_PARAMS((register struct wnn_env *, register char *, int (*) (const char *), int (*) (const char *)));
+
+static int make_dir_rec1 FRWNN_PARAMS((struct wnn_env *, register char *, int (*) (const char *), int (*) (const char *)));
+static void make_space_for FRWNN_PARAMS((register struct wnn_buf *, int , int , int, int));
+static void make_space_for_bun FRWNN_PARAMS((register struct wnn_buf *, int, int, int));
+static void make_space_for_zenkouho FRWNN_PARAMS((struct wnn_buf *, int, int, register int));
+static void message_out FRWNN_PARAMS((int (*) (const char *), const char *, ...));
+static int ren_conv1 FRWNN_PARAMS((register struct wnn_buf *, w_char *, register int, register int, int));
+static void set_dai FRWNN_PARAMS((register WNN_BUN **, register WNN_BUN **, register int));
+static void set_sho FRWNN_PARAMS((register WNN_BUN *b, register WNN_BUN **p));
+static int tan_conv1 FRWNN_PARAMS((register struct wnn_buf *, w_char *, register int, register int, int, int));
/*
* Sub-routines to handle files, enviroments and connections.
*/
@@ -436,7 +440,7 @@
struct wnn_env *
jl_connect_lang (env_n, server_n, lang, wnnrc_n, error_handler, message_handler, timeout)
- register const char *env_n, *server_n, *wnnrc_n, *lang;
+ const register char *env_n, *server_n, *wnnrc_n, *lang;
int (*error_handler) (const char *), (*message_handler) (const char *);
int timeout;
{
@@ -446,8 +450,6 @@
char p_lang[16];
register char *p;
const char *l;
- extern char *getenv ();
- extern char *_wnn_get_machine_of_serv_defs ();
wnn_errorno = 0;
/* if lang not specified use $LANG */
@@ -1535,7 +1537,7 @@
/*
"辞書ファイル \"%s\" が無いよ。作る?(Y/N)",
*/
- if (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)
@@ -1574,7 +1576,7 @@
/*
"頻度ファイル \"%s\" が無いよ。作る?(Y/N)",
*/
- if (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);
@@ -1619,7 +1621,7 @@
if_dead_disconnect (env, -1);
if (file_remove (env->js_id, hindo_name, hpwd) == -1)
if_dead_disconnect (env, -1);
- if (create_file (env, hindo_name, HINDO, fid, NULL, pwd_hindo, WNN_CREATE, message_handler) == -1)
+ if (create_file (env, hindo_name, HINDO, fid, NULL, pwd_hindo, (int (*) (const char *)) WNN_CREATE, message_handler) == -1)
return (-1);
if ((hfid = file_read (env, hindo_name)) == -1)
if_dead_disconnect (env, -1);
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jlib/js.c FreeWnn-1.1.1-a022.new/Wnn/jlib/js.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jlib/js.c 2013-08-15 14:44:15.340965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jlib/js.c 2013-08-12 10:59:16.905860476 +0900
@@ -88,6 +88,9 @@
#include "wnnerror.h"
#include "jslib.h"
+
+#include "jlib_hide.h"
+
#include "jh.h"
#include "msg.h"
@@ -128,12 +131,13 @@
#endif /* defined(EAGAIN) */
static void connect_timeout ();
-static int _get_server_name ();
-static int writen ();
-static char *get_unixdomain_of_serv_defs (), *get_service_of_serv_defs ();
-static int get_port_num_of_serv_defs ();
+static int _get_server_name FRWNN_PARAMS((const char *, char *));
+static int writen FRWNN_PARAMS((int));
+static char *get_unixdomain_of_serv_defs FRWNN_PARAMS((const char *lang));
+static char *get_service_of_serv_defs FRWNN_PARAMS((const char *));
+static int get_port_num_of_serv_defs FRWNN_PARAMS((const char *));
#if DEBUG
-void xerror ();
+void xerror FRWNN_PARAMS((const char *));
#endif
/********* V4 *****************/
@@ -398,7 +402,7 @@
/* get server name and return serverNo */
static int
_get_server_name (server, pserver)
- char *server;
+ const char *server;
char *pserver;
{
register char *p;
@@ -431,7 +435,7 @@
}
/* Packet SND/RCV subroutines */
-static void put4com ();
+static void put4com FRWNN_PARAMS((int));
/** パケットのヘッダーを送る **/
static void
@@ -560,7 +564,7 @@
/** サーバへ文字列を送る **/
static void
putscom (p)
- register char *p;
+ const register char *p;
{
if (p == NULL)
{
@@ -690,7 +694,7 @@
#if DEBUG
void
xerror (s)
- char *s;
+ const char *s;
{
fprintf (stderr, "%s\n", s);
}
@@ -742,7 +746,7 @@
/** jserver と接続する。jserver_id を返す。 **/
WNN_JSERVER_ID *
js_open_lang (server, lang, timeout)
- register char *server, *lang;
+ const register char *server, *lang;
register int timeout;
{
char *new_js;
@@ -863,9 +867,9 @@
struct wnn_env *
js_connect_lang (server, env_name, lang)
- register char *env_name;
+ const register char *env_name;
WNN_JSERVER_ID *server;
- char *lang;
+ const char *lang;
{
register int e_id;
register struct wnn_env *env;
@@ -925,7 +929,7 @@
int
js_env_exist (server, env_name)
- register char *env_name;
+ const register char *env_name;
register WNN_JSERVER_ID *server;
{
set_current_js (server);
@@ -1137,7 +1141,7 @@
}
/** js_file_list_all **/
-static int rcv_file_list ();
+static int rcv_file_list FRWNN_PARAMS((struct wnn_ret_buf *));
int
js_file_list_all (server, ret)
@@ -1167,7 +1171,7 @@
return rcv_file_list (ret);
}
-static void re_alloc ();
+static void re_alloc FRWNN_PARAMS((register struct wnn_ret_buf *, int));
static int
rcv_file_list (ret)
@@ -1257,8 +1261,8 @@
}
/** js_file_loaded_local **/
-static int check_local_file ();
-static int file_loaded_local ();
+static int check_local_file FRWNN_PARAMS((char *));
+static int file_loaded_local FRWNN_PARAMS((char *));
int
js_file_loaded_local (server, path)
@@ -1485,7 +1489,7 @@
/** js_file_receive **/
static int xget1com ();
-static void xput1com ();
+static void xput1com FRWNN_PARAMS((int));
int
js_file_receive (env, fid, fn)
@@ -1853,8 +1857,8 @@
}
/** js_dic_list_all **/
-static int rcv_dic_list ();
-static void get_dic_info ();
+ static int rcv_dic_list FRWNN_PARAMS((struct wnn_ret_buf *ret));
+ static void get_dic_info FRWNN_PARAMS((register WNN_DIC_INFO *dic));
int
js_dic_list_all (server, ret)
@@ -1980,7 +1984,7 @@
/** js_word_search **/
-static int rcv_word_data ();
+static int rcv_word_data FRWNN_PARAMS((struct wnn_ret_buf *, w_char *));
int
js_word_search (env, dic_no, yomi, ret)
@@ -2282,10 +2286,9 @@
/**
kanren
**/
-static int rcv_dai ();
-static void rcv_sho_x ();
-static void rcv_sho_kanji ();
-
+static int rcv_dai FRWNN_PARAMS((struct wnn_ret_buf *ret));
+static void rcv_sho_x FRWNN_PARAMS((register struct wnn_sho_bunsetsu *, int));
+static void rcv_sho_kanji FRWNN_PARAMS((struct wnn_sho_bunsetsu *, int, w_char **));
int
js_kanren (env, yomi, hinsi, fzk, vec, vec1, vec2, rb)
struct wnn_env *env;
@@ -2946,7 +2949,7 @@
static char *
get_serv_defs (lang, cnt)
- char *lang;
+ const char *lang;
int cnt;
{
FILE *fp;
@@ -2989,28 +2992,28 @@
char *
_wnn_get_machine_of_serv_defs (lang)
- char *lang;
+ const char *lang;
{
return (get_serv_defs (lang, MACHINE_NAME));
}
static char *
get_unixdomain_of_serv_defs (lang)
- char *lang;
+ const char *lang;
{
return (get_serv_defs (lang, UNIXDOMAIN_NAME));
}
static char *
get_service_of_serv_defs (lang)
- char *lang;
+ const char *lang;
{
return (get_serv_defs (lang, SERVICE_NAME));
}
static int
get_port_num_of_serv_defs (lang)
- char *lang;
+ const char *lang;
{
char *port_char;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jlib.V3/jlv3.c FreeWnn-1.1.1-a022.new/Wnn/jlib.V3/jlv3.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jlib.V3/jlv3.c 2013-08-15 14:44:15.343965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jlib.V3/jlv3.c 2013-08-12 11:11:18.586815913 +0900
@@ -152,8 +152,8 @@
return (0);
}
-int jd_begin ();
-static int henkan_rcv ();
+int jd_begin FRWNN_PARAMS((w_char *, int));
+static int henkan_rcv FRWNN_PARAMS((int, w_char *, int));
/** jd_reconv **/
int
@@ -457,7 +457,7 @@
JD_WNN_DEAD return (jl_word_delete (buf, current_ud, ser_no));
}
-static int oldh_to_newh ();
+static int oldh_to_newh FRWNN_PARAMS((int, unsigned short **));
/** jd_wreg **/
int
@@ -487,7 +487,7 @@
#endif
}
-static int newh_to_oldh ();
+static int newh_to_oldh FRWNN_PARAMS((unsigned short));
/** jd_wsch **/
int
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/daibn_kai.c FreeWnn-1.1.1-a022.new/Wnn/jserver/daibn_kai.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/daibn_kai.c 2002-05-13 07:51:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/daibn_kai.c 2013-08-12 22:37:25.428579063 +0900
@@ -258,7 +258,7 @@
{
if (
#ifndef NO_FZK
- (fzkchar == NULL || *fzkchar == NULL) &&
+ (fzkchar == NULL || *fzkchar == 0) &&
#endif /* NO_FZK */
beginvect == sentou_no)
{
@@ -324,7 +324,7 @@
#ifndef NO_FZK
else
{
- if (fzkchar == NULL || *fzkchar == NULL)
+ if (fzkchar == NULL || *fzkchar == 0)
{
if ((ll = wnn_get_fukugou_component_body (hinsi, &buf)) == 0)
{
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/de.c FreeWnn-1.1.1-a022.new/Wnn/jserver/de.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/de.c 2013-08-15 14:44:15.336965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/de.c 2013-08-16 00:11:45.934223678 +0900
@@ -85,6 +85,8 @@
#undef GLOBAL_VALUE_DEFINE
#include "msg.h"
+#include "etc.h"
+
#ifdef SOLARIS
#ifdef SO_DONTLINGER
#undef SO_DONTLINGER
@@ -231,8 +233,6 @@
{
int tmpttyfd;
char *cswidth_name;
- extern char *get_cswidth_name ();
- extern void set_cswidth ();
char nlspath[64];
@@ -246,8 +246,11 @@
{
log_err ("cannot open message file libwnn.msg.");
}
- if (cswidth_name = get_cswidth_name (LANG_NAME))
- set_cswidth (create_cswidth (cswidth_name));
+
+ if ((cswidth_name = get_cswidth_name (LANG_NAME)) != NULL)
+ {
+ set_cswidth (create_cswidth (cswidth_name));
+ }
port = -1;
/* option default */
@@ -293,12 +296,12 @@
daemon_init ();
env_init ();
- if (file_init () == NULL)
+ if (file_init () == 0)
{
exit (1);
}
dic_init ();
- if (NULL == get_kaiseki_area (LENGTHCONV + 1)) /* 変換可能文字数 */
+ if (0 == get_kaiseki_area (LENGTHCONV + 1)) /* 変換可能文字数 */
{
log_err ("get_kaiseki_area failed.");
exit (1);
@@ -372,7 +375,8 @@
del_client ();
continue;
}
- do_command (c_c);
+ /* do_command (c_c); */
+ do_command ();
}
}
}
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/de_header.h FreeWnn-1.1.1-a022.new/Wnn/jserver/de_header.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/de_header.h 2011-04-11 01:51:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/de_header.h 2013-08-15 11:21:33.381901018 +0900
@@ -59,6 +59,10 @@
#include "ddefine.h"
#include "wnn_os.h"
+#include "fzk.h"
+#include "etc.h"
+#include "kaiseki.h"
+
#define FILENAME 128
#define SUCCESS 1
#define FAILURE NULL
@@ -210,8 +214,8 @@
GLOBAL char lang_dir[MAXPATHLEN];
/* atojis.c */
-extern w_char *get_giji_knj ();
-extern void giji_hindoup ();
+extern w_char *get_giji_knj (int, int, int, w_char *);
+extern void giji_hindoup (int);
/* b_index.c */
#ifdef CONVERT_by_STROKE
extern int create_b_index (struct JT *jt);
@@ -227,18 +231,33 @@
extern int check_bar_katakana (int, int);
extern int kan_ckvt (unsigned short, int);
/* daibn_kai.c */
-extern int dbn_kai ();
-extern int get_status ();
-extern int zentan_able ();
+extern int dbn_kai (int, register int, int,
#ifndef NO_FZK
-extern w_char *rev_fzk ();
-#endif
-extern struct SYO_BNSETSU *que_reorder ();
-extern int sbjunjo ();
-extern int set_daibnsetu ();
-extern int sum_hyouka ();
-extern int ave_hyouka ();
-extern int cmp_hyouka ();
+ w_char *,
+#endif /* NO_FZK */
+ int, int, register int, struct BZD **);
+extern int get_status (register int, int,
+#ifndef NO_FZK
+ w_char *,
+#endif /* NO_FZK */
+ register short *);
+
+extern int zentan_able (int, register int
+#ifndef NO_FZK
+ , w_char *
+#endif /* NO_FZK */
+ );
+
+#ifndef NO_FZK
+extern w_char *rev_fzk (register w_char *, int);
+#endif /* NO_FZK */
+extern struct SYO_BNSETSU *que_reorder (register struct SYO_BNSETSU *, register struct SYO_BNSETSU *);
+extern int sbjunjo (register struct SYO_BNSETSU *, register struct SYO_BNSETSU *);
+extern int set_daibnsetu (struct BZD **, register struct BZD **, register struct SYO_BNSETSU *, int *, int);
+extern int sum_hyouka (register struct SYO_BNSETSU *);
+extern int ave_hyouka (register struct SYO_BNSETSU *);
+extern int cmp_hyouka (register struct SYO_BNSETSU *, register struct SYO_BNSETSU *);
+
/* de.c */
extern void del_client (void);
extern void daemon_fin (void);
@@ -264,19 +283,19 @@
extern void error_ret ();
/* do_dic_env.c */
extern void js_dic_add ();
-extern int add_dic_to_env ();
-extern int chk_dic ();
-extern int chk_hindo ();
+extern int add_dic_to_env (int, int);
+extern int chk_dic (int, int);
+extern int chk_hindo (int, int);
extern int get_new_dic ();
-extern int find_dic_in_env ();
+extern int find_dic_in_env (int, int);
extern void js_dic_delete ();
-extern void del_all_dic_in_env ();
+extern void del_all_dic_in_env (int);
extern void js_dic_list_all ();
extern void js_dic_list ();
extern void js_dic_use ();
extern void js_fuzokugo_set ();
extern void js_fuzokugo_get ();
-extern void used_dic_fuzoku_delete ();
+extern void used_dic_fuzoku_delete (int, int);
/* do_dic_no.c */
extern void dic_init ();
extern void js_dic_info ();
@@ -333,24 +352,24 @@
extern void js_file_remove (void);
extern void js_file_password_set (void);
/* do_henkan.c */
-extern void ret_dai ();
-extern void ret_sho ();
+extern void ret_dai (struct DSD_DBN *, int);
+extern void ret_sho (register struct DSD_SBN *, register int cnt);
#ifdef CONVERT_by_STROKE
-extern void ret_B ();
-extern void ret_daiB ();
+extern void ret_B (int, int, register int, int);
+extern void ret_daiB (int, int, register int, int);
#endif
#ifdef DEBUG
-extern void print_dlist ();
-extern void print_dlist1 ();
+extern void print_dlist (struct DSD_DBN *, int);
+extern void print_dlist1 (struct DSD_SBN *, int);
#endif
/* do_henkan1.c */
-extern void do_kanren ();
-extern void do_kantan_dai ();
-extern void do_kantan_sho ();
-extern void do_kanzen_dai ();
-extern void do_kanzen_sho ();
-extern void Get_knj ();
-extern void get_knj_com ();
+extern void do_kanren (void);
+extern void do_kantan_dai (void);
+extern void do_kantan_sho (void);
+extern void do_kanzen_dai (void);
+extern void do_kanzen_sho (void);
+extern void Get_knj (register struct jdata *, int, w_char *, w_char *, int);
+extern void get_knj_com (register struct jdata *, int, w_char *, w_char *);
/* do_hinsi_s.c */
extern void js_hindo_set ();
/* error.c */
@@ -373,95 +392,113 @@
extern void wsputs ();
#endif
/* fzk.c */
-extern struct FT *fzk_read ();
-extern struct FT *fzk_ld ();
-extern void fzk_discard ();
-extern int fzk_kai ();
-extern int fzk_ckvt ();
+extern struct FT *fzk_read (FILE *fp);
+extern struct FT *fzk_ld (FILE *fp);
+extern void fzk_discard (struct FT *fzk_tbl);
+extern int fzk_kai (w_char *, w_char *, int, int, struct ICHBNP **);
+extern int fzk_ckvt (int);
/* get_kaiarea.c */
extern int get_kaiseki_area (size_t);
extern void init_work_areas (void);
/* hinsi_list.c */
-extern void make_hinsi_list ();
-extern int hinsi_table_set ();
+extern void make_hinsi_list (struct JT *);
+extern int hinsi_table_set (struct JT *, w_char *);
/* initjserv.c */
extern int read_default (void);
extern int read_default_files (void);
/* jbiki.c */
-extern int jishobiki ();
-extern int binary1 ();
-extern int binary ();
-extern int Strcmpud ();
-extern int Substrud ();
-extern int Substrstud ();
-extern int Substrudud ();
-extern int word_search ();
-extern int rd_biki ();
-extern int rd_binary1 ();
-extern int rd_binary ();
-extern int rd_binary_same ();
+extern int jishobiki (w_char *, struct jdata **);
+extern int binary1 (register struct uind1 *, register w_char *, register int end, struct JT *);
+extern int binary (register struct uind1 *, register w_char *, int, struct JT *);
+extern int Strcmpud (struct uind1 *ui1p, w_char *yomi, struct JT *);
+extern int Substrud (struct uind1 *, w_char *, int, struct JT *);
+extern int Substrstud (w_char *, struct uind1 *, struct JT *);
+extern int Substrudud (register struct uind1 *, register struct uind1 *, register struct JT *);
+extern int word_search (int, w_char *, struct jdata **);
+extern int rd_biki (struct JT *, w_char *, register int);
+extern int rd_binary1 (register struct rind1 *, register w_char *, register int, struct rind2 *, UCHAR *, int);
+extern int rd_binary (register struct rind1 *, register w_char *, register int end, struct rind2 *, UCHAR *, int which);
+extern int rd_binary_same (register struct rind1 *, register w_char *, register int, struct rind2 *, UCHAR *kanji, int);
#ifdef CONVERT_by_STROKE
/* jbiki_b.c */
extern int is_bwnn_rev_dict ();
-extern int jishobiki_b ();
+extern int jishobiki_b (int, int);
#endif
/* jikouho.c */
-extern int jkt_sbn_one ();
+extern int jkt_sbn_one (int, int, struct JKT_SBN **, int, struct JKT_SBN *, struct ICHBNP *, register int);
#ifndef NO_KATA
-extern struct JKT_SBN *get_kata_kouho ();
+extern struct JKT_SBN *get_kata_kouho (struct JKT_SBN **, int, int, int, int *, int *, int);
#endif
-extern struct JKT_SBN *get_hira_kouho ();
-extern int jkt_get_syo ();
-extern int get_zen_giji ();
+extern struct JKT_SBN *get_hira_kouho (struct JKT_SBN **, int, int);
+extern int jkt_get_syo (int, int, int,
+#ifndef NO_FZK
+ w_char *,
+#endif /* NO_FZK */
+ int, int, struct DSD_SBN **);
+extern int get_zen_giji (struct SYO_BNSETSU *, struct JKT_SBN **);
+
/* jikouho_d.c */
-extern int jkt_get_dai ();
-extern int get_jkt_status ();
-extern struct DSD_DBN *get_dsd_dbn ();
-extern struct DSD_DBN *get_dsd_dbn ();
-extern struct DSD_SBN *get_dsd_sbn ();
-extern int dbn_set ();
-extern int cnt_sone ();
+extern int jkt_get_dai (int, int, int,
+#ifndef NO_FZK
+ w_char *,
+#endif /* NO_FZK */
+ int, int, int, struct DSD_DBN **);
+extern int get_jkt_status (int, int,
+#ifndef NO_FZK
+ w_char *,
+#endif /* NO_FZK */
+ short *);
+extern struct DSD_DBN *get_dsd_dbn (register int);
+extern struct DSD_SBN *get_dsd_sbn (register int);
+extern int dbn_set (struct DSD_DBN **, register struct JKT_DBN *);
+extern int cnt_sone (register struct JKT_SONE *);
+
/* jishoop.c */
-extern int word_add ();
-extern int word_comment_set ();
-extern int word_delete ();
-extern void kanjiadd ();
-extern int dic_in_envp ();
-extern int hindo_file_size_justify ();
+extern int word_add (int, int, w_char *, w_char *, int, int, w_char *);
+extern int word_comment_set (int, int, int, w_char *);
+extern int word_delete (int, int, int);
+extern void kanjiadd (struct JT *, w_char *, w_char *, w_char *);
+extern int dic_in_envp (int, int);
+extern int hindo_file_size_justify (struct wnn_file *, struct wnn_file *);
/* jishosub.c */
-extern int inspect ();
-extern int get_yomi_from_serial ();
-extern int get_yomi_from_serial ();
+extern int inspect (int, int, w_char *, struct jdata *);
+extern int get_yomi_from_serial (int, int, w_char *);
/* jmt0.c */
extern void init_jmt (void);
extern int jmt_set (int);
/* mknode0.c */
extern int init_bzd (void);
-extern int init_ichbnp ();
-extern void clr_node ();
-extern void freebzd ();
-extern void freeibsp ();
-extern struct BZD *getbzdsp ();
-extern struct ICHBNP *getibsp ();
-extern struct fzkkouho *getfzkoh_body ();
-extern struct fzkkouho *getfzkoh1_body ();
-extern int mknode ();
+extern int init_ichbnp (void);
+extern void clr_node (register struct BZD *);
+extern void freebzd (register struct BZD *);
+extern void freeibsp (struct ICHBNP *);
+extern struct BZD *getbzdsp (void);
+extern struct ICHBNP *getibsp (void);
+extern struct fzkkouho *getfzkoh_body (register struct ICHBNP *, int);
+extern struct fzkkouho *getfzkoh1_body (register struct ICHBNP *, register int);
+extern int mknode (struct BZD *, int, int,
+#ifndef NO_FZK
+ w_char *,
+#endif /* NO_FZK */
+ int, int);
+extern void freebzd (register struct BZD *);
+
/* mknode1.c */
extern int init_sbn ();
-extern int get_area ();
-extern void free_area ();
-extern void freesbn ();
-extern void clr_sbn_node ();
+extern int get_area (register int, register int, struct free_list **);
+extern void free_area (register struct free_list *);
+extern void freesbn (register struct SYO_BNSETSU *);
+extern void clr_sbn_node (register struct SYO_BNSETSU *);
extern struct SYO_BNSETSU *getsbnsp ();
/* mknode2.c */
-extern int init_jktdbn ();
-extern int init_jktsbn ();
-extern int init_jktsone ();
-extern void freejktdbn ();
-extern void freejktsbn ();
-extern struct JKT_DBN *getjktdbn ();
-extern struct JKT_SBN *getjktsbn ();
-extern struct JKT_SONE *getjktsone ();
+extern int init_jktdbn (void);
+extern int init_jktsbn (void);
+extern int init_jktsone (void);
+extern void freejktdbn (register struct JKT_DBN *);
+extern void freejktsbn (struct JKT_SBN *);
+extern struct JKT_DBN *getjktdbn (void);
+extern struct JKT_SBN *getjktsbn (void);
+extern struct JKT_SONE *getjktsone (void);
/* rd_jishoop.c */
extern int rd_word_add1 (struct JT *, w_char *, int, w_char *, w_char *);
extern int rd_word_delete1 (struct JT *, struct HJT *, int);
@@ -503,37 +540,28 @@
extern int tan_syo (int, int, int, int, int, struct DSD_SBN **);
#endif /* NO_FZK */
/* sisheng.c */
-extern int get_sisheng ();
-extern w_char *biki_sisheng ();
-extern unsigned int diff_sisheng ();
+extern int get_sisheng (w_char *, char *, w_char *);
+extern w_char *biki_sisheng (w_char *, char *, w_char *);
+extern unsigned int diff_sisheng (int, int);
/* snd_rcv.c */
-extern int fopen_read_cur ();
-extern int fopen_write_cur ();
-extern int fread_cur ();
+extern int fopen_read_cur (char *);
+extern int fopen_write_cur (char *);
+extern int fread_cur (char *, register int, register int);
extern int xgetc_cur ();
-extern void xungetc_cur ();
-extern void fwrite_cur ();
+extern void xungetc_cur (int);
+extern void fwrite_cur (unsigned char *, int, int);
extern void xputc_cur (unsigned char);
extern void fclose_cur ();
/* w_string.c */
-extern void Sreverse ();
-extern int Sstrcpy ();
-extern int Strcmp ();
-extern int Substr ();
-extern int Strncmp ();
-extern w_char *Strcpy ();
-extern w_char *Strncpy ();
-extern int Strlen ();
-/* gethinsi.c */
-extern int wnn_loadhinsi ();
-extern w_char *wnn_hinsi_name ();
-extern int wnn_hinsi_number ();
-extern int wnn_hinsi_list ();
-extern int wnn_has_hinsi ();
-extern int wnn_find_hinsi_by_name ();
-extern char *wnn_get_hinsi_name ();
-extern int wnn_get_fukugou_component_body ();
-extern int wnn_get_fukugou_component ();
+extern void Sreverse (register w_char *, register w_char *);
+extern int Sstrcpy (register w_char *, register unsigned char *);
+extern int Strcmp (register w_char *, register w_char *);
+extern int Substr (register w_char *, register w_char *);
+extern int Strncmp (register w_char *w1, register w_char *, register int n);
+extern w_char *Strcpy (register w_char *, register w_char *);
+extern w_char *Strncpy (register w_char *w1, register w_char *, register int n);
+extern int Strlen (register w_char *w);
+
/* bdic.c */
extern void check_backup (char*);
extern void delete_tmp_file (char*);
@@ -556,15 +584,8 @@
extern int output_header_jt (FILE*, struct JT*);
extern int input_header_hjt (FILE*, struct HJT*);
extern int output_header_hjt (FILE*, struct HJT*);
-/* dic_atojis.c */
-extern void Get_kanji ();
-extern void Get_knj1 ();
-/* revdic.c */
-extern int little_endian ();
-extern int revdic ();
-/* hindo.c */
-extern int asshuku ();
-extern int motoni2 ();
+
+
/* pwd.c */
extern void new_pwd (char*, char*);
extern int check_pwd (char*, char*);
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_dic_env.c FreeWnn-1.1.1-a022.new/Wnn/jserver/do_dic_env.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_dic_env.c 2001-06-15 03:28:53.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/do_dic_env.c 2013-08-12 13:00:42.374561078 +0900
@@ -41,7 +41,7 @@
#include "jdata.h"
-static void del_dic_from_env (), dic_delete ();
+static void del_dic_from_env (int, int), dic_delete (int, int, int);
/*
Dic. OPE for Env
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_filecom.c FreeWnn-1.1.1-a022.new/Wnn/jserver/do_filecom.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_filecom.c 2003-06-07 11:23:58.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/do_filecom.c 2013-08-12 15:51:16.580788036 +0900
@@ -85,7 +85,7 @@
if ( files == NULL )
{
log_err ("file_init: malloc faild.");
- return (NULL);
+ return (0);
}
for (i = 0; i < MAX_FILES; i++)
{
@@ -518,7 +518,7 @@
wnn_errorno = WNN_RDONLY;
goto ERR_RET;
}
- if (file_comment_set (&files[fid], comment) == NULL)
+ if (file_comment_set (&files[fid], comment) == 0)
{
goto ERR_RET;
}
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_henkan.c FreeWnn-1.1.1-a022.new/Wnn/jserver/do_henkan.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_henkan.c 2001-06-18 18:09:41.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/do_henkan.c 2013-08-13 06:54:24.029693265 +0900
@@ -43,8 +43,13 @@
#include "jdata.h"
#include "de_header.h"
-static void ret_sho_x (), ret_sho_kanji (), ret_kanji ();
-static int count_sho (), count_d_kanji (), count_s_kanji (), count_kanji ();
+static void ret_sho_x (register struct DSD_SBN *, register int);
+static void ret_sho_kanji (register struct DSD_SBN *, register int);
+static void ret_kanji (register struct DSD_SBN *);
+static int count_sho (struct DSD_DBN *, int);
+static int count_d_kanji (struct DSD_DBN *, int);
+static int count_s_kanji (struct DSD_SBN *, int);
+static int count_kanji (struct DSD_SBN *);
/* DAI BUN */
void
@@ -457,8 +462,8 @@
#undef putwchar
#endif
-static void _print_dlist ();
-static void _print_dlist1 ();
+static void _print_dlist (struct DSD_DBN *);
+static void _print_dlist1 (struct DSD_SBN *);
void
print_dlist (dlist, cnt)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_henkan1.c FreeWnn-1.1.1-a022.new/Wnn/jserver/do_henkan1.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_henkan1.c 2003-05-12 03:41:49.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/do_henkan1.c 2013-08-15 12:29:52.957922625 +0900
@@ -53,7 +53,7 @@
#undef putwchar
#endif
-static int make_buns_par ();
+static int make_buns_par (register w_char, register int);
static int bun_pter_;
@@ -118,7 +118,7 @@
{
int b_suu_;
- b_suu_ = jishobiki_b (1, bun_pter_, 0);
+ b_suu_ = jishobiki_b (1, bun_pter_); /* jishobiki_b (1, bun_pter_, 0); */
if (b_suu_ < 0)
{
error_ret (); /* ERROR */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_hindo_s.c FreeWnn-1.1.1-a022.new/Wnn/jserver/do_hindo_s.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/do_hindo_s.c 2002-06-22 22:25:45.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/do_hindo_s.c 2013-08-13 07:11:58.215628170 +0900
@@ -43,7 +43,7 @@
#include "jdata.h"
#include "de_header.h"
-static int hindo_set ();
+static int hindo_set (int, int, int, int);
void
js_hindo_set ()
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/fzk.c FreeWnn-1.1.1-a022.new/Wnn/jserver/fzk.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/fzk.c 2003-05-12 04:01:06.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/fzk.c 2013-08-13 06:37:05.750757378 +0900
@@ -627,7 +627,7 @@
for (yomicnt = 0; (yomicnt < YOMI_L) && (start < end); key[yomicnt++] = *start++)
;
key[yomicnt] = 0;
- for (; yomicnt > 0; key[--yomicnt] = NULL)
+ for (; yomicnt > 0; key[--yomicnt] = 0)
{
search_ptr = (struct fzkentry *) bsrch (key);
if (search_ptr != NULL)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/get_kaiarea.c FreeWnn-1.1.1-a022.new/Wnn/jserver/get_kaiarea.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/get_kaiarea.c 2003-06-07 11:22:23.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/get_kaiarea.c 2013-08-13 06:56:38.164684982 +0900
@@ -51,7 +51,7 @@
/*
* get_kaiseki_area: take memory areas for analysing.
- * return value: fail = NULL, success != NULL
+ * return value: fail = 0, success != 0
*/
int
get_kaiseki_area (size_t kana_len)
@@ -60,28 +60,28 @@
{
wnn_errorno = WNN_MALLOC_INITIALIZE;
log_debug ("malloc failed in maxj.");
- return (NULL);
+ return (0);
}
if (NULL == (jmtp = (struct jdata ***) calloc (kana_len, sizeof (struct jdata **))))
{
wnn_errorno = WNN_MALLOC_INITIALIZE;
log_debug ("malloc failed in jmtp.");
- return (NULL);
+ return (0);
}
if (NULL == (jmt_ = (struct jdata **) calloc (SIZE_JISHOTABLE, sizeof (struct jdata *))))
{
wnn_errorno = WNN_MALLOC_INITIALIZE;
log_debug ("malloc failed in jmt_.");
- return (NULL);
+ return (0);
}
if (NULL == (jmtw_ = (struct jdata *) calloc (SIZE_JISHOHEAP, sizeof (struct jdata))))
{
wnn_errorno = WNN_MALLOC_INITIALIZE;
log_debug ("malloc failed in jmtw_.");
- return (NULL);
+ return (0);
}
jmt_end = jmt_ + SIZE_JISHOTABLE;
@@ -92,7 +92,7 @@
{
wnn_errorno = WNN_MALLOC_INITIALIZE;
log_debug ("malloc failed in bun.");
- return (NULL);
+ return (0);
}
maxchg = kana_len;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/hinsi_list.c FreeWnn-1.1.1-a022.new/Wnn/jserver/hinsi_list.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/hinsi_list.c 2002-05-13 07:51:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/hinsi_list.c 2013-08-15 20:11:15.876147622 +0900
@@ -49,7 +49,8 @@
#include "hinsi_file.h"
#include "jdata.h"
-static int Strtime (), get_a_word ();
+static int Strtime (w_char *, int, w_char);
+static int get_a_word (w_char *, w_char **, int *);
void
make_hinsi_list (jtl)
@@ -181,8 +182,10 @@
if (Strcmp (n[m].name, w) == 0)
for (j = n[m].kosuu; j; j--)
{
- if (Strcmp (n[m].son[j], w) == 0)
- return (1);
+ if (Strcmp (n[m].son + j, w) == 0) /* changed 2013-08-15! */
+ {
+ return (1);
+ }
}
}
return (0);
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jbiki.c FreeWnn-1.1.1-a022.new/Wnn/jserver/jbiki.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jbiki.c 2003-06-07 11:22:23.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/jbiki.c 2013-08-12 16:00:22.398754333 +0900
@@ -61,9 +61,9 @@
#endif /* CONVERT_with_SiSheng */
static int ud_biki (struct JT *, w_char *);
-static int sd_biki ();
-static int sd_biki_one ();
-static int sdbinary ();
+static int sd_biki (struct JT *, w_char *);
+static int sd_biki_one (char *, int, w_char *);
+static int sdbinary (register w_char, register w_char *, int tsize);
int
jishobiki (w_char *yomi, /* 読みの先頭へのポインタ */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jbiki_b.c FreeWnn-1.1.1-a022.new/Wnn/jserver/jbiki_b.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jbiki_b.c 2001-06-15 03:16:02.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/jbiki_b.c 2013-08-15 11:05:18.411895879 +0900
@@ -52,8 +52,11 @@
#define MAX_B_KOHO 64
#define MIN_B_KOHO 5
-static void rd_biki_b (), set_kohos (), koho_insert (), b_koho_put ();
-static int set_value ();
+static void rd_biki_b (struct JT *, int, int, int);
+static void set_kohos (struct JT *, int);
+static void koho_insert (register struct b_koho *);
+static void b_koho_put (struct b_koho *);
+static int set_value (struct b_koho *);
static int number; /** クライアントの辞書番号 */
static int prior;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jikouho.c FreeWnn-1.1.1-a022.new/Wnn/jserver/jikouho.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jikouho.c 2002-05-13 07:51:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/jikouho.c 2013-08-13 06:31:38.785777567 +0900
@@ -48,8 +48,12 @@
#include "fzk.h"
#include "kaiseki.h"
-static struct JKT_SBN *find_jktsbn ();
-static int cmp_dsd_sbn (), cnt_jkt_sbn (), get_suuji_kouho (), get_eisuu_kouho (), get_kigou_kouho ();
+static struct JKT_SBN *find_jktsbn (struct JKT_SBN **, struct JKT_SONE *, int, int j_c);
+static int cmp_dsd_sbn (struct DSD_SBN *, struct DSD_SBN *);
+static int cnt_jkt_sbn (register struct JKT_SBN *sbn);
+static int get_suuji_kouho (register struct JKT_SBN *);
+static int get_eisuu_kouho (struct JKT_SBN *);
+static int get_kigou_kouho (struct JKT_SBN *jktsbn);
static int
jkt_sbn (yomi_sno, yomi_eno, endvect, endvect1, tjktsbn, bnst_num, parent)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jikouho_d.c FreeWnn-1.1.1-a022.new/Wnn/jserver/jikouho_d.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jikouho_d.c 2002-05-13 07:51:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/jikouho_d.c 2013-08-12 22:31:39.407600430 +0900
@@ -53,12 +53,29 @@
#include "kaiseki.h"
#ifdef CONVERT_from_TOP
-static void sbn_set (), sons_set ();
+static void sbn_set (register struct JKT_DBN *, register struct DSD_SBN **, register struct JKT_SONE *, register struct JKT_SBN *);
+static void sons_set (register struct JKT_DBN *, register struct JKT_SONE *, register struct JKT_SBN *, register struct DSD_SBN *, register int, register int);
#endif /* CONVERT_from_TOP */
-static void dsd_hyouka (), cnt_sbn (), cnt_dbn ();
-static int cmp_dsd_dbn (), jkt_dbn (), jkt_sbjunjo (), set_jkt_dai (), zen_sbn (), cnt_par (), cnt_son ();
-static struct JKT_SBN *jkt_que_reorder ();
+static void dsd_hyouka (struct DSD_DBN *);
+static void cnt_sbn (register struct JKT_SBN *, register int *, register int *);
+static void cnt_dbn (register struct JKT_DBN *, register int *dbn_cnt, register int *sbn_cnt);
+static int cmp_dsd_dbn (struct DSD_DBN *, struct DSD_DBN *);
+static int jkt_dbn (int, int, int,
+#ifndef NO_FZK
+ w_char *,
+#endif /* NO_FZK */
+ int, int, register int, struct JKT_DBN **);
+static int jkt_sbjunjo (struct JKT_SBN *, struct JKT_SBN *);
+static int set_jkt_dai (struct JKT_DBN **, register struct JKT_DBN **, register struct JKT_SBN *);
+static int zen_sbn (int, int, int, int, struct JKT_SBN **, int, struct JKT_SBN *
+#ifndef NO_KANA
+ , int *
+#endif /* NO_KANA */
+ );
+static int cnt_par (register struct JKT_SBN *sbn);
+static int cnt_son (register struct JKT_SBN *, register struct JKT_SBN *);
+static struct JKT_SBN *jkt_que_reorder (register struct JKT_SBN *, register struct JKT_SBN *);
static int yomi_sno_tmp;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jishoop.c FreeWnn-1.1.1-a022.new/Wnn/jserver/jishoop.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jishoop.c 2003-06-07 11:23:58.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/jishoop.c 2013-08-12 18:12:52.051041555 +0900
@@ -43,12 +43,20 @@
#include "de_header.h"
#include "jdata.h"
-static void make_space ();
-static int word_add1 (), word_delete1 (), word_comment_set1 ();
+#if __STDC__
+#define FRWNN_PARAMS(paramlist) paramlist
+#else
+#define FRWNN_PARAMS(paramlist) ()
+#endif /* __STDC__ */
+
+static void make_space FRWNN_PARAMS((register struct uind1 *, register int, register struct JT *));
+static int word_add1 FRWNN_PARAMS((struct JT *, w_char *, int, w_char *, w_char *));
+static int word_delete1 FRWNN_PARAMS((struct JT *, struct HJT *, w_char *, int));
+static int word_comment_set1 FRWNN_PARAMS((struct JT *, w_char *, int, w_char *));
#ifndef min
-#define min(a, b) ((a > b)? b:a)
-#define max(a, b) ((a < b)? b:a)
+#define min(a, b) (((a) > (b))? (b) : (a))
+#define max(a, b) (((a) < (b))? (b) : (a))
#endif
int
@@ -304,22 +312,22 @@
Sreverse (yomi, pyomi);
if ((jtl->bufsize_hontai <= jtl->maxhontai + sizeof (struct uind2) + Strlen (yomi))
- && (ud_realloc_hontai (jtl) == NULL))
+ && (ud_realloc_hontai (jtl) == 0))
{
return (-1);
}
if ((jtl->bufsize_kanji <= jtl->maxkanji + (Strlen (kanji) + Strlen (comment) + Strlen (yomi) + 3) * sizeof (w_char) + 1)
- && (ud_realloc_kanji (jtl) == NULL))
+ && (ud_realloc_kanji (jtl) == 0))
{
return (-1);
}
if (jtl->bufsize_serial <= jtl->maxserial + 4
- && ud_realloc_serial (jtl) == NULL)
+ && ud_realloc_serial (jtl) == 0)
{
return (-1);
}
if (jtl->bufsize_table <= jtl->maxtable + sizeof (struct uind1)
- && ud_realloc_table (jtl) == NULL)
+ && ud_realloc_table (jtl) == 0)
{
return (-1);
}
@@ -556,7 +564,7 @@
if (jtl->bufsize_hontai <= jtl->maxhontai + sizeof (struct uind2) + Strlen (yomi))
{
tmp = (char *) p - (char *) jtl->hontai;
- if (ud_realloc_hontai (jtl) == NULL)
+ if (ud_realloc_hontai (jtl) == 0)
{
return (-1);
}
@@ -647,7 +655,7 @@
{
if (jtl->bufsize_kanji <= jtl->maxkanji + (Strlen (kanji) + Strlen (comment) + Strlen (yomi1) + 4) * 2)
{
- if (ud_realloc_kanji (jtl) == NULL)
+ if (ud_realloc_kanji (jtl) == 0)
{
return (-1);
}
@@ -667,7 +675,7 @@
/* We need to spend one serial_no to ensure that the entry
before this and after this are not connected */
if (jtl->bufsize_serial <= jtl->maxserial + 4
- && ud_realloc_serial (jtl) == NULL)
+ && ud_realloc_serial (jtl) == 0)
{
return (-1);
}
@@ -762,7 +770,7 @@
{
while (hjtp->bufsize_serial <= jtp->maxserial)
{
- if (hindo_file_realloc (hjtp) == NULL)
+ if (hindo_file_realloc (hjtp) == 0)
return (-1);
}
error1 ("Dic file size is bigger than that of Hindo file!");
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jishosub.c FreeWnn-1.1.1-a022.new/Wnn/jserver/jishosub.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/jishosub.c 2001-06-15 03:16:02.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/jishosub.c 2013-08-12 19:27:23.886582927 +0900
@@ -34,7 +34,15 @@
#include "de_header.h"
#include "jdata.h"
-static int inspect_sd (), get_fst_serial (), inspect_ud ();
+#if __STDC__
+#define FRWNN_PARAMS(paramlist) paramlist
+#else
+#define FRWNN_PARAMS(paramlist) ()
+#endif /* __STDC__ */
+
+static int inspect_sd FRWNN_PARAMS((int, int, w_char *, struct jdata *));
+static int get_fst_serial FRWNN_PARAMS((char *, UCHAR *));
+static int inspect_ud FRWNN_PARAMS((int, int, w_char *, struct jdata *));
int
inspect (dic_no, serial, yomi, jd)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/mknode0.c FreeWnn-1.1.1-a022.new/Wnn/jserver/mknode0.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/mknode0.c 2002-05-13 07:51:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/mknode0.c 2013-08-12 20:42:37.974995257 +0900
@@ -36,10 +36,16 @@
#include "de_header.h"
#include "kaiseki.h"
-static struct BZD *clrnd_sub ();
-static void lnk_bzd (), lnk_ichbn ();
-static int mknd_sub (), hyoka2 ();
-void freebzd ();
+static struct BZD *clrnd_sub (register struct BZD *);
+static void lnk_bzd (struct free_list *), lnk_ichbn (struct free_list *);
+
+static int mknd_sub (struct BZD *, int, int,
+#ifndef NO_FZK
+ w_char *,
+#endif /* NO_FZK */
+ int, int, int);
+
+static int hyoka2 (int, int);
static struct BZD *free_bzd_top = NULL;
static struct free_list *free_list_bzd = NULL;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/mknode1.c FreeWnn-1.1.1-a022.new/Wnn/jserver/mknode1.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/mknode1.c 2002-05-13 07:51:17.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/mknode1.c 2013-08-12 20:01:03.833458198 +0900
@@ -44,7 +44,7 @@
#include "de_header.h"
#include "kaiseki.h"
-static void lnk_sbn ();
+static void lnk_sbn (struct free_list *);
static struct SYO_BNSETSU *free_sbn_top = NULL;
static struct free_list *free_list_sbn = NULL;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/mknode2.c FreeWnn-1.1.1-a022.new/Wnn/jserver/mknode2.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/mknode2.c 2002-05-13 07:51:17.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/mknode2.c 2013-08-12 21:19:11.067859835 +0900
@@ -36,7 +36,10 @@
#include "de_header.h"
#include "kaiseki.h"
-static void lnk_jkdbn (), lnk_jksbn (), lnk_jksone (), freejktsone ();
+static void lnk_jkdbn (struct free_list *);
+static void lnk_jksbn (struct free_list *);
+static void lnk_jksone (struct free_list *);
+static void freejktsone (register struct JKT_SONE *);
static struct JKT_DBN *free_jkdbn_top = NULL;
static struct free_list *free_list_jkdbn = NULL;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/rd_jishoop.c FreeWnn-1.1.1-a022.new/Wnn/jserver/rd_jishoop.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/rd_jishoop.c 2003-06-07 11:23:58.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/rd_jishoop.c 2013-08-12 18:05:13.786069852 +0900
@@ -86,22 +86,22 @@
#endif /* CONVERT_with_SiSheng */
if ((jtl->bufsize_kanji <= jtl->maxkanji + (Strlen (kanji) + Strlen (comment) + Strlen (yomi) + 3) * sizeof (w_char) + 1)
- && (ud_realloc_kanji (jtl) == NULL))
+ && (ud_realloc_kanji (jtl) == 0))
{
return (-1);
}
if (jtl->bufsize_ri1[D_YOMI] <= jtl->maxri1[D_YOMI] + 2
- && rd_realloc_ri1 (jtl, D_YOMI) == NULL)
+ && rd_realloc_ri1 (jtl, D_YOMI) == 0)
{
return (-1);
}
if (jtl->bufsize_ri1[D_KANJI] <= jtl->maxri1[D_KANJI] + 2
- && rd_realloc_ri1 (jtl, D_KANJI) == NULL)
+ && rd_realloc_ri1 (jtl, D_KANJI) == 0)
{
return (-1);
}
if (jtl->bufsize_serial <= jtl->maxserial + 4
- && ud_realloc_serial (jtl) == NULL)
+ && ud_realloc_serial (jtl) == 0)
{
return (-1);
}
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/readfile.c FreeWnn-1.1.1-a022.new/Wnn/jserver/readfile.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/readfile.c 2003-06-07 11:23:58.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/readfile.c 2013-08-12 18:34:50.166777666 +0900
@@ -55,6 +55,8 @@
#include "de_header.h"
#include "jdata.h"
+#include "etc.h"
+
#ifdef WRITE_CHECK
static int vfwrite (void*, int, int, FILE *);
#endif
@@ -101,7 +103,7 @@
struct wnn_file_head fh;
if (wf->localf == REMOTE)
{
- if (fopen_read_cur (wf->name) == NULL)
+ if (fopen_read_cur (wf->name) == 0)
{
wnn_errorno = WNN_FILE_READ_ERROR;
log_err ("read_file:could not open file %s.", wf->name);
@@ -341,7 +343,7 @@
{
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could not make the jisho area bigger.");
- return (NULL);
+ return (0);
}
jt->bufsize_hontai = new_bufsize;
jt->hontai = tp;
@@ -360,7 +362,7 @@
{
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could not make the jisho area bigger.");
- return (NULL);
+ return (0);
}
jt->bufsize_kanji = new_bufsize;
jt->kanji = tp;
@@ -403,7 +405,7 @@
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could notmake the jisho area bigger.");
- return (NULL);
+ return (0);
}
jt->bufsize_serial = new_bufsize;
jt->hindo = tp_hindo;
@@ -425,7 +427,7 @@
{
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could not make the jisho area bigger.");
- return (NULL);
+ return (0);
}
jt->ri2 = tp_ri2;
}
@@ -446,7 +448,7 @@
{
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could not make the jisho area bigger.");
- return (NULL);
+ return (0);
}
jt->bufsize_table = new_bufsize;
jt->table = tp;
@@ -467,7 +469,7 @@
{
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could not make the jisho area bigger.");
- return (NULL);
+ return (0);
}
jt->bufsize_ri1[which] = new_bufsize;
jt->ri1[which] = tp;
@@ -488,7 +490,7 @@
{
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could not make the hindo file area bigger.");
- return (NULL);
+ return (0);
}
hjt->bufsize_serial = new_bufsize;
hjt->hindo = tp;
@@ -509,7 +511,7 @@
{
wnn_errorno = WNN_MALLOC_ERR;
log_err ("could not make the jisho area bigger.");
- return (NULL);
+ return (0);
}
jt->bufsize_bnode = new_bufsize;
jt->bind = tp;
@@ -613,7 +615,7 @@
/* if(wf->localf == REMOTE){
}
*/
- if (fopen_write_cur (wf->name) == NULL)
+ if (fopen_write_cur (wf->name) == 0)
{
log_err ("receive_file:No file %s.", wf->name);
wnn_errorno = WNN_FILE_WRITE_ERROR;
@@ -1051,7 +1053,7 @@
new_size = Strlen (com) + 1;
if ((tp = (w_char *) realloc (jt->comment, jt->maxcomment * sizeof (w_char))) == NULL)
{
- return (NULL);
+ return (0);
}
jt->maxcomment = new_size;
jt->comment = tp;
@@ -1063,7 +1065,7 @@
new_size = Strlen (com) + 1;
if ((tp = (w_char *) realloc (hjt->comment, new_size * sizeof (w_char))) == NULL)
{
- return (NULL);
+ return (0);
}
hjt->maxcomment = new_size;
hjt->comment = tp;
@@ -1072,7 +1074,7 @@
break;
case WNN_FT_FUZOKUGO_FILE:
wnn_errorno = NOT_SUPPORTED_OPERATION;
- return (NULL);
+ return (0);
}
return (SUCCESS);
}
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/sisheng.c FreeWnn-1.1.1-a022.new/Wnn/jserver/sisheng.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/sisheng.c 2002-07-14 13:26:57.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/sisheng.c 2013-08-15 11:15:33.997899124 +0900
@@ -49,9 +49,9 @@
#include "cplib.h"
#include "de_header.h"
-#define isfuyuanyin(c) ((c=='m')||(c=='n')||(c=='g'))
+#define isfuyuanyin(c) (((c)=='m')||((c)=='n')||((c)=='g'))
#define isyuanyin(c) \
- ((c=='a')||(c=='e')||(c=='i')||(c=='o')||(c=='u')||(c=='v'))
+ (((c)=='a')||((c)=='e')||((c)=='i')||((c)=='o')||((c)=='u')||((c)=='v'))
/* yincod_flt_sisheng(): filter sisheng of Yincode strings */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/w_string.c FreeWnn-1.1.1-a022.new/Wnn/jserver/w_string.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jserver/w_string.c 2003-05-12 03:43:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jserver/w_string.c 2013-08-12 13:21:22.514484501 +0900
@@ -33,6 +33,8 @@
#include "commonhd.h"
#include "wnn_string.h"
+#include "de_header.h"
+
void
Sreverse (w1, w2)
register w_char *w1, *w2;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/atod.c FreeWnn-1.1.1-a022.new/Wnn/jutil/atod.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/atod.c 2013-08-15 14:44:15.361965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/atod.c 2013-08-15 20:06:06.796145993 +0900
@@ -70,6 +70,9 @@
#include "wnn_string.h"
#include "wnn_os.h"
+#include "jutil.h"
+#include "etc.h"
+
extern int wnn_loadhinsi FRWNN_PARAMS((unsigned char*)),
init_heap FRWNN_PARAMS((int,int,int,int,FILE*)),
little_endian FRWNN_PARAMS(()),
@@ -94,18 +97,8 @@
rev_short_fun FRWNN_PARAMS((w_char*)),
rev_w_char FRWNN_PARAMS((w_char*,int));
-
-extern
-#ifdef BDIC_WRITE_CHECK
- int
-#else
- void
-#endif
- put_n_EU_str FRWNN_PARAMS((FILE*,w_char*,int));
-
extern int sort_func_sdic FRWNN_PARAMS((char*,char*));
extern int sort_func_je FRWNN_PARAMS((char*,char*));
-extern char *get_cswidth_name FRWNN_PARAMS((register char*));
extern void set_cswidth FRWNN_PARAMS((register unsigned int));
static void ujistoud FRWNN_PARAMS((void)),
@@ -122,15 +115,12 @@
set_pter1 FRWNN_PARAMS((void)),
output_comment FRWNN_PARAMS((FILE*)),
output_hinsi_list FRWNN_PARAMS((FILE*));
-void upd_kanjicount FRWNN_PARAMS((int)),
- output_dic_data FRWNN_PARAMS((void));
/* Switcher variable between UD and SD */
int which_dict = WNN_REV_DICT;
#ifdef CHINESE
-extern int pzy_flag;
-static void output_sisheng ();
+static void output_sisheng FRWNN_PARAMS((FILE *));
#endif
/* Variables both for UD and SD */
@@ -271,8 +261,10 @@
com_name = argv[0];
init (argc, argv);
- if (cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG))
- set_cswidth (create_cswidth (cswidth_name));
+ if ((cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG)) != NULL)
+ {
+ set_cswidth (create_cswidth (cswidth_name));
+ }
#ifdef CHINESE
ujis_header (&which_dict); /* read header of UJIS dic */
@@ -909,7 +901,6 @@
}
#ifdef CONVERT_with_SiSheng
-extern void put_short ();
static void
output_sisheng (FILE* ofpter)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/atof.c FreeWnn-1.1.1-a022.new/Wnn/jutil/atof.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/atof.c 2002-07-14 13:26:57.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/atof.c 2013-08-13 21:51:18.947318514 +0900
@@ -131,6 +131,9 @@
#include "wnn_os.h"
#include "wnn_string.h"
+#include "etc.h"
+
+
#define FUZOKUGO_LEN 8
#define OUT_INT_KOSUU 20
#ifndef NO_FZK
@@ -249,18 +252,44 @@
#define SIZE 1024
char buf[SIZE];
-static int find_id (), bsch (), tcp (),
-#ifndef NO_FZK
- count_yomi (), count_fz_num (), count_same_yomi (),
-#endif
- find_id_name (), search_attr (), is_same_jiritugov ();
-static void init (), read_attr (), read_id (), read_jiritugov (),
+static int tcp FRWNN_PARAMS((char *));
+static int find_id FRWNN_PARAMS((char *));
+static int bsch FRWNN_PARAMS((char *, int, int));
+static int find_id_name FRWNN_PARAMS((int));
+static int search_attr FRWNN_PARAMS((char *));
+static int is_same_jiritugov FRWNN_PARAMS((int));
+
#ifndef NO_FZK
- make_fuzokugo_table (), check_fuzokugo (), sort (),
+static int count_yomi FRWNN_PARAMS((void));
+static int count_fz_num FRWNN_PARAMS((void));
+static int count_same_yomi FRWNN_PARAMS((int));
+static void sort FRWNN_PARAMS((void));
+static void check_fuzokugo FRWNN_PARAMS((void));
+static void make_fuzokugo_table FRWNN_PARAMS((void));
#endif
- read_syuutanv (), set_tc_from_name (), manipulate_tc (),
-print_out (), set_heap (), get_id_part (), check_attrs (), read_a_vector (), set_attribute (), bit_or (), set_id (), pre_clear_jiritugo_v (), usage (), sort_id ();
-extern int wnn_find_hinsi_by_name (), wnn_loadhinsi (), create_file_header ();
+
+static void set_heap FRWNN_PARAMS((char **, char *));
+static void set_tc_from_name FRWNN_PARAMS((void));
+static void get_id_part FRWNN_PARAMS((char *, char *));
+static void sort_id FRWNN_PARAMS((void));
+static void usage FRWNN_PARAMS((void));
+static void read_attr FRWNN_PARAMS((void));
+static void read_id FRWNN_PARAMS((void));
+static void read_jiritugov FRWNN_PARAMS((void));
+static void read_syuutanv FRWNN_PARAMS((void));
+static void set_tc_from_name FRWNN_PARAMS((void));
+static void print_out FRWNN_PARAMS((void));
+static void manipulate_tc FRWNN_PARAMS((void));
+static void manipulate_tc_vector FRWNN_PARAMS((struct vector *));
+static void check_attrs FRWNN_PARAMS((int, char *));
+static void read_a_vector FRWNN_PARAMS((struct vector *));
+static void set_attribute FRWNN_PARAMS((char *c, struct vector *));
+static void bit_or FRWNN_PARAMS((int [], int []));
+static void set_id FRWNN_PARAMS((int, int));
+static void pre_clear_jiritugo_v FRWNN_PARAMS((int));
+static void init FRWNN_PARAMS((int, char **));
+
+extern int wnn_loadhinsi (), create_file_header ();
static void
error_format (s, d1, d2, d3, d4, d5)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/atorev.c FreeWnn-1.1.1-a022.new/Wnn/jutil/atorev.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/atorev.c 2004-07-20 03:24:26.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/atorev.c 2013-08-13 19:47:30.016552682 +0900
@@ -53,12 +53,19 @@
#include "jdata.h"
#include "wnn_string.h"
+#include "jutil.h"
+
extern int kanjicount;
extern struct JT jt;
-static void r_alloc (), make_ri2 (), make_ri1 (), set_rpter1 ();
+static void set_rpter1 ();
+static void r_alloc FRWNN_PARAMS((void));
+static void make_ri2 FRWNN_PARAMS((void));
+static void make_ri1 FRWNN_PARAMS((int));
+static void set_rpter1 FRWNN_PARAMS((int));
+
extern int sort_func_je ();
-extern void sort_if_not_sorted (), uniq_je (), output_dic_data (), sort_kanji (), upd_kanjicount ();
+extern void sort_kanji ();
struct je **ptmp;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/dic_head.c FreeWnn-1.1.1-a022.new/Wnn/jutil/dic_head.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/dic_head.c 2004-07-20 03:24:26.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/dic_head.c 2013-08-13 17:45:11.832844819 +0900
@@ -35,7 +35,10 @@
#include "jh.h"
#include "jdata.h"
-extern int create_file_header (), output_header_jt (), input_file_header (), input_header_jt (), input_header_hjt ();
+#include "jutil.h"
+#include "etc.h"
+
+/* extern int create_file_header (), output_header_jt (), input_file_header (), input_header_jt (), input_header_hjt (); */
int
output_header (FILE* ofpter, struct JT* jtp, struct wnn_file_head* fhp)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/dtoa.c FreeWnn-1.1.1-a022.new/Wnn/jutil/dtoa.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/dtoa.c 2005-06-13 02:14:23.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/dtoa.c 2013-08-15 20:07:50.045146537 +0900
@@ -55,7 +55,11 @@
#endif /* STDC_HEADERS */
#if HAVE_UNISTD_H
# include <unistd.h>
-#endif
+#else /* HAVE_UNISTD_H */
+extern int optind;
+extern char *optarg;
+#endif /* HAVE_UNISTD_H */
+
#include "commonhd.h"
#include "wnn_config.h"
@@ -70,12 +74,31 @@
extern int pzy_flag; /* Pinyin or Zhuyin */
#endif
-extern void parse_options (), usage (), input_dic (), udtoujis (), kset (), sdtoujis (), ghindo (), sort (), output_ujis (), exit1 (), init_jeary (), get_kanji_str ();
-extern int input_header (), input_comment (), input_hinsi_list (), little_endian (), revdic (), wnn_loadhinsi (), init_heap (), w_stradd (), input_hindo_header (), motoni2 ();
+#include "etc.h"
+#include "jutil.h"
+
+void parse_options FRWNN_PARAMS((int *, char ***));
+void usage FRWNN_PARAMS((void));
+void udtoujis FRWNN_PARAMS((void));
+void kset FRWNN_PARAMS((void));
+void sdtoujis FRWNN_PARAMS((char *hopter, register int level));
+void ghindo FRWNN_PARAMS((int, char **));
+int input_comment FRWNN_PARAMS((register FILE *));
+int input_hinsi_list FRWNN_PARAMS((register FILE *));
+void input_dic FRWNN_PARAMS((FILE *));
+
+extern void sort (), output_ujis (), exit1 (), init_jeary (), get_kanji_str ();
+extern int input_header (), little_endian (), revdic (), wnn_loadhinsi (), init_heap (), w_stradd (), input_hindo_header (), motoni2 ();
+
#ifdef CONVERT_with_SiSheng
-extern int cwnn_yincod_pzy_str (), input_sisheng ();
-#endif
-static int rdtoujis (), set_hinsi (), input_hindo (), add_hindo ();
+int input_sisheng FRWNN_PARAMS((register FILE *ifpter));
+#endif /* CONVERT_with_SiSheng */
+
+static int rdtoujis FRWNN_PARAMS((void));
+static int add_hindo FRWNN_PARAMS((register FILE *, int));
+static int input_hindo FRWNN_PARAMS((register FILE *));
+static int set_hinsi FRWNN_PARAMS((void));
+
/* Moved from Wnn/etc/bdic.c */
int get_n_EU_str (FILE* ifpter, int n, w_char* st);
int get_short (short* sp, FILE* ifpter);
@@ -100,13 +123,13 @@
{
FILE *ifpter;
char *cswidth_name;
- extern char *get_cswidth_name ();
- extern void set_cswidth ();
com_name = argv[0];
- if (cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG))
- set_cswidth (create_cswidth (cswidth_name));
+ if ((cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG)) != NULL)
+ {
+ set_cswidth (create_cswidth (cswidth_name));
+ }
parse_options (&argc, &argv);
if ((ifpter = fopen (infile, "r")) == NULL)
@@ -161,8 +184,6 @@
char ***argv;
{
int c;
- extern int optind;
- extern char *optarg;
#ifdef CONVERT_with_SiSheng
# define OPTSTRING "nseEzh:"
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/oldatonewa.c FreeWnn-1.1.1-a022.new/Wnn/jutil/oldatonewa.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/oldatonewa.c 2004-07-20 03:24:26.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/oldatonewa.c 2013-08-13 14:32:53.743940895 +0900
@@ -49,6 +49,8 @@
#include "wnn_os.h"
#include "wnn_string.h"
+#include "etc.h"
+
static char *ohinsi[] = {
"カ行五段",
"カ行(行く)",
@@ -86,7 +88,6 @@
#define LINE_SIZE 1024
-extern int motoni2 ();
static int get_line1 (char* buffer);
static char* get_string (char* str, char* buf);
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/ujisf.c FreeWnn-1.1.1-a022.new/Wnn/jutil/ujisf.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/ujisf.c 2010-12-24 02:17:43.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/ujisf.c 2013-08-15 11:44:02.345908128 +0900
@@ -57,30 +57,31 @@
#include "wnn_os.h"
#include "wnn_string.h"
+#include "etc.h"
+#include "jutil.h"
+
#ifdef CHINESE
#include "cplib.h"
int pzy_flag = CWNN_PINYIN; /* Pinyin or Zhuyin */
-static void sisheng_num (), read_kanji_str_w ();
+static void sisheng_num (register char *, register int *);
+static void read_kanji_str_w (register w_char *, register w_char *);
#endif
#ifndef min
-#define min(a, b) ((a > b)? b:a)
-#define max(a, b) ((a < b)? b:a)
+#define min(a, b) (((a) > (b))? (b) : (a))
+#define max(a, b) (((a) < (b))? (b) : (a))
#endif
extern unsigned char kanjiaddr (unsigned char *d0, w_char* kanji, w_char* yomi, w_char* comment);
extern void Print_entry (w_char* yomi, w_char* kstr, w_char* cstr,
int hindo, int ima, int hinsi, int serial,
FILE* ofpter, int esc_exp);
-extern int wnn_find_hinsi_by_name ();
-#ifdef CHINESE
-extern void cwnn_zy_str_analysis (), cwnn_py_str_analysis ();
-#endif
-int sort_func (), Sorted (), w_stradd ();
-static void Kanjistradd (), bunpou_num (), read_kanji_str (), toesc ();
-void exit1 ();
+extern int w_stradd ();
-extern struct JT jt;
+static void Kanjistradd FRWNN_PARAMS((w_char *, w_char *, w_char *, register UCHAR **));
+static void bunpou_num FRWNN_PARAMS((register char *, register int *));
+static void read_kanji_str FRWNN_PARAMS((register char *, register char *));
+static void toesc FRWNN_PARAMS((char *, char *));
/* extern variables */
@@ -547,7 +548,7 @@
}
}
-extern char *wnn_get_hinsi_name ();
+/* extern char *wnn_get_hinsi_name (); */
void
print_je (jep, opter, serial_out, esc_exp)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wddel.c FreeWnn-1.1.1-a022.new/Wnn/jutil/wddel.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wddel.c 2012-06-13 04:18:32.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/wddel.c 2013-08-15 20:13:04.762148196 +0900
@@ -48,10 +48,12 @@
# if HAVE_MALLOC_H
# include <malloc.h>
# endif
+extern char *getenv ();
#endif /* STDC_HEADERS */
+
#if HAVE_UNISTD_H
# include <unistd.h>
-#endif
+#endif /* HAVE_UNISTD_H */
#include "commonhd.h"
#include "wnn_config.h"
@@ -60,6 +62,8 @@
#include "wnn_string.h"
#include "wnn_os.h"
+#include "etc.h"
+
#define WORD_DELETE 1
#define COMMENT_SET 2
#define HINDO_SET 3
@@ -105,9 +109,6 @@
int argc;
char **argv;
{
- extern char *getenv ();
- extern int optind;
- extern char *optarg;
struct wnn_dic_info *info;
int c;
int k;
@@ -115,8 +116,6 @@
int sno;
char s[LINE_SIZE];
char *cswidth_name;
- extern char *get_cswidth_name ();
- extern void set_cswidth ();
if (getenv (WNN_DEF_SERVER_ENV))
{
@@ -128,8 +127,10 @@
}
server_n = def_server;
- if (cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG))
- set_cswidth (create_cswidth (cswidth_name));
+ if ((cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG)) != NULL)
+ {
+ set_cswidth (create_cswidth (cswidth_name));
+ }
while ((c = getopt (argc, argv, "D:n:d:CHEL")) != EOF)
{
switch (c)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wdreg.c FreeWnn-1.1.1-a022.new/Wnn/jutil/wdreg.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wdreg.c 2012-06-13 04:18:32.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/wdreg.c 2013-08-15 20:14:40.489148701 +0900
@@ -48,6 +48,7 @@
# if HAVE_MALLOC_H
# include <malloc.h>
# endif
+extern char *getenv ();
#endif /* STDC_HEADERS */
#include <sys/types.h>
#include <sys/file.h>
@@ -63,9 +64,8 @@
#include "jdata.h"
#include "wnn_os.h"
-extern int init_heap ();
-extern void ujis_header (), read_ujis ();
-extern struct je **jeary;
+#include "etc.h"
+#include "jutil.h"
char *def_server;
struct JT jt;
@@ -105,16 +105,11 @@
int argc;
char **argv;
{
- extern int optind;
- extern char *optarg;
struct wnn_dic_info *info;
int c;
int k;
int num;
char *cswidth_name;
- extern char *get_cswidth_name ();
- extern void set_cswidth ();
- extern char *getenv ();
if (getenv (WNN_DEF_SERVER_ENV))
{
@@ -126,8 +121,10 @@
}
server_n = def_server;
- if (cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG))
- set_cswidth (create_cswidth (cswidth_name));
+ if ((cswidth_name = get_cswidth_name (WNN_DEFAULT_LANG)) != NULL)
+ {
+ set_cswidth (create_cswidth (cswidth_name));
+ }
while ((c = getopt (argc, argv, "D:n:d:L")) != EOF)
{
switch (c)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wnnkill.c FreeWnn-1.1.1-a022.new/Wnn/jutil/wnnkill.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wnnkill.c 2005-01-31 02:14:20.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/wnnkill.c 2013-08-13 14:02:01.093055294 +0900
@@ -55,6 +55,9 @@
#include "wnn_config.h"
#include "wnn_os.h"
+#include "jlib_hide.h"
+#include "etc.h"
+
WNN_JSERVER_ID *js;
struct wnn_ret_buf rb = { 0, NULL };
#define BUFSTRLEN 1024
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wnnstat.c FreeWnn-1.1.1-a022.new/Wnn/jutil/wnnstat.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wnnstat.c 2002-05-13 07:51:17.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/wnnstat.c 2013-08-13 13:59:30.119064617 +0900
@@ -52,6 +52,7 @@
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
+#include <stdarg.h>
#include "jslib.h"
#include "jllib.h"
@@ -61,6 +62,9 @@
#include "wnn_os.h"
#include "msg.h"
+#include "jlib_hide.h"
+#include "etc.h"
+
WNN_JSERVER_ID *js;
struct wnn_ret_buf rb = { 0, NULL };
#define WNNSTAT_ENV "This_is_wnnstat"
@@ -73,13 +77,24 @@
#define W_DIC_ALL 5
#define W_VERSION 6
+extern int optind;
+extern char *optarg;
+extern char *getenv ();
+
#ifdef JAPANESE
extern int eujis_to_jis8 (), eujis_to_sjis ();
#endif
#ifdef CHINESE
extern int ecns_to_big5 ();
#endif
-static void printall (), printpat (), err (), usage (), who (), dic (), dic_all (), file_all (), wsttost (), out ();
+static void err (), usage (), dic (), dic_all (), file_all ();
+static void printall FRWNN_PARAMS((WNN_ENV_INFO *, int));
+static void printpat FRWNN_PARAMS((WNN_ENV_INFO *, int));
+static void wsttost FRWNN_PARAMS((char *, w_char *));
+
+static void who FRWNN_PARAMS((char *lang));
+static void out FRWNN_PARAMS((const char *, ...));
+
#ifdef CHINESE
#ifdef TAIWANESE
@@ -108,16 +123,13 @@
int c, i, j;
WNN_ENV_INFO *w;
static char lang[64] = { 0 };
- extern int optind;
- extern char *optarg;
- extern char *getenv ();
char nlspath[64];
/*
char *p;
*/
char *server_env = NULL;
char *prog = argv[0];
- extern char *_wnn_get_machine_of_serv_defs (), *get_server_env ();
+ extern char *get_server_env ();
/*
if ((p = getenv("LANG")) != NULL) {
@@ -246,8 +258,8 @@
{
out ("%s:", prog);
if (serv && *serv)
- out (serv);
- out (wnn_perror_lang (lang));
+ out ("%s", serv);
+ out ("%s", wnn_perror_lang (lang));
putchar ('\n');
/* out(" jserver と接続出来ません。\n"); */
exit (-1);
@@ -519,13 +531,20 @@
}
static void
-out (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13)
- char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8, *a9, *a10, *a11, *a12, *a13;
+out (const char * format, ...)
{
int len;
char buf[1024];
char jbuf[1024];
- sprintf (buf, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
+ va_list ap;
+
+ va_start (ap, format);
+#ifdef HAVE_SNPRINTF /* Should also have vsnprintf */
+ vsnprintf (buf, sizeof buf, format, ap);
+#else
+ vsprintf (buf, format, ap); /* Dangerous */
+#endif /* HAVE_SNPRINTF */
+ va_end (ap);
len = strlen (buf);
switch (ocode)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wnntouch.c FreeWnn-1.1.1-a022.new/Wnn/jutil/wnntouch.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/jutil/wnntouch.c 2004-07-20 03:24:26.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/jutil/wnntouch.c 2013-08-13 22:12:35.103367152 +0900
@@ -52,6 +52,8 @@
#include "commonhd.h"
#include "getopt.h" /* GNU getopt in the stock */
+#include "etc.h"
+
extern int input_file_header (), check_inode (), change_file_uniq ();
static void usage (void);
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/romkan/rk_bltinfn.c FreeWnn-1.1.1-a022.new/Wnn/romkan/rk_bltinfn.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/romkan/rk_bltinfn.c 2013-08-15 14:44:15.361965120 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/romkan/rk_bltinfn.c 2013-08-14 15:25:33.429462296 +0900
@@ -54,6 +54,8 @@
#include "rk_header.h"
#include "jslib.h"
+#include "romkan.h"
+
/* 半角文字のコードのdefine */
#define HKCHOU (HNKAK1 * 0x100 + 0xB0) /* ー */
#define HKDKTN (HNKAK1 * 0x100 + 0xDE) /* ゙ */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/basic_op.c FreeWnn-1.1.1-a022.new/Wnn/uum/basic_op.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/basic_op.c 2006-02-11 03:29:38.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/basic_op.c 2013-08-15 08:59:54.712856224 +0900
@@ -189,10 +189,6 @@
int in;
unsigned int *output;
- extern int kakutei ();
- extern int send_string ();
- extern int return_it ();
-
not_redraw = 0;
while (1)
{
@@ -287,7 +283,8 @@
{
if (tmp_send)
{
- ret = return_it (c, romkan);
+ /* ret = return_it (c, romkan); */
+ ret = return_it (c);
tmp_send = 0;
}
else
@@ -401,7 +398,7 @@
int
input_a_char_from_function (fun)
- int (*fun) ();
+ int (*fun) (void);
{
int c;
int ret = 0;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/header.c FreeWnn-1.1.1-a022.new/Wnn/uum/header.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/header.c 2006-03-05 04:01:46.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/header.c 2013-08-15 12:33:46.636923857 +0900
@@ -38,6 +38,8 @@
#include "sheader.h"
#include "buffer.h"
+#include "etc.h"
+
int not_redraw;
w_char *input_buffer;
w_char *return_buf; /* return you mojiretsu buffer */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/history.c FreeWnn-1.1.1-a022.new/Wnn/uum/history.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/history.c 2002-05-13 07:51:17.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/history.c 2013-08-14 20:12:25.911553017 +0900
@@ -104,7 +104,7 @@
{
if (!history_cunt)
return (0);
- if (n <= 0 || n > maxchg || *wstr == NULL)
+ if (n <= 0 || n > maxchg || *wstr == 0)
return (-1);
if (n == 1 && NORMAL_CHAR (*wstr))
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/inspect.c FreeWnn-1.1.1-a022.new/Wnn/uum/inspect.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/inspect.c 2012-06-16 19:02:04.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/inspect.c 2013-08-15 08:52:56.838854022 +0900
@@ -181,7 +181,7 @@
return (0);
}
-static void sakujo_kouho1 ();
+static void sakujo_kouho1 (int);
int
sakujo_kouho ()
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jhlp.c FreeWnn-1.1.1-a022.new/Wnn/uum/jhlp.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jhlp.c 2013-08-04 00:06:16.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/jhlp.c 2013-08-15 12:56:49.795931147 +0900
@@ -141,6 +141,8 @@
#include <sys/eucioctl.h>
#endif /* SVR4 */
+#include "etc.h"
+
#define ERROR -1
jmp_buf kk_env;
@@ -162,7 +164,7 @@
static void save_signals (void);
static void restore_signals (void);
-static RETSIGTYPE terminate_handler (void);
+static RETSIGTYPE terminate_handler (int);
static void do_end (void);
static void open_pty (void);
static void open_pty_traditional (void);
@@ -412,7 +414,7 @@
switch (init_uum ())
{ /* initialize of kana-kanji henkan */
case -1:
- terminate_handler ();
+ terminate_handler (-1);
break;
case -2:
epilogue ();
@@ -1109,7 +1111,7 @@
/** signal SIGCHLD を受けた後の処理をする。*/
RETSIGTYPE
-chld_handler (void)
+chld_handler (int sig)
{
#ifdef HAVE_WAIT3
#ifdef HAVE_UNION_WAIT
@@ -1168,7 +1170,7 @@
/** signal SIGTERM を受けた時の処理をする。*/
static RETSIGTYPE
-terminate_handler (void)
+terminate_handler (int sig)
{
signal (SIGCHLD, SIG_IGN);
epilogue_no_close ();
@@ -1182,7 +1184,7 @@
#ifdef SIGWINCH
RETSIGTYPE
-resize_handler (void)
+resize_handler (int sig)
{
re_signal (SIGWINCH, resize_handler);
change_size ();
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jikouho.c FreeWnn-1.1.1-a022.new/Wnn/uum/jikouho.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jikouho.c 2006-02-11 18:51:44.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/jikouho.c 2013-08-14 18:31:19.091521041 +0900
@@ -370,6 +370,6 @@
buf[m++] = *tmp;
}
}
- buf[m] = NULL;
+ buf[m] = '\0';
strcpy (x, buf);
}
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jis_in.c FreeWnn-1.1.1-a022.new/Wnn/uum/jis_in.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jis_in.c 2001-06-15 03:16:07.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/jis_in.c 2013-08-14 11:06:19.040380314 +0900
@@ -43,7 +43,7 @@
#define FROM_JIS 0x21
#define TO_JIS 0x7E
-static int get_jis_ichiran ();
+static int get_jis_ichiran (char *, int);
int
in_jis () /* returns code for a moji */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jutil.c FreeWnn-1.1.1-a022.new/Wnn/uum/jutil.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/jutil.c 2002-03-30 10:45:41.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/jutil.c 2013-08-14 19:27:04.087538672 +0900
@@ -371,16 +371,18 @@
return (select_line_element (buf_ptr, dic_list_size, 0, "", 0, 0, main_table[tbl]));
}
-void
+int
print_msg1 (X)
char *X;
{
+ int ans;
push_cursor ();
throw_c (0);
clr_line ();
- printf (X);
+ ans = printf ("%s", X);
flush ();
pop_cursor ();
+ return ans;
}
void
@@ -544,12 +546,12 @@
int
yes_or_no (string)
- char *string;
+ const char *string;
{
int x;
throw_c (0);
clr_line ();
- printf (string);
+ printf ("%s", string);
flush ();
for (;;)
{
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/key_bind.c FreeWnn-1.1.1-a022.new/Wnn/uum/key_bind.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/key_bind.c 2002-03-30 10:45:41.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/key_bind.c 2013-08-14 20:12:12.045552944 +0900
@@ -248,7 +248,7 @@
static char key_binded[sizeof (kansuu_hyo) / sizeof (struct kansuu) + 1];
-int key_binding ();
+int key_binding (char [64]);
int
init_key_table ()
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/kuten.c FreeWnn-1.1.1-a022.new/Wnn/uum/kuten.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/kuten.c 2001-06-15 03:16:07.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/kuten.c 2013-08-14 10:58:28.788377836 +0900
@@ -41,7 +41,7 @@
#define MAX_TEN_LENGTH 94
-static int get_ichiran ();
+static int get_ichiran (int);
int
in_kuten () /* returns code for a moji */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/printf.c FreeWnn-1.1.1-a022.new/Wnn/uum/printf.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/printf.c 2006-02-11 18:51:44.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/printf.c 2013-08-14 10:25:43.812367479 +0900
@@ -55,7 +55,7 @@
{
return ((*char_q_len_func) (x));
}
-
+/*
void
fprintf (file, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)
FILE *file;
@@ -68,6 +68,7 @@
puteustring (buf2, file);
}
+*/
void
puteustring (buf2, file)
@@ -85,6 +86,7 @@
}
}
+/*
void
printf (format, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13)
char *format;
@@ -93,6 +95,7 @@
fprintf (stdout, format, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13);
}
+*/
#define W_BUFLEN 32
static w_char w_buf[W_BUFLEN];
@@ -185,8 +188,8 @@
push_cursor ();
throw_c (0);
clr_line ();
- printf (wnn_perror ());
- printf (MSG_GET (8));
+ printf ("%s", wnn_perror ());
+ printf ("%s", MSG_GET (8));
/*
printf(" (如何)");
*/
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/prologue.c FreeWnn-1.1.1-a022.new/Wnn/uum/prologue.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/prologue.c 2002-05-13 07:51:17.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/prologue.c 2013-08-14 16:48:22.888488489 +0900
@@ -63,6 +63,8 @@
#include "sheader.h"
#include "wnn_os.h"
+#include "romkan.h"
+#include "conv.h"
/** romkan のイニシャライズ */
int
@@ -222,32 +224,35 @@
return (0);
}
-static void
+static int
puts1 (s)
- char *s;
+ const char *s;
{
- printf ("%s\n", s);
+ int ans = printf ("%s\n", s);
flush ();
+ return ans;
}
-static void
+static int
puts2 (s)
- char *s;
+ const char *s;
{
+ int ans;
throw_c (0);
clr_line ();
- printf ("%s", s);
+ ans = printf ("%s", s);
flush ();
+ return ans;
}
static int
yes_or_no_init (s)
- char *s;
+ const char *s;
{
for (;;)
{
char x[256];
- printf (s);
+ printf ("%s", s);
flush ();
if (fgets (x, 256, stdin) == NULL)
{
@@ -269,8 +274,8 @@
char environment[PATHNAMELEN];
WnnEnv *p;
WnnEnv *save_cur_normal_env = NULL, *save_cur_reverse_env = NULL;
- int (*yes_no_func) ();
- void (*puts_func) ();
+ int (*yes_no_func) (const char *);
+ int (*puts_func) (const char *);
if (first == 0)
{
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/screen.c FreeWnn-1.1.1-a022.new/Wnn/uum/screen.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/screen.c 2002-06-22 22:26:21.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/screen.c 2013-08-14 20:24:31.897556844 +0900
@@ -97,7 +97,8 @@
#define MARJIN 1 /* カーソルが右端からこれだけの所にくれば、次の画面に行く */
static void t_cont_line_note ();
-static int find_character_on_that_col (), set_vst ();
+static int find_character_on_that_col (int, int);
+static int set_vst ();
void
throw (x)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/sdefine.h FreeWnn-1.1.1-a022.new/Wnn/uum/sdefine.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/sdefine.h 2006-03-05 04:01:46.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/sdefine.h 2013-08-14 10:45:27.831373720 +0900
@@ -181,8 +181,8 @@
#define w_char unsigned short
#endif
-#define printf PRINTF
-#define fprintf FPRINTF
+/* #define printf PRINTF */
+/* #define fprintf FPRINTF */
#define remove REMOVE
#define throw_c(col) throw_col((col) + disp_mode_length)
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/select_ele.c FreeWnn-1.1.1-a022.new/Wnn/uum/select_ele.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/select_ele.c 2012-06-13 04:18:33.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/select_ele.c 2013-08-15 08:30:02.847846780 +0900
@@ -80,10 +80,10 @@
/* 1: all */
static int kosuu; /* kosuu of elements */
-static void display_all (), display ();
-static void reverse ();
-static void clear_it ();
-static int find_cc (), set_kouho (), change_decimal (), findcp ();
+static void display_all (int, int), display (int, int);
+static void reverse (int, int);
+static void clear_it (int, int);
+static int find_cc (int), set_kouho (void), change_decimal (int), findcp (int, int);
int
select_one_element (c, kosuu1, init, msg1, msg_len1, state1, key_tbl)
@@ -113,7 +113,7 @@
msg_len = msg_len1;
state = state1;
- dd_size = set_kouho (kosuu);
+ dd_size = set_kouho (); /* dd_size = set_kouho (kosuu); */
cc = find_cc (init);
mm = init;
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/sheader.h FreeWnn-1.1.1-a022.new/Wnn/uum/sheader.h
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/sheader.h 2009-06-01 01:35:06.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/sheader.h 2013-08-15 13:00:14.803932228 +0900
@@ -29,6 +29,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef FRWNN_SHEADER_H
+#define FRWNN_SHEADER_H 1
+
+
/**************************
* header of standard i/o
**************************/
@@ -36,6 +40,8 @@
#include "jslib.h"
#include "wnn_os.h"
+#include "etc.h"
+
typedef struct _WnnEnv
{
char *host_name; /* server name */
@@ -237,7 +243,7 @@
extern void clr_line ();
extern void clr_line_all ();
extern int connect_jserver (int);
-extern int convert_getterm ();
+/* extern int convert_getterm (char *, int); */ /* moved to include/conv.h */
extern int convert_key_setup ();
extern int cur_ichi (int, int);
extern void cursor_invisible_raw (void);
@@ -262,16 +268,16 @@
extern void flushw_buf (void);
extern int forward_char (void);
extern int backward_char (void);
-extern void get_end_of_history ();
-extern void getfname ();
+extern void get_end_of_history (register w_char *);
+extern void getfname (char *, char *);
extern void h_r_off ();
extern void h_r_off_raw ();
extern void h_r_on ();
extern void h_r_on_raw ();
extern int henkan_gop ();
-extern void henkan_if_maru ();
+extern void henkan_if_maru (w_char);
extern int henkan_off ();
-extern int hextodec ();
+extern int hextodec (char);
extern int hinsi_in ();
extern int init_history ();
extern int init_key_table ();
@@ -279,143 +285,140 @@
extern int init_uum ();
extern int initial_message_out ();
extern void initialize_vars ();
-extern int input_a_char_from_function ();
-extern int insert_char ();
-extern int insert_char_and_change_to_insert_mode ();
+extern int input_a_char_from_function (int (*) (void));
+extern int insert_char (w_char);
+extern int insert_char_and_change_to_insert_mode (int);
extern int insert_modep ();
extern int j_term_init ();
-extern int flush_designate ();
+/* extern int flush_designate (w_char *); */ /* move to include/etc.h */
extern int jtosj ();
extern int jutil ();
-extern int kakutei ();
-extern int kana_in ();
-extern int kana_in_w_char_msg ();
-extern int keyin1 ();
+extern int kana_in (char *, int, w_char *, int);
+extern int kana_in_w_char_msg (w_char *, int, w_char *, int);
+extern int keyin1 (int (*) (void), char *);
extern int kk ();
extern void kk_cursor_invisible ();
extern void kk_cursor_normal ();
extern void kk_restore_cursor ();
extern void kk_save_cursor ();
-extern int make_history ();
-extern int make_info_out ();
-extern int make_jikouho_retu ();
-extern void make_kanji_buffer ();
-extern int make_string_for_ke ();
-extern int next_history1 ();
+extern int make_history (register w_char *, register int);
+extern int make_info_out (char [], int, WNN_DIC_INFO [], int);
+extern int make_jikouho_retu (char *, int, char *[], int);
+extern void make_kanji_buffer (int);
+extern int make_string_for_ke (int, char *, int);
+extern int next_history1 (register w_char *);
extern int nobasi_tijimi_mode ();
-extern int nobi_conv ();
+extern int nobi_conv (int, struct wnn_env *);
extern void pop_cursor ();
extern void pop_hrus ();
-extern int previous_history1 ();
-extern void print_buf_msg ();
+extern int previous_history1 (register w_char *);
+extern void print_buf_msg (char *);
extern void reset_cursor ();
extern void push_cursor ();
extern void push_hrus ();
-extern void putchar1 ();
-extern void putchar_norm ();
-extern void puteustring ();
+extern void putchar1 (int);
+extern void putchar_norm (int);
+extern void puteustring (char *, FILE *);
extern int reconnect_jserver_body ();
extern int redraw_line ();
extern int redraw_nisemono ();
-extern void remove_key_bind ();
+extern void remove_key_bind (int);
extern int isconect_jserver ();
extern int ren_henkan0 ();
-extern void reset_bold ();
+extern void reset_bold (int);
extern void reset_cursor_status ();
extern void restore_cursor_raw ();
extern void ring_bell ();
extern void save_cursor_raw ();
extern void scroll_up ();
-extern int select_jikouho1 ();
-extern int select_line_element ();
-extern int select_one_dict1 ();
-extern int select_one_element ();
+extern int select_jikouho1 (int);
+extern int select_line_element (char **, int, int, char *, int, int, int (**) ());
+extern int select_one_dict1 (int);
+extern int select_one_element (char **, int, int, char *, int, int, int (**) ());
extern int set_TERMCAP ();
-extern void set_bold ();
+extern void set_bold (int);
extern void set_cursor_status ();
-extern void set_escape_code ();
-extern void set_hanten_ul ();
-extern void set_lc_offset ();
+extern void set_escape_code (char *);
+extern void set_hanten_ul (int, int);
+extern void set_lc_offset (int);
extern void set_screen_vars_default ();
extern void set_keypad_on ();
extern void set_keypad_off ();
-extern void set_scroll_region ();
-extern int st_colum ();
+extern void set_scroll_region (int, int);
+extern int st_colum (int);
extern void t_cont_line_note_delete ();
-extern int t_delete_char ();
+extern int t_delete_char (void);
extern int t_kill ();
-extern int t_move ();
+extern int t_move (int);
extern int t_print_l ();
-extern void t_print_line ();
-extern int t_redraw_move ();
-extern int t_rubout ();
+extern void t_print_line (int, int, int);
+extern int t_redraw_move (int, int, int, int);
+extern int t_rubout (int, int);
extern void t_throw ();
extern int t_yank ();
-extern int tan_conv ();
-extern int tan_henkan1 ();
-extern void throw_col ();
-extern void throw_cur_raw ();
+extern int tan_conv (int);
+extern int tan_henkan1 (int, struct wnn_env *);
+extern void throw_col (int);
+extern void throw_cur_raw (int, int);
extern void touroku ();
extern void u_s_off ();
extern void u_s_off_raw ();
extern void u_s_on ();
extern void u_s_on_raw ();
-extern int update_dic_list ();
+extern int update_dic_list (struct wnn_buf *);
extern int uumrc_get_entries ();
-extern void w_printf ();
-extern int w_putchar ();
+extern void w_printf (w_char *, int);
+extern int w_putchar (w_char);
extern void w_sttost ();
-extern int wchartochar ();
-extern int yes_or_no ();
-extern int yes_or_no_or_newline ();
+extern int wchartochar (w_char *, UCHAR *);
+extern int yes_or_no (const char *);
+extern int yes_or_no_or_newline (char *);
extern int zenkouho_dai_c ();
-extern void find_yomi_for_kanji ();
+extern void find_yomi_for_kanji (w_char *, w_char *);
extern int check_vst ();
extern void t_redraw_one_line ();
-extern void throw ();
+extern void throw (int);
extern int keyin ();
-extern int push_unget_buf ();
+extern int push_unget_buf (int);
extern unsigned int *get_unget_buf ();
extern int if_unget_buf ();
-extern int set_cur_env ();
+extern int set_cur_env (char);
extern char env_state ();
-extern void get_new_env ();
+extern void get_new_env (int);
extern int call_t_redraw_move_normal ();
-extern int call_t_redraw_move ();
+extern int call_t_redraw_move (int, int, int, int, int);
extern int call_t_redraw_move_1_normal ();
-extern int call_t_redraw_move_1 ();
+extern int call_t_redraw_move_1 (int, int, int, int, int, int, int);
extern int call_t_redraw_move_2_normal ();
-extern int call_t_redraw_move_2 ();
-extern int call_t_print_l_normal ();
-extern int call_t_print_l ();
-extern int c_top_normal ();
-extern int c_end_normal ();
+extern int call_t_redraw_move_2 (int, int, int, int, int, int, int);
+extern int call_t_print_l_normal (int, int);
+extern int call_t_print_l (int, int);
+extern int c_top_normal (void);
+extern int c_end_normal (void);
extern int c_end_nobi_normal ();
extern int char_q_len_normal ();
extern int char_len_normal ();
-extern int t_redraw_move_normal ();
+extern int t_redraw_move_normal (int, int, int, int);
extern int t_print_l_normal ();
extern int call_redraw_line_normal ();
-extern int call_redraw_line ();
+extern int call_redraw_line (int, int);
extern int hani_settei_normal ();
extern void call_errorkeyin ();
extern int call_jl_yomi_len ();
-extern int through ();
-extern int sStrcpy ();
-extern int Sstrcpy ();
+/* extern int through (char *, char *, int); */
+extern int sStrcpy (UCHAR *, w_char *);
+extern int Sstrcpy (register w_char *, register UCHAR *);
extern char *sStrncpy ();
-extern w_char *Strcat ();
-extern w_char *Strncat ();
-extern int Strncmp ();
-extern w_char *Strcpy ();
-extern w_char *Strncpy ();
-extern int Strlen ();
-extern void conv_ltr_to_ieuc ();
-extern int get_cswidth_by_char ();
-extern int eeuc_to_ieuc ();
-extern int conv_keyin ();
+extern w_char *Strcat (register w_char *, register w_char *);
+extern w_char *Strncat (register w_char *, register w_char *, register int);
+extern int Strncmp (register w_char *, register w_char *, register int);
+extern w_char *Strcpy (register w_char *, register w_char *);
+extern w_char *Strncpy (register w_char *, register w_char *, int);
+extern int Strlen (register w_char *);
+extern void conv_ltr_to_ieuc (register unsigned int *);
+extern int conv_keyin (char *);
#ifdef JAPANESE
extern int eujis_to_iujis ();
@@ -457,7 +460,7 @@
extern int hani_settei_yincod ();
extern void errorkeyin_q ();
extern int not_call_jl_yomi_len ();
-extern int cwnn_pzy_yincod ();
+/* extern int cwnn_pzy_yincod (); */ /* move to include/etc.h */
extern int cwnn_yincod_pzy_str ();
extern int icns_to_ecns ();
@@ -485,4 +488,10 @@
extern int do_U_opt ();
#endif /* KOREAN */
-extern void romkan_set_lang ();
+/* uif.c */
+extern int return_it (int);
+extern int send_string (int);
+extern int kakutei (void);
+
+
+#endif /* FRWNN_SHEADER_H */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/termio.c FreeWnn-1.1.1-a022.new/Wnn/uum/termio.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/termio.c 2006-09-05 02:21:29.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/termio.c 2013-08-14 20:01:47.956549655 +0900
@@ -119,7 +119,7 @@
return (-1);
}
#endif /* defined(uniosu) */
- if (save_cursor == (char *) NULL || *save_cursor == NULL || restore_cursor == (char *) NULL || *restore_cursor == NULL || change_scroll_region == (char *) NULL || *change_scroll_region == NULL)
+ if (save_cursor == (char *) NULL || *save_cursor == '\0' || restore_cursor == (char *) NULL || *restore_cursor == '\0' || change_scroll_region == (char *) NULL || *change_scroll_region == '\0')
{
fprintf (stderr, "Your terminal is not strong enough. Goodbye !\n");
return (-1);
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/touroku.c FreeWnn-1.1.1-a022.new/Wnn/uum/touroku.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/touroku.c 2006-02-11 18:51:44.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/touroku.c 2013-08-14 17:38:18.193504276 +0900
@@ -66,7 +66,7 @@
int touroku_mark = -1;
-static int hani_settei ();
+static int hani_settei (w_char *, int);
/* 登録のための外部関数*/
void
@@ -473,7 +473,7 @@
{
kana_end += jl_jiri_len (bun_data_, e_bun) + e_offset - klen;
}
- Strcpy (yomi_buf, yomi_buf + kana_start, kana_end - kana_start);
+ Strncpy (yomi_buf, yomi_buf + kana_start, kana_end - kana_start);
yomi_buf[kana_end - kana_start] = 0;
}
}
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/ttyfdslot.c FreeWnn-1.1.1-a022.new/Wnn/uum/ttyfdslot.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/ttyfdslot.c 2002-06-22 22:26:21.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/ttyfdslot.c 2013-08-14 20:03:19.854550139 +0900
@@ -68,7 +68,7 @@
register int slotnum;
if ((fullnamp = ttyname (fd)) == NULL)
- return NULL;
+ return 0;
if ((ttynamp = rindex (fullnamp, '/')) == NULL)
{
ttynamp = fullnamp;
@@ -78,7 +78,7 @@
ttynamp++;
}
if ((ttysfp = fopen ("/etc/ttys", "r")) == NULL)
- return NULL;
+ return 0;
for (slotnum = 0; fgets (eachslot, SLOTSIZ, ttysfp);)
{
p = eachslot + strlen (eachslot) - 1;
@@ -92,7 +92,7 @@
}
}
fclose (ttysfp);
- return NULL;
+ return 0;
}
#endif /* defined(BSD42) && (! defined(BSD43)) || defined(linux) */
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/uif.c FreeWnn-1.1.1-a022.new/Wnn/uum/uif.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/uif.c 2003-05-12 03:27:42.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/uif.c 2013-08-15 08:49:44.507853008 +0900
@@ -169,7 +169,7 @@
int c, romkan;
{
push_unget_buf (romkan);
- kakutei (c);
+ kakutei (); /* kakutei (c);*/
return (1);
}
@@ -670,7 +670,7 @@
delete_c (c, romkan)
int c, romkan;
{
- t_delete_char (c, romkan);
+ t_delete_char (); /* t_delete_char (c, romkan); */
if ((c_b->maxlen == 0) && is_HON (romkan))
{
change_to_empty_mode ();
@@ -1136,7 +1136,7 @@
/*
char *message = " 接続ホスト名 > ";
*/
- w_char *kana_buf[1024];
+ w_char *kana_buf[1024]; /* w_char kana_buf[1024]; ? */
char hostname[128];
Sstrcpy (kana_buf, servername);
diff -urN FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/wnnrc_op.c FreeWnn-1.1.1-a022.new/Wnn/uum/wnnrc_op.c
--- FreeWnn-1.1.1-a022.openSUSE/Wnn/uum/wnnrc_op.c 2002-06-22 22:26:21.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/Wnn/uum/wnnrc_op.c 2013-08-15 08:54:02.068854366 +0900
@@ -645,7 +645,7 @@
total = 0;
flag = 0;
- while (*st != NULL)
+ while (*st != '\0')
{
if (isdigit (*st))
{
diff -urN FreeWnn-1.1.1-a022.openSUSE/cWnn/include/Makefile.in FreeWnn-1.1.1-a022.new/cWnn/include/Makefile.in
--- FreeWnn-1.1.1-a022.openSUSE/cWnn/include/Makefile.in 2003-05-12 03:31:46.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/cWnn/include/Makefile.in 2013-08-15 09:54:20.460873437 +0900
@@ -38,11 +38,13 @@
LINKS = wnn_config.h copyright.h demcom.h hinsi_file.h jd_sock.h \
jdata.h jh.h jlib.h wnn_string.h wnn_os.h hinsi.h ansidecl.h
LINKS2 = getopt.h
+LINKS3 = etc.h jutil.h romkan.h conv.h kaiseki.h jlib_hide.h
-all:: $(HEADERS) $(LINKS) $(LINKS2)
-includes:: $(HEADERS) $(LINKS) $(LINKS2)
+all:: $(HEADERS) $(LINKS) $(LINKS2) $(LINKS3)
+
+includes:: $(HEADERS) $(LINKS) $(LINKS2) $(LINKS3)
commonhd.h: $(WNNINCLUDESRC)/commonhd.h
$(RM) $@
@@ -204,6 +206,60 @@
depend:: getopt.h
+etc.h: $(WNNINCLUDESRC)/etc.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: etc.h
+
+depend:: etc.h
+
+
+jutil.h: $(WNNINCLUDESRC)/jutil.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: jutil.h
+
+depend:: jutil.h
+
+
+romkan.h: $(WNNINCLUDESRC)/romkan.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: romkan.h
+
+depend:: romkan.h
+
+
+conv.h: $(WNNINCLUDESRC)/conv.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: conv.h
+
+depend:: conv.h
+
+
+kaiseki.h: $(WNNINCLUDESRC)/kaiseki.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: kaiseki.h
+
+depend:: kaiseki.h
+
+
+jlib_hide.h: $(WNNINCLUDESRC)/jlib_hide.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: jlib_hide.h
+
+depend:: jlib_hide.h
+
+
# 'clean' entry is not added because last
# 'clean' entry (action = '$(RM) $(LINKS)') does same thing. (aono)
@@ -224,3 +280,4 @@
$(RM) $(HEADERS)
$(RM) $(LINKS)
$(RM) $(LINKS2)
+ $(RM) $(LINKS3)
diff -urN FreeWnn-1.1.1-a022.openSUSE/cWnn/jserver/Makefile.in FreeWnn-1.1.1-a022.new/cWnn/jserver/Makefile.in
--- FreeWnn-1.1.1-a022.openSUSE/cWnn/jserver/Makefile.in 2013-08-15 14:44:15.332965120 +0900
+++ FreeWnn-1.1.1-a022.new/cWnn/jserver/Makefile.in 2013-08-15 10:27:38.379883967 +0900
@@ -31,12 +31,13 @@
include @top_builddir@/makerule.mk
top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
top_builddir = @top_builddir@
INSTALL = @INSTALL@ $(INSTALLFLAGS)
JSERVERDEFINES = -DJSERVER -DWRITE_CHECK
- INCLUDES = -I$(CWNNINCLUDESRC) -I$(top_builddir)
+ INCLUDES = -I$(CWNNINCLUDESRC) -I$(top_builddir) -I$(srcdir)
DEFINES = $(CWNNDEFINES) $(JSERVERDEFINES) $(WNNTERM) $(CWNNLANGDEF)
LOCAL_INSTFLAGS =
SERVERINITDEF = -DSERVER_INIT_FILE=\"/$(CWNNLANG)/cserverrc\"
@@ -45,7 +46,7 @@
THINSIDEFINE = -DHINSIDATA_FILE=\"/$(TWNNLANG)/cixing.data\"
WRAPLIB = @WRAPLIB@
-HDRS = ddefine.h de_header.h fzk.h kaiseki.h
+HDRS = ddefine.h de_header.h fzk.h
SRC0 = de.c
SRC1= dispatch.c do_dic_env.c do_dic_no.c do_filecom.c error.c jbiki.c jbiki_b.c jishoop.c rd_jishoop.c readfile.c b_index.c jishosub.c jmt0.c mknode0.c mknode1.c mknode2.c renbn_kai.c bnsetu_kai.c daibn_kai.c jikouho.c jikouho_d.c fzk.c atojis.c get_kaiarea.c snd_rcv.c do_henkan.c do_henkan1.c do_env.c do_hindo_s.c initjserv.c hinsi_list.c sisheng.c w_string.c
@@ -176,16 +177,6 @@
clean::
$(RM) fzk.h
-kaiseki.h: $(WNNJSERVERSRC)/kaiseki.h
- $(RM) $@
- $(LN) $? $@
-
-includes:: kaiseki.h
-
-depend:: kaiseki.h
-
-clean::
- $(RM) kaiseki.h
de.c: $(WNNJSERVERSRC)/de.c
$(RM) $@
diff -urN FreeWnn-1.1.1-a022.openSUSE/kWnn/include/Makefile.in FreeWnn-1.1.1-a022.new/kWnn/include/Makefile.in
--- FreeWnn-1.1.1-a022.openSUSE/kWnn/include/Makefile.in 2003-05-12 03:31:46.000000000 +0900
+++ FreeWnn-1.1.1-a022.new/kWnn/include/Makefile.in 2013-08-15 17:36:53.098098801 +0900
@@ -38,10 +38,11 @@
LINKS = wnn_config.h copyright.h demcom.h hinsi_file.h jd_sock.h jdata.h \
jh.h jlib.h wnn_string.h wnn_os.h hinsi.h ansidecl.h
LINKS2 = getopt.h
+LINKS3 = etc.h jutil.h romkan.h conv.h kaiseki.h jlib_hide.h
-all:: $(HEADERS) $(LINKS) $(LINKS2)
+all:: $(HEADERS) $(LINKS) $(LINKS2) $(LINKS3)
-includes:: $(HEADERS) $(LINKS) $(LINKS2)
+includes:: $(HEADERS) $(LINKS) $(LINKS2) $(LINKS3)
commonhd.h: $(WNNINCLUDESRC)/commonhd.h
$(RM) $@
@@ -257,6 +258,61 @@
depend:: getopt.h
+
+etc.h: $(WNNINCLUDESRC)/etc.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: etc.h
+
+depend:: etc.h
+
+
+jutil.h: $(WNNINCLUDESRC)/jutil.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: jutil.h
+
+depend:: jutil.h
+
+
+romkan.h: $(WNNINCLUDESRC)/romkan.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: romkan.h
+
+depend:: romkan.h
+
+
+conv.h: $(WNNINCLUDESRC)/conv.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: conv.h
+
+depend:: conv.h
+
+
+kaiseki.h: $(WNNINCLUDESRC)/kaiseki.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: kaiseki.h
+
+depend:: kaiseki.h
+
+
+jlib_hide.h: $(WNNINCLUDESRC)/jlib_hide.h
+ $(RM) $@
+ $(LN) $? $@
+
+includes:: jlib_hide.h
+
+depend:: jlib_hide.h
+
+
# 'clean' entry is not added because last
# 'clean' entry (action = '$(RM) $(LINKS)') does same thing. (aono)
@@ -280,3 +336,4 @@
$(RM) $(HEADERS)
$(RM) $(LINKS)
$(RM) $(LINKS2)
+ $(RM) $(LINKS3)
diff -urN FreeWnn-1.1.1-a022.openSUSE/kWnn/jserver/Makefile.in FreeWnn-1.1.1-a022.new/kWnn/jserver/Makefile.in
--- FreeWnn-1.1.1-a022.openSUSE/kWnn/jserver/Makefile.in 2013-08-15 14:44:15.333965120 +0900
+++ FreeWnn-1.1.1-a022.new/kWnn/jserver/Makefile.in 2013-08-15 10:48:52.143890681 +0900
@@ -31,19 +31,20 @@
include @top_builddir@/makerule.mk
top_srcdir = @top_srcdir@
+ srcdir = @srcdir@
top_builddir = @top_builddir@
INSTALL = @INSTALL@
JSERVERDEFINES = -DJSERVER -DWRITE_CHECK
- INCLUDES = -I$(KWNNJSERVERSRC) -I$(KWNNINCLUDESRC) -I$(top_builddir)
+ INCLUDES = -I$(KWNNJSERVERSRC) -I$(KWNNINCLUDESRC) -I$(top_builddir) -I$(srcdir)
DEFINES = $(KWNNDEFINES) $(JSERVERDEFINES) $(WNNTERM) $(KWNNLANGDEF)
LOCAL_INSTFLAGS =
SERVERINITDEF = -DSERVER_INIT_FILE=\"/$(KWNNLANG)/kserverrc\"
HINSIDEFINE = -DHINSIDATA_FILE=\"/$(KWNNLANG)/hinsi.data\"
WRAPLIB = @WRAPLIB@
-HDRS = ddefine.h de_header.h fzk.h kaiseki.h
+HDRS = ddefine.h de_header.h fzk.h
SRC0 = de.c
SRC1= dispatch.c do_dic_env.c do_dic_no.c do_filecom.c error.c jbiki.c jbiki_b.c jishoop.c rd_jishoop.c readfile.c b_index.c jishosub.c jmt0.c mknode0.c mknode1.c mknode2.c renbn_kai.c bnsetu_kai.c daibn_kai.c jikouho.c jikouho_d.c fzk.c atojis.c get_kaiarea.c snd_rcv.c do_henkan.c do_henkan1.c do_env.c do_hindo_s.c initjserv.c hinsi_list.c sisheng.c w_string.c
@@ -142,16 +143,7 @@
clean::
$(RM) fzk.h
-kaiseki.h: $(WNNJSERVERSRC)/kaiseki.h
- $(RM) $@
- $(LN) $? $@
-
-includes:: kaiseki.h
-depend:: kaiseki.h
-
-clean::
- $(RM) kaiseki.h
de.c: $(WNNJSERVERSRC)/de.c
$(RM) $@