1curs_util(3CURSES)         Curses Library Functions         curs_util(3CURSES)
2
3
4

NAME

6       curs_util, unctrl, keyname, filter, use_env, putwin, getwin, delay_out‐
7       put, flushinp - curses miscellaneous utility routines
8

SYNOPSIS

10       cc [ flag ... ] file ... -lcurses [ library ... ]
11       #include <curses.h>
12
13       char *unctrl(chtype c);
14
15
16       char *keyname(int c);
17
18
19       int filter(void);
20
21
22       void use_env(char bool);
23
24
25       int putwin(WINDOW *win, FILE *filep);
26
27
28       WINDOW *getwin(FILE *filep);
29
30
31       int delay_output(int ms);
32
33
34       int flushinp(void);
35
36

DESCRIPTION

38       The unctrl() macro expands to a character string which is  a  printable
39       representation  of the character c. Control characters are displayed in
40       the ^X notation. Printing characters are displayed as is.
41
42
43       With the keyname() routine, a character string corresponding to the key
44       c is returned.
45
46
47       The  filter() routine, if used, is called before initscr() or newterm()
48       are called. It makes curses think that  there  is  a  one-line  screen.
49       curses  does  not  use  any terminal capabilities that assume that they
50       know on what line of the screen the cursor is positioned.
51
52
53       The use_env() routine, if used, is called before initscr() or newterm()
54       are  called. When called with FALSE as an argument, the values of lines
55       and columns specified in the terminfo database will be  used,  even  if
56       environment  variables  LINES and COLUMNS (used by default) are set, or
57       if curses is running in a window (in which case default behavior  would
58       be to use the window size if LINES and COLUMNS are not set).
59
60
61       With the putwin() routine, all data associated with window win is writ‐
62       ten into the file to which filep points. This information can be  later
63       retrieved using  the getwin() function.
64
65
66       The  getwin()  routine  reads window related data stored in the file by
67       putwin(). The routine then creates and initializes a new  window  using
68       that data. It returns a pointer to the new window.
69
70
71       The  delay_output()  routine inserts an ms millisecond pause in output.
72       This routine should not be used extensively because padding  characters
73       are used rather than a CPU pause.
74
75
76       The flushinp() routine throws away any typeahead that has been typed by
77       the user and has not yet been read by the program.
78

RETURN VALUES

80       Except for flushinp(), routines that return an integer return ERR  upon
81       failure and an integer value other than ERR upon successful completion.
82
83
84       flushinp() always returns OK.
85
86
87       Routines that return pointers return NULL on error.
88

ATTRIBUTES

90       See attributes(5) for descriptions of the following attributes:
91
92
93
94
95       ┌─────────────────────────────┬─────────────────────────────┐
96       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
97       ├─────────────────────────────┼─────────────────────────────┤
98       │MT-Level                     │Unsafe                       │
99       └─────────────────────────────┴─────────────────────────────┘
100

SEE ALSO

102       curs_initscr(3CURSES),     curs_scr_dump(3CURSES),     curses(3CURSES),
103       attributes(5)
104

NOTES

106       The header <curses.h> automatically includes the headers  <stdio.h> and
107       <unctrl.h>.
108
109
110       Note that unctrl() is a macro, which is defined in <unctrl.h>.
111
112
113
114SunOS 5.11                        31 Dec 1996               curs_util(3CURSES)
Impressum