curses_sys/
base.rs

1use libc::{c_void, c_char, c_int, c_short, wchar_t, uint32_t, FILE};
2
3pub type chtype  = uint32_t;
4pub type attr_t  = chtype;
5
6pub type SCREEN = c_void;
7pub type WINDOW = c_void;
8
9pub const CCHARW_MAX: usize = 5;
10
11macro_rules! BITS {
12	($mask:expr, $shift:expr) => (
13		($mask as chtype) << ($shift + 8)
14	)
15}
16
17pub const A_NORMAL:     chtype = 0;
18pub const A_ATTRIBUTES: chtype = BITS!(!0, 0);
19pub const A_CHARTEXT:   chtype = BITS!(1, 0) - 1;
20pub const A_COLOR:      chtype = BITS!((1 << 8) - 1, 0);
21pub const A_STANDOUT:   chtype = BITS!(1, 8);
22pub const A_UNDERLINE:  chtype = BITS!(1, 9);
23pub const A_REVERSE:    chtype = BITS!(1, 10);
24pub const A_BLINK:      chtype = BITS!(1, 11);
25pub const A_DIM:        chtype = BITS!(1, 12);
26pub const A_BOLD:       chtype = BITS!(1, 13);
27pub const A_ALTCHARSET: chtype = BITS!(1, 14);
28pub const A_INVIS:      chtype = BITS!(1, 15);
29pub const A_PROTECT:    chtype = BITS!(1, 16);
30pub const A_HORIZONTAL: chtype = BITS!(1, 17);
31pub const A_LEFT:       chtype = BITS!(1, 18);
32pub const A_LOW:        chtype = BITS!(1, 19);
33pub const A_RIGHT:      chtype = BITS!(1, 20);
34pub const A_TOP:        chtype = BITS!(1, 21);
35pub const A_VERTICAL:   chtype = BITS!(1, 22);
36pub const A_ITALIC:     chtype = BITS!(1, 23);
37
38pub const COLOR_BLACK:   c_short = 0;
39pub const COLOR_RED:     c_short = 1;
40pub const COLOR_GREEN:   c_short = 2;
41pub const COLOR_YELLOW:  c_short = 3;
42pub const COLOR_BLUE:    c_short = 4;
43pub const COLOR_MAGENTA: c_short = 5;
44pub const COLOR_CYAN:    c_short = 6;
45pub const COLOR_WHITE:   c_short = 7;
46
47pub const KEY_CODE_YES:  c_int = 0o400;
48pub const KEY_MIN:       c_int = 0o401;
49pub const KEY_BREAK:     c_int = 0o401;
50pub const KEY_SRESET:    c_int = 0o530;
51pub const KEY_RESET:     c_int = 0o531;
52pub const KEY_DOWN:      c_int = 0o402;
53pub const KEY_UP:        c_int = 0o403;
54pub const KEY_LEFT:      c_int = 0o404;
55pub const KEY_RIGHT:     c_int = 0o405;
56pub const KEY_HOME:      c_int = 0o406;
57pub const KEY_BACKSPACE: c_int = 0o407;
58pub const KEY_F0:        c_int = 0o410;
59pub const KEY_F1:        c_int = 0o411;
60pub const KEY_F2:        c_int = 0o412;
61pub const KEY_F3:        c_int = 0o413;
62pub const KEY_F4:        c_int = 0o414;
63pub const KEY_F5:        c_int = 0o415;
64pub const KEY_F6:        c_int = 0o416;
65pub const KEY_F7:        c_int = 0o417;
66pub const KEY_F8:        c_int = 0o420;
67pub const KEY_F9:        c_int = 0o421;
68pub const KEY_F10:       c_int = 0o422;
69pub const KEY_F11:       c_int = 0o423;
70pub const KEY_F12:       c_int = 0o424;
71pub const KEY_DL:        c_int = 0o510;
72pub const KEY_IL:        c_int = 0o511;
73pub const KEY_DC:        c_int = 0o512;
74pub const KEY_IC:        c_int = 0o513;
75pub const KEY_EIC:       c_int = 0o514;
76pub const KEY_CLEAR:     c_int = 0o515;
77pub const KEY_EOS:       c_int = 0o516;
78pub const KEY_EOL:       c_int = 0o517;
79pub const KEY_SF:        c_int = 0o520;
80pub const KEY_SR:        c_int = 0o521;
81pub const KEY_NPAGE:     c_int = 0o522;
82pub const KEY_PPAGE:     c_int = 0o523;
83pub const KEY_STAB:      c_int = 0o524;
84pub const KEY_CTAB:      c_int = 0o525;
85pub const KEY_CATAB:     c_int = 0o526;
86pub const KEY_ENTER:     c_int = 0o527;
87pub const KEY_PRINT:     c_int = 0o532;
88pub const KEY_LL:        c_int = 0o533;
89pub const KEY_A1:        c_int = 0o534;
90pub const KEY_A3:        c_int = 0o535;
91pub const KEY_B2:        c_int = 0o536;
92pub const KEY_C1:        c_int = 0o537;
93pub const KEY_C3:        c_int = 0o540;
94pub const KEY_BTAB:      c_int = 0o541;
95pub const KEY_BEG:       c_int = 0o542;
96pub const KEY_CANCEL:    c_int = 0o543;
97pub const KEY_CLOSE:     c_int = 0o544;
98pub const KEY_COMMAND:   c_int = 0o545;
99pub const KEY_COPY:      c_int = 0o546;
100pub const KEY_CREATE:    c_int = 0o547;
101pub const KEY_END:       c_int = 0o550;
102pub const KEY_EXIT:      c_int = 0o551;
103pub const KEY_FIND:      c_int = 0o552;
104pub const KEY_HELP:      c_int = 0o553;
105pub const KEY_MARK:      c_int = 0o554;
106pub const KEY_MESSAGE:   c_int = 0o555;
107pub const KEY_MOVE:      c_int = 0o556;
108pub const KEY_NEXT:      c_int = 0o557;
109pub const KEY_OPEN:      c_int = 0o560;
110pub const KEY_OPTIONS:   c_int = 0o561;
111pub const KEY_PREVIOUS:  c_int = 0o562;
112pub const KEY_REDO:      c_int = 0o563;
113pub const KEY_REFERENCE: c_int = 0o564;
114pub const KEY_REFRESH:   c_int = 0o565;
115pub const KEY_REPLACE:   c_int = 0o566;
116pub const KEY_RESTART:   c_int = 0o567;
117pub const KEY_RESUME:    c_int = 0o570;
118pub const KEY_SAVE:      c_int = 0o571;
119pub const KEY_SBEG:      c_int = 0o572;
120pub const KEY_SCANCEL:   c_int = 0o573;
121pub const KEY_SCOMMAND:  c_int = 0o574;
122pub const KEY_SCOPY:     c_int = 0o575;
123pub const KEY_SCREATE:   c_int = 0o576;
124pub const KEY_SDC:       c_int = 0o577;
125pub const KEY_SDL:       c_int = 0o600;
126pub const KEY_SELECT:    c_int = 0o601;
127pub const KEY_SEND:      c_int = 0o602;
128pub const KEY_SEOL:      c_int = 0o603;
129pub const KEY_SEXIT:     c_int = 0o604;
130pub const KEY_SFIND:     c_int = 0o605;
131pub const KEY_SHELP:     c_int = 0o606;
132pub const KEY_SHOME:     c_int = 0o607;
133pub const KEY_SIC:       c_int = 0o610;
134pub const KEY_SLEFT:     c_int = 0o611;
135pub const KEY_SMESSAGE:  c_int = 0o612;
136pub const KEY_SMOVE:     c_int = 0o613;
137pub const KEY_SNEXT:     c_int = 0o614;
138pub const KEY_SOPTIONS:  c_int = 0o615;
139pub const KEY_SPREVIOUS: c_int = 0o616;
140pub const KEY_SPRINT:    c_int = 0o617;
141pub const KEY_SREDO:     c_int = 0o620;
142pub const KEY_SREPLACE:  c_int = 0o621;
143pub const KEY_SRIGHT:    c_int = 0o622;
144pub const KEY_SRSUME:    c_int = 0o623;
145pub const KEY_SSAVE:     c_int = 0o624;
146pub const KEY_SSUSPEND:  c_int = 0o625;
147pub const KEY_SUNDO:     c_int = 0o626;
148pub const KEY_SUSPEND:   c_int = 0o627;
149pub const KEY_UNDO:      c_int = 0o630;
150pub const KEY_MOUSE:     c_int = 0o631;
151pub const KEY_RESIZE:    c_int = 0o632;
152pub const KEY_EVENT:     c_int = 0o633;
153pub const KEY_MAX:       c_int = 0o777;
154
155#[derive(Copy, Clone, Eq, PartialEq, Debug)]
156#[repr(C)]
157pub struct cchar_t {
158	pub attr:      attr_t,
159	pub chars:     [wchar_t; CCHARW_MAX],
160	pub ext_color: c_int,
161}
162
163#[inline(always)]
164pub unsafe fn ACS(c: u8) -> chtype {
165	*acs_map.offset(c as isize)
166}
167
168pub const ULCORNER: u8 = b'l';
169pub const LLCORNER: u8 = b'm';
170pub const URCORNER: u8 = b'k';
171pub const LRCORNER: u8 = b'j';
172pub const LTEE:     u8 = b't';
173pub const RTEE:     u8 = b'u';
174pub const BTEE:     u8 = b'v';
175pub const TTEE:     u8 = b'w';
176pub const HLINE:    u8 = b'q';
177pub const VLINE:    u8 = b'x';
178pub const PLUS:     u8 = b'n';
179pub const S1:       u8 = b'o';
180pub const S9:       u8 = b's';
181pub const DIAMOND:  u8 = b'`';
182pub const CKBOARD:  u8 = b'a';
183pub const DEGREE:   u8 = b'f';
184pub const PLMINUS:  u8 = b'g';
185pub const BULLET:   u8 = b'~';
186pub const LARROW:   u8 = b',';
187pub const RARROW:   u8 = b'+';
188pub const DARROW:   u8 = b'.';
189pub const UARROW:   u8 = b'-';
190pub const BOARD:    u8 = b'h';
191pub const LANTERN:  u8 = b'i';
192pub const BLOCK:    u8 = b'0';
193pub const S3:       u8 = b'p';
194pub const S7:       u8 = b'r';
195pub const LEQUAL:   u8 = b'y';
196pub const GEQUAL:   u8 = b'z';
197pub const PI:       u8 = b'{';
198pub const NEQUAL:   u8 = b'|';
199pub const STERLING: u8 = b'}';
200
201pub const BSSB:     u8 = ULCORNER;
202pub const SSBB:     u8 = LLCORNER;
203pub const BBSS:     u8 = URCORNER;
204pub const SBBS:     u8 = LRCORNER;
205pub const SBSS:     u8 = RTEE;
206pub const SSSB:     u8 = LTEE;
207pub const SSBS:     u8 = BTEE;
208pub const BSSS:     u8 = TTEE;
209pub const BSBS:     u8 = HLINE;
210pub const SBSB:     u8 = VLINE;
211pub const SSSS:     u8 = PLUS;
212
213#[cfg_attr(feature = "wide", link(name = "ncursesw"))]
214#[cfg_attr(not(feature = "wide"), link(name = "ncurses"))]
215extern "C" {
216	pub static curscr: *mut WINDOW;
217	pub static newscr: *mut WINDOW;
218	pub static stdscr: *mut WINDOW;
219
220	pub static ttytype: *const c_char;
221	pub static acs_map: *const chtype;
222
223	pub static COLORS:      c_int;
224	pub static COLOR_PAIRS: c_int;
225	pub static COLS:        c_int;
226	pub static ESCDELAY:    c_int;
227	pub static LINES:       c_int;
228	pub static TABSIZE:     c_int;
229
230	pub fn initscr() -> *mut WINDOW;
231	pub fn endwin() -> c_int;
232	pub fn isendwin() -> bool;
233	pub fn newterm(kind: *const c_char, outf: *mut FILE, infd: *mut FILE) -> *mut SCREEN;
234	pub fn set_term(new: *mut SCREEN);
235	pub fn delscreen(sp: *mut SCREEN);
236
237	pub fn newwin(nlines: c_int, ncols: c_int, begin_y: c_int, begin_x: c_int) -> *mut WINDOW;
238	pub fn delwin(win: *mut WINDOW) -> c_int;
239	pub fn mvwin(win: *mut WINDOW, y: c_int, x: c_int) -> c_int;
240	pub fn subwin(orig: *mut WINDOW, nlines: c_int, ncols: c_int, begin_y: c_int, begin_x: c_int) -> *mut WINDOW;
241	pub fn derwin(orig: *mut WINDOW, nlines: c_int, ncols: c_int, begin_y: c_int, begin_x: c_int) -> *mut WINDOW;
242	pub fn mvderwin(orig: *mut WINDOW, par_y: c_int, par_x: c_int) -> c_int;
243	pub fn dupwin(win: *const WINDOW) -> *mut WINDOW;
244	pub fn wsyncup(win: *mut WINDOW);
245	pub fn syncok(win: *mut WINDOW, bf: bool) -> c_int;
246	pub fn wcursyncup(win: *mut WINDOW);
247	pub fn wsyncdown(win: *mut WINDOW);
248
249	pub fn border(ls: chtype, rs: chtype, ts: chtype, bs: chtype, tl: chtype, tr: chtype, bl: chtype, br: chtype) -> c_int;
250	pub fn wborder(win: *mut WINDOW, ls: chtype, rs: chtype, ts: chtype, bs: chtype, tl: chtype, tr: chtype, bl: chtype, br: chtype) -> c_int;
251	#[link_name="box"] pub fn box_(win: *const WINDOW, verch: chtype, horch: chtype) -> c_int;
252
253	pub fn hline(ch: chtype, n: c_int) -> c_int;
254	pub fn whline(win: *mut WINDOW, ch: chtype, n: c_int) -> c_int;
255	pub fn vline(ch: chtype, n: c_int) -> c_int;
256	pub fn wvline(win: *mut WINDOW, ch: chtype, n: c_int) -> c_int;
257
258	pub fn mvhline(y: c_int, x: c_int, ch: chtype, n: c_int) -> c_int;
259	pub fn mvwhline(win: *mut WINDOW, y: c_int, x: c_int, ch: chtype, n: c_int) -> c_int;
260	pub fn mvvline(y: c_int, x: c_int, ch: chtype, n: c_int) -> c_int;
261	pub fn mvwvline(win: *mut WINDOW, y: c_int, x: c_int, ch: chtype, n: c_int) -> c_int;
262
263	pub fn addch(ch: chtype) -> c_int;
264	pub fn waddch(win: *mut WINDOW, ch: chtype) -> c_int;
265	pub fn mvaddch(y: c_int, x: c_int, ch: chtype) -> c_int;
266	pub fn mvwaddch(win: *mut WINDOW, y: c_int, x: c_int, ch: chtype) -> c_int;
267	pub fn echochar(ch: chtype) -> c_int;
268	pub fn wechochar(win: *mut WINDOW, ch: chtype) -> c_int;
269
270	pub fn addchstr(chstr: *const chtype) -> c_int;
271	pub fn addchnstr(chstr: *const chtype, n: c_int) -> c_int;
272	pub fn waddchstr(win: *mut WINDOW, chstr: *const chtype) -> c_int;
273	pub fn waddchnstr(win: *mut WINDOW, chstr: *const chtype, n: c_int) -> c_int;
274	pub fn mvaddchstr(y: c_int, x: c_int, chstr: *const chtype) -> c_int;
275	pub fn mvaddchnstr(y: c_int, x: c_int, chstr: *const chtype, n: c_int) -> c_int;
276	pub fn mvwaddchstr(win: *mut WINDOW, y: c_int, x: c_int, chstr: *const chtype) -> c_int;
277	pub fn mvwaddchnstr(win: *mut WINDOW, y: c_int, x: c_int, chstr: *const chtype, n: c_int) -> c_int;
278
279	pub fn addstr(string: *const c_char) -> c_int;
280	pub fn addnstr(string: *const c_char, n: c_int) -> c_int;
281	pub fn waddstr(win: *mut WINDOW, string: *const c_char) -> c_int;
282	pub fn waddnstr(win: *mut WINDOW, string: *const c_char, n: c_int) -> c_int;
283	pub fn mvaddstr(y: c_int, x: c_int, string: *const c_char) -> c_int;
284	pub fn mvaddnstr(y: c_int, x: c_int, string: *const c_char, n: c_int) -> c_int;
285	pub fn mvwaddstr(win: *mut WINDOW, y: c_int, x: c_int, string: *const c_char) -> c_int;
286	pub fn mvwaddnstr(win: *mut WINDOW, y: c_int, x: c_int, string: *const c_char, n: c_int) -> c_int;
287
288	pub fn attroff(attrs: c_int) -> c_int;
289	pub fn wattroff(win: *mut WINDOW, attrs: c_int) -> c_int;
290	pub fn attron(attrs: c_int) -> c_int;
291	pub fn wattron(win: *mut WINDOW, attrs: c_int) -> c_int;
292	pub fn attrset(attrs: c_int) -> c_int;
293	pub fn wattrset(win: *mut WINDOW, attrs: c_int) -> c_int;
294	pub fn color_set(color_pair_number: c_short, opts: *const c_void) -> c_int;
295	pub fn wcolor_set(win: *mut WINDOW, color_pair_number: c_short, opts: *const c_void) -> c_int;
296	pub fn standend() -> c_int;
297	pub fn wstandend(win: *mut WINDOW) -> c_int;
298	pub fn standout() -> c_int;
299	pub fn wstandout(win: *mut WINDOW) -> c_int;
300	pub fn attr_get(attrs: *mut attr_t, pair: *mut c_short, opts: *const c_void) -> c_int;
301	pub fn wattr_get(win: *const WINDOW, attrs: *mut attr_t, pair: *mut c_short, opts: *const c_void) -> c_int;
302	pub fn attr_off(attrs: attr_t, opts: *const c_void) -> c_int;
303	pub fn wattr_off(win: *mut WINDOW, attrs: attr_t, opts: *const c_void) -> c_int;
304	pub fn attr_on(attrs: attr_t, opts: *const c_void) -> c_int;
305	pub fn wattr_on(win: *mut WINDOW, attrs: attr_t, opts: *const c_void) -> c_int;
306	pub fn attr_set(attrs: attr_t, pair: c_short, opts: *const c_void) -> c_int;
307	pub fn wattr_set(win: *mut WINDOW, attrs: attr_t, pair: c_short, opts: *const c_void) -> c_int;
308	pub fn chgat(n: c_int, attr: attr_t, color: c_short, opts: *const c_void) -> c_int;
309	pub fn wchgat(win: *mut WINDOW, n: c_int, attr: attr_t, color: c_short, opts: *const c_void) -> c_int;
310	pub fn mvchgat(y: c_int, x: c_int, n: c_int, attr: attr_t, color: c_short, opts: *const c_void) -> c_int;
311	pub fn mvwchgat(win: *mut WINDOW, y: c_int, x: c_int, n: c_int, attr: attr_t, color: c_short, opts: *const c_void) -> c_int;
312
313	pub fn beep() -> c_int;
314	pub fn flash() -> c_int;
315
316	pub fn baudrate() -> c_int;
317	pub fn erasechar() -> c_char;
318	pub fn erasewchar(ch: *mut wchar_t) -> c_int;
319	pub fn has_ic() -> bool;
320	pub fn has_il() -> bool;
321	pub fn killchar() -> c_char;
322	pub fn killwchar(ch: *mut wchar_t) -> c_int;
323	pub fn longname() -> *const c_char;
324	pub fn term_attrs() -> attr_t;
325	pub fn termattrs() -> chtype;
326	pub fn termname() -> *const c_char;
327
328	pub fn erase() -> c_int;
329	pub fn werase(win: *mut WINDOW) -> c_int;
330	pub fn clear() -> c_int;
331	pub fn wclear(win: *mut WINDOW) -> c_int;
332	pub fn clrtobot() -> c_int;
333	pub fn wclrtobot(win: *mut WINDOW) -> c_int;
334	pub fn clrtoeol() -> c_int;
335	pub fn wclrtoeol(win: *mut WINDOW) -> c_int;
336
337	pub fn bkgdset(ch: chtype);
338	pub fn wbkgdset(win: *mut WINDOW, ch: chtype);
339	pub fn bkgd(ch: chtype) -> c_int;
340	pub fn wbkgd(win: *mut WINDOW, ch: chtype) -> c_int;
341	pub fn getbkgd(win: *const WINDOW) -> chtype;
342
343	pub fn start_color() -> c_int;
344	pub fn init_pair(pair: c_short, f: c_short, b: c_short) -> c_int;
345	pub fn init_color(color: c_short, r: c_short, g: c_short, b: c_short) -> c_int;
346	pub fn has_colors() -> bool;
347	pub fn can_change_color() -> bool;
348	pub fn color_content(color: c_short, r: *mut c_short, g: *mut c_short, b: *mut c_short) -> c_int;
349	pub fn pair_content(pair: c_short, f: *mut c_short, b: *mut c_short) -> c_int;
350	pub fn COLOR_PAIR(n: c_int) -> c_int;
351
352	pub fn unctrl(c: chtype) -> *const c_char;
353	pub fn wunctrl(c: *const cchar_t) -> *const wchar_t;
354	pub fn keyname(c: c_int) -> *const c_char;
355	pub fn key_name(w: wchar_t) -> *const c_char;
356	pub fn filter();
357	pub fn nofilter();
358	pub fn use_env(f: bool);
359	pub fn use_tioctl(f: bool);
360	pub fn putwin(win: *mut WINDOW, filep: *mut FILE);
361	pub fn getwin(filep: *mut FILE) -> *mut WINDOW;
362	pub fn delay_output(ms: c_int) -> c_int;
363	pub fn flushinp() -> c_int;
364
365	pub fn cbreak() -> c_int;
366	pub fn nocbreak() -> c_int;
367	pub fn echo() -> c_int;
368	pub fn noecho() -> c_int;
369	pub fn halfdelay(tenths: c_int) -> c_int;
370	pub fn intrflush(win: *mut WINDOW, bf: bool) -> c_int;
371	pub fn keypad(win: *mut WINDOW, bf: bool) -> c_int;
372	pub fn meta(win: *mut WINDOW, bf: bool) -> c_int;
373	pub fn nodelay(win: *mut WINDOW, bf: bool) -> c_int;
374	pub fn raw() -> c_int;
375	pub fn noraw() -> c_int;
376	pub fn noqiflush();
377	pub fn qiflush();
378	pub fn notimeout(win: *mut WINDOW, bf: bool) -> c_int;
379	pub fn timeout(delay: c_int);
380	pub fn wtimeout(win: *mut WINDOW, delay: c_int);
381	pub fn typeahead(fd: c_int) -> c_int;
382
383	pub fn inch() -> chtype;
384	pub fn winch(win: *mut WINDOW) -> chtype;
385	pub fn mvinch(y: c_int, x: c_int) -> chtype;
386	pub fn mvwinch(win: *mut WINDOW, y: c_int, x: c_int) -> chtype;
387
388	pub fn inchstr(chstr: *mut chtype) -> c_int;
389	pub fn inchnstr(chstr: *mut chtype, n: c_int) -> c_int;
390	pub fn winchstr(win: *mut WINDOW, chstr: *mut chtype) -> c_int;
391	pub fn winchnstr(win: *mut WINDOW, chstr: *mut chtype, n: c_int) -> c_int;
392	pub fn mvinchstr(y: c_int, x: c_int, chstr: *mut chtype) -> c_int;
393	pub fn mvinchnstr(y: c_int, x: c_int, chstr: *mut chtype, n: c_int) -> c_int;
394	pub fn mvwinchstr(win: *mut WINDOW, y: c_int, x: c_int, chstr: *mut chtype) -> c_int;
395	pub fn mvwinchnstr(win: *mut WINDOW, y: c_int, x: c_int, chstr: *mut chtype, n: c_int) -> c_int;
396
397	pub fn deleteln() -> c_int;
398	pub fn wdeleteln(win: *mut WINDOW) -> c_int;
399	pub fn insdelln(n: c_int) -> c_int;
400	pub fn winsdelln(win: *mut WINDOW, n: c_int) -> c_int;
401	pub fn insertln() -> c_int;
402	pub fn winsertln(win: *mut WINDOW) -> c_int;
403
404	pub fn clearok(win: *mut WINDOW, bf: bool) -> c_int;
405	pub fn idlok(win: *mut WINDOW, bf: bool) -> c_int;
406	pub fn idcok(win: *mut WINDOW, bf: bool);
407	pub fn immedok(win: *mut WINDOW, bf: bool);
408	pub fn leaveok(win: *mut WINDOW, bf: bool) -> c_int;
409	pub fn setscrreg(top: c_int, bot: c_int) -> c_int;
410	pub fn wsetscrreg(win: *mut WINDOW, top: c_int, bot: c_int) -> c_int;
411	pub fn scrollok(win: *mut WINDOW, bf: bool) -> c_int;
412	pub fn nl() -> c_int;
413	pub fn nonl() -> c_int;
414
415	#[link_name = "move"] pub fn move_(y: c_int, x: c_int) -> c_int;
416	pub fn wmove(win: *mut WINDOW, y: c_int, x: c_int) -> c_int;
417
418	pub fn getch() -> c_int;
419	pub fn wgetch(win: *mut WINDOW) -> c_int;
420	pub fn mvgetch(y: c_int, x: c_int) -> c_int;
421	pub fn mvwgetch(win: *mut WINDOW, y: c_int, x: c_int) -> c_int;
422	pub fn ungetch(ch: c_int) -> c_int;
423	pub fn has_key(ch: c_int) -> c_int;
424
425	pub fn overlay(srcwin: *const WINDOW, dstwin: *mut WINDOW) -> c_int;
426	pub fn overwrite(srcwin: *const WINDOW, dstwin: *mut WINDOW) -> c_int;
427	pub fn copywin(srcwin: *const WINDOW, dstwin: *mut WINDOW, sminrow: c_int, smincol: c_int, dminrow: c_int, dmincol: c_int, dmaxrow: c_int, dmaxcol: c_int, overlay: c_int) -> c_int;
428
429	pub fn refresh() -> c_int;
430	pub fn wrefresh(win: *mut WINDOW) -> c_int;
431	pub fn wnoutrefresh(win: *mut WINDOW) -> c_int;
432	pub fn doupdate() -> c_int;
433	pub fn redrawwin(win: *mut WINDOW) -> c_int;
434	pub fn wredrawln(win: *mut WINDOW, beg_line: c_int, num_lines: c_int) -> c_int;
435
436	pub fn def_prog_mode() -> c_int;
437	pub fn def_shell_mode() -> c_int;
438	pub fn reset_prog_mode() -> c_int;
439	pub fn reset_shell_mode() -> c_int;
440	pub fn resetty() -> c_int;
441	pub fn savetty() -> c_int;
442	pub fn getsyx(y: c_int, x: c_int);
443	pub fn setsyx(y: c_int, x: c_int);
444	pub fn ripoffline(line: c_int, init: extern "C" fn(*mut WINDOW, c_int) -> c_int) -> c_int;
445	pub fn curs_set(visibility: c_int) -> c_int;
446	pub fn napms(ms: c_int) -> c_int;
447
448	pub fn scr_dump(filename: *const c_char) -> c_int;
449	pub fn scr_restore(filename: *const c_char) -> c_int;
450	pub fn scr_init(filename: *const c_char) -> c_int;
451	pub fn scr_set(filename: *const c_char) -> c_int;
452
453	pub fn scroll(win: *mut WINDOW) -> c_int;
454	pub fn scrl(n: c_int) -> c_int;
455	pub fn wscrl(win: *mut WINDOW, n: c_int) -> c_int;
456
457	pub fn newpad(nlines: c_int, ncols: c_int) -> *mut WINDOW;
458	pub fn subpad(orig: *mut WINDOW, nlines: c_int, ncols: c_int, begin_y: c_int, begin_x: c_int) -> *mut WINDOW;
459	pub fn prefresh(pad: *mut WINDOW, pminrow: c_int, pmincol: c_int, sminrow: c_int, smincol: c_int, smaxrow: c_int, smaxcol: c_int) -> c_int;
460	pub fn pnoutrefresh(pad: *mut WINDOW, pminrow: c_int, pmincol: c_int, sminrow: c_int, smincol: c_int, smaxrow: c_int, smaxcol: c_int) -> c_int;
461	pub fn pechochar(pad: *mut WINDOW, ch: chtype) -> c_int;
462	pub fn pecho_wchar(pad: *mut WINDOW, wch: *const cchar_t) -> c_int;
463
464	pub fn slk_init(fmt: c_int) -> c_int;
465	pub fn slk_set(labnum: c_int, label: *const c_char, fmt: c_int) -> c_int;
466	pub fn slk_refresh() -> c_int;
467	pub fn slk_noutrefresh() -> c_int;
468	pub fn slk_label(labnum: c_int) -> *const c_char;
469	pub fn slk_clear() -> c_int;
470	pub fn slk_restore() -> c_int;
471	pub fn slk_touch() -> c_int;
472	pub fn slk_attron(attrs: chtype) -> c_int;
473	pub fn slk_attroff(attrs: chtype) -> c_int;
474	pub fn slk_attrset(attrs: chtype) -> c_int;
475	pub fn slk_attr_on(attrs: attr_t, opts: *const c_void) -> c_int;
476	pub fn slk_attr_off(attrs: attr_t, opts: *const c_void) -> c_int;
477	pub fn slk_attr_set(attrs: attr_t, color_pair: c_short, opts: *const c_void) -> c_int;
478	pub fn slk_attr() -> attr_t;
479	pub fn slk_color(color_pair: c_short) -> c_int;
480	pub fn slk_wset(labnum: c_int, label: *const wchar_t, fmt: c_int) -> c_int;
481
482	pub fn instr(string: *mut c_char) -> c_int;
483	pub fn innstr(string: *mut c_char, n: c_int) -> c_int;
484	pub fn winstr(win: *mut WINDOW, string: *mut c_char) -> c_int;
485	pub fn winnstr(win: *mut WINDOW, string: *mut c_char, n: c_int) -> c_int;
486	pub fn mvinstr(y: c_int, x: c_int, string: *mut c_char) -> c_int;
487	pub fn mvinnstr(y: c_int, x: c_int, string: *mut c_char, n: c_int) -> c_int;
488	pub fn mvwinstr(win: *mut WINDOW, y: c_int, x: c_int, string: *mut c_char) -> c_int;
489	pub fn mvwinnstr(win: *mut WINDOW, y: c_int, x: c_int, string: *mut c_char, n: c_int) -> c_int;
490
491	pub fn touchwin(win: *mut WINDOW) -> c_int;
492	pub fn touchline(win: *mut WINDOW, start: c_int, count: c_int) -> c_int;
493	pub fn untouchwin(win: *mut WINDOW) -> c_int;
494	pub fn wtouchln(win: *mut WINDOW, y: c_int, n: c_int, changed: c_int) -> c_int;
495	pub fn is_linetouched(win: *const WINDOW, line: c_int) -> bool;
496	pub fn is_wintouched(win: *const WINDOW) -> bool;
497}