.\" .\" $Id: open.man,v 1.4 2001/09/16 14:20:17 hiroo Exp $ .\" .\" .\" FreeWnn is a network-extensible Kana-to-Kanji conversion system. .\" This file is part of FreeWnn. .\" .\" Copyright Kyoto University Research Institute for Mathematical Sciences .\" 1987, 1988, 1989, 1990, 1991, 1992 .\" Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999 .\" Copyright ASTEC, Inc. 1987, 1988, 1989, 1990, 1991, 1992 .\" Copyright FreeWnn Project 1999, 2000 .\" .\" Maintainer: FreeWnn Project .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by .\" the Free Software Foundation; either version 2 of the License, or .\" (at your option) any later version. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License .\" along with this program; if not, write to the Free Software .\" Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA .\" .TH JL_OPEN 3 "20 September 1991" .SH 名称 .sv 1 .nf .ta 0.1i 2i jl_open() サーバとコネクションを張り環境をサーバ内に作る。 .fi .SH 形式 .sv 1 .nf .ta 0.1i 3i #include "jllib.h" struct wnn_buf * jl_open(env_n, server_n, wnnrc_n, error_handler, message_handler, timeout) char *env_n; /* 環境名 */ char *server_n; /* サーバ名 */ char *wnnrc_n; /* wnnrcファイル名 */ int (*error_handler)(); /* エラー・ハンドラ */ int (*message_handler)(); /* メッセージ・ハンドラ */ int timeout; /* タイムアウト時間 */ .fi .SH 機能 .HP 0 .IP 環境名 env_n、及び、サーバ名 server_n で指定された環境を作り、 新しく変換バッファを作って返す。 server_n が null ポインタ、および、null 文字列の時は、 /etc/hosts に jserver という alias が定義されているホストを探 し、それに接続しようとする。それも書かれていない場合には、 unix domain の socket で接続しようとする。 環境名の環境を jserver 内に作る。初期化ファイル wnnrc が指定さ れた場合、環境の初期化ファイルとして用い、そのファイルの指定 (辞書指定、付属語ファイル指定、パラメータ指定)をその環境に対し て行なう。 指定された辞書ファイル、頻度ファイルが存在しない場合の処理を、 エラー・ハンドラ error_handler、メッセージ・ハンドラ message_handler で指定する。jl_dic_add を参照。 timeout(秒)以内に、サーバと接続できない場合は、接続を中断し異 常終了する。タイムアウトの設定のために、SIGALARM を使用してい る。timeout が 0 または、負の場合は、SIGALARM を使用しない。 js_connect を参照。 .SH リターンバリュー .sv 1 .nf 正常終了時には、バッファのポインタを返す。 異常終了時には NULL を返す。 .fi .SH 使用上の注意 .HP 0 .IP タイムアウトには、SIGALARM を使用しているので、注意が必要である。 SIGALARM を使用しない場合には、timeout に 0 を設定しなければならない。