/*
* 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 (c) 1995, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* wgetch.c
*
* XCurses Library
*
* Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
*
*/
#ifdef M_RCSID
#ifndef lint
static char rcsID[] = "$Header: /rd/src/libc/xcurses/rcs/wgetch.c 1.5 1995/06/19 16:12:13 ant Exp $";
#endif
#endif
#include <private.h>
/*
* Push single-byte character back onto the input queue.
*
* MKS EXTENSION permits the return value of wgetch(), which
* can be a KEY_ value, to be pushed back.
*/
int
int ch;
{
int code;
#ifdef M_CURSES_TRACE
#endif
}
/*
* Push a single-byte character or KEY_ value but onto the
* input queue. Ignore the window parameter.
*/
int
{
if (ISFULL())
return EOF;
return 0;
}
/*
* Return true if the SCREEN's stream has an I/O error.
* Ignore the window parameter.
*/
int
__xc_ferror(void *w)
{
}
/*
* Return true if the SCREEN's stream has seen EOF.
* Ignore the window parameter.
*/
int
__xc_feof(void *w)
{
}
/*
* Clear the error and eof flags of the SCREEN's stream.
* Ignore the window parameter.
*/
void
__xc_clearerr(void *w)
{
}
int
wgetch(w)
WINDOW *w;
{
#ifdef M_CURSES_TRACE
#endif
(void) wrefresh(w);
if (!ISEMPTY())
/* Only change the terminal's input method if the window
* requires different settings from what is currently set.
* We do this because tcsetattr() on some systems can be
* _really_ slow to do for each character.
*
* NOTE that halfdelay() overrides nodelay() and wtimeout().
*/
}
if (req_for_input != (char *) 0)
/* Only check for function keys if keypad is true and we
* did not read a KEY_ value (which are < 0), nor EOF.
* It is conceivable that a KEY_ was pushed back with
* ungetch().
*/
/* Treat the termios ERASE key the same as key_backspace.
*
* We used to change the key_backspace entry to be a string
* containing the ERASE key in setupterm(), but this would
* then disable the real terminfo entry for the backspace key.
* of the backspace key in application keypad mode.
* See SR 6014.
*
* Refer to _shell instead of _prog, since _shell will
* correctly reflect the user's prefered settings, whereas
* _prog may not have been initialised if both input and
* output have been redirected.
*/
#ifdef _POSIX_VDISABLE
#endif
/* Begin check for function key. */
/* Use input stack as a queue. */
goto invalid;
}
/* Found funuction key? */
RESET();
}
/* Setup interbyte timer (once only). fgetc() will
* return EOF if no input received, which may not be
* a true EOF.
*/
if (timeout) {
}
timeout = 0;
/* Timeout or real eof. */
break;
/* Incomplete sequence, continue. */
}
/* Reverse contents of the input queue to form a stack. */
}
/* Return first byte received or EOF. */
}
(void) wrefresh(w);
}
}