/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1997 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*LINTLIBRARY*/
#include <stdlib.h>
#include <string.h>
#include "curses_inc.h"
static short keycodes[] = {
KEY_F(0),
KEY_F(1),
KEY_F(10),
KEY_F(2),
KEY_F(3),
KEY_F(4),
KEY_F(5),
KEY_F(6),
KEY_F(7),
KEY_F(8),
KEY_F(9),
};
static _KEY_MAP *p;
static bool *funckey;
static short *codeptr;
static void
{
p++;
}
/* Map text into num, updating the map structure p. */
static void
{
if (*keyptr) {
p++;
}
}
/* Map text into num, updating the map structure p. */
static void
{
p->_keyval = (short) code_value;
p++;
}
}
int
setkeymap(void)
{
short numkeys;
return (ERR);
p = keymap;
/* If backspace key sends \b, don't map it. */
codeptr++;
/* If down arrow key sends \n, don't map it. */
codeptr++;
/* If left arrow key sends \b, don't map it. */
codeptr++;
/*
* malloc returns the address of a list of pointers to
* (_KEY_MAP *) structures
*/
/* LINTED */
goto out;
}
/*
* Number of bytes needed is the number of structures times their size
* malloc room for our array of _KEY_MAP structures
*/
/* LINTED */
/* Can't do it, free list of pointers, indicate */
/* error upon return. */
out:
#ifdef DEBUG
termerr();
#endif /* DEBUG */
return (ERR);
}
if (key_size != 0) {
sizeof (_KEY_MAP *)));
}
/*
* Reset _lastkey_ordered to -1 since we put the keys read in
* from terminfo at the beginning of the keys table.
*/
/* Initialize our pointers to the structures */
while (numkeys--)
*key_ptrs++ = p++;
#ifdef DEBUG
if (outf)
keymap, p);
#endif /* DEBUG */
return (OK);
}