4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
26 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 #include <sys/types.h>
40 * usr/src/lib/libcurses/screen
44 int __sscans(WINDOW *win, char *fmt, ...);
47 int _sprintw(WINDOW *win, char *fmt, ...);
50 WINDOW *makenew(int num_lines, int num_cols, int begy, int begx);
56 int m_addstr(char *str);
65 WINDOW *m_initscr(void);
68 int m_move(int x, int y);
71 SCREEN *m_newterm(char *type, FILE *outfptr, FILE *infptr);
77 void _update_old_y_area(WINDOW *win, int nlines, int ncols, int start_line,
84 int addchnstr(chtype *s, int n);
87 int addchstr(chtype *s);
90 int addnstr(char *s, int n);
93 int addnwstr(wchar_t *s, int n);
99 int addwch(chtype ch);
102 int addwchnstr(chtype *str, int n);
105 int addwchstr(chtype *str);
108 int addwstr(wchar_t *ws);
111 int attroff(chtype at);
114 int attron(chtype at);
117 int attrset(chtype at);
126 void bkgdset(chtype c);
129 int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr,
130 chtype bl, chtype br);
146 int del_curterm(TERMINAL *terminal);
158 int echochar(chtype ch);
161 int echowchar(chtype ch);
173 int garbagedlines(WINDOW *win, int start, int finish);
176 int garbagedwin(WINDOW *win);
182 int getnwstr(wchar_t *ws, int n);
185 int getstr(char *str);
191 int getwstr(wchar_t *ws);
194 int halfdelay(int tens);
197 int hline(chtype horch, int num_chars);
203 int inchnstr(chtype *s, int n);
206 int inchstr(chtype *s);
209 int innstr(char *s, int n);
212 int innwstr(wchar_t *ws, int n);
218 int insdelln(int id);
224 int insnstr(char *s, int n);
227 int insnwstr(wchar_t *ws, int n);
236 int inswch(chtype c);
239 int inswstr(wchar_t *ws);
242 int intrflush(WINDOW *win, int flag);
248 int inwchnstr(chtype *str, int n);
251 int inwchstr(chtype *str);
254 int inwstr(wchar_t *ws);
257 int meta(WINDOW *win, int flag);
260 int move(int y, int x);
263 int mvaddch(int y, int x, chtype ch);
266 int mvaddchnstr(int y, int x, chtype *s, int n);
269 int mvaddchstr(int y, int x, chtype *s);
272 int mvaddnstr(int y, int x, char *s, int n);
275 int mvaddnwstr(int y, int x, wchar_t *ws, int n);
278 int mvaddstr(int y, int x, char *str);
281 int mvaddwch(int y, int x, chtype ch);
283 /* _mvaddwchnstr.c */
284 int mvaddwchnstr(int y, int x, chtype *str, int n);
287 int mvaddwchstr(int y, int x, chtype *s);
290 int mvaddwstr(int y, int x, wchar_t *ws);
293 int mvdelch(int y, int x);
296 int mvgetch(int y, int x);
299 int mvgetnwstr(int y, int x, wchar_t *ws, int n);
302 int mvgetstr(int y, int x, char *str);
305 int mvgetwch(int y, int x);
308 int mvgetwstr(int y, int x, wchar_t *ws);
311 int mvhline(int y, int x, chtype ch, int n);
314 chtype mvinch(int y, int x);
317 int mvinchnstr(int y, int x, chtype *str, int n);
320 int mvinchstr(int y, int x, chtype *str);
323 int mvinnstr(int y, int x, char *s, int n);
326 int mvinnwstr(int y, int x, wchar_t *ws, int n);
329 int mvinsch(int y, int x, chtype ch);
332 int mvinsnstr(int y, int x, char *s, int n);
335 int mvinsnwstr(int y, int x, wchar_t *ws, int n);
338 int mvinsstr(int y, int x, char *s);
341 int mvinstr(int y, int x, char *s);
344 int mvinswch(int y, int x, chtype ch);
347 int mvinswstr(int y, int x, wchar_t *ws);
350 chtype mvinwch(int y, int x);
353 int mvinwchnstr(int y, int x, chtype *str, int n);
356 int mvinwchstr(int y, int x, chtype *str);
359 int mvinwstr(int y, int x, wchar_t *ws);
362 int mvvline(int y, int x, chtype c, int n);
365 int mvwaddch(WINDOW *win, int y, int x, chtype ch);
368 int mvwaddchnstr(WINDOW *win, int y, int x, chtype *ch, int n);
371 int mvwaddchstr(WINDOW *win, int y, int x, chtype *ch);
374 int mvwaddnstr(WINDOW *win, int y, int x, char *c, int n);
377 int mvwaddnwstr(WINDOW *win, int y, int x, wchar_t *wc, int n);
380 int mvwaddstr(WINDOW *win, int y, int x, char *str);
383 int mvwaddwch(WINDOW *win, int y, int x, chtype ch);
385 /* _mvwaddwchnstr.c */
386 int mvwaddwchnstr(WINDOW *win, int y, int x, chtype *str, int n);
388 /* _mvwaddwchstr.c */
389 int mvwaddwchstr(WINDOW *win, int y, int x, chtype *str);
392 int mvwaddwstr(WINDOW *win, int y, int x, wchar_t *wc);
395 int mvwdelch(WINDOW *win, int y, int x);
398 int mvwgetch(WINDOW *win, int y, int x);
401 int mvwgetnwstr(WINDOW *win, int y, int x, wchar_t *ws, int n);
404 int mvwgetstr(WINDOW *win, int y, int x, char *str);
407 int mvwgetwch(WINDOW *win, int y, int x);
410 int mvwgetwstr(WINDOW *win, int y, int x, wchar_t *ws);
413 int mvwhline(WINDOW *win, int y, int x, chtype c, int n);
416 chtype mvwinch(WINDOW *win, int y, int x);
419 int mvwinchnstr(WINDOW *win, int y, int x, chtype *s, int n);
422 int mvwinchstr(WINDOW *win, int y, int x, chtype *str);
425 int mvwinnstr(WINDOW *win, int y, int x, char *str, int n);
428 int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *ws, int n);
431 int mvwinsch(WINDOW *win, int y, int x, chtype c);
434 int mvwinsnstr(WINDOW *win, int y, int x, char *str, int n);
437 int mvwinsnwstr(WINDOW *win, int y, int x, wchar_t *ws, int n);
440 int mvwinsstr(WINDOW *win, int y, int x, char *str);
443 int mvwinstr(WINDOW *win, int y, int x, char *str);
446 int mvwinswch(WINDOW *win, int y, int x, chtype c);
449 int mvwinswstr(WINDOW *win, int y, int x, wchar_t *ws);
452 chtype mvwinwch(WINDOW *win, int y, int x);
454 /* _mvwinwchnstr.c */
455 int mvwinwchnstr(WINDOW *win, int y, int x, chtype *str, int n);
458 int mvwinwchstr(WINDOW *win, int y, int x, chtype *str);
461 int mvwinwstr(WINDOW *win, int y, int x, wchar_t *ws);
464 int mvwvline(WINDOW *win, int y, int x, chtype c, int n);
480 void noqiflush(void);
483 int overlay(WINDOW *src, WINDOW *dst);
486 int overwrite(WINDOW *src, WINDOW *dst);
501 int scr_init(char *file);
504 int scr_restore(char *file);
507 int scr_set(char *file);
513 int scroll(WINDOW *win);
516 TERMINAL *set_curterm(TERMINAL *newterminal);
519 SCREEN *set_term(SCREEN *screen);
522 int setscrreg(int t, int b);
534 WINDOW *subpad(WINDOW *win, int l, int nc, int by, int bx);
537 void timeout(int tm);
540 int touchline(WINDOW *win, int y, int n);
543 char *unctrl(int ch);
546 int vline(chtype vertch, int num_chars);
549 int waddchstr(WINDOW *win, chtype *str);
552 int waddstr(WINDOW *win, char *str);
555 int waddwchstr(WINDOW *win, chtype *str);
558 int waddwstr(WINDOW *win, wchar_t *ws);
561 int wclear(WINDOW *win);
564 int wdeleteln(WINDOW *win);
567 int werase(WINDOW *win);
570 int winsertln(WINDOW *win);
573 int winsstr(WINDOW *win, char *str);
576 int winswstr(WINDOW *win, wchar_t *ws);
579 int winwchstr(WINDOW *win, chtype *str);
582 int wstandend(WINDOW *win);
585 int wstandout(WINDOW *win);
591 bool can_change_color(void);
600 int clearok(WINDOW *win, bool bf);
603 int color_content(short color, short *r, short *g, short *b);
606 int copywin(WINDOW *Srcwin, WINDOW *Dstwin, int minRowSrc, int minColSrc,
607 int minRowDst, int minColDst, int maxRowDst,
608 int maxColDst, int over_lay);
611 int curs_set(int visibility);
619 int def_prog_mode(void);
622 int _delay(int delay, int (*outc)(char));
625 int delay_output(int ms);
628 int delkey(char *sends, int keyval);
631 void delkeymap(TERMINAL *terminal);
634 void delscreen(SCREEN *screen);
637 int delterm(TERMINAL *terminal);
640 int delwin(WINDOW *win);
643 WINDOW *derwin(WINDOW *win, int num_lines, int nc, int by, int bx);
652 WINDOW *dupwin(WINDOW *win);
657 int force_doupdate(void);
660 char erasechar(void);
666 chtype getattrs(WINDOW *win);
669 int getbegy(WINDOW *win);
670 int getbegx(WINDOW *win);
673 chtype getbkgd(WINDOW *win);
676 int getmaxy(WINDOW *win);
677 int getmaxx(WINDOW *win);
680 int getpary(WINDOW *win);
681 int getparx(WINDOW *win);
684 int _getsyx(int *yp, int *xp);
690 WINDOW *getwin(FILE *filep);
693 int getcury(WINDOW *win);
694 int getcurx(WINDOW *win);
697 bool has_colors(void);
706 void idcok(WINDOW *win, bool bf);
709 int idlok(WINDOW *win, bool bf);
712 void immedok(WINDOW *win, bool bf);
718 int init_color(short color, short r, short g, short b);
721 void _init_costs(void);
722 int _countchar(void);
725 int init_pair(short pair, short f, short b);
726 void _init_HP_pair(short pair, short f, short b);
729 int is_wintouched(WINDOW *win);
732 int is_linetouched(WINDOW *win, int line);
735 char *keyname(int key);
738 int keypad(WINDOW *win, bool bf);
744 int leaveok(WINDOW *win, bool bf);
747 char *longname(void);
750 WINDOW *_makenew(int nlines, int ncols, int begy, int begx);
753 int _mbclrch(WINDOW *win, int y, int x);
754 int _mbvalid(WINDOW *win);
755 int _mbaddch(WINDOW *win, chtype a, chtype b);
758 int mbcharlen(char *sp);
761 int mbdisplen(char *sp);
764 void mbgetwidth(void);
767 int wcscrw(wchar_t wc);
770 char *wmbinch(WINDOW *win, int y, int x);
773 int _mbinsshift(WINDOW *win, int len);
776 int wmbmove(WINDOW *win, int y, int x);
779 size_t _curs_mbstowcs(wchar_t *pwcs, const char *s, size_t n);
782 int _curs_mbtowc(wchar_t *wchar, const char *s, size_t n);
785 char *_strcode2byte(wchar_t *code, char *b, int n);
786 wchar_t *_strbyte2code(char *code, wchar_t *byte, int n);
789 void memSset(chtype *s, chtype c, int n);
795 int mouse_set(long mbe);
796 int mouse_on(long mbe);
797 int mouse_off(long mbe);
798 int request_mouse_pos(void);
799 void wmouse_position(WINDOW *win, int *x, int *y);
800 int map_button(unsigned long a);
801 unsigned long getmouse(void);
802 unsigned long getbmap(void);
805 int mvcur(int cury, int curx, int newy, int newx);
808 int mvderwin(WINDOW *win, int pary, int parx);
811 int mvprintw(int y, int x, ...);
814 int mvscanw(int y, int x, ...);
817 int mvwin(WINDOW *win, int by, int bx);
820 int mvwprintw(WINDOW *win, int y, int x, ...);
823 int mvwscanw(WINDOW *win, int y, int x, ...);
829 int newkey(char *rcvchars, short keyval, bool macro);
832 WINDOW *newpad(int l, int nc);
836 SCREEN *newscreen(char *type, int lsize, int csize, int tabsize, FILE *outfptr,
840 WINDOW *newwin(int nlines, int ncols, int by, int bx);
841 int _image(WINDOW *win);
847 int nodelay(WINDOW *win, bool bf);
853 int notimeout(WINDOW *win, bool bf);
857 int _outwch(chtype c);
860 int _overlap(WINDOW *Srcwin, WINDOW *Dstwin, int Overlay);
863 int pair_content(short pair, short *f, short *b);
866 int pechowchar(WINDOW *pad, chtype ch);
869 int pnoutrefresh(WINDOW *pad, int pby, int pbx, int sby, int sbx,
873 int prefresh(WINDOW *pad, int pminy, int pminx, int sminy, int sminx,
874 int smaxy, int smaxx);
875 int _prefresh(int (*func)(WINDOW *), WINDOW *pad, int pminy, int pminx,
876 int sminy, int sminx, int smaxy, int smaxx);
877 int _padjust(WINDOW *pad, int pminy, int pminx, int sminy, int sminx,
878 int smaxy, int smaxx);
881 int printw(char *fmt, ...);
884 int putwin(WINDOW *win, FILE *filep);
887 int _quick_echo(WINDOW *win, chtype ch);
893 int redrawwin(WINDOW *win);
896 int reset_shell_mode(void);
902 int restartterm(char * term, int filenum, int *errret);
908 int ripoffline(int line, int (*init)(WINDOW *, int));
914 int scanw(char *fmt, ...);
917 int _scr_all(char *file, int which);
920 int scr_dump(char *file);
923 int scr_ll_dump(FILE *filep);
926 int scr_reset(FILE *filep, int type);
929 int scrollok(WINDOW *win, bool bf);
932 SCREEN *setcurscreen(SCREEN *new);
935 TERMINAL *setcurterm(TERMINAL *newterminal);
938 int _setecho(int bf);
944 int _setnonl(int bf);
947 void _setqiflush(int yes);
950 int setsyx(int y, int x);
953 int setupterm(char *term, int filenum, int *errret);
954 void _blast_keys(TERMINAL *terminal);
955 int reset_prog_mode(void);
956 int def_shell_mode(void);
959 int slk_attroff(chtype a);
962 int slk_attron(chtype a);
965 int slk_attrset(chtype a);
971 char *slk_label(int n);
974 int slk_noutrefresh(void);
977 int slk_refresh(void);
978 int _slk_update(void);
981 int slk_restore(void);
984 int slk_set(int n, char *lab, int f);
987 int slk_start(int ng, int *gp);
993 int start_color(void);
996 WINDOW *subwin(WINDOW *win, int l, int nc, int by, int bx);
999 int syncok(WINDOW *win, bool bf);
1002 int _tcsearch(char *cap, short offsets[], char *names[], int size, int n);
1005 chtype termattrs(void);
1008 int tgetent(char *bp, char *name);
1009 int tgetflag(char *tcstr);
1010 int tgetnum(char *tcstr);
1011 char *tgetstr(char *tcstr, char **area);
1017 char *termname(void);
1020 int tgetch(int interpret);
1023 wchar_t tgetwch(int cntl);
1026 char *tgoto(char *cap, int col, int row);
1029 int tifgetflag(char *tistr);
1030 int tifgetnum(char *tistr);
1031 char *tifgetstr(char *tistr);
1036 int tigetflag(char *tistr);
1037 int tigetnum(char *tistr);
1038 char *tigetstr(char *tistr);
1043 void tinputfd(int fd);
1048 int touchwin(WINDOW *win);
1051 char *tparm(char *instring, long fp1, long fp2, long p3, long p4, long p5,
1052 long p6, long p7, long p8, long p9);
1053 char *_branchto(char *cp, char to);
1056 int tputs(char *cp, int affcnt, int (*outc)(char));
1063 void _tstp(int dummy);
1064 void _ccleanup(int signo);
1067 int ttimeout(int delay);
1070 int typeahead(int fd);
1075 int ungetch(int ch);
1078 int ungetwch(wchar_t code);
1081 int untouchwin(WINDOW *win);
1084 void use_env(int bf);
1087 void vidupdate(chtype newmode, chtype oldmode, int (*outc)(char));
1088 int _change_video(chtype newmode, chtype oldmode, int (*outc)(char),
1089 bool color_terminal);
1090 void _change_color(short newcolor, short oldcolor, int (*outc)(char));
1093 int _vsscanf(char *buf, char *fmt, va_list ap);
1096 int vwprintw(WINDOW *win, char *fmt, va_list ap);
1099 int vwscanw(WINDOW *win, char *fmt, va_list ap);
1102 int waddchnstr(WINDOW *win, chtype *string, int ncols);
1105 int waddnstr(WINDOW *win, char *tstr, int i);
1108 int waddnwstr(WINDOW *win, wchar_t *code, int n);
1111 int waddwch(WINDOW *win, chtype c);
1114 int waddwchnstr(WINDOW *win, chtype *string, int ncols);
1117 int wadjcurspos(WINDOW *win);
1120 int wbkgd(WINDOW *win, chtype nbkgd);
1123 void wbkgdset(WINDOW *win, chtype c);
1126 int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs,
1127 chtype tl, chtype tr, chtype bl, chtype br);
1130 int wclrtobot(WINDOW *win);
1133 int wclrtoeol(WINDOW *win);
1136 size_t _curs_wcstombs(char *s, const wchar_t *pwcs, size_t n);
1139 int _curs_wctomb(char *s, const wchar_t wchar);
1142 int wdelch(WINDOW *win);
1145 int wechowchar(WINDOW *win, chtype ch);
1148 int wgetch(WINDOW *win);
1151 int wgetstr(WINDOW *win, char *str);
1152 int wgetnstr(WINDOW *win, char *str, int n);
1155 int wgetwch(WINDOW *win);
1158 int wgetwstr(WINDOW *win, wchar_t *str);
1159 int wgetnwstr(WINDOW *win, wchar_t *str, int n);
1162 int whline(WINDOW *win, chtype ch, int num_chars);
1165 chtype winch(WINDOW *win);
1168 int winchnstr(WINDOW *win, chtype *string, int ncols);
1171 int winchstr(WINDOW *win, chtype *string);
1174 int winnstr(WINDOW *win, char *string, int ncols);
1177 int winnwstr(WINDOW *win, wchar_t *wstr, int ncols);
1180 int winsch(WINDOW *win, chtype c);
1183 int winsdelln(WINDOW *win, int id);
1186 int winsnstr(WINDOW *win, char *tsp, int n);
1189 int winsnwstr(WINDOW *win, wchar_t *code, int n);
1192 int winstr(WINDOW *win, char *str);
1195 int winswch(WINDOW *win, chtype c);
1198 chtype winwch(WINDOW *win);
1201 int winwchnstr(WINDOW *win, chtype *string, int ncols);
1204 int winwstr(WINDOW *win, wchar_t *wstr);
1207 int wmove(WINDOW *win, int y, int x);
1210 int wmovenextch(WINDOW *win);
1213 int wmoveprevch(WINDOW *win);
1215 /* wnoutrefresh.c */
1216 int wnoutrefresh(WINDOW *win);
1219 int wprintw(WINDOW *win, ...);
1222 int wredrawln(WINDOW *win, int begline, int numlines);
1225 int wrefresh(WINDOW *win);
1228 int wscanw(WINDOW *win, ...);
1231 int wscrl(WINDOW *win, int n);
1234 int wsetscrreg(WINDOW *win, int topy, int boty);
1237 void wsyncdown(WINDOW *win);
1240 void wsyncup(WINDOW *win);
1241 void wcursyncup(WINDOW *win);
1244 void wtimeout(WINDOW *win, int tm);
1247 int wtouchln(WINDOW *win, int y, int n, int changed);
1250 int wvline(WINDOW *win, chtype vertch, int num_chars);
1254 int box(WINDOW *win, chtype v, chtype h);
1258 int box(WINDOW *win, _ochtype v, _ochtype h);
1261 /* really newterm32 */
1262 SCREEN *newterm(char *type, FILE *fout, FILE *fin);
1266 SCREEN *newterm(char *type, FILE *outfptr, FILE *infptr);
1270 int setterm(char *name);
1273 /* really p32echochar */
1274 int pechochar(WINDOW *win, chtype c);
1276 /* V3.pechochar.c */
1278 int pechochar(WINDOW *win, _ochtype c);
1281 /* really w32addch */
1282 int waddch(WINDOW *win, chtype c);
1286 int waddch(WINDOW *win, _ochtype c);
1289 /* really w32attroff */
1290 int wattroff(WINDOW *win, chtype attrs);
1294 int wattroff(WINDOW *win, _ochtype attrs);
1297 /* really w32attron */
1298 int wattron(WINDOW *win, chtype attrs);
1302 int wattron(WINDOW *win, _ochtype attrs);
1305 /* really w32attrset */
1306 int wattrset(WINDOW *win, chtype attrs);
1310 int wattrset(WINDOW *win, _ochtype attrs);
1313 /* really w32echochar */
1314 int wechochar(WINDOW *win, chtype c);
1316 /* V3.wechochar.c */
1318 int wechochar(WINDOW *win, _ochtype c);
1321 /* really w32insch */
1322 int winsch(WINDOW *win, chtype c);
1326 int winsch(WINDOW *win, _ochtype c);
1329 int _outchar(char ch);
1330 int putp(char *str);
1331 /* really vid32attr */
1332 int vidattr(chtype newmode);
1336 int vidattr(_ochtype a);
1339 /* really vid32puts */
1340 int vidputs(chtype a, int (*b)(char));
1344 int vidputs(_ochtype a, int (*o)(char));
1347 /* really initscr32 */
1348 WINDOW *initscr(void);
1352 WINDOW *initscr(void);