init_keytry.c revision 50276
118334Speter/****************************************************************************
290075Sobrien * Copyright (c) 1999 Free Software Foundation, Inc.                        *
3169689Skan *                                                                          *
418334Speter * Permission is hereby granted, free of charge, to any person obtaining a  *
590075Sobrien * copy of this software and associated documentation files (the            *
618334Speter * "Software"), to deal in the Software without restriction, including      *
790075Sobrien * without limitation the rights to use, copy, modify, merge, publish,      *
890075Sobrien * distribute, distribute with modifications, sublicense, and/or sell       *
990075Sobrien * copies of the Software, and to permit persons to whom the Software is    *
1090075Sobrien * furnished to do so, subject to the following conditions:                 *
1118334Speter *                                                                          *
1290075Sobrien * The above copyright notice and this permission notice shall be included  *
1390075Sobrien * in all copies or substantial portions of the Software.                   *
1490075Sobrien *                                                                          *
1590075Sobrien * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
1618334Speter * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
1718334Speter * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
1890075Sobrien * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19169689Skan * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20169689Skan * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
2118334Speter * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
2218334Speter *                                                                          *
2350397Sobrien * Except as contained in this notice, the name(s) of the above copyright   *
2450397Sobrien * holders shall not be used in advertising or otherwise to promote the     *
25132718Skan * sale, use or other dealings in this Software without prior written       *
26132718Skan * authorization.                                                           *
2718334Speter ****************************************************************************/
2890075Sobrien
29169689Skan#include <curses.priv.h>
3018334Speter
3190075Sobrien#include <term.h>	/* keypad_xmit, keypad_local, meta_on, meta_off */
3218334Speter			/* cursor_visible,cursor_normal,cursor_invisible */
3318334Speter#include <tic.h>	/* struct tinfo_fkeys */
3418334Speter
3518334SpeterMODULE_ID("$Id: init_keytry.c,v 1.1 1999/02/18 22:39:11 tom Exp $")
3690075Sobrien
3750397Sobrien/*
3850397Sobrien**      _nc_init_keytry()
3950397Sobrien**
4090075Sobrien**      Construct the try for the current terminal's keypad keys.
41117395Skan**
42132718Skan*/
43132718Skan
44132718Skan/* LINT_PREPRO
45169689Skan#if 0*/
46169689Skan#include <init_keytry.h>
4718334Speter/* LINT_PREPRO
4818334Speter#endif*/
4918334Speter
5018334Spetervoid _nc_init_keytry(void)
5118334Speter{
5218334Speter	size_t n;
5318334Speter
5456385Sobrien	/* The SP->_keytry value is initialized in newterm(), where the SP
5556385Sobrien	 * structure is created, because we can not tell where keypad() or
5656385Sobrien	 * mouse_activate() (which will call keyok()) are first called.
5756385Sobrien	 */
5818334Speter
5956385Sobrien	for (n = 0; _nc_tinfo_fkeys[n].code; n++)
6056385Sobrien		if (_nc_tinfo_fkeys[n].offset < STRCOUNT)
6156385Sobrien		_nc_add_to_try(&(SP->_keytry),
6256385Sobrien			CUR Strings[_nc_tinfo_fkeys[n].offset],
6318334Speter			_nc_tinfo_fkeys[n].code);
6490075Sobrien#ifdef TRACE
6590075Sobrien	_nc_trace_tries(SP->_keytry);
6618334Speter#endif
6718334Speter}
6818334Speter