.\" .\" $Id: open_lang.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_LANG 3 "20 September 1991" .SH 名称 .sv 1 .nf .ta 0.1i 2i jl_open_lang() サーバとコネクションを張り環境をサーバ内に作る。 .fi .SH 形式 .sv 1 .nf .ta 0.1i 3i #include "jllib.h" struct wnn_buf * jl_open_lang(env_n, server_n, lang, wnnrc_n, error_handler, message_handler, timeout) char *env_n; /* 環境名 */ char *server_n; /* サーバ名 */ char *lang; /* ランゲージ */ 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 の場合、serverdefs ファイル中の lang が一致する行を参照し、その第2項のホストに 接続しようとする。その接続ができなかった場合、あるいは、第2項 のホストがNULLの場合、unix domain の socket で接続しようとする。 lang で、変換対象の言語を指定する。詳細は、js_open_lang を参照。 初期化ファイル 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 を設定しなければならない。