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