1 /* $NetBSD: curses_commands.c,v 1.7 2012/09/19 11:51:08 blymn Exp $ */
4 * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
8 * This code has been donated to The NetBSD Foundation by the Author.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. The name of the author may not be used to endorse or promote products
16 * derived from this software withough specific prior written permission
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 #include "curses_commands.h"
43 cmd_DRAIN(int nargs
, char **args
)
45 while (getch() != ERR
);
51 cmd_addbytes(int nargs
, char **args
)
55 if (check_arg_count(nargs
, 2) == 1)
58 if (sscanf(args
[1], "%d", &count
) == 0) {
60 report_error("BAD ARGUMENT");
65 report_return(addbytes(args
[0], count
));
70 cmd_addch(int nargs
, char **args
)
74 if (check_arg_count(nargs
, 1) == 1)
77 ch
= (chtype
*) args
[0];
79 report_return(addch(ch
[0]));
84 cmd_addchnstr(int nargs
, char **args
)
88 if (check_arg_count(nargs
, 2) == 1)
91 if (sscanf(args
[1], "%d", &count
) == 0) {
93 report_error("BAD ARGUMENT");
98 report_return(addchnstr((chtype
*) args
[0], count
));
103 cmd_addchstr(int nargs
, char **args
)
105 if (check_arg_count(nargs
, 1) == 1)
109 report_return(addchstr((chtype
*) args
[0]));
114 cmd_addnstr(int nargs
, char **args
)
118 if (check_arg_count(nargs
, 2) == 1)
121 if (sscanf(args
[1], "%d", &count
) == 0) {
123 report_error("BAD ARGUMENT");
128 report_return(addnstr(args
[0], count
));
133 cmd_addstr(int nargs
, char **args
)
135 if (check_arg_count(nargs
, 1) == 1)
139 report_return(addstr(args
[0]));
144 cmd_attr_get(int nargs
, char **args
)
150 if (check_arg_count(nargs
, 0) == 1)
153 retval
= attr_get(&attrs
, &colours
, NULL
);
157 report_return(retval
);
164 cmd_attr_off(int nargs
, char **args
)
168 if (check_arg_count(nargs
, 1) == 1)
171 if (sscanf(args
[0], "%d", &attrib
) == 0) {
173 report_error("BAD ARGUMENT");
178 report_return(attr_off(attrib
, NULL
));
183 cmd_attr_on(int nargs
, char **args
)
187 if (check_arg_count(nargs
, 1) == 1)
190 if (sscanf(args
[0], "%d", &attrib
) == 0) {
192 report_error("BAD ARGUMENT");
197 report_return(attr_on(attrib
, NULL
));
202 cmd_attr_set(int nargs
, char **args
)
207 if (check_arg_count(nargs
, 2) == 1)
210 if (sscanf(args
[0], "%d", &attrib
) == 0) {
212 report_error("BAD ARGUMENT");
216 if (sscanf(args
[1], "%hd", &pair
) == 0) {
218 report_error("BAD ARGUMENT");
223 report_return(attr_set(attrib
, pair
, NULL
));
228 cmd_attroff(int nargs
, char **args
)
232 if (check_arg_count(nargs
, 1) == 1)
235 if (sscanf(args
[0], "%d", &attrib
) == 0) {
237 report_error("BAD ARGUMENT");
242 report_return(attroff(attrib
));
247 cmd_attron(int nargs
, char **args
)
251 if (check_arg_count(nargs
, 1) == 1)
254 if (sscanf(args
[0], "%d", &attrib
) == 0) {
256 report_error("BAD ARGUMENT");
261 report_return(attron(attrib
));
266 cmd_attrset(int nargs
, char **args
)
270 if (check_arg_count(nargs
, 1) == 1)
273 if (sscanf(args
[0], "%d", &attrib
) == 0) {
275 report_error("BAD ARGUMENT");
280 report_return(attrset(attrib
));
285 cmd_bkgd(int nargs
, char **args
)
289 if (check_arg_count(nargs
, 1) == 1)
292 ch
= (chtype
*) args
[0];
294 report_return(bkgd(ch
[0]));
299 cmd_bkgdset(int nargs
, char **args
)
303 if (check_arg_count(nargs
, 1) == 1)
306 ch
= (chtype
*) args
[0];
307 bkgdset(ch
[0]); /* returns void */
314 cmd_border(int nargs
, char **args
)
316 int ls
, rs
, ts
, bs
, tl
, tr
, bl
, br
;
318 if (check_arg_count(nargs
, 8) == 1)
321 if (sscanf(args
[0], "%d", &ls
) == 0) {
323 report_error("BAD ARGUMENT");
326 if (sscanf(args
[1], "%d", &rs
) == 0) {
328 report_error("BAD ARGUMENT");
331 if (sscanf(args
[2], "%d", &ts
) == 0) {
333 report_error("BAD ARGUMENT");
336 if (sscanf(args
[3], "%d", &bs
) == 0) {
338 report_error("BAD ARGUMENT");
341 if (sscanf(args
[4], "%d", &tl
) == 0) {
343 report_error("BAD ARGUMENT");
346 if (sscanf(args
[5], "%d", &tr
) == 0) {
348 report_error("BAD ARGUMENT");
351 if (sscanf(args
[6], "%d", &bl
) == 0) {
353 report_error("BAD ARGUMENT");
356 if (sscanf(args
[7], "%d", &br
) == 0) {
358 report_error("BAD ARGUMENT");
363 report_return(border(ls
, rs
, ts
, bs
, tl
, tr
, bl
, br
));
368 cmd_clear(int nargs
, char **args
)
370 if (check_arg_count(nargs
, 0) == 1)
374 report_return(clear());
379 cmd_clrtobot(int nargs
, char **args
)
381 if (check_arg_count(nargs
, 0) == 1)
385 report_return(clrtobot());
390 cmd_clrtoeol(int nargs
, char **args
)
392 if (check_arg_count(nargs
, 0) == 1)
396 report_return(clrtoeol());
401 cmd_color_set(int nargs
, char **args
)
405 if (check_arg_count(nargs
, 2) == 1)
408 if (sscanf(args
[0], "%hd", &colour_pair
) == 0) {
410 report_error("BAD ARGUMENT");
415 report_return(color_set(colour_pair
, NULL
));
420 cmd_delch(int nargs
, char **args
)
422 if (check_arg_count(nargs
, 0) == 1)
426 report_return(delch());
431 cmd_deleteln(int nargs
, char **args
)
433 if (check_arg_count(nargs
, 0) == 1)
437 report_return(deleteln());
442 cmd_echochar(int nargs
, char **args
)
444 if (check_arg_count(nargs
, 1) == 1)
447 /* XXX causes refresh */
449 report_return(echochar(args
[0][0]));
454 cmd_erase(int nargs
, char **args
)
456 if (check_arg_count(nargs
, 0) == 1)
460 report_return(erase());
465 cmd_getch(int nargs
, char **args
)
467 if (check_arg_count(nargs
, 0) == 1)
470 /* XXX causes refresh */
477 cmd_getnstr(int nargs
, char **args
)
482 if (check_arg_count(nargs
, 1) == 1)
485 if (sscanf(args
[0], "%d", &limit
) == 0) {
487 report_error("BAD ARGUMENT");
491 if ((string
= malloc(limit
+ 1)) == NULL
) {
493 report_error("MALLOC_FAILED");
499 report_return(getnstr(string
, limit
));
500 report_status(string
);
506 cmd_getstr(int nargs
, char **args
)
510 if (check_arg_count(nargs
, 0) == 1)
515 report_return(getstr(string
));
516 report_status(string
);
521 cmd_inch(int nargs
, char **args
)
523 if (check_arg_count(nargs
, 0) == 1)
533 cmd_inchnstr(int nargs
, char **args
)
538 if (check_arg_count(nargs
, 1) == 1)
541 if (sscanf(args
[0], "%d", &limit
) == 0) {
543 report_error("BAD ARGUMENT");
547 if ((string
= malloc((limit
+ 1) * sizeof(chtype
))) == NULL
) {
549 report_error("MALLOC_FAILED");
555 report_return(inchnstr(string
, limit
));
562 cmd_inchstr(int nargs
, char **args
)
566 if (check_arg_count(nargs
, 0) == 1)
571 report_return(inchstr(string
));
577 cmd_innstr(int nargs
, char **args
)
582 if (check_arg_count(nargs
, 1) == 1)
585 if (sscanf(args
[0], "%d", &limit
) == 0) {
587 report_error("BAD ARGUMENT");
591 if ((string
= malloc(limit
+ 1)) == NULL
) {
593 report_error("MALLOC_FAILED");
599 report_int(innstr(string
, limit
));
600 report_status(string
);
606 cmd_insch(int nargs
, char **args
)
608 if (check_arg_count(nargs
, 1) == 1)
612 report_return(insch(args
[0][0]));
617 cmd_insdelln(int nargs
, char **args
)
621 if (check_arg_count(nargs
, 1) == 1)
624 if (sscanf(args
[0], "%d", &nlines
) == 0) {
626 report_error("BAD ARGUMENT");
631 report_return(insdelln(nlines
));
636 cmd_insertln(int nargs
, char **args
)
638 if (check_arg_count(nargs
, 0) == 1)
642 report_return(insertln());
647 cmd_instr(int nargs
, char **args
)
651 if (check_arg_count(nargs
, 0) == 1)
656 report_return(instr(string
));
657 report_status(string
);
662 cmd_move(int nargs
, char **args
)
666 if (check_arg_count(nargs
, 2) == 1)
669 if (sscanf(args
[0], "%d", &y
) == 0) {
671 report_error("BAD ARGUMENT");
675 if (sscanf(args
[1], "%d", &x
) == 0) {
677 report_error("BAD ARGUMENT");
682 report_return(move(y
, x
));
687 cmd_refresh(int nargs
, char **args
)
689 if (check_arg_count(nargs
, 0) == 1)
693 report_return(refresh());
698 cmd_scrl(int nargs
, char **args
)
702 if (check_arg_count(nargs
, 1) == 1)
705 if (sscanf(args
[0], "%d", &nlines
) == 0) {
707 report_error("BAD ARGUMENT");
712 report_return(scrl(nlines
));
717 cmd_setscrreg(int nargs
, char **args
)
721 if (check_arg_count(nargs
, 2) == 1)
724 if (sscanf(args
[0], "%d", &top
) == 0) {
726 report_error("BAD ARGUMENT");
730 if (sscanf(args
[1], "%d", &bottom
) == 0) {
732 report_error("BAD ARGUMENT");
737 report_return(setscrreg(top
, bottom
));
742 cmd_standend(int nargs
, char **args
)
744 if (check_arg_count(nargs
, 0) == 1)
748 report_return(standend());
753 cmd_standout(int nargs
, char **args
)
755 if (check_arg_count(nargs
, 0) == 1)
759 report_return(standout());
764 cmd_timeout(int nargs
, char **args
)
768 if (check_arg_count(nargs
, 1) == 1)
771 if (sscanf(args
[0], "%d", &tval
) == 0) {
773 report_error("BAD ARGUMENT");
777 timeout(tval
); /* void return */
784 cmd_underscore(int nargs
, char **args
)
786 if (check_arg_count(nargs
, 0) == 1)
790 report_return(underscore());
795 cmd_underend(int nargs
, char **args
)
797 if (check_arg_count(nargs
, 0) == 1)
801 report_return(underend());
806 cmd_waddbytes(int nargs
, char **args
)
811 if (check_arg_count(nargs
, 3) == 1)
814 if (sscanf(args
[0], "%p", &win
) == 0) {
816 report_error("BAD ARGUMENT");
820 if (sscanf(args
[2], "%d", &count
) == 0) {
822 report_error("BAD ARGUMENT");
827 report_return(waddbytes(win
, args
[1], count
));
832 cmd_waddstr(int nargs
, char **args
)
836 if (check_arg_count(nargs
, 2) == 1)
839 if (sscanf(args
[0], "%p", &win
) == 0) {
841 report_error("BAD ARGUMENT");
846 report_return(waddstr(win
, args
[1]));
851 cmd_mvaddbytes(int nargs
, char **args
)
855 if (check_arg_count(nargs
, 4) == 1)
858 if (sscanf(args
[0], "%d", &y
) == 0) {
860 report_error("BAD ARGUMENT");
864 if (sscanf(args
[1], "%d", &x
) == 0) {
866 report_error("BAD ARGUMENT");
870 if (sscanf(args
[3], "%d", &count
) == 0) {
872 report_error("BAD ARGUMENT");
877 report_return(mvaddbytes(y
, x
, args
[2], count
));
882 cmd_mvaddch(int nargs
, char **args
)
887 if (check_arg_count(nargs
, 3) == 1)
890 if (sscanf(args
[0], "%d", &y
) == 0) {
892 report_error("BAD ARGUMENT");
896 if (sscanf(args
[1], "%d", &x
) == 0) {
898 report_error("BAD ARGUMENT");
902 ch
= (chtype
*) args
[2];
904 report_return(mvaddch(y
, x
, ch
[0]));
909 cmd_mvaddchnstr(int nargs
, char **args
)
913 if (check_arg_count(nargs
, 4) == 1)
916 if (sscanf(args
[0], "%d", &y
) == 0) {
918 report_error("BAD ARGUMENT");
922 if (sscanf(args
[1], "%d", &x
) == 0) {
924 report_error("BAD ARGUMENT");
928 if (sscanf(args
[3], "%d", &count
) == 0) {
930 report_error("BAD ARGUMENT");
935 report_return(mvaddchnstr(y
, x
, (chtype
*) args
[2], count
));
940 cmd_mvaddchstr(int nargs
, char **args
)
944 if (check_arg_count(nargs
, 3) == 1)
947 if (sscanf(args
[0], "%d", &y
) == 0) {
949 report_error("BAD ARGUMENT");
953 if (sscanf(args
[1], "%d", &x
) == 0) {
955 report_error("BAD ARGUMENT");
960 report_return(mvaddchstr(y
, x
, (chtype
*) args
[2]));
965 cmd_mvaddnstr(int nargs
, char **args
)
969 if (check_arg_count(nargs
, 4) == 1)
972 if (sscanf(args
[0], "%d", &y
) == 0) {
974 report_error("BAD ARGUMENT");
978 if (sscanf(args
[1], "%d", &x
) == 0) {
980 report_error("BAD ARGUMENT");
984 if (sscanf(args
[3], "%d", &count
) == 0) {
986 report_error("BAD ARGUMENT");
991 report_return(mvaddnstr(y
, x
, args
[2], count
));
996 cmd_mvaddstr(int nargs
, char **args
)
1000 if (check_arg_count(nargs
, 3) == 1)
1003 if (sscanf(args
[0], "%d", &y
) == 0) {
1005 report_error("BAD ARGUMENT");
1009 if (sscanf(args
[1], "%d", &x
) == 0) {
1011 report_error("BAD ARGUMENT");
1016 report_return(mvaddstr(y
, x
, args
[2]));
1021 cmd_mvdelch(int nargs
, char **args
)
1025 if (check_arg_count(nargs
, 2) == 1)
1028 if (sscanf(args
[0], "%d", &y
) == 0) {
1030 report_error("BAD ARGUMENT");
1034 if (sscanf(args
[1], "%d", &x
) == 0) {
1036 report_error("BAD ARGUMENT");
1041 report_return(mvdelch(y
, x
));
1046 cmd_mvgetch(int nargs
, char **args
)
1050 if (check_arg_count(nargs
, 2) == 1)
1053 if (sscanf(args
[0], "%d", &y
) == 0) {
1055 report_error("BAD ARGUMENT");
1059 if (sscanf(args
[1], "%d", &x
) == 0) {
1061 report_error("BAD ARGUMENT");
1066 report_int(mvgetch(y
, x
));
1071 cmd_mvgetnstr(int nargs
, char **args
)
1076 if (check_arg_count(nargs
, 3) == 1)
1079 if (sscanf(args
[0], "%d", &y
) == 0) {
1081 report_error("BAD ARGUMENT");
1085 if (sscanf(args
[1], "%d", &x
) == 0) {
1087 report_error("BAD ARGUMENT");
1091 if (sscanf(args
[2], "%d", &count
) == 0) {
1093 report_error("BAD ARGUMENT");
1097 if ((string
= malloc(count
+ 1)) == NULL
) {
1099 report_error("MALLOC_FAILED");
1105 report_return(mvgetnstr(y
, x
, string
, count
));
1106 report_status(string
);
1112 cmd_mvgetstr(int nargs
, char **args
)
1117 if (check_arg_count(nargs
, 2) == 1)
1120 if (sscanf(args
[0], "%d", &y
) == 0) {
1122 report_error("BAD ARGUMENT");
1126 if (sscanf(args
[1], "%d", &x
) == 0) {
1128 report_error("BAD ARGUMENT");
1134 report_return(mvgetstr(y
, x
, string
));
1135 report_status(string
);
1140 cmd_mvinch(int nargs
, char **args
)
1144 if (check_arg_count(nargs
, 2) == 1)
1147 if (sscanf(args
[0], "%d", &y
) == 0) {
1149 report_error("BAD ARGUMENT");
1153 if (sscanf(args
[1], "%d", &x
) == 0) {
1155 report_error("BAD ARGUMENT");
1160 report_int(mvinch(y
, x
));
1165 cmd_mvinchnstr(int nargs
, char **args
)
1170 if (check_arg_count(nargs
, 3) == 1)
1173 if (sscanf(args
[0], "%d", &y
) == 0) {
1175 report_error("BAD ARGUMENT");
1179 if (sscanf(args
[1], "%d", &x
) == 0) {
1181 report_error("BAD ARGUMENT");
1185 if (sscanf(args
[2], "%d", &count
) == 0) {
1187 report_error("BAD ARGUMENT");
1191 if ((string
= malloc((count
+ 1) * sizeof(chtype
))) == NULL
) {
1193 report_error("MALLOC_FAILED");
1199 report_return(mvinchnstr(y
, x
, string
, count
));
1200 report_nstr(string
);
1206 cmd_mvinchstr(int nargs
, char **args
)
1211 if (check_arg_count(nargs
, 2) == 1)
1214 if (sscanf(args
[0], "%d", &y
) == 0) {
1216 report_error("BAD ARGUMENT");
1220 if (sscanf(args
[1], "%d", &x
) == 0) {
1222 report_error("BAD ARGUMENT");
1228 report_return(mvinchstr(y
, x
, string
));
1229 report_nstr(string
);
1234 cmd_mvinnstr(int nargs
, char **args
)
1239 if (check_arg_count(nargs
, 3) == 1)
1242 if (sscanf(args
[0], "%d", &y
) == 0) {
1244 report_error("BAD ARGUMENT");
1248 if (sscanf(args
[1], "%d", &x
) == 0) {
1250 report_error("BAD ARGUMENT");
1254 if (sscanf(args
[2], "%d", &count
) == 0) {
1256 report_error("BAD ARGUMENT");
1260 if ((string
= malloc(count
+ 1)) == NULL
) {
1262 report_error("MALLOC_FAILED");
1268 report_return(mvinnstr(y
, x
, string
, count
));
1269 report_status(string
);
1275 cmd_mvinsch(int nargs
, char **args
)
1279 if (check_arg_count(nargs
, 3) == 1)
1282 if (sscanf(args
[0], "%d", &y
) == 0) {
1284 report_error("BAD ARGUMENT");
1288 if (sscanf(args
[1], "%d", &x
) == 0) {
1290 report_error("BAD ARGUMENT");
1294 if (sscanf(args
[2], "%d", &ch
) == 0) {
1296 report_error("BAD ARGUMENT");
1301 report_return(mvinsch(y
, x
, ch
));
1306 cmd_mvinstr(int nargs
, char **args
)
1310 if (check_arg_count(nargs
, 3) == 1)
1313 if (sscanf(args
[0], "%d", &y
) == 0) {
1315 report_error("BAD ARGUMENT");
1319 if (sscanf(args
[1], "%d", &x
) == 0) {
1321 report_error("BAD ARGUMENT");
1326 report_return(mvinstr(y
, x
, args
[2]));
1332 cmd_mvwaddbytes(int nargs
, char **args
)
1337 if (check_arg_count(nargs
, 5) == 1)
1340 if (sscanf(args
[0], "%p", &win
) == 0) {
1342 report_error("BAD ARGUMENT");
1346 if (sscanf(args
[1], "%d", &y
) == 0) {
1348 report_error("BAD ARGUMENT");
1352 if (sscanf(args
[2], "%d", &x
) == 0) {
1354 report_error("BAD ARGUMENT");
1358 if (sscanf(args
[4], "%d", &count
) == 0) {
1360 report_error("BAD ARGUMENT");
1365 report_return(mvwaddbytes(win
, y
, x
, args
[3], count
));
1370 cmd_mvwaddch(int nargs
, char **args
)
1375 if (check_arg_count(nargs
, 4) == 1)
1378 if (sscanf(args
[0], "%p", &win
) == 0) {
1380 report_error("BAD ARGUMENT");
1384 if (sscanf(args
[1], "%d", &y
) == 0) {
1386 report_error("BAD ARGUMENT");
1390 if (sscanf(args
[2], "%d", &x
) == 0) {
1392 report_error("BAD ARGUMENT");
1397 report_return(mvwaddch(win
, y
, x
, args
[3][0]));
1402 cmd_mvwaddchnstr(int nargs
, char **args
)
1407 if (check_arg_count(nargs
, 5) == 1)
1410 if (sscanf(args
[0], "%p", &win
) == 0) {
1412 report_error("BAD ARGUMENT");
1416 if (sscanf(args
[1], "%d", &y
) == 0) {
1418 report_error("BAD ARGUMENT");
1422 if (sscanf(args
[2], "%d", &x
) == 0) {
1424 report_error("BAD ARGUMENT");
1428 if (sscanf(args
[4], "%d", &count
) == 0) {
1430 report_error("BAD ARGUMENT");
1435 report_return(mvwaddchnstr(win
, y
, x
, (chtype
*) args
[3], count
));
1440 cmd_mvwaddchstr(int nargs
, char **args
)
1445 if (check_arg_count(nargs
, 4) == 1)
1448 if (sscanf(args
[0], "%p", &win
) == 0) {
1450 report_error("BAD ARGUMENT");
1454 if (sscanf(args
[1], "%d", &y
) == 0) {
1456 report_error("BAD ARGUMENT");
1460 if (sscanf(args
[2], "%d", &x
) == 0) {
1462 report_error("BAD ARGUMENT");
1467 report_return(mvwaddchstr(win
, y
, x
, (chtype
*) args
[3]));
1472 cmd_mvwaddnstr(int nargs
, char **args
)
1477 if (check_arg_count(nargs
, 5) == 1)
1480 if (sscanf(args
[0], "%p", &win
) == 0) {
1482 report_error("BAD ARGUMENT");
1486 if (sscanf(args
[1], "%d", &y
) == 0) {
1488 report_error("BAD ARGUMENT");
1492 if (sscanf(args
[2], "%d", &x
) == 0) {
1494 report_error("BAD ARGUMENT");
1498 if (sscanf(args
[4], "%d", &count
) == 0) {
1500 report_error("BAD ARGUMENT");
1505 report_return(mvwaddnstr(win
, y
, x
, args
[3], count
));
1510 cmd_mvwaddstr(int nargs
, char **args
)
1515 if (check_arg_count(nargs
, 4) == 1)
1518 if (sscanf(args
[0], "%p", &win
) == 0) {
1520 report_error("BAD ARGUMENT");
1524 if (sscanf(args
[1], "%d", &y
) == 0) {
1526 report_error("BAD ARGUMENT");
1530 if (sscanf(args
[2], "%d", &x
) == 0) {
1532 report_error("BAD ARGUMENT");
1537 report_return(mvwaddstr(win
, y
, x
, args
[3]));
1542 cmd_mvwdelch(int nargs
, char **args
)
1547 if (check_arg_count(nargs
, 3) == 1)
1550 if (sscanf(args
[0], "%p", &win
) == 0) {
1552 report_error("BAD ARGUMENT");
1556 if (sscanf(args
[1], "%d", &y
) == 0) {
1558 report_error("BAD ARGUMENT");
1562 if (sscanf(args
[2], "%d", &x
) == 0) {
1564 report_error("BAD ARGUMENT");
1569 report_return(mvwdelch(win
, y
, x
));
1574 cmd_mvwgetch(int nargs
, char **args
)
1579 if (check_arg_count(nargs
, 3) == 1)
1582 if (sscanf(args
[0], "%p", &win
) == 0) {
1584 report_error("BAD ARGUMENT");
1588 if (sscanf(args
[1], "%d", &y
) == 0) {
1590 report_error("BAD ARGUMENT");
1594 if (sscanf(args
[2], "%d", &x
) == 0) {
1596 report_error("BAD ARGUMENT");
1600 /* XXX - implicit refresh */
1602 report_int(mvwgetch(win
, y
, x
));
1607 cmd_mvwgetnstr(int nargs
, char **args
)
1613 if (check_arg_count(nargs
, 4) == 1)
1616 if (sscanf(args
[0], "%p", &win
) == 0) {
1618 report_error("BAD ARGUMENT");
1622 if (sscanf(args
[1], "%d", &y
) == 0) {
1624 report_error("BAD ARGUMENT");
1628 if (sscanf(args
[2], "%d", &x
) == 0) {
1630 report_error("BAD ARGUMENT");
1634 if (sscanf(args
[3], "%d", &count
) == 0) {
1636 report_error("BAD ARGUMENT");
1640 if ((string
= malloc(count
+ 1)) == NULL
) {
1642 report_error("MALLOC_FAILED");
1648 report_return(mvwgetnstr(win
, y
, x
, string
, count
));
1649 report_status(string
);
1655 cmd_mvwgetstr(int nargs
, char **args
)
1661 if (check_arg_count(nargs
, 3) == 1)
1664 if (sscanf(args
[0], "%p", &win
) == 0) {
1666 report_error("BAD ARGUMENT");
1670 if (sscanf(args
[1], "%d", &y
) == 0) {
1672 report_error("BAD ARGUMENT");
1676 if (sscanf(args
[2], "%d", &x
) == 0) {
1678 report_error("BAD ARGUMENT");
1684 report_return(mvwgetstr(win
, y
, x
, string
));
1685 report_status(string
);
1690 cmd_mvwinch(int nargs
, char **args
)
1695 if (check_arg_count(nargs
, 3) == 1)
1698 if (sscanf(args
[0], "%p", &win
) == 0) {
1700 report_error("BAD ARGUMENT");
1704 if (sscanf(args
[1], "%d", &y
) == 0) {
1706 report_error("BAD ARGUMENT");
1710 if (sscanf(args
[2], "%d", &x
) == 0) {
1712 report_error("BAD ARGUMENT");
1717 report_int(mvwinch(win
, y
, x
));
1722 cmd_mvwinsch(int nargs
, char **args
)
1727 if (check_arg_count(nargs
, 4) == 1)
1730 if (sscanf(args
[0], "%p", &win
) == 0) {
1732 report_error("BAD ARGUMENT");
1736 if (sscanf(args
[1], "%d", &y
) == 0) {
1738 report_error("BAD ARGUMENT");
1742 if (sscanf(args
[2], "%d", &x
) == 0) {
1744 report_error("BAD ARGUMENT");
1749 report_int(mvwinsch(win
, y
, x
, args
[3][0]));
1754 cmd_assume_default_colors(int nargs
, char **args
)
1758 if (check_arg_count(nargs
, 2) == 1)
1761 if (sscanf(args
[0], "%hd", &fore
) == 0) {
1763 report_error("BAD ARGUMENT");
1767 if (sscanf(args
[1], "%hd", &back
) == 0) {
1769 report_error("BAD ARGUMENT");
1774 report_return(assume_default_colors(fore
, back
));
1779 cmd_baudrate(int nargs
, char **args
)
1781 if (check_arg_count(nargs
, 0) == 1)
1785 report_int(baudrate());
1790 cmd_beep(int nargs
, char **args
)
1792 if (check_arg_count(nargs
, 0) == 1)
1796 report_return(beep());
1801 cmd_box(int nargs
, char **args
)
1804 chtype
*vertical
, *horizontal
;
1806 if (check_arg_count(nargs
, 3) == 1)
1809 if (sscanf(args
[0], "%p", &win
) == 0) {
1811 report_error("BAD ARGUMENT");
1815 vertical
= (chtype
*) args
[1];
1816 horizontal
= (chtype
*) args
[2];
1818 report_return(box(win
, vertical
[0], horizontal
[0]));
1823 cmd_can_change_color(int nargs
, char **args
)
1825 if (check_arg_count(nargs
, 0) == 1)
1829 report_int(can_change_color());
1834 cmd_cbreak(int nargs
, char **args
)
1836 if (check_arg_count(nargs
, 0) == 1)
1840 report_return(cbreak());
1845 cmd_clearok(int nargs
, char **args
)
1850 if (check_arg_count(nargs
, 2) == 1)
1853 if (sscanf(args
[0], "%p", &win
) == 0) {
1855 report_error("BAD ARGUMENT");
1859 if (sscanf(args
[1], "%d", &flag
) == 0) {
1861 report_error("BAD ARGUMENT");
1866 report_return(clearok(win
, flag
));
1871 cmd_color_content(int nargs
, char **args
)
1873 short colour
, red
, green
, blue
;
1875 if (check_arg_count(nargs
, 1) == 1)
1878 if (sscanf(args
[0], "%hd", &colour
) == 0) {
1880 report_error("BAD ARGUMENT");
1886 report_return(color_content(colour
, &red
, &green
, &blue
));
1894 cmd_copywin(int nargs
, char **args
)
1896 int sminrow
, smincol
, dminrow
, dmincol
, dmaxrow
, dmaxcol
, ovlay
;
1897 WINDOW
*source
, *destination
;
1899 if (check_arg_count(nargs
, 9) == 1)
1902 if (sscanf(args
[0], "%p", &source
) == 0) {
1904 report_error("BAD ARGUMENT");
1908 if (sscanf(args
[1], "%p", &destination
) == 0) {
1910 report_error("BAD ARGUMENT");
1914 if (sscanf(args
[2], "%d", &sminrow
) == 0) {
1916 report_error("BAD ARGUMENT");
1920 if (sscanf(args
[3], "%d", &smincol
) == 0) {
1922 report_error("BAD ARGUMENT");
1926 if (sscanf(args
[4], "%d", &dminrow
) == 0) {
1928 report_error("BAD ARGUMENT");
1932 if (sscanf(args
[5], "%d", &dmincol
) == 0) {
1934 report_error("BAD ARGUMENT");
1938 if (sscanf(args
[6], "%d", &dmaxrow
) == 0) {
1940 report_error("BAD ARGUMENT");
1944 if (sscanf(args
[7], "%d", &dmaxcol
) == 0) {
1946 report_error("BAD ARGUMENT");
1950 if (sscanf(args
[8], "%d", &ovlay
) == 0) {
1952 report_error("BAD ARGUMENT");
1957 report_return(copywin(source
, destination
, sminrow
, smincol
, dminrow
,
1958 dmincol
, dmaxrow
, dmaxcol
, ovlay
));
1963 cmd_curs_set(int nargs
, char **args
)
1967 if (check_arg_count(nargs
, 1) == 1)
1970 if (sscanf(args
[0], "%d", &vis
) == 0) {
1972 report_error("BAD ARGUMENT");
1977 report_int(curs_set(vis
));
1982 cmd_def_prog_mode(int nargs
, char **args
)
1984 if (check_arg_count(nargs
, 0) == 1)
1988 report_return(def_prog_mode());
1993 cmd_def_shell_mode(int nargs
, char **args
)
1995 if (check_arg_count(nargs
, 0) == 1)
1999 report_return(def_shell_mode());
2004 cmd_define_key(int nargs
, char **args
)
2008 if (check_arg_count(nargs
, 2) == 1)
2011 if (sscanf(args
[1], "%d", &symbol
) == 0) {
2013 report_error("BAD ARGUMENT");
2018 report_return(define_key(args
[0], symbol
));
2023 cmd_delay_output(int nargs
, char **args
)
2027 if (check_arg_count(nargs
, 1) == 1)
2030 if (sscanf(args
[0], "%d", &dtime
) == 0) {
2032 report_error("BAD ARGUMENT");
2037 report_return(delay_output(dtime
));
2042 cmd_delscreen(int nargs
, char **args
)
2046 if (check_arg_count(nargs
, 1) == 1)
2049 if (sscanf(args
[0], "%p", &scrn
) == 0) {
2051 report_error("BAD ARGUMENT");
2055 delscreen(scrn
); /* void return */
2062 cmd_delwin(int nargs
, char **args
)
2066 if (check_arg_count(nargs
, 1) == 1)
2069 if (sscanf(args
[0], "%p", &win
) == 0) {
2071 report_error("BAD ARGUMENT");
2076 report_return(delwin(win
));
2081 cmd_derwin(int nargs
, char **args
)
2083 int lines
, cols
, y
, x
;
2086 if (check_arg_count(nargs
, 5) == 1)
2089 if (sscanf(args
[0], "%p", &win
) == 0) {
2091 report_error("BAD ARGUMENT");
2095 if (sscanf(args
[1], "%d", &lines
) == 0) {
2097 report_error("BAD ARGUMENT");
2101 if (sscanf(args
[2], "%d", &cols
) == 0) {
2103 report_error("BAD ARGUMENT");
2107 if (sscanf(args
[3], "%d", &y
) == 0) {
2109 report_error("BAD ARGUMENT");
2113 if (sscanf(args
[4], "%d", &x
) == 0) {
2115 report_error("BAD ARGUMENT");
2120 report_ptr(derwin(win
, lines
, cols
, y
, x
));
2125 cmd_dupwin(int nargs
, char **args
)
2129 if (check_arg_count(nargs
, 1) == 1)
2132 if (sscanf(args
[0], "%p", &win
) == 0) {
2134 report_error("BAD ARGUMENT");
2139 report_ptr(dupwin(win
));
2144 cmd_doupdate(int nargs
, char **args
)
2146 if (check_arg_count(nargs
, 0) == 1)
2149 /* XXX - implicit refresh */
2151 report_return(doupdate());
2156 cmd_echo(int nargs
, char **args
)
2158 if (check_arg_count(nargs
, 0) == 1)
2162 report_return(echo());
2167 cmd_endwin(int nargs
, char **args
)
2169 if (check_arg_count(nargs
, 0) == 1)
2173 report_return(endwin());
2178 cmd_erasechar(int nargs
, char **args
)
2180 if (check_arg_count(nargs
, 0) == 1)
2184 report_int(erasechar());
2189 cmd_flash(int nargs
, char **args
)
2191 if (check_arg_count(nargs
, 0) == 1)
2195 report_return(flash());
2200 cmd_flushinp(int nargs
, char **args
)
2202 if (check_arg_count(nargs
, 0) == 1)
2206 report_return(flushinp());
2211 cmd_flushok(int nargs
, char **args
)
2216 if (check_arg_count(nargs
, 2) == 1)
2219 if (sscanf(args
[0], "%p", &win
) == 0) {
2221 report_error("BAD ARGUMENT");
2225 if (sscanf(args
[1], "%d", &flag
) == 0) {
2227 report_error("BAD ARGUMENT");
2232 report_return(flushok(win
, flag
));
2237 cmd_fullname(int nargs
, char **args
)
2241 if (check_arg_count(nargs
, 1) == 1)
2246 report_status(fullname(args
[0], string
));
2247 report_status(string
);
2252 cmd_getattrs(int nargs
, char **args
)
2256 if (check_arg_count(nargs
, 1) == 1)
2259 if (sscanf(args
[0], "%p", &win
) == 0) {
2261 report_error("BAD ARGUMENT");
2266 report_int(getattrs(win
));
2271 cmd_getbkgd(int nargs
, char **args
)
2275 if (check_arg_count(nargs
, 1) == 1)
2278 if (sscanf(args
[0], "%p", &win
) == 0) {
2280 report_error("BAD ARGUMENT");
2285 report_byte(getbkgd(win
));
2290 cmd_getcury(int nargs
, char **args
)
2294 if (check_arg_count(nargs
, 1) == 1)
2297 if (sscanf(args
[0], "%p", &win
) == 0) {
2299 report_error("BAD ARGUMENT");
2304 report_int(getcury(win
));
2309 cmd_getcurx(int nargs
, char **args
)
2313 if (check_arg_count(nargs
, 1) == 1)
2316 if (sscanf(args
[0], "%p", &win
) == 0) {
2318 report_error("BAD ARGUMENT");
2323 report_int(getcurx(win
));
2328 cmd_getyx(int nargs
, char **args
)
2333 if (check_arg_count(nargs
, 1) == 1)
2336 if (sscanf(args
[0], "%p", &win
) == 0) {
2338 report_error("BAD ARGUMENT");
2350 cmd_getbegy(int nargs
, char **args
)
2354 if (check_arg_count(nargs
, 1) == 1)
2357 if (sscanf(args
[0], "%p", &win
) == 0) {
2359 report_error("BAD ARGUMENT");
2364 report_int(getbegy(win
));
2369 cmd_getbegx(int nargs
, char **args
)
2373 if (check_arg_count(nargs
, 1) == 1)
2376 if (sscanf(args
[0], "%p", &win
) == 0) {
2378 report_error("BAD ARGUMENT");
2383 report_int(getbegx(win
));
2388 cmd_getmaxy(int nargs
, char **args
)
2392 if (check_arg_count(nargs
, 1) == 1)
2395 if (sscanf(args
[0], "%p", &win
) == 0) {
2397 report_error("BAD ARGUMENT");
2402 report_int(getmaxy(win
));
2407 cmd_getmaxx(int nargs
, char **args
)
2411 if (check_arg_count(nargs
, 1) == 1)
2414 if (sscanf(args
[0], "%p", &win
) == 0) {
2416 report_error("BAD ARGUMENT");
2421 report_int(getmaxx(win
));
2426 cmd_getpary(int nargs
, char **args
)
2430 if (check_arg_count(nargs
, 1) == 1)
2433 if (sscanf(args
[0], "%p", &win
) == 0) {
2435 report_error("BAD ARGUMENT");
2440 report_int(getpary(win
));
2445 cmd_getparx(int nargs
, char **args
)
2449 if (check_arg_count(nargs
, 1) == 1)
2452 if (sscanf(args
[0], "%p", &win
) == 0) {
2454 report_error("BAD ARGUMENT");
2459 report_int(getparx(win
));
2464 cmd_getparyx(int nargs
, char **args
)
2469 if (check_arg_count(nargs
, 1) == 1)
2472 if (sscanf(args
[0], "%p", &win
) == 0) {
2474 report_error("BAD ARGUMENT");
2479 getparyx(win
, y
, x
);
2486 cmd_gettmode(int nargs
, char **args
)
2488 if (check_arg_count(nargs
, 0) == 1)
2492 report_return(gettmode());
2497 cmd_getwin(int nargs
, char **args
)
2501 if (check_arg_count(nargs
, 1) == 1)
2504 if ((fp
= fopen(args
[0], "r")) == NULL
) {
2506 report_error("BAD FILE_ARGUMENT");
2511 report_ptr(getwin(fp
));
2517 cmd_halfdelay(int nargs
, char **args
)
2521 if (check_arg_count(nargs
, 1) == 1)
2524 if (sscanf(args
[0], "%d", &ms
) == 0) {
2526 report_error("BAD ARGUMENT");
2531 report_return(halfdelay(ms
));
2536 cmd_has_colors(int nargs
, char **args
)
2538 if (check_arg_count(nargs
, 0) == 1)
2542 report_int(has_colors());
2547 cmd_has_ic(int nargs
, char **args
)
2549 if (check_arg_count(nargs
, 0) == 1)
2553 report_int(has_ic());
2558 cmd_has_il(int nargs
, char **args
)
2560 if (check_arg_count(nargs
, 0) == 1)
2564 report_int(has_il());
2569 cmd_hline(int nargs
, char **args
)
2574 if (check_arg_count(nargs
, 2) == 1)
2577 ch
= (chtype
*) args
[0];
2579 if (sscanf(args
[1], "%d", &count
) == 0) {
2581 report_error("BAD ARGUMENT");
2586 report_return(hline(ch
[0], count
));
2591 cmd_idcok(int nargs
, char **args
)
2596 if (check_arg_count(nargs
, 2) == 1)
2599 if (sscanf(args
[0], "%p", &win
) == 0) {
2601 report_error("BAD ARGUMENT");
2605 if (sscanf(args
[1], "%d", &flag
) == 0) {
2607 report_error("BAD ARGUMENT");
2612 report_return(idcok(win
, flag
));
2617 cmd_idlok(int nargs
, char **args
)
2622 if (check_arg_count(nargs
, 2) == 1)
2625 if (sscanf(args
[0], "%p", &win
) == 0) {
2627 report_error("BAD ARGUMENT");
2631 if (sscanf(args
[1], "%d", &flag
) == 0) {
2633 report_error("BAD ARGUMENT");
2638 report_return(idlok(win
, flag
));
2643 cmd_init_color(int nargs
, char **args
)
2645 short colour
, red
, green
, blue
;
2647 if (check_arg_count(nargs
, 4) == 1)
2650 if (sscanf(args
[0], "%hd", &colour
) == 0) {
2652 report_error("BAD ARGUMENT");
2656 if (sscanf(args
[1], "%hd", &red
) == 0) {
2658 report_error("BAD ARGUMENT");
2662 if (sscanf(args
[2], "%hd", &green
) == 0) {
2664 report_error("BAD ARGUMENT");
2668 if (sscanf(args
[3], "%hd", &blue
) == 0) {
2670 report_error("BAD ARGUMENT");
2675 report_return(init_color(colour
, red
, green
, blue
));
2680 cmd_init_pair(int nargs
, char **args
)
2682 short pair
, fore
, back
;
2684 if (check_arg_count(nargs
, 3) == 1)
2687 if (sscanf(args
[0], "%hd", &pair
) == 0) {
2689 report_error("BAD ARGUMENT");
2693 if (sscanf(args
[1], "%hd", &fore
) == 0) {
2695 report_error("BAD ARGUMENT");
2699 if (sscanf(args
[2], "%hd", &back
) == 0) {
2701 report_error("BAD ARGUMENT");
2706 report_return(init_pair(pair
, fore
, back
));
2711 cmd_initscr(int nargs
, char **args
)
2713 if (check_arg_count(nargs
, 0) == 1)
2717 report_ptr(initscr());
2722 cmd_intrflush(int nargs
, char **args
)
2727 if (check_arg_count(nargs
, 2) == 1)
2730 if (sscanf(args
[0], "%p", &win
) == 0) {
2732 report_error("BAD ARGUMENT");
2736 if (sscanf(args
[1], "%d", &flag
) == 0) {
2738 report_error("BAD ARGUMENT");
2743 report_return(intrflush(win
, flag
));
2748 cmd_isendwin(int nargs
, char **args
)
2750 if (check_arg_count(nargs
, 0) == 1)
2754 report_int(isendwin());
2759 cmd_is_linetouched(int nargs
, char **args
)
2764 if (check_arg_count(nargs
, 2) == 1)
2767 if (sscanf(args
[0], "%p", &win
) == 0) {
2769 report_error("BAD ARGUMENT");
2773 if (sscanf(args
[1], "%d", &line
) == 0) {
2775 report_error("BAD ARGUMENT");
2780 report_int(is_linetouched(win
, line
));
2785 cmd_is_wintouched(int nargs
, char **args
)
2789 if (check_arg_count(nargs
, 1) == 1)
2792 if (sscanf(args
[0], "%p", &win
) == 0) {
2794 report_error("BAD ARGUMENT");
2799 report_int(is_wintouched(win
));
2804 cmd_keyok(int nargs
, char **args
)
2808 if (check_arg_count(nargs
, 2) == 1)
2811 if (sscanf(args
[0], "%d", &keysym
) == 0) {
2813 report_error("BAD ARGUMENT");
2817 if (sscanf(args
[1], "%d", &flag
) == 0) {
2819 report_error("BAD ARGUMENT");
2824 report_return(keyok(keysym
, flag
));
2829 cmd_keypad(int nargs
, char **args
)
2834 if (check_arg_count(nargs
, 2) == 1)
2837 if (sscanf(args
[0], "%p", &win
) == 0) {
2839 report_error("BAD ARGUMENT");
2843 if (sscanf(args
[1], "%d", &flag
) == 0) {
2845 report_error("BAD ARGUMENT");
2850 report_return(keypad(win
, flag
));
2855 cmd_keyname(int nargs
, char **args
)
2859 if (check_arg_count(nargs
, 1) == 1)
2862 if (sscanf(args
[0], "%d", &key
) == 0) {
2864 report_error("BAD ARGUMENT");
2869 report_status(keyname(key
));
2874 cmd_killchar(int nargs
, char **args
)
2876 if (check_arg_count(nargs
, 0) == 1)
2880 report_int(killchar());
2885 cmd_leaveok(int nargs
, char **args
)
2890 if (check_arg_count(nargs
, 2) == 1)
2893 if (sscanf(args
[0], "%p", &win
) == 0) {
2895 report_error("BAD ARGUMENT");
2899 if (sscanf(args
[1], "%d", &flag
) == 0) {
2901 report_error("BAD ARGUMENT");
2906 report_return(leaveok(win
, flag
));
2911 cmd_meta(int nargs
, char **args
)
2916 if (check_arg_count(nargs
, 2) == 1)
2919 if (sscanf(args
[0], "%p", &win
) == 0) {
2921 report_error("BAD ARGUMENT");
2925 if (sscanf(args
[1], "%d", &flag
) == 0) {
2927 report_error("BAD ARGUMENT");
2932 report_return(meta(win
, flag
));
2937 cmd_mvcur(int nargs
, char **args
)
2939 int oldy
, oldx
, y
, x
;
2941 if (check_arg_count(nargs
, 4) == 1)
2944 if (sscanf(args
[0], "%d", &oldy
) == 0) {
2946 report_error("BAD ARGUMENT");
2950 if (sscanf(args
[1], "%d", &oldx
) == 0) {
2952 report_error("BAD ARGUMENT");
2956 if (sscanf(args
[2], "%d", &y
) == 0) {
2958 report_error("BAD ARGUMENT");
2962 if (sscanf(args
[3], "%d", &x
) == 0) {
2964 report_error("BAD ARGUMENT");
2969 report_return(mvcur(oldy
, oldx
, y
, x
));
2974 cmd_mvderwin(int nargs
, char **args
)
2979 if (check_arg_count(nargs
, 3) == 1)
2982 if (sscanf(args
[0], "%p", &win
) == 0) {
2984 report_error("BAD ARGUMENT");
2988 if (sscanf(args
[1], "%d", &y
) == 0) {
2990 report_error("BAD ARGUMENT");
2994 if (sscanf(args
[2], "%d", &x
) == 0) {
2996 report_error("BAD ARGUMENT");
3001 report_return(mvderwin(win
, y
, x
));
3006 cmd_mvhline(int nargs
, char **args
)
3011 if (check_arg_count(nargs
, 4) == 1)
3014 if (sscanf(args
[0], "%d", &y
) == 0) {
3016 report_error("BAD ARGUMENT");
3020 if (sscanf(args
[1], "%d", &x
) == 0) {
3022 report_error("BAD ARGUMENT");
3026 ch
= (chtype
*) args
[2];
3028 if (sscanf(args
[3], "%d", &n
) == 0) {
3030 report_error("BAD ARGUMENT");
3035 report_return(mvhline(y
, x
, ch
[0], n
));
3040 cmd_mvprintw(int nargs
, char **args
)
3044 if (check_arg_count(nargs
, 4) == 1)
3047 if (sscanf(args
[0], "%d", &y
) == 0) {
3049 report_error("BAD ARGUMENT");
3053 if (sscanf(args
[1], "%d", &x
) == 0) {
3055 report_error("BAD ARGUMENT");
3060 report_return(mvprintw(y
, x
, args
[2], args
[3]));
3065 cmd_mvscanw(int nargs
, char **args
)
3070 if (check_arg_count(nargs
, 3) == 1)
3073 if (sscanf(args
[0], "%d", &y
) == 0) {
3075 report_error("BAD ARGUMENT");
3079 if (sscanf(args
[1], "%d", &x
) == 0) {
3081 report_error("BAD ARGUMENT");
3087 report_return(mvscanw(y
, x
, args
[2], &string
));
3088 report_status(string
);
3093 cmd_mvvline(int nargs
, char **args
)
3098 if (check_arg_count(nargs
, 4) == 1)
3101 if (sscanf(args
[0], "%d", &y
) == 0) {
3103 report_error("BAD ARGUMENT");
3107 if (sscanf(args
[1], "%d", &x
) == 0) {
3109 report_error("BAD ARGUMENT");
3113 ch
= (chtype
*) args
[2];
3115 if (sscanf(args
[3], "%d", &n
) == 0) {
3117 report_error("BAD ARGUMENT");
3122 report_return(mvvline(y
, x
, ch
[0], n
));
3127 cmd_mvwhline(int nargs
, char **args
)
3132 if (check_arg_count(nargs
, 5) == 1)
3135 if (sscanf(args
[0], "%p", &win
) == 0) {
3137 report_error("BAD ARGUMENT");
3141 if (sscanf(args
[1], "%d", &y
) == 0) {
3143 report_error("BAD ARGUMENT");
3147 if (sscanf(args
[2], "%d", &x
) == 0) {
3149 report_error("BAD ARGUMENT");
3153 if (sscanf(args
[3], "%d", &ch
) == 0) {
3155 report_error("BAD ARGUMENT");
3159 if (sscanf(args
[4], "%d", &n
) == 0) {
3161 report_error("BAD ARGUMENT");
3166 report_return(mvwhline(win
, y
, x
, ch
, n
));
3171 cmd_mvwvline(int nargs
, char **args
)
3177 if (check_arg_count(nargs
, 5) == 1)
3180 if (sscanf(args
[0], "%p", &win
) == 0) {
3182 report_error("BAD ARGUMENT");
3186 if (sscanf(args
[1], "%d", &y
) == 0) {
3188 report_error("BAD ARGUMENT");
3192 if (sscanf(args
[2], "%d", &x
) == 0) {
3194 report_error("BAD ARGUMENT");
3198 ch
= (chtype
*) args
[3];
3200 if (sscanf(args
[4], "%d", &n
) == 0) {
3202 report_error("BAD ARGUMENT");
3207 report_return(mvwvline(win
, y
, x
, ch
[0], n
));
3212 cmd_mvwin(int nargs
, char **args
)
3217 if (check_arg_count(nargs
, 3) == 1)
3220 if (sscanf(args
[0], "%p", &win
) == 0) {
3222 report_error("BAD ARGUMENT");
3226 if (sscanf(args
[1], "%d", &y
) == 0) {
3228 report_error("BAD ARGUMENT");
3232 if (sscanf(args
[2], "%d", &x
) == 0) {
3234 report_error("BAD ARGUMENT");
3239 report_return(mvwin(win
, y
, x
));
3244 cmd_mvwinchnstr(int nargs
, char **args
)
3250 if (check_arg_count(nargs
, 4) == 1)
3253 if (sscanf(args
[0], "%p", &win
) == 0) {
3255 report_error("BAD ARGUMENT");
3259 if (sscanf(args
[1], "%d", &y
) == 0) {
3261 report_error("BAD ARGUMENT");
3265 if (sscanf(args
[2], "%d", &x
) == 0) {
3267 report_error("BAD ARGUMENT");
3271 if (sscanf(args
[3], "%d", &count
) == 0) {
3273 report_error("BAD ARGUMENT");
3277 if ((string
= malloc((count
+ 1) * sizeof(chtype
))) == NULL
) {
3279 report_error("MALLOC_FAILED");
3285 report_return(mvwinchnstr(win
, y
, x
, string
, count
));
3286 report_nstr(string
);
3292 cmd_mvwinchstr(int nargs
, char **args
)
3298 if (check_arg_count(nargs
, 3) == 1)
3301 if (sscanf(args
[0], "%p", &win
) == 0) {
3303 report_error("BAD ARGUMENT");
3307 if (sscanf(args
[1], "%d", &y
) == 0) {
3309 report_error("BAD ARGUMENT");
3313 if (sscanf(args
[2], "%d", &x
) == 0) {
3315 report_error("BAD ARGUMENT");
3321 report_return(mvwinchstr(win
, y
, x
, string
));
3322 report_nstr(string
);
3327 cmd_mvwinnstr(int nargs
, char **args
)
3333 if (check_arg_count(nargs
, 4) == 1)
3336 if (sscanf(args
[0], "%p", &win
) == 0) {
3338 report_error("BAD ARGUMENT");
3342 if (sscanf(args
[1], "%d", &y
) == 0) {
3344 report_error("BAD ARGUMENT");
3348 if (sscanf(args
[2], "%d", &x
) == 0) {
3350 report_error("BAD ARGUMENT");
3354 if (sscanf(args
[3], "%d", &count
) == 0) {
3356 report_error("BAD ARGUMENT");
3360 if ((string
= malloc(count
+ 1)) == NULL
) {
3362 report_error("MALLOC_FAILED");
3368 report_return(mvwinnstr(win
, y
, x
, string
, count
));
3369 report_status(string
);
3375 cmd_mvwinstr(int nargs
, char **args
)
3381 if (check_arg_count(nargs
, 3) == 1)
3384 if (sscanf(args
[0], "%p", &win
) == 0) {
3386 report_error("BAD ARGUMENT");
3390 if (sscanf(args
[1], "%d", &y
) == 0) {
3392 report_error("BAD ARGUMENT");
3396 if (sscanf(args
[2], "%d", &x
) == 0) {
3398 report_error("BAD ARGUMENT");
3404 report_return(mvwinstr(win
, y
, x
, string
));
3405 report_status(string
);
3410 cmd_mvwprintw(int nargs
, char **args
)
3415 if (check_arg_count(nargs
, 5) == 1)
3418 if (sscanf(args
[0], "%p", &win
) == 0) {
3420 report_error("BAD ARGUMENT");
3424 if (sscanf(args
[1], "%d", &y
) == 0) {
3426 report_error("BAD ARGUMENT");
3430 if (sscanf(args
[2], "%d", &x
) == 0) {
3432 report_error("BAD ARGUMENT");
3437 report_return(mvwprintw(win
, y
, x
, args
[3], args
[4]));
3442 cmd_mvwscanw(int nargs
, char **args
)
3448 if (check_arg_count(nargs
, 4) == 1)
3451 if (sscanf(args
[0], "%p", &win
) == 0) {
3453 report_error("BAD ARGUMENT");
3457 if (sscanf(args
[1], "%d", &y
) == 0) {
3459 report_error("BAD ARGUMENT");
3463 if (sscanf(args
[2], "%d", &x
) == 0) {
3465 report_error("BAD ARGUMENT");
3471 report_int(mvwscanw(win
, y
, x
, args
[3], &string
));
3472 report_status(string
);
3477 cmd_napms(int nargs
, char **args
)
3481 if (check_arg_count(nargs
, 1) == 1)
3484 if (sscanf(args
[0], "%d", &naptime
) == 0) {
3486 report_error("BAD ARGUMENT");
3491 report_return(napms(naptime
));
3496 cmd_newpad(int nargs
, char **args
)
3500 if (check_arg_count(nargs
, 2) == 1)
3503 if (sscanf(args
[0], "%d", &y
) == 0) {
3505 report_error("BAD ARGUMENT");
3509 if (sscanf(args
[1], "%d", &x
) == 0) {
3511 report_error("BAD ARGUMENT");
3516 report_ptr(newpad(y
, x
));
3521 cmd_newterm(int nargs
, char **args
)
3525 if (check_arg_count(nargs
, 3) == 1)
3528 if ((in
= fopen(args
[1], "rw")) == NULL
) {
3530 report_error("BAD FILE_ARGUMENT");
3535 if ((out
= fopen(args
[2], "rw")) == NULL
) {
3537 report_error("BAD FILE_ARGUMENT");
3542 report_ptr(newterm(args
[0], out
, in
));
3547 cmd_newwin(int nargs
, char **args
)
3549 int lines
, cols
, begin_y
, begin_x
;
3551 if (check_arg_count(nargs
, 4) == 1)
3554 if (sscanf(args
[0], "%d", &lines
) == 0) {
3556 report_error("BAD ARGUMENT");
3560 if (sscanf(args
[1], "%d", &cols
) == 0) {
3562 report_error("BAD ARGUMENT");
3566 if (sscanf(args
[2], "%d", &begin_y
) == 0) {
3568 report_error("BAD ARGUMENT");
3572 if (sscanf(args
[3], "%d", &begin_x
) == 0) {
3574 report_error("BAD ARGUMENT");
3579 report_ptr(newwin(lines
, cols
, begin_y
, begin_x
));
3584 cmd_nl(int nargs
, char **args
)
3586 if (check_arg_count(nargs
, 0) == 1)
3590 report_return(nl());
3595 cmd_no_color_attributes(int nargs
, char **args
)
3597 if (check_arg_count(nargs
, 0) == 1)
3601 report_int(no_color_attributes());
3606 cmd_nocbreak(int nargs
, char **args
)
3608 if (check_arg_count(nargs
, 0) == 1)
3612 report_return(nocbreak());
3617 cmd_nodelay(int nargs
, char **args
)
3622 if (check_arg_count(nargs
, 2) == 1)
3625 if (sscanf(args
[0], "%p", &win
) == 0) {
3627 report_error("BAD ARGUMENT");
3631 if (sscanf(args
[1], "%d", &flag
) == 0) {
3633 report_error("BAD ARGUMENT");
3638 report_return(nodelay(win
, flag
));
3643 cmd_noecho(int nargs
, char **args
)
3645 if (check_arg_count(nargs
, 0) == 1)
3649 report_return(noecho());
3654 cmd_nonl(int nargs
, char **args
)
3656 if (check_arg_count(nargs
, 0) == 1)
3660 report_return(nonl());
3665 cmd_noqiflush(int nargs
, char **args
)
3667 if (check_arg_count(nargs
, 0) == 1)
3672 report_return(OK
); /* fake a return, the call returns void */
3677 cmd_noraw(int nargs
, char **args
)
3679 if (check_arg_count(nargs
, 0) == 1)
3683 report_return(noraw());
3688 cmd_notimeout(int nargs
, char **args
)
3693 if (check_arg_count(nargs
, 2) == 1)
3696 if (sscanf(args
[0], "%p", &win
) == 0) {
3698 report_error("BAD ARGUMENT");
3702 if (sscanf(args
[1], "%d", &flag
) == 0) {
3704 report_error("BAD ARGUMENT");
3709 report_return(notimeout(win
, flag
));
3714 cmd_overlay(int nargs
, char **args
)
3716 WINDOW
*source
, *dest
;
3718 if (check_arg_count(nargs
, 2) == 1)
3721 if (sscanf(args
[0], "%p", &source
) == 0) {
3723 report_error("BAD ARGUMENT");
3727 if (sscanf(args
[1], "%p", &dest
) == 0) {
3729 report_error("BAD ARGUMENT");
3734 report_return(overlay(source
, dest
));
3739 cmd_overwrite(int nargs
, char **args
)
3741 WINDOW
*source
, *dest
;
3743 if (check_arg_count(nargs
, 2) == 1)
3746 if (sscanf(args
[0], "%p", &source
) == 0) {
3748 report_error("BAD ARGUMENT");
3752 if (sscanf(args
[1], "%p", &dest
) == 0) {
3754 report_error("BAD ARGUMENT");
3759 report_return(overwrite(source
, dest
));
3764 cmd_pair_content(int nargs
, char **args
)
3766 short pair
, fore
, back
;
3768 if (check_arg_count(nargs
, 1) == 1)
3771 if (sscanf(args
[0], "%hd", &pair
) == 0) {
3773 report_error("BAD ARGUMENT");
3779 report_return(pair_content(pair
, &fore
, &back
));
3786 cmd_pechochar(int nargs
, char **args
)
3791 if (check_arg_count(nargs
, 2) == 1)
3794 if (sscanf(args
[0], "%p", &pad
) == 0) {
3796 report_error("BAD ARGUMENT");
3800 if (sscanf(args
[1], "%d", &ch
) == 0) {
3802 report_error("BAD ARGUMENT");
3807 report_return(pechochar(pad
, ch
));
3812 cmd_pnoutrefresh(int nargs
, char **args
)
3814 int pbeg_y
, pbeg_x
, sbeg_y
, sbeg_x
, smax_y
, smax_x
;
3817 if (check_arg_count(nargs
, 7) == 1)
3820 if (sscanf(args
[0], "%p", &pad
) == 0) {
3822 report_error("BAD ARGUMENT");
3826 if (sscanf(args
[1], "%d", &pbeg_y
) == 0) {
3828 report_error("BAD ARGUMENT");
3832 if (sscanf(args
[2], "%d", &pbeg_x
) == 0) {
3834 report_error("BAD ARGUMENT");
3838 if (sscanf(args
[3], "%d", &sbeg_y
) == 0) {
3840 report_error("BAD ARGUMENT");
3844 if (sscanf(args
[4], "%d", &sbeg_x
) == 0) {
3846 report_error("BAD ARGUMENT");
3850 if (sscanf(args
[5], "%d", &smax_y
) == 0) {
3852 report_error("BAD ARGUMENT");
3856 if (sscanf(args
[6], "%d", &smax_x
) == 0) {
3858 report_error("BAD ARGUMENT");
3863 report_return(pnoutrefresh(pad
, pbeg_y
, pbeg_x
, sbeg_y
, sbeg_x
, smax_y
,
3869 cmd_prefresh(int nargs
, char **args
)
3871 int pbeg_y
, pbeg_x
, sbeg_y
, sbeg_x
, smax_y
, smax_x
;
3874 if (check_arg_count(nargs
, 7) == 1)
3877 if (sscanf(args
[0], "%p", &pad
) == 0) {
3879 report_error("BAD ARGUMENT");
3883 if (sscanf(args
[1], "%d", &pbeg_y
) == 0) {
3885 report_error("BAD ARGUMENT");
3889 if (sscanf(args
[2], "%d", &pbeg_x
) == 0) {
3891 report_error("BAD ARGUMENT");
3895 if (sscanf(args
[3], "%d", &sbeg_y
) == 0) {
3897 report_error("BAD ARGUMENT");
3901 if (sscanf(args
[4], "%d", &sbeg_x
) == 0) {
3903 report_error("BAD ARGUMENT");
3907 if (sscanf(args
[5], "%d", &smax_y
) == 0) {
3909 report_error("BAD ARGUMENT");
3913 if (sscanf(args
[6], "%d", &smax_x
) == 0) {
3915 report_error("BAD ARGUMENT");
3919 /* XXX causes refresh */
3921 report_return(prefresh(pad
, pbeg_y
, pbeg_x
, sbeg_y
, sbeg_x
, smax_y
,
3928 cmd_printw(int nargs
, char **args
)
3930 if (check_arg_count(nargs
, 2) == 1)
3935 report_return(printw(args
[0], args
[1]));
3940 cmd_putwin(int nargs
, char **args
)
3945 if (check_arg_count(nargs
, 2) == 1)
3948 if (sscanf(args
[0], "%p", &win
) == 0) {
3950 report_error("BAD ARGUMENT");
3954 if ((fp
= fopen(args
[1], "rw")) == NULL
) {
3956 report_error("BAD FILE_ARGUMENT");
3961 report_return(putwin(win
, fp
));
3966 cmd_qiflush(int nargs
, char **args
)
3968 if (check_arg_count(nargs
, 0) == 1)
3973 report_return(OK
); /* fake a return because call returns void */
3978 cmd_raw(int nargs
, char **args
)
3980 if (check_arg_count(nargs
, 0) == 1)
3984 report_return(raw());
3989 cmd_redrawwin(int nargs
, char **args
)
3993 if (check_arg_count(nargs
, 1) == 1)
3996 if (sscanf(args
[0], "%p", &win
) == 0) {
3998 report_error("BAD ARGUMENT");
4003 report_return(redrawwin(win
));
4008 cmd_reset_prog_mode(int nargs
, char **args
)
4010 if (check_arg_count(nargs
, 0) == 1)
4014 report_return(reset_prog_mode());
4019 cmd_reset_shell_mode(int nargs
, char **args
)
4021 if (check_arg_count(nargs
, 0) == 1)
4025 report_return(reset_shell_mode());
4030 cmd_resetty(int nargs
, char **args
)
4032 if (check_arg_count(nargs
, 0) == 1)
4036 report_return(resetty());
4041 cmd_resizeterm(int nargs
, char **args
)
4045 if (check_arg_count(nargs
, 2) == 1)
4048 if (sscanf(args
[0], "%d", &rows
) == 0) {
4050 report_error("BAD ARGUMENT");
4054 if (sscanf(args
[1], "%d", &cols
) == 0) {
4056 report_error("BAD ARGUMENT");
4061 report_return(resizeterm(rows
, cols
));
4066 cmd_savetty(int nargs
, char **args
)
4068 if (check_arg_count(nargs
, 0) == 1)
4072 report_return(savetty());
4077 cmd_scanw(int nargs
, char **args
)
4081 if (check_arg_count(nargs
, 0) == 1)
4086 report_return(scanw("%s", string
));
4087 report_status(string
);
4092 cmd_scroll(int nargs
, char **args
)
4096 if (check_arg_count(nargs
, 1) == 1)
4099 if (sscanf(args
[0], "%p", &win
) == 0) {
4101 report_error("BAD ARGUMENT");
4106 report_return(scroll(win
));
4111 cmd_scrollok(int nargs
, char **args
)
4116 if (check_arg_count(nargs
, 2) == 1)
4119 if (sscanf(args
[0], "%p", &win
) == 0) {
4121 report_error("BAD ARGUMENT");
4125 if (sscanf(args
[1], "%d", &flag
) == 0) {
4127 report_error("BAD ARGUMENT");
4132 report_return(scrollok(win
, flag
));
4137 cmd_setterm(int nargs
, char **args
)
4139 if (check_arg_count(nargs
, 1) == 1)
4143 report_return(setterm(args
[0]));
4148 cmd_set_term(int nargs
, char **args
)
4152 if (check_arg_count(nargs
, 1) == 1)
4155 if (sscanf(args
[0], "%p", &scrn
) == 0) {
4157 report_error("BAD ARGUMENT");
4162 report_ptr(set_term(scrn
));
4167 cmd_start_color(int nargs
, char **args
)
4169 if (check_arg_count(nargs
, 0) == 1)
4173 report_return(start_color());
4178 cmd_subpad(int nargs
, char **args
)
4181 int lines
, cols
, begin_y
, begin_x
;
4183 if (check_arg_count(nargs
, 5) == 1)
4186 if (sscanf(args
[0], "%p", &pad
) == 0) {
4188 report_error("BAD ARGUMENT");
4192 if (sscanf(args
[1], "%d", &lines
) == 0) {
4194 report_error("BAD ARGUMENT");
4198 if (sscanf(args
[2], "%d", &cols
) == 0) {
4200 report_error("BAD ARGUMENT");
4204 if (sscanf(args
[3], "%d", &begin_y
) == 0) {
4206 report_error("BAD ARGUMENT");
4210 if (sscanf(args
[4], "%d", &begin_x
) == 0) {
4212 report_error("BAD ARGUMENT");
4217 report_ptr(subpad(pad
, lines
, cols
, begin_y
, begin_x
));
4222 cmd_subwin(int nargs
, char **args
)
4225 int lines
, cols
, begin_y
, begin_x
;
4227 if (check_arg_count(nargs
, 5) == 1)
4230 if (sscanf(args
[0], "%p", &win
) == 0) {
4232 report_error("BAD ARGUMENT");
4236 if (sscanf(args
[1], "%d", &lines
) == 0) {
4238 report_error("BAD ARGUMENT");
4242 if (sscanf(args
[2], "%d", &cols
) == 0) {
4244 report_error("BAD ARGUMENT");
4248 if (sscanf(args
[3], "%d", &begin_y
) == 0) {
4250 report_error("BAD ARGUMENT");
4254 if (sscanf(args
[4], "%d", &begin_x
) == 0) {
4256 report_error("BAD ARGUMENT");
4261 report_ptr(subwin(win
, lines
, cols
, begin_y
, begin_x
));
4266 cmd_termattrs(int nargs
, char **args
)
4268 if (check_arg_count(nargs
, 0) == 1)
4272 report_int(termattrs());
4277 cmd_term_attrs(int nargs
, char **args
)
4279 if (check_arg_count(nargs
, 0) == 1)
4283 report_int(term_attrs());
4288 cmd_touchline(int nargs
, char **args
)
4293 if (check_arg_count(nargs
, 3) == 1)
4296 if (sscanf(args
[0], "%p", &win
) == 0) {
4298 report_error("BAD ARGUMENT");
4302 if (sscanf(args
[1], "%d", &start
) == 0) {
4304 report_error("BAD ARGUMENT");
4308 if (sscanf(args
[2], "%d", &count
) == 0) {
4310 report_error("BAD ARGUMENT");
4315 report_return(touchline(win
, start
, count
));
4320 cmd_touchoverlap(int nargs
, char **args
)
4322 WINDOW
*win1
, *win2
;
4324 if (check_arg_count(nargs
, 2) == 1)
4327 if (sscanf(args
[0], "%p", &win1
) == 0) {
4329 report_error("BAD ARGUMENT");
4333 if (sscanf(args
[1], "%p", &win2
) == 0) {
4335 report_error("BAD ARGUMENT");
4340 report_return(touchoverlap(win1
, win2
));
4345 cmd_touchwin(int nargs
, char **args
)
4349 if (check_arg_count(nargs
, 1) == 1)
4352 if (sscanf(args
[0], "%p", &win
) == 0) {
4354 report_error("BAD ARGUMENT");
4359 report_return(touchwin(win
));
4364 cmd_ungetch(int nargs
, char **args
)
4368 if (check_arg_count(nargs
, 1) == 1)
4371 if (sscanf(args
[0], "%d", &ch
) == 0) {
4373 report_error("BAD ARGUMENT");
4378 report_return(ungetch(ch
));
4383 cmd_untouchwin(int nargs
, char **args
)
4387 if (check_arg_count(nargs
, 1) == 1)
4390 if (sscanf(args
[0], "%p", &win
) == 0) {
4392 report_error("BAD ARGUMENT");
4397 report_return(untouchwin(win
));
4402 cmd_use_default_colors(int nargs
, char **args
)
4404 if (check_arg_count(nargs
, 0) == 1)
4408 report_return(use_default_colors());
4413 cmd_vline(int nargs
, char **args
)
4418 if (check_arg_count(nargs
, 2) == 1)
4421 ch
= (chtype
*) args
[0];
4423 if (sscanf(args
[1], "%d", &count
) == 0) {
4425 report_error("BAD ARGUMENT");
4430 report_return(vline(ch
[0], count
));
4435 internal_vw_printw(WINDOW
*win
, char *arg1
, ...)
4441 rv
= vw_printw(win
, arg1
, va
);
4448 cmd_vw_printw(int nargs
, char **args
)
4452 if (check_arg_count(nargs
, 3) == 1)
4455 if (sscanf(args
[0], "%p", &win
) == 0) {
4457 report_error("BAD ARGUMENT");
4462 report_return(internal_vw_printw(win
, args
[1], args
[2]));
4467 internal_vw_scanw(WINDOW
*win
, char *arg1
, ...)
4473 rv
= vw_scanw(win
, arg1
, va
);
4480 cmd_vw_scanw(int nargs
, char **args
)
4485 if (check_arg_count(nargs
, 2) == 1)
4488 if (sscanf(args
[0], "%p", &win
) == 0) {
4490 report_error("BAD ARGUMENT");
4496 report_int(internal_vw_scanw(win
, args
[1], string
));
4497 report_status(string
);
4502 cmd_vwprintw(int nargs
, char **args
)
4504 cmd_vw_printw(nargs
, args
);
4509 cmd_vwscanw(int nargs
, char **args
)
4511 cmd_vw_scanw(nargs
, args
);
4516 cmd_waddch(int nargs
, char **args
)
4521 if (check_arg_count(nargs
, 2) == 1)
4524 if (sscanf(args
[0], "%p", &win
) == 0) {
4526 report_error("BAD ARGUMENT");
4530 ch
= (chtype
*) args
[1];
4533 report_return(waddch(win
, ch
[0]));
4538 cmd_waddchnstr(int nargs
, char **args
)
4543 if (check_arg_count(nargs
, 3) == 1)
4546 if (sscanf(args
[0], "%p", &win
) == 0) {
4548 report_error("BAD ARGUMENT");
4552 if (sscanf(args
[2], "%d", &count
) == 0) {
4554 report_error("BAD ARGUMENT");
4559 report_return(waddchnstr(win
, (chtype
*) args
[1], count
));
4564 cmd_waddchstr(int nargs
, char **args
)
4568 if (check_arg_count(nargs
, 2) == 1)
4571 if (sscanf(args
[0], "%p", &win
) == 0) {
4573 report_error("BAD ARGUMENT");
4578 report_return(waddchstr(win
, (chtype
*) args
[1]));
4583 cmd_waddnstr(int nargs
, char **args
)
4588 if (check_arg_count(nargs
, 1) == 3)
4591 if (sscanf(args
[0], "%p", &win
) == 0) {
4593 report_error("BAD ARGUMENT");
4597 if (sscanf(args
[2], "%d", &count
) == 0) {
4599 report_error("BAD ARGUMENT");
4604 report_return(waddnstr(win
, args
[1], count
));
4610 cmd_wattr_get(int nargs
, char **args
)
4616 if (check_arg_count(nargs
, 1) == 1)
4619 if (sscanf(args
[0], "%p", &win
) == 0) {
4621 report_error("BAD ARGUMENT");
4627 report_return(wattr_get(win
, &attr
, &pair
, NULL
));
4634 cmd_wattr_off(int nargs
, char **args
)
4639 if (check_arg_count(nargs
, 2) == 1)
4642 if (sscanf(args
[0], "%p", &win
) == 0) {
4644 report_error("BAD ARGUMENT");
4648 if (sscanf(args
[1], "%d", &attr
) == 0) {
4650 report_error("BAD ARGUMENT");
4655 report_return(wattr_off(win
, attr
, NULL
));
4660 cmd_wattr_on(int nargs
, char **args
)
4665 if (check_arg_count(nargs
, 2) == 1)
4668 if (sscanf(args
[0], "%p", &win
) == 0) {
4670 report_error("BAD ARGUMENT");
4674 if (sscanf(args
[1], "%d", &attr
) == 0) {
4676 report_error("BAD ARGUMENT");
4681 report_return(wattr_on(win
, attr
, NULL
));
4686 cmd_wattr_set(int nargs
, char **args
)
4692 if (check_arg_count(nargs
, 3) == 1)
4695 if (sscanf(args
[0], "%p", &win
) == 0) {
4697 report_error("BAD ARGUMENT");
4701 if (sscanf(args
[1], "%d", &attr
) == 0) {
4703 report_error("BAD ARGUMENT");
4707 if (sscanf(args
[2], "%hd", &pair
) == 0) {
4709 report_error("BAD ARGUMENT");
4714 report_return(wattr_set(win
, attr
, pair
, NULL
));
4719 cmd_wattroff(int nargs
, char **args
)
4724 if (check_arg_count(nargs
, 2) == 1)
4727 if (sscanf(args
[0], "%p", &win
) == 0) {
4729 report_error("BAD ARGUMENT");
4733 if (sscanf(args
[1], "%d", &attr
) == 0) {
4735 report_error("BAD ARGUMENT");
4740 report_return(wattroff(win
, attr
));
4745 cmd_wattron(int nargs
, char **args
)
4750 if (check_arg_count(nargs
, 2) == 1)
4753 if (sscanf(args
[0], "%p", &win
) == 0) {
4755 report_error("BAD ARGUMENT");
4759 if (sscanf(args
[1], "%d", &attr
) == 0) {
4761 report_error("BAD ARGUMENT");
4766 report_return(wattron(win
, attr
));
4771 cmd_wattrset(int nargs
, char **args
)
4776 if (check_arg_count(nargs
, 2) == 1)
4779 if (sscanf(args
[0], "%p", &win
) == 0) {
4781 report_error("BAD ARGUMENT");
4785 if (sscanf(args
[1], "%d", &attr
) == 0) {
4787 report_error("BAD ARGUMENT");
4792 report_return(wattrset(win
, attr
));
4797 cmd_wbkgd(int nargs
, char **args
)
4802 if (check_arg_count(nargs
, 2) == 1)
4805 if (sscanf(args
[0], "%p", &win
) == 0) {
4807 report_error("BAD ARGUMENT");
4811 ch
= (chtype
*) args
[1];
4813 report_return(wbkgd(win
, ch
[0]));
4818 cmd_wbkgdset(int nargs
, char **args
)
4823 if (check_arg_count(nargs
, 2) == 1)
4826 if (sscanf(args
[0], "%p", &win
) == 0) {
4828 report_error("BAD ARGUMENT");
4832 if (sscanf(args
[1], "%d", &ch
) == 0) {
4834 report_error("BAD ARGUMENT");
4838 wbkgdset(win
, ch
); /* void return */
4845 cmd_wborder(int nargs
, char **args
)
4848 int ls
, rs
, ts
, bs
, tl
, tr
, bl
, br
;
4850 if (check_arg_count(nargs
, 9) == 1)
4853 if (sscanf(args
[0], "%p", &win
) == 0) {
4855 report_error("BAD ARGUMENT");
4859 if (sscanf(args
[1], "%d", &ls
) == 0) {
4861 report_error("BAD ARGUMENT");
4865 if (sscanf(args
[2], "%d", &rs
) == 0) {
4867 report_error("BAD ARGUMENT");
4871 if (sscanf(args
[3], "%d", &ts
) == 0) {
4873 report_error("BAD ARGUMENT");
4877 if (sscanf(args
[4], "%d", &bs
) == 0) {
4879 report_error("BAD ARGUMENT");
4883 if (sscanf(args
[5], "%d", &tl
) == 0) {
4885 report_error("BAD ARGUMENT");
4889 if (sscanf(args
[6], "%d", &tr
) == 0) {
4891 report_error("BAD ARGUMENT");
4895 if (sscanf(args
[7], "%d", &bl
) == 0) {
4897 report_error("BAD ARGUMENT");
4901 if (sscanf(args
[8], "%d", &br
) == 0) {
4903 report_error("BAD ARGUMENT");
4908 report_return(wborder(win
, ls
, rs
, ts
, bs
, tl
, tr
, bl
, br
));
4913 cmd_wclear(int nargs
, char **args
)
4917 if (check_arg_count(nargs
, 1) == 1)
4920 if (sscanf(args
[0], "%p", &win
) == 0) {
4922 report_error("BAD ARGUMENT");
4927 report_return(wclear(win
));
4932 cmd_wclrtobot(int nargs
, char **args
)
4936 if (check_arg_count(nargs
, 1) == 1)
4939 if (sscanf(args
[0], "%p", &win
) == 0) {
4941 report_error("BAD ARGUMENT");
4946 report_return(wclrtobot(win
));
4951 cmd_wclrtoeol(int nargs
, char **args
)
4955 if (check_arg_count(nargs
, 1) == 1)
4958 if (sscanf(args
[0], "%p", &win
) == 0) {
4960 report_error("BAD ARGUMENT");
4965 report_return(wclrtoeol(win
));
4971 cmd_wcolor_set(int nargs
, char **args
)
4976 if (check_arg_count(nargs
, 2) == 1)
4979 if (sscanf(args
[0], "%p", &win
) == 0) {
4981 report_error("BAD ARGUMENT");
4985 if (sscanf(args
[1], "%hd", &pair
) == 0) {
4987 report_error("BAD ARGUMENT");
4992 report_return(wcolor_set(win
, pair
, NULL
));
4997 cmd_wdelch(int nargs
, char **args
)
5001 if (check_arg_count(nargs
, 1) == 1)
5004 if (sscanf(args
[0], "%p", &win
) == 0) {
5006 report_error("BAD ARGUMENT");
5011 report_return(wdelch(win
));
5016 cmd_wdeleteln(int nargs
, char **args
)
5020 if (check_arg_count(nargs
, 1) == 1)
5023 if (sscanf(args
[0], "%p", &win
) == 0) {
5025 report_error("BAD ARGUMENT");
5030 report_return(wdeleteln(win
));
5036 cmd_wechochar(int nargs
, char **args
)
5041 if (check_arg_count(nargs
, 2) == 1)
5044 if (sscanf(args
[0], "%p", &win
) == 0) {
5046 report_error("BAD ARGUMENT");
5050 if (sscanf(args
[1], "%d", &ch
) == 0) {
5052 report_error("BAD ARGUMENT");
5057 report_return(wechochar(win
, ch
));
5062 cmd_werase(int nargs
, char **args
)
5066 if (check_arg_count(nargs
, 1) == 1)
5069 if (sscanf(args
[0], "%p", &win
) == 0) {
5071 report_error("BAD ARGUMENT");
5076 report_return(werase(win
));
5081 cmd_wgetch(int nargs
, char **args
)
5085 if (check_arg_count(nargs
, 1) == 1)
5088 if (sscanf(args
[0], "%p", &win
) == 0) {
5090 report_error("BAD ARGUMENT");
5095 report_int(wgetch(win
));
5100 cmd_wgetnstr(int nargs
, char **args
)
5106 if (check_arg_count(nargs
, 2) == 1)
5109 if (sscanf(args
[0], "%p", &win
) == 0) {
5111 report_error("BAD ARGUMENT");
5115 if (sscanf(args
[1], "%d", &count
) == 0) {
5117 report_error("BAD ARGUMENT");
5123 report_return(wgetnstr(win
, string
, count
));
5124 report_status(string
);
5129 cmd_wgetstr(int nargs
, char **args
)
5135 if (check_arg_count(nargs
, 1) == 1)
5138 if (sscanf(args
[0], "%p", &win
) == 0) {
5140 report_error("BAD ARGUMENT");
5147 report_return(wgetstr(win
, string
));
5148 report_status(string
);
5153 cmd_whline(int nargs
, char **args
)
5158 if (check_arg_count(nargs
, 3) == 1)
5161 if (sscanf(args
[0], "%p", &win
) == 0) {
5163 report_error("BAD ARGUMENT");
5167 if (sscanf(args
[1], "%d", &ch
) == 0) {
5169 report_error("BAD ARGUMENT");
5173 if (sscanf(args
[2], "%d", &count
) == 0) {
5175 report_error("BAD ARGUMENT");
5180 report_return(whline(win
, ch
, count
));
5185 cmd_winch(int nargs
, char **args
)
5189 if (check_arg_count(nargs
, 1) == 1)
5192 if (sscanf(args
[0], "%p", &win
) == 0) {
5194 report_error("BAD ARGUMENT");
5199 report_int(winch(win
));
5204 cmd_winchnstr(int nargs
, char **args
)
5210 if (check_arg_count(nargs
, 2) == 1)
5213 if (sscanf(args
[0], "%p", &win
) == 0) {
5215 report_error("BAD ARGUMENT");
5219 if (sscanf(args
[1], "%d", &count
) == 0) {
5221 report_error("BAD ARGUMENT");
5227 report_return(winchnstr(win
, string
, count
));
5228 report_nstr(string
);
5233 cmd_winchstr(int nargs
, char **args
)
5238 if (check_arg_count(nargs
, 1) == 1)
5241 if (sscanf(args
[0], "%p", &win
) == 0) {
5243 report_error("BAD ARGUMENT");
5249 report_return(winchstr(win
, string
));
5250 report_nstr(string
);
5255 cmd_winnstr(int nargs
, char **args
)
5261 if (check_arg_count(nargs
, 2) == 1)
5264 if (sscanf(args
[0], "%p", &win
) == 0) {
5266 report_error("BAD ARGUMENT");
5270 if (sscanf(args
[1], "%d", &count
) == 0) {
5272 report_error("BAD ARGUMENT");
5278 report_return(winnstr(win
, string
, count
));
5279 report_status(string
);
5284 cmd_winsch(int nargs
, char **args
)
5289 if (check_arg_count(nargs
, 2) == 1)
5292 if (sscanf(args
[0], "%p", &win
) == 0) {
5294 report_error("BAD ARGUMENT");
5298 if (sscanf(args
[1], "%d", &ch
) == 0) {
5300 report_error("BAD ARGUMENT");
5305 report_return(winsch(win
, ch
));
5310 cmd_winsdelln(int nargs
, char **args
)
5315 if (check_arg_count(nargs
, 2) == 1)
5318 if (sscanf(args
[0], "%p", &win
) == 0) {
5320 report_error("BAD ARGUMENT");
5324 if (sscanf(args
[1], "%d", &count
) == 0) {
5326 report_error("BAD ARGUMENT");
5331 report_return(winsdelln(win
, count
));
5336 cmd_winsertln(int nargs
, char **args
)
5340 if (check_arg_count(nargs
, 1) == 1)
5343 if (sscanf(args
[0], "%p", &win
) == 0) {
5345 report_error("BAD ARGUMENT");
5350 report_return(winsertln(win
));
5355 cmd_winstr(int nargs
, char **args
)
5360 if (check_arg_count(nargs
, 1) == 1)
5363 if (sscanf(args
[0], "%p", &win
) == 0) {
5365 report_error("BAD ARGUMENT");
5371 report_return(winstr(win
, string
));
5372 report_status(string
);
5377 cmd_wmove(int nargs
, char **args
)
5382 if (check_arg_count(nargs
, 3) == 1)
5385 if (sscanf(args
[0], "%p", &win
) == 0) {
5387 report_error("BAD ARGUMENT");
5391 if (sscanf(args
[1], "%d", &y
) == 0) {
5393 report_error("BAD ARGUMENT");
5397 if (sscanf(args
[2], "%d", &x
) == 0) {
5399 report_error("BAD ARGUMENT");
5404 report_return(wmove(win
, y
, x
));
5409 cmd_wnoutrefresh(int nargs
, char **args
)
5413 if (check_arg_count(nargs
, 1) == 1)
5416 if (sscanf(args
[0], "%p", &win
) == 0) {
5418 report_error("BAD ARGUMENT");
5423 report_return(wnoutrefresh(win
));
5428 cmd_wprintw(int nargs
, char **args
)
5432 if (check_arg_count(nargs
, 3) == 1)
5435 if (sscanf(args
[0], "%p", &win
) == 0) {
5437 report_error("BAD ARGUMENT");
5442 report_return(wprintw(win
, args
[1], args
[2]));
5447 cmd_wredrawln(int nargs
, char **args
)
5450 int beg_line
, num_lines
;
5452 if (check_arg_count(nargs
, 3) == 1)
5455 if (sscanf(args
[0], "%p", &win
) == 0) {
5457 report_error("BAD ARGUMENT");
5461 if (sscanf(args
[1], "%d", &beg_line
) == 0) {
5463 report_error("BAD ARGUMENT");
5467 if (sscanf(args
[2], "%d", &num_lines
) == 0) {
5469 report_error("BAD ARGUMENT");
5474 report_return(wredrawln(win
, beg_line
, num_lines
));
5479 cmd_wrefresh(int nargs
, char **args
)
5483 if (check_arg_count(nargs
, 1) == 1)
5486 if (sscanf(args
[0], "%p", &win
) == 0) {
5488 report_error("BAD ARGUMENT");
5492 /* XXX - generates output */
5494 report_return(wrefresh(win
));
5499 cmd_wresize(int nargs
, char **args
)
5504 if (check_arg_count(nargs
, 3) == 1)
5507 if (sscanf(args
[0], "%p", &win
) == 0) {
5509 report_error("BAD ARGUMENT");
5513 if (sscanf(args
[1], "%d", &lines
) == 0) {
5515 report_error("BAD ARGUMENT");
5519 if (sscanf(args
[2], "%d", &cols
) == 0) {
5521 report_error("BAD ARGUMENT");
5526 report_return(wresize(win
, lines
, cols
));
5531 cmd_wscanw(int nargs
, char **args
)
5536 if (check_arg_count(nargs
, 2) == 1)
5539 if (sscanf(args
[0], "%p", &win
) == 0) {
5541 report_error("BAD ARGUMENT");
5546 report_return(wscanw(win
, args
[1], &string
));
5551 cmd_wscrl(int nargs
, char **args
)
5556 if (check_arg_count(nargs
, 2) == 1)
5559 if (sscanf(args
[0], "%p", &win
) == 0) {
5561 report_error("BAD ARGUMENT");
5565 if (sscanf(args
[1], "%d", &n
) == 0) {
5567 report_error("BAD ARGUMENT");
5572 report_return(wscrl(win
, n
));
5577 cmd_wsetscrreg(int nargs
, char **args
)
5582 if (check_arg_count(nargs
, 3) == 1)
5585 if (sscanf(args
[0], "%p", &win
) == 0) {
5587 report_error("BAD ARGUMENT");
5591 if (sscanf(args
[1], "%d", &top
) == 0) {
5593 report_error("BAD ARGUMENT");
5597 if (sscanf(args
[2], "%d", &bottom
) == 0) {
5599 report_error("BAD ARGUMENT");
5604 report_return(wsetscrreg(win
, top
, bottom
));
5609 cmd_wstandend(int nargs
, char **args
)
5613 if (check_arg_count(nargs
, 1) == 1)
5616 if (sscanf(args
[0], "%p", &win
) == 0) {
5618 report_error("BAD ARGUMENT");
5623 report_return(wstandend(win
));
5628 cmd_wstandout(int nargs
, char **args
)
5632 if (check_arg_count(nargs
, 1) == 1)
5635 if (sscanf(args
[0], "%p", &win
) == 0) {
5637 report_error("BAD ARGUMENT");
5642 report_return(wstandout(win
));
5647 cmd_wtimeout(int nargs
, char **args
)
5652 if (check_arg_count(nargs
, 2) == 1)
5655 if (sscanf(args
[0], "%p", &win
) == 0) {
5657 report_error("BAD ARGUMENT");
5661 if (sscanf(args
[1], "%d", &tval
) == 0) {
5663 report_error("BAD ARGUMENT");
5667 wtimeout(win
, tval
); /* void return */
5674 cmd_wtouchln(int nargs
, char **args
)
5677 int line
, n
, changed
;
5679 if (check_arg_count(nargs
, 4) == 1)
5682 if (sscanf(args
[0], "%p", &win
) == 0) {
5684 report_error("BAD ARGUMENT");
5688 if (sscanf(args
[1], "%d", &line
) == 0) {
5690 report_error("BAD ARGUMENT");
5694 if (sscanf(args
[2], "%d", &n
) == 0) {
5696 report_error("BAD ARGUMENT");
5700 if (sscanf(args
[3], "%d", &changed
) == 0) {
5702 report_error("BAD ARGUMENT");
5707 report_return(wtouchln(win
, line
, n
, changed
));
5712 cmd_wunderend(int nargs
, char **args
)
5716 if (check_arg_count(nargs
, 1) == 1)
5719 if (sscanf(args
[0], "%p", &win
) == 0) {
5721 report_error("BAD ARGUMENT");
5726 report_return(wunderend(win
));
5731 cmd_wunderscore(int nargs
, char **args
)
5735 if (check_arg_count(nargs
, 1) == 1)
5738 if (sscanf(args
[0], "%p", &win
) == 0) {
5740 report_error("BAD ARGUMENT");
5745 report_return(wunderscore(win
));
5750 cmd_wvline(int nargs
, char **args
)
5756 if (check_arg_count(nargs
, 3) == 1)
5759 if (sscanf(args
[0], "%p", &win
) == 0) {
5761 report_error("BAD ARGUMENT");
5765 ch
= (chtype
*) args
[1];
5767 if (sscanf(args
[2], "%d", &n
) == 0) {
5769 report_error("BAD ARGUMENT");
5774 report_return(wvline(win
, ch
[0], n
));
5779 cmd_insnstr(int nargs
, char **args
)
5783 if (check_arg_count(nargs
, 2) == 1)
5786 if (sscanf(args
[1], "%d", &n
) == 0) {
5788 report_error("BAD ARGUMENT");
5793 report_return(insnstr(args
[0], n
));
5798 cmd_insstr(int nargs
, char **args
)
5800 if (check_arg_count(nargs
, 1) == 1)
5804 report_return(insstr(args
[0]));
5809 cmd_mvinsnstr(int nargs
, char **args
)
5813 if (check_arg_count(nargs
, 4) == 1)
5816 if (sscanf(args
[0], "%d", &y
) == 0) {
5818 report_error("BAD ARGUMENT");
5822 if (sscanf(args
[1], "%d", &x
) == 0) {
5824 report_error("BAD ARGUMENT");
5828 if (sscanf(args
[3], "%d", &n
) == 0) {
5830 report_error("BAD ARGUMENT");
5835 report_return(mvinsnstr(y
, x
, args
[2], n
));
5840 cmd_mvinsstr(int nargs
, char **args
)
5844 if (check_arg_count(nargs
, 3) == 1)
5847 if (sscanf(args
[0], "%d", &y
) == 0) {
5849 report_error("BAD ARGUMENT");
5853 if (sscanf(args
[1], "%d", &x
) == 0) {
5855 report_error("BAD ARGUMENT");
5860 report_return(mvinsstr(y
, x
, args
[2]));
5865 cmd_mvwinsnstr(int nargs
, char **args
)
5870 if (check_arg_count(nargs
, 5) == 1)
5873 if (sscanf(args
[0], "%p", &win
) == 0) {
5875 report_error("BAD ARGUMENT");
5879 if (sscanf(args
[1], "%d", &y
) == 0) {
5881 report_error("BAD ARGUMENT");
5885 if (sscanf(args
[2], "%d", &x
) == 0) {
5887 report_error("BAD ARGUMENT");
5891 if (sscanf(args
[4], "%d", &n
) == 0) {
5893 report_error("BAD ARGUMENT");
5898 report_return(mvwinsnstr(win
, y
, x
, args
[3], n
));
5904 cmd_mvwinsstr(int nargs
, char **args
)
5909 if (check_arg_count(nargs
, 4) == 1)
5912 if (sscanf(args
[0], "%p", &win
) == 0) {
5914 report_error("BAD ARGUMENT");
5918 if (sscanf(args
[1], "%d", &y
) == 0) {
5920 report_error("BAD ARGUMENT");
5924 if (sscanf(args
[2], "%d", &x
) == 0) {
5926 report_error("BAD ARGUMENT");
5931 report_return(mvwinsstr(win
, y
, x
, args
[3]));
5936 cmd_winsnstr(int nargs
, char **args
)
5941 if (check_arg_count(nargs
, 3) == 1)
5944 if (sscanf(args
[0], "%p", &win
) == 0) {
5946 report_error("BAD ARGUMENT");
5950 if (sscanf(args
[2], "%d", &n
) == 0) {
5952 report_error("BAD ARGUMENT");
5957 report_return(winsnstr(win
, args
[1], n
));
5962 cmd_winsstr(int nargs
, char **args
)
5966 if (check_arg_count(nargs
, 2) == 1)
5969 if (sscanf(args
[0], "%p", &win
) == 0) {
5971 report_error("BAD ARGUMENT");
5976 report_return(winsstr(win
, args
[1]));
5982 cmd_chgat(int nargs
, char **args
)
5984 int n
, attr
, colour
;
5986 if (check_arg_count(nargs
, 4) == 1)
5989 if (sscanf(args
[0], "%d", &n
) == 0) {
5991 report_error("BAD ARGUMENT");
5995 if (sscanf(args
[1], "%d", &attr
) == 0) {
5997 report_error("BAD ARGUMENT");
6001 if (sscanf(args
[2], "%d", &colour
) == 0) {
6003 report_error("BAD ARGUMENT");
6007 /* Note: 4th argument unused in current curses implementation */
6009 report_return(chgat(n
, attr
, colour
, NULL
));
6014 cmd_wchgat(int nargs
, char **args
)
6020 if (check_arg_count(nargs
, 4) == 1)
6023 if (sscanf(args
[0], "%p", &win
) == 0) {
6025 report_error("BAD ARGUMENT");
6029 if (sscanf(args
[1], "%d", &n
) == 0) {
6031 report_error("BAD ARGUMENT");
6035 if (sscanf(args
[2], "%d", &attr
) == 0) {
6037 report_error("BAD ARGUMENT");
6041 if (sscanf(args
[3], "%hd", &colour
) == 0) {
6043 report_error("BAD ARGUMENT");
6048 report_return(wchgat(win
, n
, attr
, colour
, NULL
));
6053 cmd_mvchgat(int nargs
, char **args
)
6058 if (check_arg_count(nargs
, 6) == 1)
6061 if (sscanf(args
[0], "%d", &y
) == 0) {
6063 report_error("BAD ARGUMENT");
6067 if (sscanf(args
[1], "%d", &x
) == 0) {
6069 report_error("BAD ARGUMENT");
6073 if (sscanf(args
[2], "%d", &n
) == 0) {
6075 report_error("BAD ARGUMENT");
6079 if (sscanf(args
[3], "%d", &attr
) == 0) {
6081 report_error("BAD ARGUMENT");
6085 if (sscanf(args
[4], "%hd", &colour
) == 0) {
6087 report_error("BAD ARGUMENT");
6092 report_return(mvchgat(y
, x
, n
, attr
, colour
, NULL
));
6097 cmd_mvwchgat(int nargs
, char **args
)
6100 int y
, x
, n
, attr
, colour
;
6102 if (check_arg_count(nargs
, 6) == 1)
6105 if (sscanf(args
[0], "%p", &win
) == 0) {
6107 report_error("BAD ARGUMENT");
6111 if (sscanf(args
[1], "%d", &y
) == 0) {
6113 report_error("BAD ARGUMENT");
6117 if (sscanf(args
[2], "%d", &x
) == 0) {
6119 report_error("BAD ARGUMENT");
6123 if (sscanf(args
[3], "%d", &n
) == 0) {
6125 report_error("BAD ARGUMENT");
6129 if (sscanf(args
[4], "%d", &attr
) == 0) {
6131 report_error("BAD ARGUMENT");
6135 if (sscanf(args
[5], "%d", &colour
) == 0) {
6137 report_error("BAD ARGUMENT");
6142 report_return(mvwchgat(win
, y
, x
, n
, attr
, colour
, NULL
));
6147 cmd_add_wch(int nargs
, char **args
)
6149 if (check_arg_count(nargs
, 1) == 1)
6153 report_error("UNSUPPORTED");
6158 cmd_wadd_wch(int nargs
, char **args
)
6160 if (check_arg_count(nargs
, 1) == 1)
6164 report_error("UNSUPPORTED");
6169 cmd_mvadd_wch(int nargs
, char **args
)
6171 if (check_arg_count(nargs
, 1) == 1)
6175 report_error("UNSUPPORTED");
6180 cmd_mvwadd_wch(int nargs
, char **args
)
6182 if (check_arg_count(nargs
, 1) == 1)
6186 report_error("UNSUPPORTED");
6192 cmd_add_wchnstr(int nargs
, char **args
)
6194 if (check_arg_count(nargs
, 1) == 1)
6198 report_error("UNSUPPORTED");
6203 cmd_add_wchstr(int nargs
, char **args
)
6205 if (check_arg_count(nargs
, 1) == 1)
6209 report_error("UNSUPPORTED");
6214 cmd_wadd_wchnstr(int nargs
, char **args
)
6216 if (check_arg_count(nargs
, 1) == 1)
6220 report_error("UNSUPPORTED");
6225 cmd_wadd_wchstr(int nargs
, char **args
)
6227 if (check_arg_count(nargs
, 1) == 1)
6231 report_error("UNSUPPORTED");
6236 cmd_mvadd_wchnstr(int nargs
, char **args
)
6238 if (check_arg_count(nargs
, 1) == 1)
6242 report_error("UNSUPPORTED");
6247 cmd_mvadd_wchstr(int nargs
, char **args
)
6249 if (check_arg_count(nargs
, 1) == 1)
6253 report_error("UNSUPPORTED");
6258 cmd_mvwadd_wchnstr(int nargs
, char **args
)
6260 if (check_arg_count(nargs
, 1) == 1)
6264 report_error("UNSUPPORTED");
6269 cmd_mvwadd_wchstr(int nargs
, char **args
)
6271 if (check_arg_count(nargs
, 1) == 1)
6275 report_error("UNSUPPORTED");
6281 cmd_addnwstr(int nargs
, char **args
)
6283 if (check_arg_count(nargs
, 1) == 1)
6287 report_error("UNSUPPORTED");
6292 cmd_addwstr(int nargs
, char **args
)
6294 if (check_arg_count(nargs
, 1) == 1)
6298 report_error("UNSUPPORTED");
6303 cmd_mvaddnwstr(int nargs
, char **args
)
6305 if (check_arg_count(nargs
, 1) == 1)
6309 report_error("UNSUPPORTED");
6314 cmd_mvaddwstr(int nargs
, char **args
)
6316 if (check_arg_count(nargs
, 1) == 1)
6320 report_error("UNSUPPORTED");
6325 cmd_mvwaddnwstr(int nargs
, char **args
)
6327 if (check_arg_count(nargs
, 1) == 1)
6331 report_error("UNSUPPORTED");
6336 cmd_mvwaddwstr(int nargs
, char **args
)
6338 if (check_arg_count(nargs
, 1) == 1)
6342 report_error("UNSUPPORTED");
6347 cmd_waddnwstr(int nargs
, char **args
)
6349 if (check_arg_count(nargs
, 1) == 1)
6353 report_error("UNSUPPORTED");
6358 cmd_waddwstr(int nargs
, char **args
)
6360 if (check_arg_count(nargs
, 1) == 1)
6364 report_error("UNSUPPORTED");
6370 cmd_echo_wchar(int nargs
, char **args
)
6372 if (check_arg_count(nargs
, 1) == 1)
6376 report_error("UNSUPPORTED");
6381 cmd_wecho_wchar(int nargs
, char **args
)
6383 if (check_arg_count(nargs
, 1) == 1)
6387 report_error("UNSUPPORTED");
6392 cmd_pecho_wchar(int nargs
, char **args
)
6394 if (check_arg_count(nargs
, 1) == 1)
6398 report_error("UNSUPPORTED");
6405 cmd_ins_wch(int nargs
, char **args
)
6407 if (check_arg_count(nargs
, 1) == 1)
6411 report_error("UNSUPPORTED");
6416 cmd_wins_wch(int nargs
, char **args
)
6418 if (check_arg_count(nargs
, 1) == 1)
6422 report_error("UNSUPPORTED");
6427 cmd_mvins_wch(int nargs
, char **args
)
6429 if (check_arg_count(nargs
, 1) == 1)
6433 report_error("UNSUPPORTED");
6438 cmd_mvwins_wch(int nargs
, char **args
)
6440 if (check_arg_count(nargs
, 1) == 1)
6444 report_error("UNSUPPORTED");
6450 cmd_ins_nwstr(int nargs
, char **args
)
6452 if (check_arg_count(nargs
, 1) == 1)
6456 report_error("UNSUPPORTED");
6461 cmd_ins_wstr(int nargs
, char **args
)
6463 if (check_arg_count(nargs
, 1) == 1)
6467 report_error("UNSUPPORTED");
6472 cmd_mvins_nwstr(int nargs
, char **args
)
6474 if (check_arg_count(nargs
, 1) == 1)
6478 report_error("UNSUPPORTED");
6483 cmd_mvins_wstr(int nargs
, char **args
)
6485 if (check_arg_count(nargs
, 1) == 1)
6489 report_error("UNSUPPORTED");
6494 cmd_mvwins_nwstr(int nargs
, char **args
)
6496 if (check_arg_count(nargs
, 1) == 1)
6500 report_error("UNSUPPORTED");
6505 cmd_mvwins_wstr(int nargs
, char **args
)
6507 if (check_arg_count(nargs
, 1) == 1)
6511 report_error("UNSUPPORTED");
6516 cmd_wins_nwstr(int nargs
, char **args
)
6518 if (check_arg_count(nargs
, 1) == 1)
6522 report_error("UNSUPPORTED");
6527 cmd_wins_wstr(int nargs
, char **args
)
6529 if (check_arg_count(nargs
, 1) == 1)
6533 report_error("UNSUPPORTED");
6540 cmd_get_wch(int nargs
, char **args
)
6542 if (check_arg_count(nargs
, 1) == 1)
6546 report_error("UNSUPPORTED");
6551 cmd_unget_wch(int nargs
, char **args
)
6553 if (check_arg_count(nargs
, 1) == 1)
6557 report_error("UNSUPPORTED");
6562 cmd_mvget_wch(int nargs
, char **args
)
6564 if (check_arg_count(nargs
, 1) == 1)
6568 report_error("UNSUPPORTED");
6573 cmd_mvwget_wch(int nargs
, char **args
)
6575 if (check_arg_count(nargs
, 1) == 1)
6579 report_error("UNSUPPORTED");
6584 cmd_wget_wch(int nargs
, char **args
)
6586 if (check_arg_count(nargs
, 1) == 1)
6590 report_error("UNSUPPORTED");
6596 cmd_getn_wstr(int nargs
, char **args
)
6598 if (check_arg_count(nargs
, 1) == 1)
6602 report_error("UNSUPPORTED");
6607 cmd_get_wstr(int nargs
, char **args
)
6609 if (check_arg_count(nargs
, 1) == 1)
6613 report_error("UNSUPPORTED");
6618 cmd_mvgetn_wstr(int nargs
, char **args
)
6620 if (check_arg_count(nargs
, 1) == 1)
6624 report_error("UNSUPPORTED");
6629 cmd_mvget_wstr(int nargs
, char **args
)
6631 if (check_arg_count(nargs
, 1) == 1)
6635 report_error("UNSUPPORTED");
6640 cmd_mvwgetn_wstr(int nargs
, char **args
)
6642 if (check_arg_count(nargs
, 1) == 1)
6646 report_error("UNSUPPORTED");
6651 cmd_mvwget_wstr(int nargs
, char **args
)
6653 if (check_arg_count(nargs
, 1) == 1)
6657 report_error("UNSUPPORTED");
6662 cmd_wgetn_wstr(int nargs
, char **args
)
6664 if (check_arg_count(nargs
, 1) == 1)
6668 report_error("UNSUPPORTED");
6673 cmd_wget_wstr(int nargs
, char **args
)
6675 if (check_arg_count(nargs
, 1) == 1)
6679 report_error("UNSUPPORTED");
6685 cmd_in_wch(int nargs
, char **args
)
6687 if (check_arg_count(nargs
, 1) == 1)
6691 report_error("UNSUPPORTED");
6696 cmd_mvin_wch(int nargs
, char **args
)
6698 if (check_arg_count(nargs
, 1) == 1)
6702 report_error("UNSUPPORTED");
6707 cmd_mvwin_wch(int nargs
, char **args
)
6709 if (check_arg_count(nargs
, 1) == 1)
6713 report_error("UNSUPPORTED");
6718 cmd_win_wch(int nargs
, char **args
)
6720 if (check_arg_count(nargs
, 1) == 1)
6724 report_error("UNSUPPORTED");
6730 cmd_in_wchnstr(int nargs
, char **args
)
6732 if (check_arg_count(nargs
, 1) == 1)
6736 report_error("UNSUPPORTED");
6741 cmd_in_wchstr(int nargs
, char **args
)
6743 if (check_arg_count(nargs
, 1) == 1)
6747 report_error("UNSUPPORTED");
6752 cmd_mvin_wchnstr(int nargs
, char **args
)
6754 if (check_arg_count(nargs
, 1) == 1)
6758 report_error("UNSUPPORTED");
6763 cmd_mvin_wchstr(int nargs
, char **args
)
6765 if (check_arg_count(nargs
, 1) == 1)
6769 report_error("UNSUPPORTED");
6774 cmd_mvwin_wchnstr(int nargs
, char **args
)
6776 if (check_arg_count(nargs
, 1) == 1)
6780 report_error("UNSUPPORTED");
6785 cmd_mvwin_wchstr(int nargs
, char **args
)
6787 if (check_arg_count(nargs
, 1) == 1)
6791 report_error("UNSUPPORTED");
6796 cmd_win_wchnstr(int nargs
, char **args
)
6798 if (check_arg_count(nargs
, 1) == 1)
6802 report_error("UNSUPPORTED");
6807 cmd_win_wchstr(int nargs
, char **args
)
6809 if (check_arg_count(nargs
, 1) == 1)
6813 report_error("UNSUPPORTED");
6819 cmd_innwstr(int nargs
, char **args
)
6821 if (check_arg_count(nargs
, 1) == 1)
6825 report_error("UNSUPPORTED");
6830 cmd_inwstr(int nargs
, char **args
)
6832 if (check_arg_count(nargs
, 1) == 1)
6836 report_error("UNSUPPORTED");
6841 cmd_mvinnwstr(int nargs
, char **args
)
6843 if (check_arg_count(nargs
, 1) == 1)
6847 report_error("UNSUPPORTED");
6852 cmd_mvinwstr(int nargs
, char **args
)
6854 if (check_arg_count(nargs
, 1) == 1)
6858 report_error("UNSUPPORTED");
6863 cmd_mvwinnwstr(int nargs
, char **args
)
6865 if (check_arg_count(nargs
, 1) == 1)
6869 report_error("UNSUPPORTED");
6874 cmd_mvwinwstr(int nargs
, char **args
)
6876 if (check_arg_count(nargs
, 1) == 1)
6880 report_error("UNSUPPORTED");
6885 cmd_winnwstr(int nargs
, char **args
)
6887 if (check_arg_count(nargs
, 1) == 1)
6891 report_error("UNSUPPORTED");
6896 cmd_winwstr(int nargs
, char **args
)
6898 if (check_arg_count(nargs
, 1) == 1)
6902 report_error("UNSUPPORTED");
6907 /* cchar handlgin */
6909 cmd_setcchar(int nargs
, char **args
)
6911 if (check_arg_count(nargs
, 1) == 1)
6915 report_error("UNSUPPORTED");
6920 cmd_getcchar(int nargs
, char **args
)
6922 if (check_arg_count(nargs
, 1) == 1)
6926 report_error("UNSUPPORTED");
6933 cmd_key_name(int nargs
, char **args
)
6937 if (check_arg_count(nargs
, 1) == 1)
6940 if (sscanf(args
[0], "%d", &w
) == 0) {
6942 report_error("BAD ARGUMENT");
6947 report_status(key_name(w
));
6952 cmd_border_set(int nargs
, char **args
)
6954 if (check_arg_count(nargs
, 1) == 1)
6958 report_error("UNSUPPORTED");
6963 cmd_wborder_set(int nargs
, char **args
)
6965 if (check_arg_count(nargs
, 1) == 1)
6969 report_error("UNSUPPORTED");
6974 cmd_box_set(int nargs
, char **args
)
6976 if (check_arg_count(nargs
, 1) == 1)
6980 report_error("UNSUPPORTED");
6985 cmd_erasewchar(int nargs
, char **args
)
6989 if (check_arg_count(nargs
, 0) == 1)
6994 report_return(erasewchar(&ch
));
7000 cmd_killwchar(int nargs
, char **args
)
7004 if (check_arg_count(nargs
, 0) == 1)
7009 report_return(erasewchar(&ch
));
7015 cmd_hline_set(int nargs
, char **args
)
7017 if (check_arg_count(nargs
, 1) == 1)
7021 report_error("UNSUPPORTED");
7026 cmd_mvhline_set(int nargs
, char **args
)
7028 if (check_arg_count(nargs
, 1) == 1)
7032 report_error("UNSUPPORTED");
7037 cmd_mvvline_set(int nargs
, char **args
)
7039 if (check_arg_count(nargs
, 1) == 1)
7043 report_error("UNSUPPORTED");
7048 cmd_mvwhline_set(int nargs
, char **args
)
7050 if (check_arg_count(nargs
, 1) == 1)
7054 report_error("UNSUPPORTED");
7059 cmd_mvwvline_set(int nargs
, char **args
)
7061 if (check_arg_count(nargs
, 1) == 1)
7065 report_error("UNSUPPORTED");
7070 cmd_vline_set(int nargs
, char **args
)
7072 if (check_arg_count(nargs
, 1) == 1)
7076 report_error("UNSUPPORTED");
7081 cmd_whline_set(int nargs
, char **args
)
7083 if (check_arg_count(nargs
, 1) == 1)
7087 report_error("UNSUPPORTED");
7092 cmd_wvline_set(int nargs
, char **args
)
7094 if (check_arg_count(nargs
, 1) == 1)
7098 report_error("UNSUPPORTED");
7103 cmd_bkgrnd(int nargs
, char **args
)
7105 if (check_arg_count(nargs
, 1) == 1)
7109 report_error("UNSUPPORTED");
7114 cmd_bkgrndset(int nargs
, char **args
)
7116 if (check_arg_count(nargs
, 1) == 1)
7120 report_error("UNSUPPORTED");
7125 cmd_getbkgrnd(int nargs
, char **args
)
7127 if (check_arg_count(nargs
, 1) == 1)
7131 report_error("UNSUPPORTED");
7136 cmd_wbkgrnd(int nargs
, char **args
)
7138 if (check_arg_count(nargs
, 1) == 1)
7142 report_error("UNSUPPORTED");
7147 cmd_wbkgrndset(int nargs
, char **args
)
7149 if (check_arg_count(nargs
, 1) == 1)
7153 report_error("UNSUPPORTED");
7158 cmd_wgetbkgrnd(int nargs
, char **args
)
7160 if (check_arg_count(nargs
, 1) == 1)
7164 report_error("UNSUPPORTED");