add Berkeley specific header
[unix-history] / usr / src / lib / libcurses / PSD.doc / doc.II
CommitLineData
a08e0da0
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
81d48c56 5.\" @(#)doc.II 6.1 (Berkeley) %G%
a08e0da0
KM
6.\"
7.Ds
81d48c56
KM
8.Fd cbreak "" \*m
9.Fd nocbreak "" \*m
a08e0da0 10.Fd crmode "" \*m
a08e0da0
KM
11.Fd nocrmode "" \*m
12.De
13Set or unset the terminal to/from cbreak mode.
81d48c56
KM
14The misnamed macros
15.Fn crmode
16and
17.Fn nocrmode
18are retained for backwards compatibility
19with ealier versions of the library.
a08e0da0
KM
20.Ds
21.Fd echo "" \*m
a08e0da0
KM
22.Fd noecho "" \*m
23.De
24Sets the terminal to echo or not echo characters.
25.Ds
26.Fd getch "" \*m
a08e0da0
KM
27.Fd wgetch win
28WINDOW *win;
29.De
30Gets a character from the terminal and (if necessary)
31echos it on the window.
32\*(Es
33Otherwise, the character gotten is returned.
34If
35.i noecho
36has been set, then the window is left unaltered.
37In order to retain control of the terminal,
38it is necessary to have one of
39.i noecho ,
40.i cbreak ,
41or
42.i rawmode
43set.
44If you do not set one,
45whatever routine you call to read characters will set
46.i cbreak
47for you,
48and then reset to the original mode when finished.
49.Ds
50.Fd getstr str \*m
51char *str;
a08e0da0
KM
52.Fd wgetstr win\*,str
53WINDOW *win;
54char *str;
55.De
56Get a string through the window
57and put it in the location pointed to by
58.Vn str ,
59which is assumed to be large enough to handle it.
60It sets tty modes if necessary,
61and then calls
62.Fn getch
63(or
64.Fn wgetch ) "" win
65to get the characters needed to fill in the string
66until a newline or EOF is encountered.
67The newline stripped off the string.
68\*(Es
69.Ds
81d48c56
KM
70.Fd \*_putchar c
71char c;
72.De
73Put out a character using the
74.Fn putchar
75macro.
76This function is used to output every character
77that
78.b curses
79generates.
80Thus,
81it can be redefined by the user who wants to do non-standard things
82with the output.
83It is named with an initial \*(lq\*_\*(rq
84because it usually should be invisible to the programmer.
85.Ds
a08e0da0 86.Fd raw "" \*m
a08e0da0
KM
87.Fd noraw "" \*m
88.De
89Set or unset the terminal to/from raw mode.
90On version 7
91.Un \**
92.(f
93\**
94.Un
95is a trademark of Bell Laboratories.
96.)f
97this also turns of newline mapping
98(see
99.Fn nl ).
100.Ds
101.Fd scanw fmt\*,arg1\*,arg2\*,...
102char *fmt;
a08e0da0
KM
103.Fd wscanw win\*,fmt\*,arg1\*,arg2\*,...
104WINDOW *win;
105char *fmt;
106.De
107Perform a
108.Fn scanf
109through the window using
110.Vn fmt .
111It does this using consecutive
112.Fn getch 's
113(or
114.Fn wgetch 's). "" win
115\*(Es