2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1995, by Sun Microsystems, Inc. 2N/A * All rights reserved. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved. 2N/A * Push single-byte character back onto the input queue. 2N/A * MKS EXTENSION permits the return value of wgetch(), which 2N/A * can be a KEY_ value, to be pushed back. 2N/A * Push a single-byte character or KEY_ value but onto the 2N/A * input queue. Ignore the window parameter. 2N/A * Return true if the SCREEN's stream has an I/O error. 2N/A * Ignore the window parameter. 2N/A * Return true if the SCREEN's stream has seen EOF. 2N/A * Ignore the window parameter. 2N/A * Clear the error and eof flags of the SCREEN's stream. 2N/A * Ignore the window parameter. 2N/A /* Only change the terminal's input method if the window 2N/A * requires different settings from what is currently set. 2N/A * We do this because tcsetattr() on some systems can be 2N/A * _really_ slow to do for each character. 2N/A * NOTE that halfdelay() overrides nodelay() and wtimeout(). 2N/A /* Only check for function keys if keypad is true and we 2N/A * did not read a KEY_ value (which are < 0), nor EOF. 2N/A * It is conceivable that a KEY_ was pushed back with 2N/A /* Treat the termios ERASE key the same as key_backspace. 2N/A * We used to change the key_backspace entry to be a string 2N/A * containing the ERASE key in setupterm(), but this would 2N/A * then disable the real terminfo entry for the backspace key. 2N/A * of the backspace key in application keypad mode. 2N/A * Refer to _shell instead of _prog, since _shell will 2N/A * correctly reflect the user's prefered settings, whereas 2N/A * _prog may not have been initialised if both input and 2N/A * output have been redirected. 2N/A /* Begin check for function key. */ 2N/A /* Use input stack as a queue. */ 2N/A /* Found funuction key? */ 2N/A /* Setup interbyte timer (once only). fgetc() will 2N/A * return EOF if no input received, which may not be 2N/A /* Timeout or real eof. */ 2N/A /* Incomplete sequence, continue. */ 2N/A /* Reverse contents of the input queue to form a stack. */ 2N/A /* Return first byte received or EOF. */