Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

echo(3) [osf1 man page]

curs_inopts(3)						     Library Functions Manual						    curs_inopts(3)

curs_inopts, cbreak, nocbreak, echo, noecho, halfdelay, intrflush, keypad, meta, nodelay, qiflush, noqiflush, raw, noraw, timeout, notimeut, wtimeout, typeahead - Curses routines that control terminal-input options SYNOPSIS
#include <curses.h> int cbreak( void ); int nocbreak( void ); int echo( void ); int noecho( void ); int halfdelay( int tenths ); int intrflush( WINDOW *win, bool bf ); int keypad( WINDOW *win, bool bf ); int meta( WINDOW *win, bool bf ); int nodelay( WINDOW *win, bool bf ); int raw( void ); int noraw( void ); void qiflush( void ); void noqiflush( void ); void timeout( int delay ); int notimeout( WINDOW *win, bool bf ); void wtimeout( WINDOW *win, int delay ); int typeahead( int fd ); LIBRARY
Curses Library (libcurses) STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: cbreak, nocbreak, echo, noecho, halfdelay, intrflush, keypad, meta, nodelay, qiflush, noqiflush, raw, noraw, timeout, notimeout, wtimeout, typeahead: XCURSES4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. DESCRIPTION
The cbreak and nocbreak routines put the terminal into and out of cbreak mode, respectively. In this mode, characters typed by the user are immediately available to the program, and erase/kill character-processing is not performed. When out of this mode, the tty driver buf- fers the typed characters until the user types a newline or carriage return. Interrupt and flow-control characters are unaffected by this mode. Initially, the terminal may or may not be in cbreak mode, as the mode is inherited; therefore, a program should call cbreak or nocbreak explicitly. Most interactive programs using Curses set the cbreak mode. Note that cbreak overrides raw. (See curs_getch(3) for a discussion of how these routines interact with echo and noecho.) The echo and noecho routines control whether characters typed by the user are echoed by getch as they are typed. Echoing by the tty driver is always disabled, but initially getch is in echo mode, so characters are echoed as they are typed. Authors of most interactive programs prefer to do their own echoing in a controlled area of the screen or not to echo at all, so they disable echoing by calling noecho. (See curs_getch(3) for a discussion of how these routines interact with cbreak and nocbreak.) The halfdelay routine sets half-delay mode, which is similar to cbreak mode in that characters typed by the user are immediately available to the program. However, after blocking for tenths tenths of seconds, halfdelay returns ERR if nothing has been typed. The value of tenths must be a number between 1 and 255. Applications call the nocbreak routine to leave half-delay mode. If the intrflush routine enables or disables the intrflush option. When intrflush is enabled (bf is set to TRUE), all output in the tty driver queue is flushed when the user presses an interrupt key (interrupt, break, or quit). This flush operation gives the effect of faster response to the interrupt but causes Curses to have the wrong image of what is on the screen. Disabling the intrflush option (setting bf to FALSE) prevents output in the tty driver queue from being flushed. The default for the intrflush option is inherited from the tty driver settings. The window argument is ignored. The keypad routine enables the keypad option associated with the user's terminal. If the keypad option is enabled (bf is set to TRUE), the user can press a function key (such as an arrow key) and wgetch returns a single value representing the function key, as in KEY_LEFT. If the keypad is disabled (bf is set to FALSE), Curses does not treat function keys specially, and the program has to interpret the escape sequences. If the keypad in the terminal can be turned on (made to transmit) and off (made to work locally), enabling the keypad option causes the terminal keypad to be turned on when wgetch is called. The default value for keypad is false. Initially, whether the terminal returns 7 or 8 significant bits on input depends on the control mode of the tty driver (see termios(4)). To force 8 bits to be returned, applications call meta(win, TRUE). To force 7 bits to be returned, applications call meta(win, FALSE). The window argument, win, is always ignored. If the terminfo database capabilities smm (meta_on) and rmm (meta_off) are defined for the termi- nal, smm is sent to the terminal when meta(win, TRUE) is called and rmm is sent when meta(win, FALSE) is called. The nodelay routine enables and disables no delay mode. When this mode is enabled (bf is set to TRUE), the call causes getch to be a non- blocking call. In this case, if no input is ready, getch returns ERR. If no delay mode is disabled (bf is FALSE), getch waits until the user presses a key. While interpreting an input escape sequence, wgetch sets a timer while waiting for the next character. If the application calls notime- out(win, TRUE), then wgetch does not set a timeout interval. The purpose of the timeout is to differentiate between sequences received from a function key and those typed by a user. The raw and noraw routines place the terminal in and out of raw mode. Raw mode is similar to cbreak mode in that the typed characters are immediately passed through to the user program. The difference is that in raw mode, the interrupt, quit, suspend, and flow control charac- ters do not generate a signal but are all passed through uninterpreted to the application. The behavior of the Break key depends on other bits in the tty driver that are not set by Curses. When applications use the noqiflush routine, Curses sets the NOFLSH condition in the tty driver to disable queue flushing. In this state, the normal flushing of input and output queues associated with the quit and interrupt characters is not done. (see termios(4)). When the application calls qiflush, Curses flushes the queues when the quit and interrupt characters are read. The timeout and wtimeout routines set blocking or nonblocking read for a given window. If delay is negative, blocking read is set; that is, the read operation waits indefinitely for input. If delay is zero, then nonblocking read is set; that is, the read operation returns ERR if no input is waiting. If delay is positive, then the read operation blocks for delay milliseconds, then returns ERR if there is still no input. Therefore, the timeout and wtimeout routines provide the same functionality as nodelay, plus (where delay is positive) the addi- tional capability of being able to block for only a specified number of milliseconds. Curses performs "line-breakout optimization" by looking periodically for typeahead input while updating the screen. If input is found, and it is coming from a tty, Curses postpones the screen update until refresh or doupdate is called again. This optimization allows faster response to commands typed in advance. To do the typeahead checking, Curses normally uses the input FILE pointer passed to newterm, or stdin if initscr was called. The typeahead routine tells Curses to check for typeahead input by using the specified file descriptor, fd. If fd is -1, then Curses performs no typeahead checking. NOTES
The header file <curses.h> automatically includes the header file <stdio.h>. Note that echo, noecho, and timeout may be macros. RETURN VALUES
All routines that return an integer return ERR upon failure and OK upon successful completion, unless otherwise noted in the preceding rou- tine descriptions. SEE ALSO
Functions: curses(3), curs_getch(3), curs_initscr(3) Files: termios(4) Others: standards(5) curs_inopts(3)
Man Page