.\" .\" $Id: rk_init.man,v 1.3 2001/06/14 18:08:34 ura 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 ROMKAN_INIT 3 "11 October 1991" .SH 名称 .sv 1 .nf .ta 0.1i 2i romkan_init() ローマ字かな変換初期処理 .fi .SH 形式 .sv 1 .nf .ta 0.1i 3i #include int romkan_init(pathname, delete, chmflg, keyin, bytcntfn) char *pathname, chmflg; letter delete, (*keyin)(); int (*bytcntfn)(); .fi .SH 機能説明 .HP 0 .IP romkan_init は、モード定義表(mode(4_JT) を参照) を読み込んで、ローマ字かな 変換の初期処理を行う。モード定義表は、pathname によって、そのファイル名、 または、ディレクトリ・パス名が示される。ディレクトリ・パス名のときには、 そのディレクトリの下の "mode" をそのファイル名とする。 この関数を呼んだ後、romkan_getc(3J_T) を呼ぶと、順次、変換結果を得ることが できる。 delete は、DELETE として使用するキャラクタコード (romkan_getc を参照) を指 定する。 chmflg は、ローマ字仮名変換モードが変更された際、変換文字入力関数 romkan_getc がモード変換コードを返すようにする場合0以外を指定する。 keyin は、文字入力関数の名前である。keyin は unsigned int 型で、引数はなく 入力文字をバイトごとに返すようにする。 bytcntfn は2バイト文字評価関数の名前で、入力文字を指す char 型ポインタの 引数を伴って呼び出す。bytcntfn は、引数が指す1バイトを見て、それが2バイ ト文字を構成するコードであれば 2、そうでなければ 1 を返すようにする。 bytcntfn にヌルを指定すると、UJIS半角カタカナコードを構成する0x8e, 0xa1〜fe を2バイト文字として評価する。 romkan_init は、正常終了時0を返す。変換表の読み込み中にエラーを検出すると1 を返すと共にエラーメッセージを stderr に出力する。 通常、romkan_init(pathname, 0x08 又は0x7f, 1又は0, keyin, 0)として呼ぶ。 romkan_init は、変換表の読み込み、モード初期設定後 romkan_clear(3_JT) を呼 んで変換用処理バッファの初期化を行う。 .SH 関連項目 .HP 0 .IP romkan_getc(3J_T), romkan_next(3J_T), romkan_clear(3J_T), romkan_dispmode(3J_T), romkan_ungetc(3J_T), 2A_CTRL(4_JT), 2B_ROMKANA(4_JT)