.\" .\" Copyright (c) 1992,1993,1994 Hellmuth Michaelis .\" .\" Copyright (c) 1990 The Regents of the University of California. .\" .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)keycap.3, 3.00, Last Edit-Date: [Sun Jan 2 13:46:43 1994] .\" .\" $FreeBSD$ .Dd January 3, 1993 .Dt KEYCAP 3 .Sh 名称 .Nm kgetent , .Nm kgetnum , .Nm kgetflag , .Nm kgetstr .Nd キーキャップデータベースへのアクセスルーチン群 .Sh 書式 .Ft int .Fn kgetent "char *bp" "char *name" .Ft int .Fn kgetnum "char *id" .Ft int .Fn kgetflag "char *id" .Ft char * .Fn kgetstr "char *id" "char **area" .Sh 解説 これらの関数は、キーボードケーパビリティデータベース、通常は .Pa /usr/share/misc/keycap.pcvt からケーパビリティを引き出して使用します。 データベースの フォーマットは .Xr keycap 5 に説明されています。 .Pp .Fn kgetent 関数は、 .Fa bp のバッファに .Fa name のキーボードマッピングの エントリを展開します。 引数 .Fa bp はサイズが 1024 のキャラクタバッファであるべきで、 .Fn kgetnum , .Fn kgetflag , .Fn kgetstr へのその後のすべての呼び出しを通して 保持されなければなりません。 .Fn kgetent 関数は、オープンできた .Nm keycap データベース・ファイルが一つもなければ \-1 を返し、 所定のマップ名にエントリがなければ 0 を返し、 全てが正常終了すれば 1 を返します。 .Pp .Fn kgetnum 関数はケーパビリティ .Fa id に対する数値を得ます。 マップから与えられなければ \-1 を返します。 .Pp .Fn kgetflag 関数は、特定のケーパビリティがマップのエントリに存在すれば 1 を戻し、 存在しなければ 0 を戻します。 .Pp .Fn kgetstr 関数はケーパビリティ .Fa id に対する文字列を .Fa area によって示されたバッファにコピーし、そのポインタを返します。 そして .Fa area ポインタをその文字列の後ろまで進めます。 .Fn kgetstr 関数は、ケーパビリティが見つからなければ .Dv NULL を返します。 .Sh ファイル .Bl -tag -width /usr/share/misc/keycap.pcvt -compact .It Pa /usr/share/misc/keycap.pcvt キーボードケーパビリティデータベース (なければインストール時に選択されます) .El .Sh 関連項目 .Xr kcon 1 , .Xr keycap 5