Print this page
1059 curses.h conflicts with stdbool.h
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/ucbhead/curses.h
+++ new/usr/src/ucbhead/curses.h
1 1 /*
2 2 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
3 3 * Use is subject to license terms.
4 4 */
5 5
6 6 /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
7 7 /* All Rights Reserved */
↓ open down ↓ |
7 lines elided |
↑ open up ↑ |
8 8
9 9 /*
10 10 * Copyright (c) 1980 Regents of the University of California.
11 11 * All rights reserved. The Berkeley software License Agreement
12 12 * specifies the terms and conditions for redistribution.
13 13 */
14 14
15 15 #ifndef _CURSES_H
16 16 #define _CURSES_H
17 17
18 -#pragma ident "%Z%%M% %I% %E% SMI"
19 -
20 18 #ifdef __cplusplus
21 19 extern "C" {
22 20 #endif
23 21
24 22 #ifndef WINDOW
25 23
26 24 #include <stdio.h>
27 25 #include <sgtty.h>
28 26
29 27 #undef HZ /* in case they've included <sys/param.h> */
30 28
31 -#if !(defined(__cplusplus) && defined(_BOOL))
29 +#if !(defined(__cplusplus) && defined(bool))
32 30 #define bool char
33 31 #endif
34 32
35 33 #define reg register
36 34
37 35 #define TRUE (1)
38 36 #define FALSE (0)
39 37 #define ERR (0)
40 38 #define OK (1)
41 39
42 40 #define _ENDLINE 001
43 41 #define _FULLWIN 002
44 42 #define _SCROLLWIN 004
45 43 #define _FLUSH 010
46 44 #define _FULLLINE 020
47 45 #define _IDLINE 040
48 46 #define _STANDOUT 0200
49 47 #define _NOCHANGE -1
50 48
51 49 #define _puts(s) tputs(s, 0, _putchar)
52 50
53 51 typedef struct sgttyb SGTTY;
54 52
55 53 /*
56 54 * Capabilities from termcap
57 55 */
58 56
59 57 extern bool AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL,
60 58 XB, XN, XT, XS, XX;
61 59 extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL,
62 60 *DM, *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6,
63 61 *K7, *K8, *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL,
64 62 *KR, *KS, *KU, *LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF,
65 63 *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VS,
66 64 *VE, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM,
67 65 *LEFT_PARM, *RIGHT_PARM;
68 66 extern char PC;
69 67
70 68 /*
71 69 * From the tty modes...
72 70 */
73 71
74 72 extern bool GT, NONL, UPPERCASE, normtty, _pfast;
75 73
76 74 struct _win_st {
77 75 short _cury, _curx;
78 76 short _maxy, _maxx;
79 77 short _begy, _begx;
80 78 short _flags;
81 79 short _ch_off;
82 80 bool _clear;
83 81 bool _leave;
84 82 bool _scroll;
85 83 char **_y;
86 84 short *_firstch;
87 85 short *_lastch;
88 86 struct _win_st *_nextp, *_orig;
89 87 };
90 88
91 89 #define WINDOW struct _win_st
92 90
93 91 extern bool My_term, _echoit, _rawmode, _endwin;
94 92
95 93 extern char *Def_term, ttytype[50];
96 94
97 95 extern int LINES, COLS, _tty_ch, _res_flg;
98 96
99 97 extern SGTTY _tty;
100 98
101 99 extern WINDOW *stdscr, *curscr;
102 100
103 101 #define VOID(x) (x)
104 102
105 103 /*
106 104 * pseudo functions for standard screen
107 105 */
108 106 #define addch(ch) VOID(waddch(stdscr, ch))
109 107 #define getch() VOID(wgetch(stdscr))
110 108 #define addstr(str) VOID(waddstr(stdscr, str))
111 109 #define getstr(str) VOID(wgetstr(stdscr, str))
112 110 #define move(y, x) VOID(wmove(stdscr, y, x))
113 111 #define clear() VOID(wclear(stdscr))
114 112 #define erase() VOID(werase(stdscr))
115 113 #define clrtobot() VOID(wclrtobot(stdscr))
116 114 #define clrtoeol() VOID(wclrtoeol(stdscr))
117 115 #define insertln() VOID(winsertln(stdscr))
118 116 #define deleteln() VOID(wdeleteln(stdscr))
119 117 #define refresh() VOID(wrefresh(stdscr))
120 118 #define inch() VOID(winch(stdscr))
121 119 #define insch(c) VOID(winsch(stdscr, c))
122 120 #define delch() VOID(wdelch(stdscr))
123 121 #define standout() VOID(wstandout(stdscr))
124 122 #define standend() VOID(wstandend(stdscr))
125 123
126 124 /*
127 125 * mv functions
128 126 */
129 127 #define mvwaddch(win, y, x, ch) VOID(wmove(win, y, x) == ERR ? \
130 128 ERR:waddch(win, ch))
131 129 #define mvwgetch(win, y, x) VOID(wmove(win, y, x) == ERR?ERR:wgetch(win))
132 130 #define mvwaddstr(win, y, x, str) VOID(wmove(win, y, x) == ERR? \
133 131 ERR:waddstr(win, str))
134 132 #define mvwgetstr(win, y, x, str) VOID(wmove(win, y, x) == ERR? \
135 133 ERR:wgetstr(win, str))
136 134 #define mvwinch(win, y, x) VOID(wmove(win, y, x) == ERR ? ERR : winch(win))
137 135 #define mvwdelch(win, y, x) VOID(wmove(win, y, x) == ERR ? \
138 136 ERR : wdelch(win))
139 137 #define mvwinsch(win, y, x, c) VOID(wmove(win, y, x) == ERR ? \
140 138 ERR:winsch(win, c))
141 139 #define mvaddch(y, x, ch) mvwaddch(stdscr, y, x, ch)
142 140 #define mvgetch(y, x) mvwgetch(stdscr, y, x)
143 141 #define mvaddstr(y, x, str) mvwaddstr(stdscr, y, x, str)
144 142 #define mvgetstr(y, x, str) mvwgetstr(stdscr, y, x, str)
145 143 #define mvinch(y, x) mvwinch(stdscr, y, x)
146 144 #define mvdelch(y, x) mvwdelch(stdscr, y, x)
147 145 #define mvinsch(y, x, c) mvwinsch(stdscr, y, x, c)
148 146
149 147 /*
150 148 * pseudo functions
151 149 */
152 150
153 151 #define clearok(win, bf) (win->_clear = bf)
154 152 #define leaveok(win, bf) (win->_leave = bf)
155 153 #define scrollok(win, bf) (win->_scroll = bf)
156 154 #define flushok(win, bf) (bf ? (win->_flags |= _FLUSH): \
157 155 (win->_flags &= ~_FLUSH))
158 156 #define getyx(win, y, x) y = win->_cury, x = win->_curx
159 157 #define winch(win) (win->_y[win->_cury][win->_curx] & 0177)
160 158
161 159 #define raw() (_tty.sg_flags |= RAW, _pfast = _rawmode = TRUE, \
162 160 (void) stty(_tty_ch, &_tty))
163 161 #define noraw() (_tty.sg_flags &= ~RAW, _rawmode = FALSE, \
164 162 _pfast = !(_tty.sg_flags & CRMOD), (void) stty(_tty_ch, &_tty))
165 163 #define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, \
166 164 (void) stty(_tty_ch, &_tty))
167 165 #define nocbreak() (_tty.sg_flags &= ~CBREAK, _rawmode = FALSE, \
168 166 (void) stty(_tty_ch, &_tty))
169 167 #define crmode() cbreak() /* backwards compatability */
170 168 #define nocrmode() nocbreak() /* backwards compatability */
171 169 #define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, \
172 170 (void) stty(_tty_ch, &_tty))
173 171 #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, \
174 172 (void) stty(_tty_ch, &_tty))
175 173 #define nl() (_tty.sg_flags |= CRMOD, _pfast = _rawmode, \
176 174 (void) stty(_tty_ch, &_tty))
177 175 #define nonl() (_tty.sg_flags &= ~CRMOD, _pfast = TRUE, \
178 176 (void) stty(_tty_ch, &_tty))
179 177 #define savetty() ((void) gtty(_tty_ch, &_tty), _res_flg = _tty.sg_flags)
180 178 #define resetty() (_tty.sg_flags = _res_flg, (void) stty(_tty_ch, &_tty))
181 179
182 180 #define erasechar() (_tty.sg_erase)
183 181 #define killchar() (_tty.sg_kill)
184 182 #define baudrate() (_tty.sg_ospeed)
185 183
186 184 /*
187 185 * chtype is the type used to store a character together with attributes.
188 186 * It can be set to "char" to save space, or "int" to get more attributes.
189 187 */
190 188 #ifdef CHTYPE
191 189 typedef CHTYPE chtype;
192 190 #else
193 191 typedef unsigned int chtype;
194 192 #endif
195 193
196 194 #ifndef __STDC__
197 195 WINDOW *initscr(), *newwin(), *subwin();
198 196 char *longname(), *getcap();
199 197 #else
200 198 extern WINDOW *initscr(void);
201 199 extern WINDOW *newwin(int, int, int, int);
202 200 extern WINDOW *subwin(WINDOW *, int, int, int, int);
203 201 extern char *longname(char *, char *);
204 202 extern char *getcap(char *);
205 203 extern char *wstandout(WINDOW *);
206 204 extern char *wstandend(WINDOW *);
207 205 extern int gettmode(void);
208 206 extern int idlok(WINDOW *, bool);
209 207 extern int box(WINDOW *, char, char);
210 208 extern int touchwin(WINDOW *);
211 209 extern int touchline(WINDOW *, int, int, int);
212 210 extern int mvcur(int, int, int, int);
213 211 extern int wmove(WINDOW *, int, int);
214 212 extern int scroll(WINDOW *);
215 213 extern int werase(WINDOW *);
216 214 extern int wrefresh(WINDOW *);
217 215 extern int endwin(void);
218 216 extern int mvwin(WINDOW *, int, int);
219 217 extern int delwin(WINDOW *);
220 218 extern int overlay(WINDOW *, WINDOW *);
221 219 extern int overwrite(WINDOW *, WINDOW *);
222 220 extern int winsertln(WINDOW *);
223 221 extern int wdeleteln(WINDOW *);
224 222 extern int wgetstr(WINDOW *, char *);
225 223 extern int wgetch(WINDOW *);
226 224 extern int waddch(WINDOW *, char);
227 225 extern int waddstr(WINDOW *, char *);
228 226 extern int winsch(WINDOW *, char);
229 227 extern int wdelch(WINDOW *);
230 228 extern int wclear(WINDOW *);
231 229 extern int wclrtobot(WINDOW *);
232 230 extern int wclrtoeol(WINDOW *);
233 231 extern int printw(char *, ...);
234 232 extern int wprintw(WINDOW *, char *, ...);
235 233 extern int mvprintw(int, int, char *, ...);
236 234 extern int mvwprintw(WINDOW *, int, int, char *, ...);
237 235 extern int scanw(char *, ...);
238 236 extern int wscanw(WINDOW *, char *, ...);
239 237 extern int mvscanw(int, int, char *, ...);
240 238 extern int mvwscanw(WINDOW *, int, int, char *, ...);
241 239 extern int setterm(char *);
242 240 #endif /* __STDC__ */
243 241
244 242 /*
245 243 * Used to be in unctrl.h.
246 244 */
247 245 #define unctrl(c) _unctrl[(c) & 0177]
248 246 extern char *_unctrl[];
249 247 #endif
250 248
251 249 #ifdef __cplusplus
252 250 }
253 251 #endif
254 252
255 253 #endif /* _CURSES_H */
↓ open down ↓ |
214 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX