Sortix 1.1dev ports manual
This manual documents Sortix 1.1dev ports. You can instead view this document in the latest official manual.
CURSES_TTY(3) | Library Functions Manual | CURSES_TTY(3) |
NAME
curses_tty, beep, flash, curs_set, def_prog_mode, reset_prog_mode, def_shell_mode, reset_shell_mode, echo, noecho, delay_output, erasechar, flushinp, gettmode, halfdelay, has_ic, has_il, idcok, idlok, intrflush, noqiflush, qiflush, killchar, meta, napms, nl, nonl, cbreak, nocbreak, raw, noraw, savetty, resetty — curses terminal manipulation routinesLIBRARY
Curses Library (libcurses, -lcurses)SYNOPSIS
#include <curses.h> intbeep(void); int
flash(void); int
curs_set(int visibility); int
def_prog_mode(void); int
reset_prog_mode(void); int
def_shell_mode(void); int
reset_shell_mode(void); int
echo(void); int
noecho(void); int
delay_output(int ms); char
erasechar(void); int
flushinp(void); int
gettmode(void); int
has_ic(void); int
has_il(void); int
idcok(WINDOW *win, boolf flag); int
idlok(WINDOW *win, boolf flag); int
intrflush(WINDOW *win, boolf flag); void
noqiflush(void); void
qiflush(void); char
killchar(void); int
meta(WINDOW *win, boolf flag); int
napms(int ms); int
nl(void); int
nonl(void); int
cbreak(void); int
nocbreak(void); int
halfdelay(int); int
raw(void); int
noraw(void); int
savetty(void); int
resetty(void);
DESCRIPTION
These functions manipulate curses terminal settings. The beep() function rings the terminal bell, if this is possible. Failing that, the terminal screen will be flashed. If neither of these are possible, then no action will be taken. flash() will flash the terminal screen if possible. Failing that, the terminal bell will be rung. If neither of these are possible then no action will be taken. The cursor visibility can be set by calling curs_set(). The following visibility settings are valid for curs_set():- Visibility
- Effect
- 0
- cursor is invisible.
- 1
- cursor is normal visibility
- 2
- cursor is high visibility
TRUE
or
FALSE
depending on whether or not the
terminal has a insert character capability or not. Similarly the
has_il() function does the same test but for a
insert line capability.
The use of the insert character capability in curses operations can be enabled
or disabled by calling idcok() on the desired
window. Similarly, the use of the insert line capability can be controlled
using the idlok() function.
The intrflush() function controls whether or not a
flush of the input buffer is performed when an interrupt key (kill, suspend or
quit) is pressed. The win parameter is
ignored. The noqiflush() function is equivalent
to
intrflush(stdscr,
FALSE). The
qiflush() function is equivalent to
intrflush(stdscr,
TRUE).
The character that performs the line kill function can be determined by calling
the killchar() function.
The meta() function turns on and off the generation
of 8 bit characters by the terminal, if flag
is FALSE
then only 7 bit characters will be
returned, if flag is
TRUE
then 8 bit characters will be returned
by the terminal.
The napms() causes the application to sleep for the
number of milliseconds specified by ms.
Calling nl() will cause curses to map all carriage
returns to newlines on input, this functionality is enabled by default. The
nonl() function disables this behaviour.
The cbreak() function will put the terminal into
cbreak mode, which means that characters will be returned one at a time
instead of waiting for a newline character, line discipline processing will be
performed. The nocbreak() function disables this
mode.
Calling halfdelay() puts the terminal into the same
mode as cbreak() with the exception that if no
character is received within the specified number of tenths of a second then
the input routine will return ERR
. This
mode can be cancelled by calling nocbreak(). The
valid range for the timeout is from 1 to 255 tenths of a second.
The noraw() function sets the input mode for the
current terminal into Cooked mode, that is input character translation and
signal character processing is performed. The
raw() function puts the terminal into Raw mode,
no input character translation is done nor is signal character processing.
The terminal tty flags can be saved by calling
savetty() and may be restored by calling
resetty(), the use of these functions is
discouraged as they may cause the terminal to be put into a state that is
incompatible with curses operation.
RETURN VALUES
Functions returning pointers will returnNULL
if an error is detected. The functions that return an int will return one of
the following values:
OK
- The function completed successfully.
ERR
- An error occurred in the function.
SEE ALSO
getch(3), termios(4)NOTES
The idcok() and idlok() currently have no effect on the curses code at all, currently curses will always use the terminal insert character and insert line capabilities if available.STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.HISTORY
The Curses package appeared in 4.0BSD.June 13, 2003 | Debian |