Import patches from pkgsrc
* Adjust paths to modern conventions. * Avoid opening /dev/console. * Consistently provide lowercase and MixedCase options. * Don't abuse an int as a pointer (optarg). * Fix compilation errors on NetBSD and DragonFly BSD. * Fix documentation. * Import headers and remove redundant declarations. Signed-off-by: Masanori Ogino <mogino@acm.org>
This commit is contained in:
parent
b9687d1b88
commit
381c676eda
26 changed files with 143 additions and 98 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@
|
||||||
|
|
||||||
build/
|
build/
|
||||||
patches/
|
patches/
|
||||||
|
|
||||||
|
*.orig
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ char *filename;
|
||||||
{
|
{
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
if (stat(filename, &buf) == 0) return (long)buf.st_size;
|
if (stat(filename, &buf) == 0) return (long)buf.st_size;
|
||||||
#else
|
#else
|
||||||
if (stat(filename, &buf) == 0) return buf.st_size;
|
if (stat(filename, &buf) == 0) return buf.st_size;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ JIS
|
||||||
.IP ・
|
.IP ・
|
||||||
メイン辞書、ユーザ辞書、学習ファイルは、接続するサーバの動作しているマシン上のものが使用されます。
|
メイン辞書、ユーザ辞書、学習ファイルは、接続するサーバの動作しているマシン上のものが使用されます。
|
||||||
.br
|
.br
|
||||||
これらのファイルは、デフォルトではディレクトリ \fB/usr/dict/sj3\fP の下におかれますが、サーバのセットアップファイルにより変更が可能です。
|
これらのファイルは、デフォルトではディレクトリ \fB/usr/local/lib/sj3/dict\fP の下におかれますが、サーバのセットアップファイルにより変更が可能です。
|
||||||
.IP ・
|
.IP ・
|
||||||
ユーザ辞書と学習ファイルは、関数 sj3_open で指定されたユーザ名を USER と
|
ユーザ辞書と学習ファイルは、関数 sj3_open で指定されたユーザ名を USER と
|
||||||
すれば、\fBuser/USER/private.dic\fP と \fBuser/USER/study.dat\fP です。
|
すれば、\fBuser/USER/private.dic\fP と \fBuser/USER/study.dat\fP です。
|
||||||
|
|
@ -91,7 +91,7 @@ char *uname; /*
|
||||||
サーバと正常に接続できたときには 0 を、何かエラーのあったときには 0 以外の
|
サーバと正常に接続できたときには 0 を、何かエラーのあったときには 0 以外の
|
||||||
エラーステータスを返します。
|
エラーステータスを返します。
|
||||||
.sp
|
.sp
|
||||||
エラーステータスはヘッダファイル \fB/usr/include/sj3lib.h\fP で
|
エラーステータスはヘッダファイル \fB/usr/local/include/sj3lib.h\fP で
|
||||||
定義されるビットアサインされた値で、詳細は以下のとおりです。
|
定義されるビットアサインされた値で、詳細は以下のとおりです。
|
||||||
.sp
|
.sp
|
||||||
.IP "\fBSJ3_SERVER_DEAD\fP
|
.IP "\fBSJ3_SERVER_DEAD\fP
|
||||||
|
|
@ -138,7 +138,7 @@ sj3_close()
|
||||||
サーバとの使用を正常に終了できたときには 0 を、
|
サーバとの使用を正常に終了できたときには 0 を、
|
||||||
何かエラーのあったときには 0 以外のエラーステータスを返します。
|
何かエラーのあったときには 0 以外のエラーステータスを返します。
|
||||||
.sp
|
.sp
|
||||||
エラーステータスはヘッダファイル \fB/usr/include/sj3lib.h\fP で
|
エラーステータスはヘッダファイル \fB/usr/local/include/sj3lib.h\fP で
|
||||||
定義されるビットアサインされた値で、詳細は以下のとおりです。
|
定義されるビットアサインされた値で、詳細は以下のとおりです。
|
||||||
.sp
|
.sp
|
||||||
.IP "\fBSJ3_SERVER_DEAD\fP
|
.IP "\fBSJ3_SERVER_DEAD\fP
|
||||||
|
|
@ -187,7 +187,7 @@ int knjsiz; /*
|
||||||
変換結果の漢字文字列を、配列 \fBstruct bunsetu bun[]\fP に
|
変換結果の漢字文字列を、配列 \fBstruct bunsetu bun[]\fP に
|
||||||
各文節に関する情報をセットします。
|
各文節に関する情報をセットします。
|
||||||
.br
|
.br
|
||||||
\fBstruct bunsetu\fP はヘッダファイル \fB/usr/include/sj3lib.h\fP で
|
\fBstruct bunsetu\fP はヘッダファイル \fB/usr/local/include/sj3lib.h\fP で
|
||||||
宣言されている以下のような構造体です。
|
宣言されている以下のような構造体です。
|
||||||
.sp
|
.sp
|
||||||
.RS
|
.RS
|
||||||
|
|
@ -417,7 +417,7 @@ int hinsi; /*
|
||||||
なりません。
|
なりません。
|
||||||
またその長さは、最大でも 32 文字を越えてはなりません。
|
またその長さは、最大でも 32 文字を越えてはなりません。
|
||||||
.sp
|
.sp
|
||||||
品詞コードはヘッダファイル \fB/usr/include/sj3lib.h\fP で
|
品詞コードはヘッダファイル \fB/usr/local/include/sj3lib.h\fP で
|
||||||
定義される以下の品詞のうちの一つです。
|
定義される以下の品詞のうちの一つです。
|
||||||
.sp
|
.sp
|
||||||
.RS
|
.RS
|
||||||
|
|
@ -445,7 +445,7 @@ SJ3_H_ADJECT
|
||||||
登録できたときには 0 が、登録できなかったときにはそれ以外の
|
登録できたときには 0 が、登録できなかったときにはそれ以外の
|
||||||
エラーステータスが返されます。
|
エラーステータスが返されます。
|
||||||
.sp
|
.sp
|
||||||
エラーステータスはヘッダファイル \fB/usr/include/sj3lib.h\fP で
|
エラーステータスはヘッダファイル \fB/usr/local/include/sj3lib.h\fP で
|
||||||
定義され、詳細は以下のとおりです。
|
定義され、詳細は以下のとおりです。
|
||||||
.sp
|
.sp
|
||||||
.IP "\fBSJ3_DICT_ERROR\fP
|
.IP "\fBSJ3_DICT_ERROR\fP
|
||||||
|
|
@ -519,7 +519,7 @@ int hinsi; /*
|
||||||
なりません。
|
なりません。
|
||||||
またその長さは、最大でも 32 文字を越えてはなりません。
|
またその長さは、最大でも 32 文字を越えてはなりません。
|
||||||
.sp
|
.sp
|
||||||
品詞コードは \fB/usr/include/sj3lib.h\fP で定義される以下の品詞の
|
品詞コードは \fB/usr/local/include/sj3lib.h\fP で定義される以下の品詞の
|
||||||
うちの一つです。
|
うちの一つです。
|
||||||
.sp
|
.sp
|
||||||
.RS
|
.RS
|
||||||
|
|
@ -547,7 +547,7 @@ SJ3_H_ADJECT
|
||||||
削除できたときには 0 が、削除できなかったときにはそれ以外の
|
削除できたときには 0 が、削除できなかったときにはそれ以外の
|
||||||
エラーステータスが返されます。
|
エラーステータスが返されます。
|
||||||
.sp
|
.sp
|
||||||
エラーステータスは \fB/usr/include/sj3lib.h\fP で定義され、
|
エラーステータスは \fB/usr/local/include/sj3lib.h\fP で定義され、
|
||||||
詳細は以下のとおりです。
|
詳細は以下のとおりです。
|
||||||
.sp
|
.sp
|
||||||
.IP "\fBSJ3_DICT_ERROR\fP
|
.IP "\fBSJ3_DICT_ERROR\fP
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ DictDir \fIdirectory_name\fP
|
||||||
そのファイル名を絶対パスとして辞書にアクセスしますが、\'/\'以外のときには、
|
そのファイル名を絶対パスとして辞書にアクセスしますが、\'/\'以外のときには、
|
||||||
ここで指定されるディレクトリからの相対パスとして辞書にアクセスします。
|
ここで指定されるディレクトリからの相対パスとして辞書にアクセスします。
|
||||||
.br
|
.br
|
||||||
デフォルトは /usr/dict/sj3 です。
|
デフォルトは /usr/local/lib/sj3/dict です。
|
||||||
.RE
|
.RE
|
||||||
.sp
|
.sp
|
||||||
.NH 3
|
.NH 3
|
||||||
|
|
|
||||||
|
|
@ -109,13 +109,13 @@ sj3 \-
|
||||||
.SH 関連ファイル
|
.SH 関連ファイル
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP 15
|
.TP 15
|
||||||
/usr/dict/sj3/user/$USER/private.dic
|
/usr/local/lib/sj3/dict/user/$USER/private.dic
|
||||||
仮名漢字変換ユーザ辞書
|
仮名漢字変換ユーザ辞書
|
||||||
.TP
|
.TP
|
||||||
/usr/dict/sj3/user/$USER/study.dat
|
/usr/local/lib/sj3/dict/user/$USER/study.dat
|
||||||
仮名漢字変換学習ファイル
|
仮名漢字変換学習ファイル
|
||||||
.TP
|
.TP
|
||||||
/usr/lib/sj3/sjrk
|
/usr/local/lib/sj3/sjrk
|
||||||
デフォルトローマ字仮名変換規則定義ファイル
|
デフォルトローマ字仮名変換規則定義ファイル
|
||||||
.SH 関連事項
|
.SH 関連事項
|
||||||
sj3serv(1), sj3lib(3)
|
sj3serv(1), sj3lib(3)
|
||||||
|
|
|
||||||
|
|
@ -105,16 +105,16 @@ sj3dic \- sj3
|
||||||
.SH 関連ファイル
|
.SH 関連ファイル
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP \w'\ \ \ \ user/\fIusername\fP/private.dic'u+2n
|
.TP \w'\ \ \ \ user/\fIusername\fP/private.dic'u+2n
|
||||||
/usr/bin/sj3serv
|
/usr/local/bin/sj3serv
|
||||||
かな漢字変換サーバ
|
かな漢字変換サーバ
|
||||||
.TP
|
.TP
|
||||||
/usr/lib/sj3/serverrc
|
/usr/local/lib/sj3/serverrc
|
||||||
かな漢字変換サーバ セットアップファイル
|
かな漢字変換サーバ セットアップファイル
|
||||||
.TP
|
.TP
|
||||||
/usr/bin/sj3
|
/usr/local/bin/sj3
|
||||||
日本語入力フロントエンドプロセッサ
|
日本語入力フロントエンドプロセッサ
|
||||||
.TP
|
.TP
|
||||||
/usr/dict/sj3/
|
/usr/local/lib/sj3/dict/
|
||||||
かな漢字変換サーバ デフォルト辞書ディレクトリ
|
かな漢字変換サーバ デフォルト辞書ディレクトリ
|
||||||
.TP
|
.TP
|
||||||
sj3main.dic
|
sj3main.dic
|
||||||
|
|
@ -126,10 +126,10 @@ sj3dic \- sj3
|
||||||
user/\fIusername\fP/study.dat
|
user/\fIusername\fP/study.dat
|
||||||
かな漢字変換学習ファイル
|
かな漢字変換学習ファイル
|
||||||
.TP
|
.TP
|
||||||
/usr/include/sj3lib.h
|
/usr/local/include/sj3lib.h
|
||||||
かな漢字変換ライブラリ用インクルードファイル
|
かな漢字変換ライブラリ用インクルードファイル
|
||||||
.TP
|
.TP
|
||||||
/usr/lib/libsj3lib.a
|
/usr/local/lib/libsj3lib.a
|
||||||
かな漢字変換ライブラリ
|
かな漢字変換ライブラリ
|
||||||
.\".TP
|
.\".TP
|
||||||
.\"/usr/sony/demo/sj3/*
|
.\"/usr/sony/demo/sj3/*
|
||||||
|
|
|
||||||
|
|
@ -539,16 +539,16 @@
|
||||||
.SH ファイル
|
.SH ファイル
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP \w'\ \ \ \ user/\f2username\f1/private.dic'u+2n
|
.TP \w'\ \ \ \ user/\f2username\f1/private.dic'u+2n
|
||||||
.B /usr/bin/sj3serv
|
.B /usr/local/bin/sj3serv
|
||||||
かな漢字変換サーバ
|
かな漢字変換サーバ
|
||||||
.TP
|
.TP
|
||||||
.B /usr/lib/sj3/serverrc
|
.B /usr/local/lib/sj3/serverrc
|
||||||
かな漢字変換サーバ セットアップファイル
|
かな漢字変換サーバ セットアップファイル
|
||||||
.TP
|
.TP
|
||||||
.B /usr/bin/sj3
|
.B /usr/local/bin/sj3
|
||||||
日本語入力フロントエンドプロセッサ
|
日本語入力フロントエンドプロセッサ
|
||||||
.TP
|
.TP
|
||||||
.B /usr/dict/sj3/
|
.B /usr/local/lib/sj3/dict/
|
||||||
かな漢字変換サーバ デフォルト辞書ディレクトリ
|
かな漢字変換サーバ デフォルト辞書ディレクトリ
|
||||||
.TP
|
.TP
|
||||||
.B " sj3main.dic
|
.B " sj3main.dic
|
||||||
|
|
@ -560,14 +560,14 @@
|
||||||
.B " user/\f2username\f1/study.dat
|
.B " user/\f2username\f1/study.dat
|
||||||
かな漢字変換学習ファイル
|
かな漢字変換学習ファイル
|
||||||
.TP
|
.TP
|
||||||
.B /usr/include/sj3lib.h
|
.B /usr/local/include/sj3lib.h
|
||||||
かな漢字変換ライブラリ用インクルードファイル
|
かな漢字変換ライブラリ用インクルードファイル
|
||||||
.TP
|
.TP
|
||||||
.B /usr/lib/libsj3lib.a
|
.B /usr/local/lib/libsj3lib.a
|
||||||
かな漢字変換ライブラリ
|
かな漢字変換ライブラリ
|
||||||
.TP
|
.\".TP
|
||||||
\f3/usr/demo/sj3/ *\f1
|
.\"\f3/usr/local/demo/sj3/ *\f1
|
||||||
かな漢字変換ライブラリ 使用法サンプル
|
.\"かな漢字変換ライブラリ 使用法サンプル
|
||||||
.PD
|
.PD
|
||||||
.SH 関連項目
|
.SH 関連項目
|
||||||
\f4sj3\f1 (1),
|
\f4sj3\f1 (1),
|
||||||
|
|
|
||||||
|
|
@ -47,17 +47,17 @@ sj3serv \-
|
||||||
このオプションは、\fIsj3serv\fP の読み込むセットアップファイルを指定します。
|
このオプションは、\fIsj3serv\fP の読み込むセットアップファイルを指定します。
|
||||||
.br
|
.br
|
||||||
\fIsj3serv\fP はデフォルトではセットアップファイル
|
\fIsj3serv\fP はデフォルトではセットアップファイル
|
||||||
‘/usr/lib/sj3/serverrc’を読み込みますが、
|
‘/usr/local/lib/sj3/serverrc’を読み込みますが、
|
||||||
このオプションが指定されたときにはかわりに
|
このオプションが指定されたときにはかわりに
|
||||||
コマンドラインで指定されたセットアップファイルを読み込みます。
|
コマンドラインで指定されたセットアップファイルを読み込みます。
|
||||||
.br
|
.br
|
||||||
.SH 関連ファイル
|
.SH 関連ファイル
|
||||||
.PD 0
|
.PD 0
|
||||||
.TP \w'\ \ \ \ user/\fIusername\fP/private.dic'u+2n
|
.TP \w'\ \ \ \ user/\fIusername\fP/private.dic'u+2n
|
||||||
/usr/lib/sj3/serverrc
|
/usr/local/lib/sj3/serverrc
|
||||||
デフォルト仮名変換サーバ セットアップファイル
|
デフォルト仮名変換サーバ セットアップファイル
|
||||||
.TP
|
.TP
|
||||||
/usr/sony/dict/sj3/
|
/usr/local/lib/sj3/dict/
|
||||||
かな漢字変換サーバ デフォルト辞書ディレクトリ
|
かな漢字変換サーバ デフォルト辞書ディレクトリ
|
||||||
.TP
|
.TP
|
||||||
sj3main.dic
|
sj3main.dic
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,15 @@
|
||||||
#define ProtoName "tcp"
|
#define ProtoName "tcp"
|
||||||
#define PortNumber "3000"
|
#define PortNumber "3000"
|
||||||
#else
|
#else
|
||||||
|
/*
|
||||||
|
* Change the default Port number of sj3 for FreeBSD.
|
||||||
|
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/20
|
||||||
|
*/
|
||||||
|
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
|
||||||
|
#define PortNumber 3086
|
||||||
|
#else /* ! __FreeBSD__ __NetBSD__ __OpenBSD__ */
|
||||||
#define PortNumber 3000
|
#define PortNumber 3000
|
||||||
|
#endif /* ! __FreeBSD__ __NetBSD__ __OpenBSD__ */
|
||||||
#endif
|
#endif
|
||||||
#define DirectryMode 0755
|
#define DirectryMode 0755
|
||||||
#define DictFileMode 0644
|
#define DictFileMode 0644
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,22 @@
|
||||||
* $SonyDate: 1997/01/23 11:20:55 $
|
* $SonyDate: 1997/01/23 11:20:55 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Change ErrotOutFile variable.
|
||||||
|
* Because suppress a error when sj3serv start up, change to "/dev/stderr".
|
||||||
|
* This error is "Cannot Open "/dev/console".".
|
||||||
|
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||||
|
*
|
||||||
|
* Change ErrotOutFile variable.
|
||||||
|
* This default value is "/dev/null" in document.
|
||||||
|
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/11
|
||||||
|
*/
|
||||||
|
#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
|
||||||
#define ErrorOutFile "/dev/console"
|
#define ErrorOutFile "/dev/console"
|
||||||
|
#else
|
||||||
|
/* #define ErrorOutFile "/dev/stderr" */ /* for test */
|
||||||
|
#define ErrorOutFile "/dev/null"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SocketName "/tmp/sj3sock"
|
#define SocketName "/tmp/sj3sock"
|
||||||
#define LockFile "/tmp/SJ3SERV.EXIST"
|
#define LockFile "/tmp/SJ3SERV.EXIST"
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@
|
||||||
# define FD_CLR __FD_CLR
|
# define FD_CLR __FD_CLR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int errno;
|
|
||||||
extern int serv_errno;
|
extern int serv_errno;
|
||||||
extern Global *work_base;
|
extern Global *work_base;
|
||||||
char *malloc();
|
char *malloc();
|
||||||
|
|
@ -318,7 +317,7 @@ char *passwd;
|
||||||
serv_errno = SJ3_IncorrectPasswd; goto error1;
|
serv_errno = SJ3_IncorrectPasswd; goto error1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
if ((dp = (Uchar *)malloc((long)sbuf.st_size)) == NULL) {
|
if ((dp = (Uchar *)malloc((long)sbuf.st_size)) == NULL) {
|
||||||
#else
|
#else
|
||||||
if ((dp = (Uchar *)malloc(sbuf.st_size)) == NULL) {
|
if ((dp = (Uchar *)malloc(sbuf.st_size)) == NULL) {
|
||||||
|
|
@ -330,7 +329,7 @@ char *passwd;
|
||||||
}
|
}
|
||||||
memset(dfp, '\0', sizeof(*dfp));
|
memset(dfp, '\0', sizeof(*dfp));
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
if (fgetfile(fp, 0L, (long)sbuf.st_size, dp) == ERROR) goto error3;
|
if (fgetfile(fp, 0L, (long)sbuf.st_size, dp) == ERROR) goto error3;
|
||||||
#else
|
#else
|
||||||
if (fgetfile(fp, 0L, sbuf.st_size, dp) == ERROR) goto error3;
|
if (fgetfile(fp, 0L, sbuf.st_size, dp) == ERROR) goto error3;
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ extern char *proto_name;
|
||||||
extern int port_number;
|
extern int port_number;
|
||||||
#endif
|
#endif
|
||||||
extern int max_client;
|
extern int max_client;
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
static int fd_inet = -1;
|
static int fd_inet = -1;
|
||||||
static int fd_unix = -1;
|
static int fd_unix = -1;
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,6 @@
|
||||||
#define SJIS_PROTO 1
|
#define SJIS_PROTO 1
|
||||||
#define EUC_PROTO 2
|
#define EUC_PROTO 2
|
||||||
|
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
extern Global *work_base;
|
extern Global *work_base;
|
||||||
extern STDY *stdy_base;
|
extern STDY *stdy_base;
|
||||||
extern int serv_errno;
|
extern int serv_errno;
|
||||||
|
|
@ -82,7 +80,6 @@ static Client *cur_cli;
|
||||||
static Uchar defaultchar[2] = {(Uchar)0x81, (Uchar)0x40};
|
static Uchar defaultchar[2] = {(Uchar)0x81, (Uchar)0x40};
|
||||||
static int defuse=0, defuse2=0;
|
static int defuse=0, defuse2=0;
|
||||||
|
|
||||||
char *malloc();
|
|
||||||
DictFile *opendict();
|
DictFile *opendict();
|
||||||
int closedict();
|
int closedict();
|
||||||
StdyFile *openstdy();
|
StdyFile *openstdy();
|
||||||
|
|
|
||||||
|
|
@ -215,9 +215,11 @@ char **argv;
|
||||||
(void) setlocale(LC_CTYPE, "ja_JP.EUC");
|
(void) setlocale(LC_CTYPE, "ja_JP.EUC");
|
||||||
#endif
|
#endif
|
||||||
opening();
|
opening();
|
||||||
|
#ifndef __NetBSD__
|
||||||
if (setuid(geteuid())) {
|
if (setuid(geteuid())) {
|
||||||
fprintf(stderr, "error at setuid.\r\n"); exit(1);
|
fprintf(stderr, "error at setuid.\r\n"); exit(1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
parse_arg(argc, argv);
|
parse_arg(argc, argv);
|
||||||
read_runcmd();
|
read_runcmd();
|
||||||
|
|
|
||||||
|
|
@ -139,10 +139,13 @@ u_char *src, *dst;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static u_char *get_str(p, dst)
|
static u_char *get_str(p, pv_dst)
|
||||||
u_char *p;
|
u_char *p;
|
||||||
char **dst;
|
void *pv_dst;
|
||||||
{
|
{
|
||||||
|
char **dst;
|
||||||
|
|
||||||
|
dst = pv_dst;
|
||||||
if (!*dst) {
|
if (!*dst) {
|
||||||
*dst = malloc(strlen((char *)p) + 1);
|
*dst = malloc(strlen((char *)p) + 1);
|
||||||
if (!*dst) RcError("no more memory");
|
if (!*dst) RcError("no more memory");
|
||||||
|
|
@ -151,21 +154,26 @@ char **dst;
|
||||||
while (*p++) ;
|
while (*p++) ;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
static u_char *get_int(p, dst)
|
static u_char *get_int(p, pv_dst)
|
||||||
u_char *p;
|
u_char *p;
|
||||||
int *dst;
|
void *pv_dst;
|
||||||
{
|
{
|
||||||
register char *fmt;
|
register char *fmt;
|
||||||
|
int *dst;
|
||||||
|
|
||||||
|
dst = pv_dst;
|
||||||
fmt = (*p == '0') ? "%o" : "%d";
|
fmt = (*p == '0') ? "%o" : "%d";
|
||||||
if (sscanf((char *)p, fmt, dst) != 1) RcError("bad integer");
|
if (sscanf((char *)p, fmt, dst) != 1) RcError("bad integer");
|
||||||
while (*p++) ;
|
while (*p++) ;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
static u_char *get_flag(p, dst)
|
static u_char *get_flag(p, pv_dst)
|
||||||
u_char *p;
|
u_char *p;
|
||||||
int *dst;
|
void *pv_dst;
|
||||||
{
|
{
|
||||||
|
int *dst;
|
||||||
|
|
||||||
|
dst = pv_dst;
|
||||||
if (sscanf((char *)p, "%d", dst) == 1)
|
if (sscanf((char *)p, "%d", dst) == 1)
|
||||||
;
|
;
|
||||||
else if (!cmpstr("on", p))
|
else if (!cmpstr("on", p))
|
||||||
|
|
@ -219,33 +227,56 @@ StrList **dst;
|
||||||
struct optlist {
|
struct optlist {
|
||||||
char *optname;
|
char *optname;
|
||||||
u_char *(*optfunc)();
|
u_char *(*optfunc)();
|
||||||
int optarg;
|
void *optarg;
|
||||||
} option[] = {
|
} option[] = {
|
||||||
"DebugOut", get_str, (int)&debug_file,
|
/*
|
||||||
"DebugLevel", get_int, (int)&debug_level,
|
* Add option flag.
|
||||||
"ForkFlag", get_flag, (int)&fork_flag,
|
* Because They are lacked in here. See document.
|
||||||
|
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||||
|
*/
|
||||||
|
"DebugOut", get_str, &debug_file,
|
||||||
|
"debugout", get_str, &debug_file,
|
||||||
|
"DebugLevel", get_int, &debug_level,
|
||||||
|
"debuglevel", get_int, &debug_level,
|
||||||
|
"ForkFlag", get_flag, &fork_flag,
|
||||||
|
"forkflag", get_flag, &fork_flag,
|
||||||
|
|
||||||
"PortName", get_str, (int)&port_name,
|
"PortName", get_str, &port_name,
|
||||||
|
"portname", get_str, &port_name,
|
||||||
#ifdef TLI
|
#ifdef TLI
|
||||||
"PortNumber", get_str, (int)&port_number,
|
"PortNumber", get_str, &port_number,
|
||||||
"ProtoName", get_str, (int)&proto_name,
|
"portnumber", get_str, &port_number,
|
||||||
|
"ProtoName", get_str, &proto_name,
|
||||||
|
"protoname", get_str, &proto_name,
|
||||||
#else
|
#else
|
||||||
"PortNumber", get_int, (int)&port_number,
|
"PortNumber", get_int, &port_number,
|
||||||
|
"portnumber", get_int, &port_number,
|
||||||
#endif
|
#endif
|
||||||
"SocketName", get_str, (int)&socket_name,
|
"SocketName", get_str, &socket_name,
|
||||||
|
"socketname", get_str, &socket_name,
|
||||||
#ifdef LOCK_FILE
|
#ifdef LOCK_FILE
|
||||||
"LockFile", get_str, (int)&lock_file;
|
"LockFile", get_str, &lock_file;
|
||||||
|
"lockfile", get_str, &lock_file;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
"maxclient", get_int, (int)&max_client,
|
"MaxClient", get_int, &max_client,
|
||||||
"dictdir", get_str, (int)&dict_dir,
|
"maxclient", get_int, &max_client,
|
||||||
"readdict", get_list, (int)&read_dict,
|
"DictDir", get_str, &dict_dir,
|
||||||
"opendict", get_list, (int)&open_dict,
|
"dictdir", get_str, &dict_dir,
|
||||||
"errorout", get_str, (int)&error_file,
|
"ReadDict", get_list, &read_dict,
|
||||||
"logout", get_str, (int)&log_file,
|
"readdict", get_list, &read_dict,
|
||||||
"dirmode", get_int, (int)&dir_mode,
|
"OpenDict", get_list, &open_dict,
|
||||||
"filemode", get_int, (int)&file_mode,
|
"opendict", get_list, &open_dict,
|
||||||
"allowuser", get_list, (int)&allow_user,
|
"ErrorOut", get_str, &error_file,
|
||||||
|
"errorout", get_str, &error_file,
|
||||||
|
"LogOut", get_str, &log_file,
|
||||||
|
"logout", get_str, &log_file,
|
||||||
|
"DirMode", get_int, &dir_mode,
|
||||||
|
"dirmode", get_int, &dir_mode,
|
||||||
|
"FileMode", get_int, &file_mode,
|
||||||
|
"filemode", get_int, &file_mode,
|
||||||
|
"AllowUser", get_list, &allow_user,
|
||||||
|
"allowuser", get_list, &allow_user,
|
||||||
0, 0, 0
|
0, 0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
10
sj3.tmpl
10
sj3.tmpl
|
|
@ -32,12 +32,12 @@
|
||||||
* $SonyDate: 1997/01/23 11:20:57 $
|
* $SonyDate: 1997/01/23 11:20:57 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
SJ3TOP = /usr/local
|
SJ3TOP = $(PREFIX)
|
||||||
SJ3BINDIR = $(SJ3TOP)/bin
|
SJ3BINDIR = $(SJ3TOP)/bin
|
||||||
SJ3HDRDIR = $(SJ3TOP)/include
|
SJ3HDRDIR = $(SJ3TOP)/include
|
||||||
SJ3LIBDIR = $(SJ3TOP)/lib
|
SJ3LIBDIR = $(SJ3TOP)/lib
|
||||||
SJ3CONFDIR = $(SJ3TOP)/lib/sj3
|
SJ3CONFDIR = $(SJ3TOP)/share/sj3
|
||||||
SJ3DICTDIR = $(SJ3CONFDIR)/dict
|
SJ3DICTDIR = $(IMDICTDIR)/sj3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Change for FreeBSD.
|
* Change for FreeBSD.
|
||||||
|
|
@ -45,10 +45,11 @@ SJ3DICTDIR = $(SJ3CONFDIR)/dict
|
||||||
* return NULL, use it in library libxpg4
|
* return NULL, use it in library libxpg4
|
||||||
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||||
*/
|
*/
|
||||||
|
#if 0
|
||||||
#if defined(FreeBSDArchitecture)
|
#if defined(FreeBSDArchitecture)
|
||||||
|
|
||||||
CODE_LIBS = -lxpg4
|
CODE_LIBS = -lxpg4
|
||||||
SJ3OWNER = root
|
SJ3OWNER = bin
|
||||||
SJ3GROUP = bin
|
SJ3GROUP = bin
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
@ -62,3 +63,4 @@ SJ3GROUP = staff
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <sys/errno.h>
|
#include <errno.h>
|
||||||
#include "wchar16.h"
|
#include "wchar16.h"
|
||||||
#include "select.h"
|
#include "select.h"
|
||||||
#include "key.h"
|
#include "key.h"
|
||||||
|
|
@ -204,7 +204,6 @@ register int *count;
|
||||||
register int n;
|
register int n;
|
||||||
SELECT_FD ifds;
|
SELECT_FD ifds;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
extern int errno;
|
|
||||||
register wchar16_t *s;
|
register wchar16_t *s;
|
||||||
int value;
|
int value;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "sj_sysvdef.h"
|
#include "sj_sysvdef.h"
|
||||||
#include <sys/errno.h>
|
#include <errno.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "inkey.h"
|
#include "inkey.h"
|
||||||
#include "select.h"
|
#include "select.h"
|
||||||
|
|
@ -201,7 +201,6 @@ master_flush ()
|
||||||
SELECT_FD ifds;
|
SELECT_FD ifds;
|
||||||
int nc;
|
int nc;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
cont:
|
cont:
|
||||||
|
|
|
||||||
|
|
@ -40,14 +40,13 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static char *getttys();
|
||||||
char *ttyname();
|
|
||||||
char *getttys();
|
|
||||||
char *strrchr();
|
|
||||||
static char *ttys = "/etc/ttys";
|
static char *ttys = "/etc/ttys";
|
||||||
|
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
|
|
|
||||||
15
sj3/sj3.c
15
sj3/sj3.c
|
|
@ -38,14 +38,12 @@
|
||||||
#include "sj_sysvdef.h"
|
#include "sj_sysvdef.h"
|
||||||
#include "wchar16.h"
|
#include "wchar16.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/errno.h>
|
#include <errno.h>
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
#if defined(__NetBSD__) || defined(__bsdi__)
|
|
||||||
#define USE_OLD_TTY
|
#define USE_OLD_TTY
|
||||||
#if defined(__NetBSD__)
|
#if defined(__NetBSD__)
|
||||||
#define LACKOF_SETLOCALE
|
#define LACKOF_SETLOCALE
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -473,7 +471,7 @@ getmaster ()
|
||||||
* Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v].
|
* Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v].
|
||||||
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||||
*/
|
*/
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
struct stat stb;
|
struct stat stb;
|
||||||
int h, i, j, k1, k2;
|
int h, i, j, k1, k2;
|
||||||
#else /* !__FreeBSD__ */
|
#else /* !__FreeBSD__ */
|
||||||
|
|
@ -492,7 +490,7 @@ getmaster ()
|
||||||
* Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v].
|
* Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v].
|
||||||
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||||
*/
|
*/
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
for (h = 0; h < 8; h++) {
|
for (h = 0; h < 8; h++) {
|
||||||
line[k1] = "pqrsPQRS"[h];
|
line[k1] = "pqrsPQRS"[h];
|
||||||
line[k2] = '0';
|
line[k2] = '0';
|
||||||
|
|
@ -852,7 +850,7 @@ shellprocess ()
|
||||||
SCPYN(Utmp.ut_line, strrchr (slave_name, '/') + 1);
|
SCPYN(Utmp.ut_line, strrchr (slave_name, '/') + 1);
|
||||||
time (&Utmp.ut_time);
|
time (&Utmp.ut_time);
|
||||||
|
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
if (setsid() < 0)
|
if (setsid() < 0)
|
||||||
perror("setsid()");
|
perror("setsid()");
|
||||||
#else
|
#else
|
||||||
|
|
@ -937,7 +935,7 @@ getslave ()
|
||||||
done2 ();
|
done2 ();
|
||||||
}
|
}
|
||||||
#ifndef SYSV_TERMIOS
|
#ifndef SYSV_TERMIOS
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
ioctl(slave, TIOCSCTTY, NULL);
|
ioctl(slave, TIOCSCTTY, NULL);
|
||||||
#endif
|
#endif
|
||||||
ioctl (slave, TIOCSETP, (char *)&b);
|
ioctl (slave, TIOCSETP, (char *)&b);
|
||||||
|
|
@ -1085,7 +1083,6 @@ suspend ()
|
||||||
SELECT_FD ifds;
|
SELECT_FD ifds;
|
||||||
int nc;
|
int nc;
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
clear_guide_line ();
|
clear_guide_line ();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,14 +48,12 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/fcntl.h>
|
#include <sys/fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||||
#if defined(__NetBSD__) || defined(__bsdi__)
|
|
||||||
#define USE_OLD_TTY
|
#define USE_OLD_TTY
|
||||||
#endif
|
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/errno.h>
|
#include <errno.h>
|
||||||
#include <sys/file.h>
|
#include <sys/file.h>
|
||||||
#include "sj2.h"
|
#include "sj2.h"
|
||||||
#include "select.h"
|
#include "select.h"
|
||||||
|
|
@ -72,7 +70,6 @@ static wchar16_t backup = (wchar16_t) 0;
|
||||||
|
|
||||||
static int eucmode = 0;
|
static int eucmode = 0;
|
||||||
extern int master;
|
extern int master;
|
||||||
extern int errno;
|
|
||||||
|
|
||||||
wchar16_t SJ_getchar()
|
wchar16_t SJ_getchar()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
@ -108,9 +108,8 @@ sjset_code()
|
||||||
|
|
||||||
getsjrc ()
|
getsjrc ()
|
||||||
{
|
{
|
||||||
FILE *fd, *fopen();
|
FILE *fd;
|
||||||
register char *p;
|
register char *p;
|
||||||
char *getenv();
|
|
||||||
|
|
||||||
sjset_code();
|
sjset_code();
|
||||||
RCfile[0] = '\0';
|
RCfile[0] = '\0';
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ static open_unix()
|
||||||
}
|
}
|
||||||
|
|
||||||
len = strlen(sunix.sun_path)+sizeof(sunix.sun_family);
|
len = strlen(sunix.sun_path)+sizeof(sunix.sun_family);
|
||||||
#if defined(__NetBSD__) || defined(__FreeBSD__)
|
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
len += sizeof(sunix.sun_len);
|
len += sizeof(sunix.sun_len);
|
||||||
#endif
|
#endif
|
||||||
if (connect(fd, (struct sockaddr *)&sunix, len)
|
if (connect(fd, (struct sockaddr *)&sunix, len)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
* $SonyDate: 1995/02/10 06:02:25 $
|
* $SonyDate: 1995/02/10 06:02:25 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "wchar16.h"
|
#include "wchar16.h"
|
||||||
#include "sj.h"
|
#include "sj.h"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue