.\" .\" 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] .\" .Dd January 3, 1993 .Os .Dt KEYCAP 3 .Sh NAME .Nm kgetent , .Nm kgetnum , .Nm kgetflag , .Nm kgetstr .Nd routines for accessing the keycap database .Sh SYNOPSIS .Fn kgetent "char *bp" "char *name" .Fn kgetnum "char *id" .Fn kgetflag "char *id" .Ft char * .Fn kgetstr "char *id" "char *area" .Sh DESCRIPTION These functions extract and use capabilities from a keyboard capability data base, usually .Pa /usr/share/misc/keycap , the format of which is described in .Xr keycap 5 . .Pp The .Fn kgetent function extracts the entry for keyboard mapping .Fa name into the buffer at .Fa bp . The .Fa bp argument should be a character buffer of size 1024 and must be retained through all subsequent calls to .Fn kgetnum , .Fn kgetflag , and .Fn kgetstr . The .Fn kgetent function returns \-1 if none of the .Nm keycap data base files could be opened, 0 if the map name given does not have an entry, and 1 if all goes well. .Pp The .Fn kgetnum function gets the numeric value of capability .Fa id , returning \-1 if is not given for the map. .Pp The .Fn kgetflag function returns 1 if the specified capability is present in the map's entry, 0 if it is not. .Pp The .Fn kgetstr function returns the string value of the capability .Fa id , places it in the buffer at .Fa area , and advances the .Fa area pointer. The .Fn kgetstr function returns .Dv NULL if the capability was not found. .Pp .Sh FILES .Bl -tag -width /usr/share/misc/keycap.pcvt -compact .It Pa /usr/share/misc/keycap.pcvt Keyboard capabilities database (if nothing else chosen during installation). .El .Sh SEE ALSO .Xr kcon 1 , .Xr keycap 5