etc/protocols - sync with NetBSD-8
[minix.git] / tests / lib / libcurses / slave / curses_commands.c
blob9a6679aa1114e6e3e483e3de86817c3efa77197a
1 /* $NetBSD: curses_commands.c,v 1.7 2012/09/19 11:51:08 blymn Exp $ */
3 /*-
4 * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
6 * All rights reserved.
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
12 * are met:
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.
32 #include <curses.h>
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
36 #include <termios.h>
37 #include <stdarg.h>
39 #include "slave.h"
40 #include "curses_commands.h"
42 void
43 cmd_DRAIN(int nargs, char **args)
45 while (getch() != ERR);
46 report_count(1);
47 report_return(OK);
50 void
51 cmd_addbytes(int nargs, char **args)
53 int count;
55 if (check_arg_count(nargs, 2) == 1)
56 return;
58 if (sscanf(args[1], "%d", &count) == 0) {
59 report_count(1);
60 report_error("BAD ARGUMENT");
61 return;
64 report_count(1);
65 report_return(addbytes(args[0], count));
69 void
70 cmd_addch(int nargs, char **args)
72 chtype *ch;
74 if (check_arg_count(nargs, 1) == 1)
75 return;
77 ch = (chtype *) args[0];
78 report_count(1);
79 report_return(addch(ch[0]));
83 void
84 cmd_addchnstr(int nargs, char **args)
86 int count;
88 if (check_arg_count(nargs, 2) == 1)
89 return;
91 if (sscanf(args[1], "%d", &count) == 0) {
92 report_count(1);
93 report_error("BAD ARGUMENT");
94 return;
97 report_count(1);
98 report_return(addchnstr((chtype *) args[0], count));
102 void
103 cmd_addchstr(int nargs, char **args)
105 if (check_arg_count(nargs, 1) == 1)
106 return;
108 report_count(1);
109 report_return(addchstr((chtype *) args[0]));
113 void
114 cmd_addnstr(int nargs, char **args)
116 int count;
118 if (check_arg_count(nargs, 2) == 1)
119 return;
121 if (sscanf(args[1], "%d", &count) == 0) {
122 report_count(1);
123 report_error("BAD ARGUMENT");
124 return;
127 report_count(1);
128 report_return(addnstr(args[0], count));
132 void
133 cmd_addstr(int nargs, char **args)
135 if (check_arg_count(nargs, 1) == 1)
136 return;
138 report_count(1);
139 report_return(addstr(args[0]));
143 void
144 cmd_attr_get(int nargs, char **args)
146 attr_t attrs;
147 short colours;
148 int retval;
150 if (check_arg_count(nargs, 0) == 1)
151 return;
153 retval = attr_get(&attrs, &colours, NULL);
155 /* XXXX - call3 */
156 report_count(3);
157 report_return(retval);
158 report_int(attrs);
159 report_int(colours);
163 void
164 cmd_attr_off(int nargs, char **args)
166 int attrib;
168 if (check_arg_count(nargs, 1) == 1)
169 return;
171 if (sscanf(args[0], "%d", &attrib) == 0) {
172 report_count(1);
173 report_error("BAD ARGUMENT");
174 return;
177 report_count(1);
178 report_return(attr_off(attrib, NULL));
182 void
183 cmd_attr_on(int nargs, char **args)
185 int attrib;
187 if (check_arg_count(nargs, 1) == 1)
188 return;
190 if (sscanf(args[0], "%d", &attrib) == 0) {
191 report_count(1);
192 report_error("BAD ARGUMENT");
193 return;
196 report_count(1);
197 report_return(attr_on(attrib, NULL));
201 void
202 cmd_attr_set(int nargs, char **args)
204 int attrib;
205 short pair;
207 if (check_arg_count(nargs, 2) == 1)
208 return;
210 if (sscanf(args[0], "%d", &attrib) == 0) {
211 report_count(1);
212 report_error("BAD ARGUMENT");
213 return;
216 if (sscanf(args[1], "%hd", &pair) == 0) {
217 report_count(1);
218 report_error("BAD ARGUMENT");
219 return;
222 report_count(1);
223 report_return(attr_set(attrib, pair, NULL));
227 void
228 cmd_attroff(int nargs, char **args)
230 int attrib;
232 if (check_arg_count(nargs, 1) == 1)
233 return;
235 if (sscanf(args[0], "%d", &attrib) == 0) {
236 report_count(1);
237 report_error("BAD ARGUMENT");
238 return;
241 report_count(1);
242 report_return(attroff(attrib));
246 void
247 cmd_attron(int nargs, char **args)
249 int attrib;
251 if (check_arg_count(nargs, 1) == 1)
252 return;
254 if (sscanf(args[0], "%d", &attrib) == 0) {
255 report_count(1);
256 report_error("BAD ARGUMENT");
257 return;
260 report_count(1);
261 report_return(attron(attrib));
265 void
266 cmd_attrset(int nargs, char **args)
268 int attrib;
270 if (check_arg_count(nargs, 1) == 1)
271 return;
273 if (sscanf(args[0], "%d", &attrib) == 0) {
274 report_count(1);
275 report_error("BAD ARGUMENT");
276 return;
279 report_count(1);
280 report_return(attrset(attrib));
284 void
285 cmd_bkgd(int nargs, char **args)
287 chtype *ch;
289 if (check_arg_count(nargs, 1) == 1)
290 return;
292 ch = (chtype *) args[0];
293 report_count(1);
294 report_return(bkgd(ch[0]));
298 void
299 cmd_bkgdset(int nargs, char **args)
301 chtype *ch;
303 if (check_arg_count(nargs, 1) == 1)
304 return;
306 ch = (chtype *) args[0];
307 bkgdset(ch[0]); /* returns void */
308 report_count(1);
309 report_return(OK);
313 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)
319 return;
321 if (sscanf(args[0], "%d", &ls) == 0) {
322 report_count(1);
323 report_error("BAD ARGUMENT");
324 return;
326 if (sscanf(args[1], "%d", &rs) == 0) {
327 report_count(1);
328 report_error("BAD ARGUMENT");
329 return;
331 if (sscanf(args[2], "%d", &ts) == 0) {
332 report_count(1);
333 report_error("BAD ARGUMENT");
334 return;
336 if (sscanf(args[3], "%d", &bs) == 0) {
337 report_count(1);
338 report_error("BAD ARGUMENT");
339 return;
341 if (sscanf(args[4], "%d", &tl) == 0) {
342 report_count(1);
343 report_error("BAD ARGUMENT");
344 return;
346 if (sscanf(args[5], "%d", &tr) == 0) {
347 report_count(1);
348 report_error("BAD ARGUMENT");
349 return;
351 if (sscanf(args[6], "%d", &bl) == 0) {
352 report_count(1);
353 report_error("BAD ARGUMENT");
354 return;
356 if (sscanf(args[7], "%d", &br) == 0) {
357 report_count(1);
358 report_error("BAD ARGUMENT");
359 return;
362 report_count(1);
363 report_return(border(ls, rs, ts, bs, tl, tr, bl, br));
367 void
368 cmd_clear(int nargs, char **args)
370 if (check_arg_count(nargs, 0) == 1)
371 return;
373 report_count(1);
374 report_return(clear());
378 void
379 cmd_clrtobot(int nargs, char **args)
381 if (check_arg_count(nargs, 0) == 1)
382 return;
384 report_count(1);
385 report_return(clrtobot());
389 void
390 cmd_clrtoeol(int nargs, char **args)
392 if (check_arg_count(nargs, 0) == 1)
393 return;
395 report_count(1);
396 report_return(clrtoeol());
400 void
401 cmd_color_set(int nargs, char **args)
403 short colour_pair;
405 if (check_arg_count(nargs, 2) == 1)
406 return;
408 if (sscanf(args[0], "%hd", &colour_pair) == 0) {
409 report_count(1);
410 report_error("BAD ARGUMENT");
411 return;
414 report_count(1);
415 report_return(color_set(colour_pair, NULL));
419 void
420 cmd_delch(int nargs, char **args)
422 if (check_arg_count(nargs, 0) == 1)
423 return;
425 report_count(1);
426 report_return(delch());
430 void
431 cmd_deleteln(int nargs, char **args)
433 if (check_arg_count(nargs, 0) == 1)
434 return;
436 report_count(1);
437 report_return(deleteln());
441 void
442 cmd_echochar(int nargs, char **args)
444 if (check_arg_count(nargs, 1) == 1)
445 return;
447 /* XXX causes refresh */
448 report_count(1);
449 report_return(echochar(args[0][0]));
453 void
454 cmd_erase(int nargs, char **args)
456 if (check_arg_count(nargs, 0) == 1)
457 return;
459 report_count(1);
460 report_return(erase());
464 void
465 cmd_getch(int nargs, char **args)
467 if (check_arg_count(nargs, 0) == 1)
468 return;
470 /* XXX causes refresh */
471 report_count(1);
472 report_int(getch());
476 void
477 cmd_getnstr(int nargs, char **args)
479 int limit;
480 char *string;
482 if (check_arg_count(nargs, 1) == 1)
483 return;
485 if (sscanf(args[0], "%d", &limit) == 0) {
486 report_count(1);
487 report_error("BAD ARGUMENT");
488 return;
491 if ((string = malloc(limit + 1)) == NULL) {
492 report_count(1);
493 report_error("MALLOC_FAILED");
494 return;
497 /* XXX call2 */
498 report_count(2);
499 report_return(getnstr(string, limit));
500 report_status(string);
501 free(string);
505 void
506 cmd_getstr(int nargs, char **args)
508 char string[256];
510 if (check_arg_count(nargs, 0) == 1)
511 return;
513 /* XXX call2 */
514 report_count(2);
515 report_return(getstr(string));
516 report_status(string);
520 void
521 cmd_inch(int nargs, char **args)
523 if (check_arg_count(nargs, 0) == 1)
524 return;
527 report_count(1);
528 report_byte(inch());
532 void
533 cmd_inchnstr(int nargs, char **args)
535 int limit;
536 chtype *string;
538 if (check_arg_count(nargs, 1) == 1)
539 return;
541 if (sscanf(args[0], "%d", &limit) == 0) {
542 report_count(1);
543 report_error("BAD ARGUMENT");
544 return;
547 if ((string = malloc((limit + 1) * sizeof(chtype))) == NULL) {
548 report_count(1);
549 report_error("MALLOC_FAILED");
550 return;
553 /* XXX call2 */
554 report_count(2);
555 report_return(inchnstr(string, limit));
556 report_nstr(string);
557 free(string);
561 void
562 cmd_inchstr(int nargs, char **args)
564 chtype string[256];
566 if (check_arg_count(nargs, 0) == 1)
567 return;
569 /* XXX call2 */
570 report_count(2);
571 report_return(inchstr(string));
572 report_nstr(string);
576 void
577 cmd_innstr(int nargs, char **args)
579 int limit;
580 char *string;
582 if (check_arg_count(nargs, 1) == 1)
583 return;
585 if (sscanf(args[0], "%d", &limit) == 0) {
586 report_count(1);
587 report_error("BAD ARGUMENT");
588 return;
591 if ((string = malloc(limit + 1)) == NULL) {
592 report_count(1);
593 report_error("MALLOC_FAILED");
594 return;
597 /* XXX call2 */
598 report_count(2);
599 report_int(innstr(string, limit));
600 report_status(string);
601 free(string);
605 void
606 cmd_insch(int nargs, char **args)
608 if (check_arg_count(nargs, 1) == 1)
609 return;
611 report_count(1);
612 report_return(insch(args[0][0]));
616 void
617 cmd_insdelln(int nargs, char **args)
619 int nlines;
621 if (check_arg_count(nargs, 1) == 1)
622 return;
624 if (sscanf(args[0], "%d", &nlines) == 0) {
625 report_count(1);
626 report_error("BAD ARGUMENT");
627 return;
630 report_count(1);
631 report_return(insdelln(nlines));
635 void
636 cmd_insertln(int nargs, char **args)
638 if (check_arg_count(nargs, 0) == 1)
639 return;
641 report_count(1);
642 report_return(insertln());
646 void
647 cmd_instr(int nargs, char **args)
649 char string[256];
651 if (check_arg_count(nargs, 0) == 1)
652 return;
654 /* XXX call2 */
655 report_count(2);
656 report_return(instr(string));
657 report_status(string);
661 void
662 cmd_move(int nargs, char **args)
664 int y, x;
666 if (check_arg_count(nargs, 2) == 1)
667 return;
669 if (sscanf(args[0], "%d", &y) == 0) {
670 report_count(1);
671 report_error("BAD ARGUMENT");
672 return;
675 if (sscanf(args[1], "%d", &x) == 0) {
676 report_count(1);
677 report_error("BAD ARGUMENT");
678 return;
681 report_count(1);
682 report_return(move(y, x));
686 void
687 cmd_refresh(int nargs, char **args)
689 if (check_arg_count(nargs, 0) == 1)
690 return;
692 report_count(1);
693 report_return(refresh());
697 void
698 cmd_scrl(int nargs, char **args)
700 int nlines;
702 if (check_arg_count(nargs, 1) == 1)
703 return;
705 if (sscanf(args[0], "%d", &nlines) == 0) {
706 report_count(1);
707 report_error("BAD ARGUMENT");
708 return;
711 report_count(1);
712 report_return(scrl(nlines));
716 void
717 cmd_setscrreg(int nargs, char **args)
719 int top, bottom;
721 if (check_arg_count(nargs, 2) == 1)
722 return;
724 if (sscanf(args[0], "%d", &top) == 0) {
725 report_count(1);
726 report_error("BAD ARGUMENT");
727 return;
730 if (sscanf(args[1], "%d", &bottom) == 0) {
731 report_count(1);
732 report_error("BAD ARGUMENT");
733 return;
736 report_count(1);
737 report_return(setscrreg(top, bottom));
741 void
742 cmd_standend(int nargs, char **args)
744 if (check_arg_count(nargs, 0) == 1)
745 return;
747 report_count(1);
748 report_return(standend());
752 void
753 cmd_standout(int nargs, char **args)
755 if (check_arg_count(nargs, 0) == 1)
756 return;
758 report_count(1);
759 report_return(standout());
763 void
764 cmd_timeout(int nargs, char **args)
766 int tval;
768 if (check_arg_count(nargs, 1) == 1)
769 return;
771 if (sscanf(args[0], "%d", &tval) == 0) {
772 report_count(1);
773 report_error("BAD ARGUMENT");
774 return;
777 timeout(tval); /* void return */
778 report_count(1);
779 report_return(OK);
783 void
784 cmd_underscore(int nargs, char **args)
786 if (check_arg_count(nargs, 0) == 1)
787 return;
789 report_count(1);
790 report_return(underscore());
794 void
795 cmd_underend(int nargs, char **args)
797 if (check_arg_count(nargs, 0) == 1)
798 return;
800 report_count(1);
801 report_return(underend());
805 void
806 cmd_waddbytes(int nargs, char **args)
808 WINDOW *win;
809 int count;
811 if (check_arg_count(nargs, 3) == 1)
812 return;
814 if (sscanf(args[0], "%p", &win) == 0) {
815 report_count(1);
816 report_error("BAD ARGUMENT");
817 return;
820 if (sscanf(args[2], "%d", &count) == 0) {
821 report_count(1);
822 report_error("BAD ARGUMENT");
823 return;
826 report_count(1);
827 report_return(waddbytes(win, args[1], count));
831 void
832 cmd_waddstr(int nargs, char **args)
834 WINDOW *win;
836 if (check_arg_count(nargs, 2) == 1)
837 return;
839 if (sscanf(args[0], "%p", &win) == 0) {
840 report_count(1);
841 report_error("BAD ARGUMENT");
842 return;
845 report_count(1);
846 report_return(waddstr(win, args[1]));
850 void
851 cmd_mvaddbytes(int nargs, char **args)
853 int y, x, count;
855 if (check_arg_count(nargs, 4) == 1)
856 return;
858 if (sscanf(args[0], "%d", &y) == 0) {
859 report_count(1);
860 report_error("BAD ARGUMENT");
861 return;
864 if (sscanf(args[1], "%d", &x) == 0) {
865 report_count(1);
866 report_error("BAD ARGUMENT");
867 return;
870 if (sscanf(args[3], "%d", &count) == 0) {
871 report_count(1);
872 report_error("BAD ARGUMENT");
873 return;
876 report_count(1);
877 report_return(mvaddbytes(y, x, args[2], count));
881 void
882 cmd_mvaddch(int nargs, char **args)
884 int y, x;
885 chtype *ch;
887 if (check_arg_count(nargs, 3) == 1)
888 return;
890 if (sscanf(args[0], "%d", &y) == 0) {
891 report_count(1);
892 report_error("BAD ARGUMENT");
893 return;
896 if (sscanf(args[1], "%d", &x) == 0) {
897 report_count(1);
898 report_error("BAD ARGUMENT");
899 return;
902 ch = (chtype *) args[2];
903 report_count(1);
904 report_return(mvaddch(y, x, ch[0]));
908 void
909 cmd_mvaddchnstr(int nargs, char **args)
911 int y, x, count;
913 if (check_arg_count(nargs, 4) == 1)
914 return;
916 if (sscanf(args[0], "%d", &y) == 0) {
917 report_count(1);
918 report_error("BAD ARGUMENT");
919 return;
922 if (sscanf(args[1], "%d", &x) == 0) {
923 report_count(1);
924 report_error("BAD ARGUMENT");
925 return;
928 if (sscanf(args[3], "%d", &count) == 0) {
929 report_count(1);
930 report_error("BAD ARGUMENT");
931 return;
934 report_count(1);
935 report_return(mvaddchnstr(y, x, (chtype *) args[2], count));
939 void
940 cmd_mvaddchstr(int nargs, char **args)
942 int y, x;
944 if (check_arg_count(nargs, 3) == 1)
945 return;
947 if (sscanf(args[0], "%d", &y) == 0) {
948 report_count(1);
949 report_error("BAD ARGUMENT");
950 return;
953 if (sscanf(args[1], "%d", &x) == 0) {
954 report_count(1);
955 report_error("BAD ARGUMENT");
956 return;
959 report_count(1);
960 report_return(mvaddchstr(y, x, (chtype *) args[2]));
964 void
965 cmd_mvaddnstr(int nargs, char **args)
967 int y, x, count;
969 if (check_arg_count(nargs, 4) == 1)
970 return;
972 if (sscanf(args[0], "%d", &y) == 0) {
973 report_count(1);
974 report_error("BAD ARGUMENT");
975 return;
978 if (sscanf(args[1], "%d", &x) == 0) {
979 report_count(1);
980 report_error("BAD ARGUMENT");
981 return;
984 if (sscanf(args[3], "%d", &count) == 0) {
985 report_count(1);
986 report_error("BAD ARGUMENT");
987 return;
990 report_count(1);
991 report_return(mvaddnstr(y, x, args[2], count));
995 void
996 cmd_mvaddstr(int nargs, char **args)
998 int y, x;
1000 if (check_arg_count(nargs, 3) == 1)
1001 return;
1003 if (sscanf(args[0], "%d", &y) == 0) {
1004 report_count(1);
1005 report_error("BAD ARGUMENT");
1006 return;
1009 if (sscanf(args[1], "%d", &x) == 0) {
1010 report_count(1);
1011 report_error("BAD ARGUMENT");
1012 return;
1015 report_count(1);
1016 report_return(mvaddstr(y, x, args[2]));
1020 void
1021 cmd_mvdelch(int nargs, char **args)
1023 int y, x;
1025 if (check_arg_count(nargs, 2) == 1)
1026 return;
1028 if (sscanf(args[0], "%d", &y) == 0) {
1029 report_count(1);
1030 report_error("BAD ARGUMENT");
1031 return;
1034 if (sscanf(args[1], "%d", &x) == 0) {
1035 report_count(1);
1036 report_error("BAD ARGUMENT");
1037 return;
1040 report_count(1);
1041 report_return(mvdelch(y, x));
1045 void
1046 cmd_mvgetch(int nargs, char **args)
1048 int y, x;
1050 if (check_arg_count(nargs, 2) == 1)
1051 return;
1053 if (sscanf(args[0], "%d", &y) == 0) {
1054 report_count(1);
1055 report_error("BAD ARGUMENT");
1056 return;
1059 if (sscanf(args[1], "%d", &x) == 0) {
1060 report_count(1);
1061 report_error("BAD ARGUMENT");
1062 return;
1065 report_count(1);
1066 report_int(mvgetch(y, x));
1070 void
1071 cmd_mvgetnstr(int nargs, char **args)
1073 int y, x, count;
1074 char *string;
1076 if (check_arg_count(nargs, 3) == 1)
1077 return;
1079 if (sscanf(args[0], "%d", &y) == 0) {
1080 report_count(1);
1081 report_error("BAD ARGUMENT");
1082 return;
1085 if (sscanf(args[1], "%d", &x) == 0) {
1086 report_count(1);
1087 report_error("BAD ARGUMENT");
1088 return;
1091 if (sscanf(args[2], "%d", &count) == 0) {
1092 report_count(1);
1093 report_error("BAD ARGUMENT");
1094 return;
1097 if ((string = malloc(count + 1)) == NULL) {
1098 report_count(1);
1099 report_error("MALLOC_FAILED");
1100 return;
1103 /* XXX call2 */
1104 report_count(2);
1105 report_return(mvgetnstr(y, x, string, count));
1106 report_status(string);
1107 free(string);
1111 void
1112 cmd_mvgetstr(int nargs, char **args)
1114 int y, x;
1115 char string[256];
1117 if (check_arg_count(nargs, 2) == 1)
1118 return;
1120 if (sscanf(args[0], "%d", &y) == 0) {
1121 report_count(1);
1122 report_error("BAD ARGUMENT");
1123 return;
1126 if (sscanf(args[1], "%d", &x) == 0) {
1127 report_count(1);
1128 report_error("BAD ARGUMENT");
1129 return;
1132 /* XXX call2 */
1133 report_count(2);
1134 report_return(mvgetstr(y, x, string));
1135 report_status(string);
1139 void
1140 cmd_mvinch(int nargs, char **args)
1142 int y, x;
1144 if (check_arg_count(nargs, 2) == 1)
1145 return;
1147 if (sscanf(args[0], "%d", &y) == 0) {
1148 report_count(1);
1149 report_error("BAD ARGUMENT");
1150 return;
1153 if (sscanf(args[1], "%d", &x) == 0) {
1154 report_count(1);
1155 report_error("BAD ARGUMENT");
1156 return;
1159 report_count(1);
1160 report_int(mvinch(y, x));
1164 void
1165 cmd_mvinchnstr(int nargs, char **args)
1167 int y, x, count;
1168 chtype *string;
1170 if (check_arg_count(nargs, 3) == 1)
1171 return;
1173 if (sscanf(args[0], "%d", &y) == 0) {
1174 report_count(1);
1175 report_error("BAD ARGUMENT");
1176 return;
1179 if (sscanf(args[1], "%d", &x) == 0) {
1180 report_count(1);
1181 report_error("BAD ARGUMENT");
1182 return;
1185 if (sscanf(args[2], "%d", &count) == 0) {
1186 report_count(1);
1187 report_error("BAD ARGUMENT");
1188 return;
1191 if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
1192 report_count(1);
1193 report_error("MALLOC_FAILED");
1194 return;
1197 /* XXX call2 */
1198 report_count(2);
1199 report_return(mvinchnstr(y, x, string, count));
1200 report_nstr(string);
1201 free(string);
1205 void
1206 cmd_mvinchstr(int nargs, char **args)
1208 int y, x;
1209 chtype string[256];
1211 if (check_arg_count(nargs, 2) == 1)
1212 return;
1214 if (sscanf(args[0], "%d", &y) == 0) {
1215 report_count(1);
1216 report_error("BAD ARGUMENT");
1217 return;
1220 if (sscanf(args[1], "%d", &x) == 0) {
1221 report_count(1);
1222 report_error("BAD ARGUMENT");
1223 return;
1226 /* XXX call2 */
1227 report_count(2);
1228 report_return(mvinchstr(y, x, string));
1229 report_nstr(string);
1233 void
1234 cmd_mvinnstr(int nargs, char **args)
1236 int y, x, count;
1237 char *string;
1239 if (check_arg_count(nargs, 3) == 1)
1240 return;
1242 if (sscanf(args[0], "%d", &y) == 0) {
1243 report_count(1);
1244 report_error("BAD ARGUMENT");
1245 return;
1248 if (sscanf(args[1], "%d", &x) == 0) {
1249 report_count(1);
1250 report_error("BAD ARGUMENT");
1251 return;
1254 if (sscanf(args[2], "%d", &count) == 0) {
1255 report_count(1);
1256 report_error("BAD ARGUMENT");
1257 return;
1260 if ((string = malloc(count + 1)) == NULL) {
1261 report_count(1);
1262 report_error("MALLOC_FAILED");
1263 return;
1266 /* XXX call2 */
1267 report_count(2);
1268 report_return(mvinnstr(y, x, string, count));
1269 report_status(string);
1270 free(string);
1274 void
1275 cmd_mvinsch(int nargs, char **args)
1277 int y, x, ch;
1279 if (check_arg_count(nargs, 3) == 1)
1280 return;
1282 if (sscanf(args[0], "%d", &y) == 0) {
1283 report_count(1);
1284 report_error("BAD ARGUMENT");
1285 return;
1288 if (sscanf(args[1], "%d", &x) == 0) {
1289 report_count(1);
1290 report_error("BAD ARGUMENT");
1291 return;
1294 if (sscanf(args[2], "%d", &ch) == 0) {
1295 report_count(1);
1296 report_error("BAD ARGUMENT");
1297 return;
1300 report_count(1);
1301 report_return(mvinsch(y, x, ch));
1305 void
1306 cmd_mvinstr(int nargs, char **args)
1308 int y, x;
1310 if (check_arg_count(nargs, 3) == 1)
1311 return;
1313 if (sscanf(args[0], "%d", &y) == 0) {
1314 report_count(1);
1315 report_error("BAD ARGUMENT");
1316 return;
1319 if (sscanf(args[1], "%d", &x) == 0) {
1320 report_count(1);
1321 report_error("BAD ARGUMENT");
1322 return;
1325 report_count(1);
1326 report_return(mvinstr(y, x, args[2]));
1331 void
1332 cmd_mvwaddbytes(int nargs, char **args)
1334 int y, x, count;
1335 WINDOW *win;
1337 if (check_arg_count(nargs, 5) == 1)
1338 return;
1340 if (sscanf(args[0], "%p", &win) == 0) {
1341 report_count(1);
1342 report_error("BAD ARGUMENT");
1343 return;
1346 if (sscanf(args[1], "%d", &y) == 0) {
1347 report_count(1);
1348 report_error("BAD ARGUMENT");
1349 return;
1352 if (sscanf(args[2], "%d", &x) == 0) {
1353 report_count(1);
1354 report_error("BAD ARGUMENT");
1355 return;
1358 if (sscanf(args[4], "%d", &count) == 0) {
1359 report_count(1);
1360 report_error("BAD ARGUMENT");
1361 return;
1364 report_count(1);
1365 report_return(mvwaddbytes(win, y, x, args[3], count));
1369 void
1370 cmd_mvwaddch(int nargs, char **args)
1372 int y, x;
1373 WINDOW *win;
1375 if (check_arg_count(nargs, 4) == 1)
1376 return;
1378 if (sscanf(args[0], "%p", &win) == 0) {
1379 report_count(1);
1380 report_error("BAD ARGUMENT");
1381 return;
1384 if (sscanf(args[1], "%d", &y) == 0) {
1385 report_count(1);
1386 report_error("BAD ARGUMENT");
1387 return;
1390 if (sscanf(args[2], "%d", &x) == 0) {
1391 report_count(1);
1392 report_error("BAD ARGUMENT");
1393 return;
1396 report_count(1);
1397 report_return(mvwaddch(win, y, x, args[3][0]));
1401 void
1402 cmd_mvwaddchnstr(int nargs, char **args)
1404 int y, x, count;
1405 WINDOW *win;
1407 if (check_arg_count(nargs, 5) == 1)
1408 return;
1410 if (sscanf(args[0], "%p", &win) == 0) {
1411 report_count(1);
1412 report_error("BAD ARGUMENT");
1413 return;
1416 if (sscanf(args[1], "%d", &y) == 0) {
1417 report_count(1);
1418 report_error("BAD ARGUMENT");
1419 return;
1422 if (sscanf(args[2], "%d", &x) == 0) {
1423 report_count(1);
1424 report_error("BAD ARGUMENT");
1425 return;
1428 if (sscanf(args[4], "%d", &count) == 0) {
1429 report_count(1);
1430 report_error("BAD ARGUMENT");
1431 return;
1434 report_count(1);
1435 report_return(mvwaddchnstr(win, y, x, (chtype *) args[3], count));
1439 void
1440 cmd_mvwaddchstr(int nargs, char **args)
1442 int y, x;
1443 WINDOW *win;
1445 if (check_arg_count(nargs, 4) == 1)
1446 return;
1448 if (sscanf(args[0], "%p", &win) == 0) {
1449 report_count(1);
1450 report_error("BAD ARGUMENT");
1451 return;
1454 if (sscanf(args[1], "%d", &y) == 0) {
1455 report_count(1);
1456 report_error("BAD ARGUMENT");
1457 return;
1460 if (sscanf(args[2], "%d", &x) == 0) {
1461 report_count(1);
1462 report_error("BAD ARGUMENT");
1463 return;
1466 report_count(1);
1467 report_return(mvwaddchstr(win, y, x, (chtype *) args[3]));
1471 void
1472 cmd_mvwaddnstr(int nargs, char **args)
1474 int y, x, count;
1475 WINDOW *win;
1477 if (check_arg_count(nargs, 5) == 1)
1478 return;
1480 if (sscanf(args[0], "%p", &win) == 0) {
1481 report_count(1);
1482 report_error("BAD ARGUMENT");
1483 return;
1486 if (sscanf(args[1], "%d", &y) == 0) {
1487 report_count(1);
1488 report_error("BAD ARGUMENT");
1489 return;
1492 if (sscanf(args[2], "%d", &x) == 0) {
1493 report_count(1);
1494 report_error("BAD ARGUMENT");
1495 return;
1498 if (sscanf(args[4], "%d", &count) == 0) {
1499 report_count(1);
1500 report_error("BAD ARGUMENT");
1501 return;
1504 report_count(1);
1505 report_return(mvwaddnstr(win, y, x, args[3], count));
1509 void
1510 cmd_mvwaddstr(int nargs, char **args)
1512 int y, x;
1513 WINDOW *win;
1515 if (check_arg_count(nargs, 4) == 1)
1516 return;
1518 if (sscanf(args[0], "%p", &win) == 0) {
1519 report_count(1);
1520 report_error("BAD ARGUMENT");
1521 return;
1524 if (sscanf(args[1], "%d", &y) == 0) {
1525 report_count(1);
1526 report_error("BAD ARGUMENT");
1527 return;
1530 if (sscanf(args[2], "%d", &x) == 0) {
1531 report_count(1);
1532 report_error("BAD ARGUMENT");
1533 return;
1536 report_count(1);
1537 report_return(mvwaddstr(win, y, x, args[3]));
1541 void
1542 cmd_mvwdelch(int nargs, char **args)
1544 int y, x;
1545 WINDOW *win;
1547 if (check_arg_count(nargs, 3) == 1)
1548 return;
1550 if (sscanf(args[0], "%p", &win) == 0) {
1551 report_count(1);
1552 report_error("BAD ARGUMENT");
1553 return;
1556 if (sscanf(args[1], "%d", &y) == 0) {
1557 report_count(1);
1558 report_error("BAD ARGUMENT");
1559 return;
1562 if (sscanf(args[2], "%d", &x) == 0) {
1563 report_count(1);
1564 report_error("BAD ARGUMENT");
1565 return;
1568 report_count(1);
1569 report_return(mvwdelch(win, y, x));
1573 void
1574 cmd_mvwgetch(int nargs, char **args)
1576 int y, x;
1577 WINDOW *win;
1579 if (check_arg_count(nargs, 3) == 1)
1580 return;
1582 if (sscanf(args[0], "%p", &win) == 0) {
1583 report_count(1);
1584 report_error("BAD ARGUMENT");
1585 return;
1588 if (sscanf(args[1], "%d", &y) == 0) {
1589 report_count(1);
1590 report_error("BAD ARGUMENT");
1591 return;
1594 if (sscanf(args[2], "%d", &x) == 0) {
1595 report_count(1);
1596 report_error("BAD ARGUMENT");
1597 return;
1600 /* XXX - implicit refresh */
1601 report_count(1);
1602 report_int(mvwgetch(win, y, x));
1606 void
1607 cmd_mvwgetnstr(int nargs, char **args)
1609 int y, x, count;
1610 char *string;
1611 WINDOW *win;
1613 if (check_arg_count(nargs, 4) == 1)
1614 return;
1616 if (sscanf(args[0], "%p", &win) == 0) {
1617 report_count(1);
1618 report_error("BAD ARGUMENT");
1619 return;
1622 if (sscanf(args[1], "%d", &y) == 0) {
1623 report_count(1);
1624 report_error("BAD ARGUMENT");
1625 return;
1628 if (sscanf(args[2], "%d", &x) == 0) {
1629 report_count(1);
1630 report_error("BAD ARGUMENT");
1631 return;
1634 if (sscanf(args[3], "%d", &count) == 0) {
1635 report_count(1);
1636 report_error("BAD ARGUMENT");
1637 return;
1640 if ((string = malloc(count + 1)) == NULL) {
1641 report_count(1);
1642 report_error("MALLOC_FAILED");
1643 return;
1646 /* XXX call2 */
1647 report_count(2);
1648 report_return(mvwgetnstr(win, y, x, string, count));
1649 report_status(string);
1650 free(string);
1654 void
1655 cmd_mvwgetstr(int nargs, char **args)
1657 int y, x;
1658 WINDOW *win;
1659 char string[256];
1661 if (check_arg_count(nargs, 3) == 1)
1662 return;
1664 if (sscanf(args[0], "%p", &win) == 0) {
1665 report_count(1);
1666 report_error("BAD ARGUMENT");
1667 return;
1670 if (sscanf(args[1], "%d", &y) == 0) {
1671 report_count(1);
1672 report_error("BAD ARGUMENT");
1673 return;
1676 if (sscanf(args[2], "%d", &x) == 0) {
1677 report_count(1);
1678 report_error("BAD ARGUMENT");
1679 return;
1682 /* XXX - call2 */
1683 report_count(2);
1684 report_return(mvwgetstr(win, y, x, string));
1685 report_status(string);
1689 void
1690 cmd_mvwinch(int nargs, char **args)
1692 int y, x;
1693 WINDOW *win;
1695 if (check_arg_count(nargs, 3) == 1)
1696 return;
1698 if (sscanf(args[0], "%p", &win) == 0) {
1699 report_count(1);
1700 report_error("BAD ARGUMENT");
1701 return;
1704 if (sscanf(args[1], "%d", &y) == 0) {
1705 report_count(1);
1706 report_error("BAD ARGUMENT");
1707 return;
1710 if (sscanf(args[2], "%d", &x) == 0) {
1711 report_count(1);
1712 report_error("BAD ARGUMENT");
1713 return;
1716 report_count(1);
1717 report_int(mvwinch(win, y, x));
1721 void
1722 cmd_mvwinsch(int nargs, char **args)
1724 int y, x;
1725 WINDOW *win;
1727 if (check_arg_count(nargs, 4) == 1)
1728 return;
1730 if (sscanf(args[0], "%p", &win) == 0) {
1731 report_count(1);
1732 report_error("BAD ARGUMENT");
1733 return;
1736 if (sscanf(args[1], "%d", &y) == 0) {
1737 report_count(1);
1738 report_error("BAD ARGUMENT");
1739 return;
1742 if (sscanf(args[2], "%d", &x) == 0) {
1743 report_count(1);
1744 report_error("BAD ARGUMENT");
1745 return;
1748 report_count(1);
1749 report_int(mvwinsch(win, y, x, args[3][0]));
1753 void
1754 cmd_assume_default_colors(int nargs, char **args)
1756 short fore, back;
1758 if (check_arg_count(nargs, 2) == 1)
1759 return;
1761 if (sscanf(args[0], "%hd", &fore) == 0) {
1762 report_count(1);
1763 report_error("BAD ARGUMENT");
1764 return;
1767 if (sscanf(args[1], "%hd", &back) == 0) {
1768 report_count(1);
1769 report_error("BAD ARGUMENT");
1770 return;
1773 report_count(1);
1774 report_return(assume_default_colors(fore, back));
1778 void
1779 cmd_baudrate(int nargs, char **args)
1781 if (check_arg_count(nargs, 0) == 1)
1782 return;
1784 report_count(1);
1785 report_int(baudrate());
1789 void
1790 cmd_beep(int nargs, char **args)
1792 if (check_arg_count(nargs, 0) == 1)
1793 return;
1795 report_count(1);
1796 report_return(beep());
1800 void
1801 cmd_box(int nargs, char **args)
1803 WINDOW *win;
1804 chtype *vertical, *horizontal;
1806 if (check_arg_count(nargs, 3) == 1)
1807 return;
1809 if (sscanf(args[0], "%p", &win) == 0) {
1810 report_count(1);
1811 report_error("BAD ARGUMENT");
1812 return;
1815 vertical = (chtype *) args[1];
1816 horizontal = (chtype *) args[2];
1817 report_count(1);
1818 report_return(box(win, vertical[0], horizontal[0]));
1822 void
1823 cmd_can_change_color(int nargs, char **args)
1825 if (check_arg_count(nargs, 0) == 1)
1826 return;
1828 report_count(1);
1829 report_int(can_change_color());
1833 void
1834 cmd_cbreak(int nargs, char **args)
1836 if (check_arg_count(nargs, 0) == 1)
1837 return;
1839 report_count(1);
1840 report_return(cbreak());
1844 void
1845 cmd_clearok(int nargs, char **args)
1847 WINDOW *win;
1848 int flag;
1850 if (check_arg_count(nargs, 2) == 1)
1851 return;
1853 if (sscanf(args[0], "%p", &win) == 0) {
1854 report_count(1);
1855 report_error("BAD ARGUMENT");
1856 return;
1859 if (sscanf(args[1], "%d", &flag) == 0) {
1860 report_count(1);
1861 report_error("BAD ARGUMENT");
1862 return;
1865 report_count(1);
1866 report_return(clearok(win, flag));
1870 void
1871 cmd_color_content(int nargs, char **args)
1873 short colour, red, green, blue;
1875 if (check_arg_count(nargs, 1) == 1)
1876 return;
1878 if (sscanf(args[0], "%hd", &colour) == 0) {
1879 report_count(1);
1880 report_error("BAD ARGUMENT");
1881 return;
1884 /* XXX - call4 */
1885 report_count(4);
1886 report_return(color_content(colour, &red, &green, &blue));
1887 report_int(red);
1888 report_int(green);
1889 report_int(blue);
1893 void
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)
1900 return;
1902 if (sscanf(args[0], "%p", &source) == 0) {
1903 report_count(1);
1904 report_error("BAD ARGUMENT");
1905 return;
1908 if (sscanf(args[1], "%p", &destination) == 0) {
1909 report_count(1);
1910 report_error("BAD ARGUMENT");
1911 return;
1914 if (sscanf(args[2], "%d", &sminrow) == 0) {
1915 report_count(1);
1916 report_error("BAD ARGUMENT");
1917 return;
1920 if (sscanf(args[3], "%d", &smincol) == 0) {
1921 report_count(1);
1922 report_error("BAD ARGUMENT");
1923 return;
1926 if (sscanf(args[4], "%d", &dminrow) == 0) {
1927 report_count(1);
1928 report_error("BAD ARGUMENT");
1929 return;
1932 if (sscanf(args[5], "%d", &dmincol) == 0) {
1933 report_count(1);
1934 report_error("BAD ARGUMENT");
1935 return;
1938 if (sscanf(args[6], "%d", &dmaxrow) == 0) {
1939 report_count(1);
1940 report_error("BAD ARGUMENT");
1941 return;
1944 if (sscanf(args[7], "%d", &dmaxcol) == 0) {
1945 report_count(1);
1946 report_error("BAD ARGUMENT");
1947 return;
1950 if (sscanf(args[8], "%d", &ovlay) == 0) {
1951 report_count(1);
1952 report_error("BAD ARGUMENT");
1953 return;
1956 report_count(1);
1957 report_return(copywin(source, destination, sminrow, smincol, dminrow,
1958 dmincol, dmaxrow, dmaxcol, ovlay));
1962 void
1963 cmd_curs_set(int nargs, char **args)
1965 int vis;
1967 if (check_arg_count(nargs, 1) == 1)
1968 return;
1970 if (sscanf(args[0], "%d", &vis) == 0) {
1971 report_count(1);
1972 report_error("BAD ARGUMENT");
1973 return;
1976 report_count(1);
1977 report_int(curs_set(vis));
1981 void
1982 cmd_def_prog_mode(int nargs, char **args)
1984 if (check_arg_count(nargs, 0) == 1)
1985 return;
1987 report_count(1);
1988 report_return(def_prog_mode());
1992 void
1993 cmd_def_shell_mode(int nargs, char **args)
1995 if (check_arg_count(nargs, 0) == 1)
1996 return;
1998 report_count(1);
1999 report_return(def_shell_mode());
2003 void
2004 cmd_define_key(int nargs, char **args)
2006 int symbol;
2008 if (check_arg_count(nargs, 2) == 1)
2009 return;
2011 if (sscanf(args[1], "%d", &symbol) == 0) {
2012 report_count(1);
2013 report_error("BAD ARGUMENT");
2014 return;
2017 report_count(1);
2018 report_return(define_key(args[0], symbol));
2022 void
2023 cmd_delay_output(int nargs, char **args)
2025 int dtime;
2027 if (check_arg_count(nargs, 1) == 1)
2028 return;
2030 if (sscanf(args[0], "%d", &dtime) == 0) {
2031 report_count(1);
2032 report_error("BAD ARGUMENT");
2033 return;
2036 report_count(1);
2037 report_return(delay_output(dtime));
2041 void
2042 cmd_delscreen(int nargs, char **args)
2044 SCREEN *scrn;
2046 if (check_arg_count(nargs, 1) == 1)
2047 return;
2049 if (sscanf(args[0], "%p", &scrn) == 0) {
2050 report_count(1);
2051 report_error("BAD ARGUMENT");
2052 return;
2055 delscreen(scrn); /* void return */
2056 report_count(1);
2057 report_return(OK);
2061 void
2062 cmd_delwin(int nargs, char **args)
2064 WINDOW *win;
2066 if (check_arg_count(nargs, 1) == 1)
2067 return;
2069 if (sscanf(args[0], "%p", &win) == 0) {
2070 report_count(1);
2071 report_error("BAD ARGUMENT");
2072 return;
2075 report_count(1);
2076 report_return(delwin(win));
2080 void
2081 cmd_derwin(int nargs, char **args)
2083 int lines, cols, y, x;
2084 WINDOW *win;
2086 if (check_arg_count(nargs, 5) == 1)
2087 return;
2089 if (sscanf(args[0], "%p", &win) == 0) {
2090 report_count(1);
2091 report_error("BAD ARGUMENT");
2092 return;
2095 if (sscanf(args[1], "%d", &lines) == 0) {
2096 report_count(1);
2097 report_error("BAD ARGUMENT");
2098 return;
2101 if (sscanf(args[2], "%d", &cols) == 0) {
2102 report_count(1);
2103 report_error("BAD ARGUMENT");
2104 return;
2107 if (sscanf(args[3], "%d", &y) == 0) {
2108 report_count(1);
2109 report_error("BAD ARGUMENT");
2110 return;
2113 if (sscanf(args[4], "%d", &x) == 0) {
2114 report_count(1);
2115 report_error("BAD ARGUMENT");
2116 return;
2119 report_count(1);
2120 report_ptr(derwin(win, lines, cols, y, x));
2124 void
2125 cmd_dupwin(int nargs, char **args)
2127 WINDOW *win;
2129 if (check_arg_count(nargs, 1) == 1)
2130 return;
2132 if (sscanf(args[0], "%p", &win) == 0) {
2133 report_count(1);
2134 report_error("BAD ARGUMENT");
2135 return;
2138 report_count(1);
2139 report_ptr(dupwin(win));
2143 void
2144 cmd_doupdate(int nargs, char **args)
2146 if (check_arg_count(nargs, 0) == 1)
2147 return;
2149 /* XXX - implicit refresh */
2150 report_count(1);
2151 report_return(doupdate());
2155 void
2156 cmd_echo(int nargs, char **args)
2158 if (check_arg_count(nargs, 0) == 1)
2159 return;
2161 report_count(1);
2162 report_return(echo());
2166 void
2167 cmd_endwin(int nargs, char **args)
2169 if (check_arg_count(nargs, 0) == 1)
2170 return;
2172 report_count(1);
2173 report_return(endwin());
2177 void
2178 cmd_erasechar(int nargs, char **args)
2180 if (check_arg_count(nargs, 0) == 1)
2181 return;
2183 report_count(1);
2184 report_int(erasechar());
2188 void
2189 cmd_flash(int nargs, char **args)
2191 if (check_arg_count(nargs, 0) == 1)
2192 return;
2194 report_count(1);
2195 report_return(flash());
2199 void
2200 cmd_flushinp(int nargs, char **args)
2202 if (check_arg_count(nargs, 0) == 1)
2203 return;
2205 report_count(1);
2206 report_return(flushinp());
2210 void
2211 cmd_flushok(int nargs, char **args)
2213 int flag;
2214 WINDOW *win;
2216 if (check_arg_count(nargs, 2) == 1)
2217 return;
2219 if (sscanf(args[0], "%p", &win) == 0) {
2220 report_count(1);
2221 report_error("BAD ARGUMENT");
2222 return;
2225 if (sscanf(args[1], "%d", &flag) == 0) {
2226 report_count(1);
2227 report_error("BAD ARGUMENT");
2228 return;
2231 report_count(1);
2232 report_return(flushok(win, flag));
2236 void
2237 cmd_fullname(int nargs, char **args)
2239 char string[256];
2241 if (check_arg_count(nargs, 1) == 1)
2242 return;
2244 /* XXX - call2 */
2245 report_count(2);
2246 report_status(fullname(args[0], string));
2247 report_status(string);
2251 void
2252 cmd_getattrs(int nargs, char **args)
2254 WINDOW *win;
2256 if (check_arg_count(nargs, 1) == 1)
2257 return;
2259 if (sscanf(args[0], "%p", &win) == 0) {
2260 report_count(1);
2261 report_error("BAD ARGUMENT");
2262 return;
2265 report_count(1);
2266 report_int(getattrs(win));
2270 void
2271 cmd_getbkgd(int nargs, char **args)
2273 WINDOW *win;
2275 if (check_arg_count(nargs, 1) == 1)
2276 return;
2278 if (sscanf(args[0], "%p", &win) == 0) {
2279 report_count(1);
2280 report_error("BAD ARGUMENT");
2281 return;
2284 report_count(1);
2285 report_byte(getbkgd(win));
2289 void
2290 cmd_getcury(int nargs, char **args)
2292 WINDOW *win;
2294 if (check_arg_count(nargs, 1) == 1)
2295 return;
2297 if (sscanf(args[0], "%p", &win) == 0) {
2298 report_count(1);
2299 report_error("BAD ARGUMENT");
2300 return;
2303 report_count(1);
2304 report_int(getcury(win));
2308 void
2309 cmd_getcurx(int nargs, char **args)
2311 WINDOW *win;
2313 if (check_arg_count(nargs, 1) == 1)
2314 return;
2316 if (sscanf(args[0], "%p", &win) == 0) {
2317 report_count(1);
2318 report_error("BAD ARGUMENT");
2319 return;
2322 report_count(1);
2323 report_int(getcurx(win));
2327 void
2328 cmd_getyx(int nargs, char **args)
2330 WINDOW *win;
2331 int y, x;
2333 if (check_arg_count(nargs, 1) == 1)
2334 return;
2336 if (sscanf(args[0], "%p", &win) == 0) {
2337 report_count(1);
2338 report_error("BAD ARGUMENT");
2339 return;
2342 getyx(win, y, x);
2343 report_count(2);
2344 report_int(y);
2345 report_int(x);
2349 void
2350 cmd_getbegy(int nargs, char **args)
2352 WINDOW *win;
2354 if (check_arg_count(nargs, 1) == 1)
2355 return;
2357 if (sscanf(args[0], "%p", &win) == 0) {
2358 report_count(1);
2359 report_error("BAD ARGUMENT");
2360 return;
2363 report_count(1);
2364 report_int(getbegy(win));
2368 void
2369 cmd_getbegx(int nargs, char **args)
2371 WINDOW *win;
2373 if (check_arg_count(nargs, 1) == 1)
2374 return;
2376 if (sscanf(args[0], "%p", &win) == 0) {
2377 report_count(1);
2378 report_error("BAD ARGUMENT");
2379 return;
2382 report_count(1);
2383 report_int(getbegx(win));
2387 void
2388 cmd_getmaxy(int nargs, char **args)
2390 WINDOW *win;
2392 if (check_arg_count(nargs, 1) == 1)
2393 return;
2395 if (sscanf(args[0], "%p", &win) == 0) {
2396 report_count(1);
2397 report_error("BAD ARGUMENT");
2398 return;
2401 report_count(1);
2402 report_int(getmaxy(win));
2406 void
2407 cmd_getmaxx(int nargs, char **args)
2409 WINDOW *win;
2411 if (check_arg_count(nargs, 1) == 1)
2412 return;
2414 if (sscanf(args[0], "%p", &win) == 0) {
2415 report_count(1);
2416 report_error("BAD ARGUMENT");
2417 return;
2420 report_count(1);
2421 report_int(getmaxx(win));
2425 void
2426 cmd_getpary(int nargs, char **args)
2428 WINDOW *win;
2430 if (check_arg_count(nargs, 1) == 1)
2431 return;
2433 if (sscanf(args[0], "%p", &win) == 0) {
2434 report_count(1);
2435 report_error("BAD ARGUMENT");
2436 return;
2439 report_count(1);
2440 report_int(getpary(win));
2444 void
2445 cmd_getparx(int nargs, char **args)
2447 WINDOW *win;
2449 if (check_arg_count(nargs, 1) == 1)
2450 return;
2452 if (sscanf(args[0], "%p", &win) == 0) {
2453 report_count(1);
2454 report_error("BAD ARGUMENT");
2455 return;
2458 report_count(1);
2459 report_int(getparx(win));
2463 void
2464 cmd_getparyx(int nargs, char **args)
2466 WINDOW *win;
2467 int y, x;
2469 if (check_arg_count(nargs, 1) == 1)
2470 return;
2472 if (sscanf(args[0], "%p", &win) == 0) {
2473 report_count(1);
2474 report_error("BAD ARGUMENT");
2475 return;
2478 report_count(2);
2479 getparyx(win, y, x);
2480 report_int(y);
2481 report_int(x);
2485 void
2486 cmd_gettmode(int nargs, char **args)
2488 if (check_arg_count(nargs, 0) == 1)
2489 return;
2491 report_count(1);
2492 report_return(gettmode());
2496 void
2497 cmd_getwin(int nargs, char **args)
2499 FILE *fp;
2501 if (check_arg_count(nargs, 1) == 1)
2502 return;
2504 if ((fp = fopen(args[0], "r")) == NULL) {
2505 report_count(1);
2506 report_error("BAD FILE_ARGUMENT");
2507 return;
2510 report_count(1);
2511 report_ptr(getwin(fp));
2512 fclose(fp);
2516 void
2517 cmd_halfdelay(int nargs, char **args)
2519 int ms;
2521 if (check_arg_count(nargs, 1) == 1)
2522 return;
2524 if (sscanf(args[0], "%d", &ms) == 0) {
2525 report_count(1);
2526 report_error("BAD ARGUMENT");
2527 return;
2530 report_count(1);
2531 report_return(halfdelay(ms));
2535 void
2536 cmd_has_colors(int nargs, char **args)
2538 if (check_arg_count(nargs, 0) == 1)
2539 return;
2541 report_count(1);
2542 report_int(has_colors());
2546 void
2547 cmd_has_ic(int nargs, char **args)
2549 if (check_arg_count(nargs, 0) == 1)
2550 return;
2552 report_count(1);
2553 report_int(has_ic());
2557 void
2558 cmd_has_il(int nargs, char **args)
2560 if (check_arg_count(nargs, 0) == 1)
2561 return;
2563 report_count(1);
2564 report_int(has_il());
2568 void
2569 cmd_hline(int nargs, char **args)
2571 int count;
2572 chtype *ch;
2574 if (check_arg_count(nargs, 2) == 1)
2575 return;
2577 ch = (chtype *) args[0];
2579 if (sscanf(args[1], "%d", &count) == 0) {
2580 report_count(1);
2581 report_error("BAD ARGUMENT");
2582 return;
2585 report_count(1);
2586 report_return(hline(ch[0], count));
2590 void
2591 cmd_idcok(int nargs, char **args)
2593 int flag;
2594 WINDOW *win;
2596 if (check_arg_count(nargs, 2) == 1)
2597 return;
2599 if (sscanf(args[0], "%p", &win) == 0) {
2600 report_count(1);
2601 report_error("BAD ARGUMENT");
2602 return;
2605 if (sscanf(args[1], "%d", &flag) == 0) {
2606 report_count(1);
2607 report_error("BAD ARGUMENT");
2608 return;
2611 report_count(1);
2612 report_return(idcok(win, flag));
2616 void
2617 cmd_idlok(int nargs, char **args)
2619 int flag;
2620 WINDOW *win;
2622 if (check_arg_count(nargs, 2) == 1)
2623 return;
2625 if (sscanf(args[0], "%p", &win) == 0) {
2626 report_count(1);
2627 report_error("BAD ARGUMENT");
2628 return;
2631 if (sscanf(args[1], "%d", &flag) == 0) {
2632 report_count(1);
2633 report_error("BAD ARGUMENT");
2634 return;
2637 report_count(1);
2638 report_return(idlok(win, flag));
2642 void
2643 cmd_init_color(int nargs, char **args)
2645 short colour, red, green, blue;
2647 if (check_arg_count(nargs, 4) == 1)
2648 return;
2650 if (sscanf(args[0], "%hd", &colour) == 0) {
2651 report_count(1);
2652 report_error("BAD ARGUMENT");
2653 return;
2656 if (sscanf(args[1], "%hd", &red) == 0) {
2657 report_count(1);
2658 report_error("BAD ARGUMENT");
2659 return;
2662 if (sscanf(args[2], "%hd", &green) == 0) {
2663 report_count(1);
2664 report_error("BAD ARGUMENT");
2665 return;
2668 if (sscanf(args[3], "%hd", &blue) == 0) {
2669 report_count(1);
2670 report_error("BAD ARGUMENT");
2671 return;
2674 report_count(1);
2675 report_return(init_color(colour, red, green, blue));
2679 void
2680 cmd_init_pair(int nargs, char **args)
2682 short pair, fore, back;
2684 if (check_arg_count(nargs, 3) == 1)
2685 return;
2687 if (sscanf(args[0], "%hd", &pair) == 0) {
2688 report_count(1);
2689 report_error("BAD ARGUMENT");
2690 return;
2693 if (sscanf(args[1], "%hd", &fore) == 0) {
2694 report_count(1);
2695 report_error("BAD ARGUMENT");
2696 return;
2699 if (sscanf(args[2], "%hd", &back) == 0) {
2700 report_count(1);
2701 report_error("BAD ARGUMENT");
2702 return;
2705 report_count(1);
2706 report_return(init_pair(pair, fore, back));
2710 void
2711 cmd_initscr(int nargs, char **args)
2713 if (check_arg_count(nargs, 0) == 1)
2714 return;
2716 report_count(1);
2717 report_ptr(initscr());
2721 void
2722 cmd_intrflush(int nargs, char **args)
2724 int flag;
2725 WINDOW *win;
2727 if (check_arg_count(nargs, 2) == 1)
2728 return;
2730 if (sscanf(args[0], "%p", &win) == 0) {
2731 report_count(1);
2732 report_error("BAD ARGUMENT");
2733 return;
2736 if (sscanf(args[1], "%d", &flag) == 0) {
2737 report_count(1);
2738 report_error("BAD ARGUMENT");
2739 return;
2742 report_count(1);
2743 report_return(intrflush(win, flag));
2747 void
2748 cmd_isendwin(int nargs, char **args)
2750 if (check_arg_count(nargs, 0) == 1)
2751 return;
2753 report_count(1);
2754 report_int(isendwin());
2758 void
2759 cmd_is_linetouched(int nargs, char **args)
2761 int line;
2762 WINDOW *win;
2764 if (check_arg_count(nargs, 2) == 1)
2765 return;
2767 if (sscanf(args[0], "%p", &win) == 0) {
2768 report_count(1);
2769 report_error("BAD ARGUMENT");
2770 return;
2773 if (sscanf(args[1], "%d", &line) == 0) {
2774 report_count(1);
2775 report_error("BAD ARGUMENT");
2776 return;
2779 report_count(1);
2780 report_int(is_linetouched(win, line));
2784 void
2785 cmd_is_wintouched(int nargs, char **args)
2787 WINDOW *win;
2789 if (check_arg_count(nargs, 1) == 1)
2790 return;
2792 if (sscanf(args[0], "%p", &win) == 0) {
2793 report_count(1);
2794 report_error("BAD ARGUMENT");
2795 return;
2798 report_count(1);
2799 report_int(is_wintouched(win));
2803 void
2804 cmd_keyok(int nargs, char **args)
2806 int keysym, flag;
2808 if (check_arg_count(nargs, 2) == 1)
2809 return;
2811 if (sscanf(args[0], "%d", &keysym) == 0) {
2812 report_count(1);
2813 report_error("BAD ARGUMENT");
2814 return;
2817 if (sscanf(args[1], "%d", &flag) == 0) {
2818 report_count(1);
2819 report_error("BAD ARGUMENT");
2820 return;
2823 report_count(1);
2824 report_return(keyok(keysym, flag));
2828 void
2829 cmd_keypad(int nargs, char **args)
2831 int flag;
2832 WINDOW *win;
2834 if (check_arg_count(nargs, 2) == 1)
2835 return;
2837 if (sscanf(args[0], "%p", &win) == 0) {
2838 report_count(1);
2839 report_error("BAD ARGUMENT");
2840 return;
2843 if (sscanf(args[1], "%d", &flag) == 0) {
2844 report_count(1);
2845 report_error("BAD ARGUMENT");
2846 return;
2849 report_count(1);
2850 report_return(keypad(win, flag));
2854 void
2855 cmd_keyname(int nargs, char **args)
2857 unsigned int key;
2859 if (check_arg_count(nargs, 1) == 1)
2860 return;
2862 if (sscanf(args[0], "%d", &key) == 0) {
2863 report_count(1);
2864 report_error("BAD ARGUMENT");
2865 return;
2868 report_count(1);
2869 report_status(keyname(key));
2873 void
2874 cmd_killchar(int nargs, char **args)
2876 if (check_arg_count(nargs, 0) == 1)
2877 return;
2879 report_count(1);
2880 report_int(killchar());
2884 void
2885 cmd_leaveok(int nargs, char **args)
2887 int flag;
2888 WINDOW *win;
2890 if (check_arg_count(nargs, 2) == 1)
2891 return;
2893 if (sscanf(args[0], "%p", &win) == 0) {
2894 report_count(1);
2895 report_error("BAD ARGUMENT");
2896 return;
2899 if (sscanf(args[1], "%d", &flag) == 0) {
2900 report_count(1);
2901 report_error("BAD ARGUMENT");
2902 return;
2905 report_count(1);
2906 report_return(leaveok(win, flag));
2910 void
2911 cmd_meta(int nargs, char **args)
2913 int flag;
2914 WINDOW *win;
2916 if (check_arg_count(nargs, 2) == 1)
2917 return;
2919 if (sscanf(args[0], "%p", &win) == 0) {
2920 report_count(1);
2921 report_error("BAD ARGUMENT");
2922 return;
2925 if (sscanf(args[1], "%d", &flag) == 0) {
2926 report_count(1);
2927 report_error("BAD ARGUMENT");
2928 return;
2931 report_count(1);
2932 report_return(meta(win, flag));
2936 void
2937 cmd_mvcur(int nargs, char **args)
2939 int oldy, oldx, y, x;
2941 if (check_arg_count(nargs, 4) == 1)
2942 return;
2944 if (sscanf(args[0], "%d", &oldy) == 0) {
2945 report_count(1);
2946 report_error("BAD ARGUMENT");
2947 return;
2950 if (sscanf(args[1], "%d", &oldx) == 0) {
2951 report_count(1);
2952 report_error("BAD ARGUMENT");
2953 return;
2956 if (sscanf(args[2], "%d", &y) == 0) {
2957 report_count(1);
2958 report_error("BAD ARGUMENT");
2959 return;
2962 if (sscanf(args[3], "%d", &x) == 0) {
2963 report_count(1);
2964 report_error("BAD ARGUMENT");
2965 return;
2968 report_count(1);
2969 report_return(mvcur(oldy, oldx, y, x));
2973 void
2974 cmd_mvderwin(int nargs, char **args)
2976 int y, x;
2977 WINDOW *win;
2979 if (check_arg_count(nargs, 3) == 1)
2980 return;
2982 if (sscanf(args[0], "%p", &win) == 0) {
2983 report_count(1);
2984 report_error("BAD ARGUMENT");
2985 return;
2988 if (sscanf(args[1], "%d", &y) == 0) {
2989 report_count(1);
2990 report_error("BAD ARGUMENT");
2991 return;
2994 if (sscanf(args[2], "%d", &x) == 0) {
2995 report_count(1);
2996 report_error("BAD ARGUMENT");
2997 return;
3000 report_count(1);
3001 report_return(mvderwin(win, y, x));
3005 void
3006 cmd_mvhline(int nargs, char **args)
3008 int y, x, n;
3009 chtype *ch;
3011 if (check_arg_count(nargs, 4) == 1)
3012 return;
3014 if (sscanf(args[0], "%d", &y) == 0) {
3015 report_count(1);
3016 report_error("BAD ARGUMENT");
3017 return;
3020 if (sscanf(args[1], "%d", &x) == 0) {
3021 report_count(1);
3022 report_error("BAD ARGUMENT");
3023 return;
3026 ch = (chtype *) args[2];
3028 if (sscanf(args[3], "%d", &n) == 0) {
3029 report_count(1);
3030 report_error("BAD ARGUMENT");
3031 return;
3034 report_count(1);
3035 report_return(mvhline(y, x, ch[0], n));
3039 void
3040 cmd_mvprintw(int nargs, char **args)
3042 int y, x;
3044 if (check_arg_count(nargs, 4) == 1)
3045 return;
3047 if (sscanf(args[0], "%d", &y) == 0) {
3048 report_count(1);
3049 report_error("BAD ARGUMENT");
3050 return;
3053 if (sscanf(args[1], "%d", &x) == 0) {
3054 report_count(1);
3055 report_error("BAD ARGUMENT");
3056 return;
3059 report_count(1);
3060 report_return(mvprintw(y, x, args[2], args[3]));
3064 void
3065 cmd_mvscanw(int nargs, char **args)
3067 int y, x;
3068 char string[256];
3070 if (check_arg_count(nargs, 3) == 1)
3071 return;
3073 if (sscanf(args[0], "%d", &y) == 0) {
3074 report_count(1);
3075 report_error("BAD ARGUMENT");
3076 return;
3079 if (sscanf(args[1], "%d", &x) == 0) {
3080 report_count(1);
3081 report_error("BAD ARGUMENT");
3082 return;
3085 /* XXX - call2 */
3086 report_count(2);
3087 report_return(mvscanw(y, x, args[2], &string));
3088 report_status(string);
3092 void
3093 cmd_mvvline(int nargs, char **args)
3095 int y, x, n;
3096 chtype *ch;
3098 if (check_arg_count(nargs, 4) == 1)
3099 return;
3101 if (sscanf(args[0], "%d", &y) == 0) {
3102 report_count(1);
3103 report_error("BAD ARGUMENT");
3104 return;
3107 if (sscanf(args[1], "%d", &x) == 0) {
3108 report_count(1);
3109 report_error("BAD ARGUMENT");
3110 return;
3113 ch = (chtype *) args[2];
3115 if (sscanf(args[3], "%d", &n) == 0) {
3116 report_count(1);
3117 report_error("BAD ARGUMENT");
3118 return;
3121 report_count(1);
3122 report_return(mvvline(y, x, ch[0], n));
3126 void
3127 cmd_mvwhline(int nargs, char **args)
3129 int y, x, ch, n;
3130 WINDOW *win;
3132 if (check_arg_count(nargs, 5) == 1)
3133 return;
3135 if (sscanf(args[0], "%p", &win) == 0) {
3136 report_count(1);
3137 report_error("BAD ARGUMENT");
3138 return;
3141 if (sscanf(args[1], "%d", &y) == 0) {
3142 report_count(1);
3143 report_error("BAD ARGUMENT");
3144 return;
3147 if (sscanf(args[2], "%d", &x) == 0) {
3148 report_count(1);
3149 report_error("BAD ARGUMENT");
3150 return;
3153 if (sscanf(args[3], "%d", &ch) == 0) {
3154 report_count(1);
3155 report_error("BAD ARGUMENT");
3156 return;
3159 if (sscanf(args[4], "%d", &n) == 0) {
3160 report_count(1);
3161 report_error("BAD ARGUMENT");
3162 return;
3165 report_count(1);
3166 report_return(mvwhline(win, y, x, ch, n));
3170 void
3171 cmd_mvwvline(int nargs, char **args)
3173 int y, x, n;
3174 WINDOW *win;
3175 chtype *ch;
3177 if (check_arg_count(nargs, 5) == 1)
3178 return;
3180 if (sscanf(args[0], "%p", &win) == 0) {
3181 report_count(1);
3182 report_error("BAD ARGUMENT");
3183 return;
3186 if (sscanf(args[1], "%d", &y) == 0) {
3187 report_count(1);
3188 report_error("BAD ARGUMENT");
3189 return;
3192 if (sscanf(args[2], "%d", &x) == 0) {
3193 report_count(1);
3194 report_error("BAD ARGUMENT");
3195 return;
3198 ch = (chtype *) args[3];
3200 if (sscanf(args[4], "%d", &n) == 0) {
3201 report_count(1);
3202 report_error("BAD ARGUMENT");
3203 return;
3206 report_count(1);
3207 report_return(mvwvline(win, y, x, ch[0], n));
3211 void
3212 cmd_mvwin(int nargs, char **args)
3214 int y, x;
3215 WINDOW *win;
3217 if (check_arg_count(nargs, 3) == 1)
3218 return;
3220 if (sscanf(args[0], "%p", &win) == 0) {
3221 report_count(1);
3222 report_error("BAD ARGUMENT");
3223 return;
3226 if (sscanf(args[1], "%d", &y) == 0) {
3227 report_count(1);
3228 report_error("BAD ARGUMENT");
3229 return;
3232 if (sscanf(args[2], "%d", &x) == 0) {
3233 report_count(1);
3234 report_error("BAD ARGUMENT");
3235 return;
3238 report_count(1);
3239 report_return(mvwin(win, y, x));
3243 void
3244 cmd_mvwinchnstr(int nargs, char **args)
3246 int y, x, count;
3247 chtype *string;
3248 WINDOW *win;
3250 if (check_arg_count(nargs, 4) == 1)
3251 return;
3253 if (sscanf(args[0], "%p", &win) == 0) {
3254 report_count(1);
3255 report_error("BAD ARGUMENT");
3256 return;
3259 if (sscanf(args[1], "%d", &y) == 0) {
3260 report_count(1);
3261 report_error("BAD ARGUMENT");
3262 return;
3265 if (sscanf(args[2], "%d", &x) == 0) {
3266 report_count(1);
3267 report_error("BAD ARGUMENT");
3268 return;
3271 if (sscanf(args[3], "%d", &count) == 0) {
3272 report_count(1);
3273 report_error("BAD ARGUMENT");
3274 return;
3277 if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
3278 report_count(1);
3279 report_error("MALLOC_FAILED");
3280 return;
3283 /* XXX call2 */
3284 report_count(2);
3285 report_return(mvwinchnstr(win, y, x, string, count));
3286 report_nstr(string);
3287 free(string);
3291 void
3292 cmd_mvwinchstr(int nargs, char **args)
3294 int y, x;
3295 chtype string[256];
3296 WINDOW *win;
3298 if (check_arg_count(nargs, 3) == 1)
3299 return;
3301 if (sscanf(args[0], "%p", &win) == 0) {
3302 report_count(1);
3303 report_error("BAD ARGUMENT");
3304 return;
3307 if (sscanf(args[1], "%d", &y) == 0) {
3308 report_count(1);
3309 report_error("BAD ARGUMENT");
3310 return;
3313 if (sscanf(args[2], "%d", &x) == 0) {
3314 report_count(1);
3315 report_error("BAD ARGUMENT");
3316 return;
3319 /* XXX call2 */
3320 report_count(2);
3321 report_return(mvwinchstr(win, y, x, string));
3322 report_nstr(string);
3326 void
3327 cmd_mvwinnstr(int nargs, char **args)
3329 int y, x, count;
3330 char *string;
3331 WINDOW *win;
3333 if (check_arg_count(nargs, 4) == 1)
3334 return;
3336 if (sscanf(args[0], "%p", &win) == 0) {
3337 report_count(1);
3338 report_error("BAD ARGUMENT");
3339 return;
3342 if (sscanf(args[1], "%d", &y) == 0) {
3343 report_count(1);
3344 report_error("BAD ARGUMENT");
3345 return;
3348 if (sscanf(args[2], "%d", &x) == 0) {
3349 report_count(1);
3350 report_error("BAD ARGUMENT");
3351 return;
3354 if (sscanf(args[3], "%d", &count) == 0) {
3355 report_count(1);
3356 report_error("BAD ARGUMENT");
3357 return;
3360 if ((string = malloc(count + 1)) == NULL) {
3361 report_count(1);
3362 report_error("MALLOC_FAILED");
3363 return;
3366 /* XXX call2 */
3367 report_count(2);
3368 report_return(mvwinnstr(win, y, x, string, count));
3369 report_status(string);
3370 free(string);
3374 void
3375 cmd_mvwinstr(int nargs, char **args)
3377 int y, x;
3378 char string[256];
3379 WINDOW *win;
3381 if (check_arg_count(nargs, 3) == 1)
3382 return;
3384 if (sscanf(args[0], "%p", &win) == 0) {
3385 report_count(1);
3386 report_error("BAD ARGUMENT");
3387 return;
3390 if (sscanf(args[1], "%d", &y) == 0) {
3391 report_count(1);
3392 report_error("BAD ARGUMENT");
3393 return;
3396 if (sscanf(args[2], "%d", &x) == 0) {
3397 report_count(1);
3398 report_error("BAD ARGUMENT");
3399 return;
3402 /* XXX call2 */
3403 report_count(2);
3404 report_return(mvwinstr(win, y, x, string));
3405 report_status(string);
3409 void
3410 cmd_mvwprintw(int nargs, char **args)
3412 int y, x;
3413 WINDOW *win;
3415 if (check_arg_count(nargs, 5) == 1)
3416 return;
3418 if (sscanf(args[0], "%p", &win) == 0) {
3419 report_count(1);
3420 report_error("BAD ARGUMENT");
3421 return;
3424 if (sscanf(args[1], "%d", &y) == 0) {
3425 report_count(1);
3426 report_error("BAD ARGUMENT");
3427 return;
3430 if (sscanf(args[2], "%d", &x) == 0) {
3431 report_count(1);
3432 report_error("BAD ARGUMENT");
3433 return;
3436 report_count(1);
3437 report_return(mvwprintw(win, y, x, args[3], args[4]));
3441 void
3442 cmd_mvwscanw(int nargs, char **args)
3444 int y, x;
3445 WINDOW *win;
3446 char string[256];
3448 if (check_arg_count(nargs, 4) == 1)
3449 return;
3451 if (sscanf(args[0], "%p", &win) == 0) {
3452 report_count(1);
3453 report_error("BAD ARGUMENT");
3454 return;
3457 if (sscanf(args[1], "%d", &y) == 0) {
3458 report_count(1);
3459 report_error("BAD ARGUMENT");
3460 return;
3463 if (sscanf(args[2], "%d", &x) == 0) {
3464 report_count(1);
3465 report_error("BAD ARGUMENT");
3466 return;
3469 /* XXX - call2 */
3470 report_count(2);
3471 report_int(mvwscanw(win, y, x, args[3], &string));
3472 report_status(string);
3476 void
3477 cmd_napms(int nargs, char **args)
3479 int naptime;
3481 if (check_arg_count(nargs, 1) == 1)
3482 return;
3484 if (sscanf(args[0], "%d", &naptime) == 0) {
3485 report_count(1);
3486 report_error("BAD ARGUMENT");
3487 return;
3490 report_count(1);
3491 report_return(napms(naptime));
3495 void
3496 cmd_newpad(int nargs, char **args)
3498 int y, x;
3500 if (check_arg_count(nargs, 2) == 1)
3501 return;
3503 if (sscanf(args[0], "%d", &y) == 0) {
3504 report_count(1);
3505 report_error("BAD ARGUMENT");
3506 return;
3509 if (sscanf(args[1], "%d", &x) == 0) {
3510 report_count(1);
3511 report_error("BAD ARGUMENT");
3512 return;
3515 report_count(1);
3516 report_ptr(newpad(y, x));
3520 void
3521 cmd_newterm(int nargs, char **args)
3523 FILE *in, *out;
3525 if (check_arg_count(nargs, 3) == 1)
3526 return;
3528 if ((in = fopen(args[1], "rw")) == NULL) {
3529 report_count(1);
3530 report_error("BAD FILE_ARGUMENT");
3531 return;
3535 if ((out = fopen(args[2], "rw")) == NULL) {
3536 report_count(1);
3537 report_error("BAD FILE_ARGUMENT");
3538 return;
3541 report_count(1);
3542 report_ptr(newterm(args[0], out, in));
3546 void
3547 cmd_newwin(int nargs, char **args)
3549 int lines, cols, begin_y, begin_x;
3551 if (check_arg_count(nargs, 4) == 1)
3552 return;
3554 if (sscanf(args[0], "%d", &lines) == 0) {
3555 report_count(1);
3556 report_error("BAD ARGUMENT");
3557 return;
3560 if (sscanf(args[1], "%d", &cols) == 0) {
3561 report_count(1);
3562 report_error("BAD ARGUMENT");
3563 return;
3566 if (sscanf(args[2], "%d", &begin_y) == 0) {
3567 report_count(1);
3568 report_error("BAD ARGUMENT");
3569 return;
3572 if (sscanf(args[3], "%d", &begin_x) == 0) {
3573 report_count(1);
3574 report_error("BAD ARGUMENT");
3575 return;
3578 report_count(1);
3579 report_ptr(newwin(lines, cols, begin_y, begin_x));
3583 void
3584 cmd_nl(int nargs, char **args)
3586 if (check_arg_count(nargs, 0) == 1)
3587 return;
3589 report_count(1);
3590 report_return(nl());
3594 void
3595 cmd_no_color_attributes(int nargs, char **args)
3597 if (check_arg_count(nargs, 0) == 1)
3598 return;
3600 report_count(1);
3601 report_int(no_color_attributes());
3605 void
3606 cmd_nocbreak(int nargs, char **args)
3608 if (check_arg_count(nargs, 0) == 1)
3609 return;
3611 report_count(1);
3612 report_return(nocbreak());
3616 void
3617 cmd_nodelay(int nargs, char **args)
3619 int flag;
3620 WINDOW *win;
3622 if (check_arg_count(nargs, 2) == 1)
3623 return;
3625 if (sscanf(args[0], "%p", &win) == 0) {
3626 report_count(1);
3627 report_error("BAD ARGUMENT");
3628 return;
3631 if (sscanf(args[1], "%d", &flag) == 0) {
3632 report_count(1);
3633 report_error("BAD ARGUMENT");
3634 return;
3637 report_count(1);
3638 report_return(nodelay(win, flag));
3642 void
3643 cmd_noecho(int nargs, char **args)
3645 if (check_arg_count(nargs, 0) == 1)
3646 return;
3648 report_count(1);
3649 report_return(noecho());
3653 void
3654 cmd_nonl(int nargs, char **args)
3656 if (check_arg_count(nargs, 0) == 1)
3657 return;
3659 report_count(1);
3660 report_return(nonl());
3664 void
3665 cmd_noqiflush(int nargs, char **args)
3667 if (check_arg_count(nargs, 0) == 1)
3668 return;
3670 noqiflush();
3671 report_count(1);
3672 report_return(OK); /* fake a return, the call returns void */
3676 void
3677 cmd_noraw(int nargs, char **args)
3679 if (check_arg_count(nargs, 0) == 1)
3680 return;
3682 report_count(1);
3683 report_return(noraw());
3687 void
3688 cmd_notimeout(int nargs, char **args)
3690 int flag;
3691 WINDOW *win;
3693 if (check_arg_count(nargs, 2) == 1)
3694 return;
3696 if (sscanf(args[0], "%p", &win) == 0) {
3697 report_count(1);
3698 report_error("BAD ARGUMENT");
3699 return;
3702 if (sscanf(args[1], "%d", &flag) == 0) {
3703 report_count(1);
3704 report_error("BAD ARGUMENT");
3705 return;
3708 report_count(1);
3709 report_return(notimeout(win, flag));
3713 void
3714 cmd_overlay(int nargs, char **args)
3716 WINDOW *source, *dest;
3718 if (check_arg_count(nargs, 2) == 1)
3719 return;
3721 if (sscanf(args[0], "%p", &source) == 0) {
3722 report_count(1);
3723 report_error("BAD ARGUMENT");
3724 return;
3727 if (sscanf(args[1], "%p", &dest) == 0) {
3728 report_count(1);
3729 report_error("BAD ARGUMENT");
3730 return;
3733 report_count(1);
3734 report_return(overlay(source, dest));
3738 void
3739 cmd_overwrite(int nargs, char **args)
3741 WINDOW *source, *dest;
3743 if (check_arg_count(nargs, 2) == 1)
3744 return;
3746 if (sscanf(args[0], "%p", &source) == 0) {
3747 report_count(1);
3748 report_error("BAD ARGUMENT");
3749 return;
3752 if (sscanf(args[1], "%p", &dest) == 0) {
3753 report_count(1);
3754 report_error("BAD ARGUMENT");
3755 return;
3758 report_count(1);
3759 report_return(overwrite(source, dest));
3763 void
3764 cmd_pair_content(int nargs, char **args)
3766 short pair, fore, back;
3768 if (check_arg_count(nargs, 1) == 1)
3769 return;
3771 if (sscanf(args[0], "%hd", &pair) == 0) {
3772 report_count(1);
3773 report_error("BAD ARGUMENT");
3774 return;
3777 /* XXX - call3 */
3778 report_count(3);
3779 report_return(pair_content(pair, &fore, &back));
3780 report_int(fore);
3781 report_int(back);
3785 void
3786 cmd_pechochar(int nargs, char **args)
3788 int ch;
3789 WINDOW *pad;
3791 if (check_arg_count(nargs, 2) == 1)
3792 return;
3794 if (sscanf(args[0], "%p", &pad) == 0) {
3795 report_count(1);
3796 report_error("BAD ARGUMENT");
3797 return;
3800 if (sscanf(args[1], "%d", &ch) == 0) {
3801 report_count(1);
3802 report_error("BAD ARGUMENT");
3803 return;
3806 report_count(1);
3807 report_return(pechochar(pad, ch));
3811 void
3812 cmd_pnoutrefresh(int nargs, char **args)
3814 int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
3815 WINDOW *pad;
3817 if (check_arg_count(nargs, 7) == 1)
3818 return;
3820 if (sscanf(args[0], "%p", &pad) == 0) {
3821 report_count(1);
3822 report_error("BAD ARGUMENT");
3823 return;
3826 if (sscanf(args[1], "%d", &pbeg_y) == 0) {
3827 report_count(1);
3828 report_error("BAD ARGUMENT");
3829 return;
3832 if (sscanf(args[2], "%d", &pbeg_x) == 0) {
3833 report_count(1);
3834 report_error("BAD ARGUMENT");
3835 return;
3838 if (sscanf(args[3], "%d", &sbeg_y) == 0) {
3839 report_count(1);
3840 report_error("BAD ARGUMENT");
3841 return;
3844 if (sscanf(args[4], "%d", &sbeg_x) == 0) {
3845 report_count(1);
3846 report_error("BAD ARGUMENT");
3847 return;
3850 if (sscanf(args[5], "%d", &smax_y) == 0) {
3851 report_count(1);
3852 report_error("BAD ARGUMENT");
3853 return;
3856 if (sscanf(args[6], "%d", &smax_x) == 0) {
3857 report_count(1);
3858 report_error("BAD ARGUMENT");
3859 return;
3862 report_count(1);
3863 report_return(pnoutrefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
3864 smax_x));
3868 void
3869 cmd_prefresh(int nargs, char **args)
3871 int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
3872 WINDOW *pad;
3874 if (check_arg_count(nargs, 7) == 1)
3875 return;
3877 if (sscanf(args[0], "%p", &pad) == 0) {
3878 report_count(1);
3879 report_error("BAD ARGUMENT");
3880 return;
3883 if (sscanf(args[1], "%d", &pbeg_y) == 0) {
3884 report_count(1);
3885 report_error("BAD ARGUMENT");
3886 return;
3889 if (sscanf(args[2], "%d", &pbeg_x) == 0) {
3890 report_count(1);
3891 report_error("BAD ARGUMENT");
3892 return;
3895 if (sscanf(args[3], "%d", &sbeg_y) == 0) {
3896 report_count(1);
3897 report_error("BAD ARGUMENT");
3898 return;
3901 if (sscanf(args[4], "%d", &sbeg_x) == 0) {
3902 report_count(1);
3903 report_error("BAD ARGUMENT");
3904 return;
3907 if (sscanf(args[5], "%d", &smax_y) == 0) {
3908 report_count(1);
3909 report_error("BAD ARGUMENT");
3910 return;
3913 if (sscanf(args[6], "%d", &smax_x) == 0) {
3914 report_count(1);
3915 report_error("BAD ARGUMENT");
3916 return;
3919 /* XXX causes refresh */
3920 report_count(1);
3921 report_return(prefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
3922 smax_x));
3927 void
3928 cmd_printw(int nargs, char **args)
3930 if (check_arg_count(nargs, 2) == 1)
3931 return;
3934 report_count(1);
3935 report_return(printw(args[0], args[1]));
3939 void
3940 cmd_putwin(int nargs, char **args)
3942 FILE *fp;
3943 WINDOW *win;
3945 if (check_arg_count(nargs, 2) == 1)
3946 return;
3948 if (sscanf(args[0], "%p", &win) == 0) {
3949 report_count(1);
3950 report_error("BAD ARGUMENT");
3951 return;
3954 if ((fp = fopen(args[1], "rw")) == NULL) {
3955 report_count(1);
3956 report_error("BAD FILE_ARGUMENT");
3957 return;
3960 report_count(1);
3961 report_return(putwin(win, fp));
3965 void
3966 cmd_qiflush(int nargs, char **args)
3968 if (check_arg_count(nargs, 0) == 1)
3969 return;
3971 qiflush();
3972 report_count(1);
3973 report_return(OK); /* fake a return because call returns void */
3977 void
3978 cmd_raw(int nargs, char **args)
3980 if (check_arg_count(nargs, 0) == 1)
3981 return;
3983 report_count(1);
3984 report_return(raw());
3988 void
3989 cmd_redrawwin(int nargs, char **args)
3991 WINDOW *win;
3993 if (check_arg_count(nargs, 1) == 1)
3994 return;
3996 if (sscanf(args[0], "%p", &win) == 0) {
3997 report_count(1);
3998 report_error("BAD ARGUMENT");
3999 return;
4002 report_count(1);
4003 report_return(redrawwin(win));
4007 void
4008 cmd_reset_prog_mode(int nargs, char **args)
4010 if (check_arg_count(nargs, 0) == 1)
4011 return;
4013 report_count(1);
4014 report_return(reset_prog_mode());
4018 void
4019 cmd_reset_shell_mode(int nargs, char **args)
4021 if (check_arg_count(nargs, 0) == 1)
4022 return;
4024 report_count(1);
4025 report_return(reset_shell_mode());
4029 void
4030 cmd_resetty(int nargs, char **args)
4032 if (check_arg_count(nargs, 0) == 1)
4033 return;
4035 report_count(1);
4036 report_return(resetty());
4040 void
4041 cmd_resizeterm(int nargs, char **args)
4043 int rows, cols;
4045 if (check_arg_count(nargs, 2) == 1)
4046 return;
4048 if (sscanf(args[0], "%d", &rows) == 0) {
4049 report_count(1);
4050 report_error("BAD ARGUMENT");
4051 return;
4054 if (sscanf(args[1], "%d", &cols) == 0) {
4055 report_count(1);
4056 report_error("BAD ARGUMENT");
4057 return;
4060 report_count(1);
4061 report_return(resizeterm(rows, cols));
4065 void
4066 cmd_savetty(int nargs, char **args)
4068 if (check_arg_count(nargs, 0) == 1)
4069 return;
4071 report_count(1);
4072 report_return(savetty());
4076 void
4077 cmd_scanw(int nargs, char **args)
4079 char string[256];
4081 if (check_arg_count(nargs, 0) == 1)
4082 return;
4084 /* XXX call2 */
4085 report_count(2);
4086 report_return(scanw("%s", string));
4087 report_status(string);
4091 void
4092 cmd_scroll(int nargs, char **args)
4094 WINDOW *win;
4096 if (check_arg_count(nargs, 1) == 1)
4097 return;
4099 if (sscanf(args[0], "%p", &win) == 0) {
4100 report_count(1);
4101 report_error("BAD ARGUMENT");
4102 return;
4105 report_count(1);
4106 report_return(scroll(win));
4110 void
4111 cmd_scrollok(int nargs, char **args)
4113 WINDOW *win;
4114 int flag;
4116 if (check_arg_count(nargs, 2) == 1)
4117 return;
4119 if (sscanf(args[0], "%p", &win) == 0) {
4120 report_count(1);
4121 report_error("BAD ARGUMENT");
4122 return;
4125 if (sscanf(args[1], "%d", &flag) == 0) {
4126 report_count(1);
4127 report_error("BAD ARGUMENT");
4128 return;
4131 report_count(1);
4132 report_return(scrollok(win, flag));
4136 void
4137 cmd_setterm(int nargs, char **args)
4139 if (check_arg_count(nargs, 1) == 1)
4140 return;
4142 report_count(1);
4143 report_return(setterm(args[0]));
4147 void
4148 cmd_set_term(int nargs, char **args)
4150 SCREEN *scrn;
4152 if (check_arg_count(nargs, 1) == 1)
4153 return;
4155 if (sscanf(args[0], "%p", &scrn) == 0) {
4156 report_count(1);
4157 report_error("BAD ARGUMENT");
4158 return;
4161 report_count(1);
4162 report_ptr(set_term(scrn));
4166 void
4167 cmd_start_color(int nargs, char **args)
4169 if (check_arg_count(nargs, 0) == 1)
4170 return;
4172 report_count(1);
4173 report_return(start_color());
4177 void
4178 cmd_subpad(int nargs, char **args)
4180 WINDOW *pad;
4181 int lines, cols, begin_y, begin_x;
4183 if (check_arg_count(nargs, 5) == 1)
4184 return;
4186 if (sscanf(args[0], "%p", &pad) == 0) {
4187 report_count(1);
4188 report_error("BAD ARGUMENT");
4189 return;
4192 if (sscanf(args[1], "%d", &lines) == 0) {
4193 report_count(1);
4194 report_error("BAD ARGUMENT");
4195 return;
4198 if (sscanf(args[2], "%d", &cols) == 0) {
4199 report_count(1);
4200 report_error("BAD ARGUMENT");
4201 return;
4204 if (sscanf(args[3], "%d", &begin_y) == 0) {
4205 report_count(1);
4206 report_error("BAD ARGUMENT");
4207 return;
4210 if (sscanf(args[4], "%d", &begin_x) == 0) {
4211 report_count(1);
4212 report_error("BAD ARGUMENT");
4213 return;
4216 report_count(1);
4217 report_ptr(subpad(pad, lines, cols, begin_y, begin_x));
4221 void
4222 cmd_subwin(int nargs, char **args)
4224 WINDOW *win;
4225 int lines, cols, begin_y, begin_x;
4227 if (check_arg_count(nargs, 5) == 1)
4228 return;
4230 if (sscanf(args[0], "%p", &win) == 0) {
4231 report_count(1);
4232 report_error("BAD ARGUMENT");
4233 return;
4236 if (sscanf(args[1], "%d", &lines) == 0) {
4237 report_count(1);
4238 report_error("BAD ARGUMENT");
4239 return;
4242 if (sscanf(args[2], "%d", &cols) == 0) {
4243 report_count(1);
4244 report_error("BAD ARGUMENT");
4245 return;
4248 if (sscanf(args[3], "%d", &begin_y) == 0) {
4249 report_count(1);
4250 report_error("BAD ARGUMENT");
4251 return;
4254 if (sscanf(args[4], "%d", &begin_x) == 0) {
4255 report_count(1);
4256 report_error("BAD ARGUMENT");
4257 return;
4260 report_count(1);
4261 report_ptr(subwin(win, lines, cols, begin_y, begin_x));
4265 void
4266 cmd_termattrs(int nargs, char **args)
4268 if (check_arg_count(nargs, 0) == 1)
4269 return;
4271 report_count(1);
4272 report_int(termattrs());
4276 void
4277 cmd_term_attrs(int nargs, char **args)
4279 if (check_arg_count(nargs, 0) == 1)
4280 return;
4282 report_count(1);
4283 report_int(term_attrs());
4287 void
4288 cmd_touchline(int nargs, char **args)
4290 WINDOW *win;
4291 int start, count;
4293 if (check_arg_count(nargs, 3) == 1)
4294 return;
4296 if (sscanf(args[0], "%p", &win) == 0) {
4297 report_count(1);
4298 report_error("BAD ARGUMENT");
4299 return;
4302 if (sscanf(args[1], "%d", &start) == 0) {
4303 report_count(1);
4304 report_error("BAD ARGUMENT");
4305 return;
4308 if (sscanf(args[2], "%d", &count) == 0) {
4309 report_count(1);
4310 report_error("BAD ARGUMENT");
4311 return;
4314 report_count(1);
4315 report_return(touchline(win, start, count));
4319 void
4320 cmd_touchoverlap(int nargs, char **args)
4322 WINDOW *win1, *win2;
4324 if (check_arg_count(nargs, 2) == 1)
4325 return;
4327 if (sscanf(args[0], "%p", &win1) == 0) {
4328 report_count(1);
4329 report_error("BAD ARGUMENT");
4330 return;
4333 if (sscanf(args[1], "%p", &win2) == 0) {
4334 report_count(1);
4335 report_error("BAD ARGUMENT");
4336 return;
4339 report_count(1);
4340 report_return(touchoverlap(win1, win2));
4344 void
4345 cmd_touchwin(int nargs, char **args)
4347 WINDOW *win;
4349 if (check_arg_count(nargs, 1) == 1)
4350 return;
4352 if (sscanf(args[0], "%p", &win) == 0) {
4353 report_count(1);
4354 report_error("BAD ARGUMENT");
4355 return;
4358 report_count(1);
4359 report_return(touchwin(win));
4363 void
4364 cmd_ungetch(int nargs, char **args)
4366 int ch;
4368 if (check_arg_count(nargs, 1) == 1)
4369 return;
4371 if (sscanf(args[0], "%d", &ch) == 0) {
4372 report_count(1);
4373 report_error("BAD ARGUMENT");
4374 return;
4377 report_count(1);
4378 report_return(ungetch(ch));
4382 void
4383 cmd_untouchwin(int nargs, char **args)
4385 WINDOW *win;
4387 if (check_arg_count(nargs, 1) == 1)
4388 return;
4390 if (sscanf(args[0], "%p", &win) == 0) {
4391 report_count(1);
4392 report_error("BAD ARGUMENT");
4393 return;
4396 report_count(1);
4397 report_return(untouchwin(win));
4401 void
4402 cmd_use_default_colors(int nargs, char **args)
4404 if (check_arg_count(nargs, 0) == 1)
4405 return;
4407 report_count(1);
4408 report_return(use_default_colors());
4412 void
4413 cmd_vline(int nargs, char **args)
4415 int count;
4416 chtype *ch;
4418 if (check_arg_count(nargs, 2) == 1)
4419 return;
4421 ch = (chtype *) args[0];
4423 if (sscanf(args[1], "%d", &count) == 0) {
4424 report_count(1);
4425 report_error("BAD ARGUMENT");
4426 return;
4429 report_count(1);
4430 report_return(vline(ch[0], count));
4434 static int
4435 internal_vw_printw(WINDOW *win, char *arg1, ...)
4437 va_list va;
4438 int rv;
4440 va_start(va, arg1);
4441 rv = vw_printw(win, arg1, va);
4442 va_end(va);
4444 return rv;
4447 void
4448 cmd_vw_printw(int nargs, char **args)
4450 WINDOW *win;
4452 if (check_arg_count(nargs, 3) == 1)
4453 return;
4455 if (sscanf(args[0], "%p", &win) == 0) {
4456 report_count(1);
4457 report_error("BAD ARGUMENT");
4458 return;
4461 report_count(1);
4462 report_return(internal_vw_printw(win, args[1], args[2]));
4466 static int
4467 internal_vw_scanw(WINDOW *win, char *arg1, ...)
4469 va_list va;
4470 int rv;
4472 va_start(va, arg1);
4473 rv = vw_scanw(win, arg1, va);
4474 va_end(va);
4476 return rv;
4479 void
4480 cmd_vw_scanw(int nargs, char **args)
4482 WINDOW *win;
4483 char string[256];
4485 if (check_arg_count(nargs, 2) == 1)
4486 return;
4488 if (sscanf(args[0], "%p", &win) == 0) {
4489 report_count(1);
4490 report_error("BAD ARGUMENT");
4491 return;
4494 /* XXX - call2 */
4495 report_count(2);
4496 report_int(internal_vw_scanw(win, args[1], string));
4497 report_status(string);
4501 void
4502 cmd_vwprintw(int nargs, char **args)
4504 cmd_vw_printw(nargs, args);
4508 void
4509 cmd_vwscanw(int nargs, char **args)
4511 cmd_vw_scanw(nargs, args);
4515 void
4516 cmd_waddch(int nargs, char **args)
4518 WINDOW *win;
4519 chtype *ch;
4521 if (check_arg_count(nargs, 2) == 1)
4522 return;
4524 if (sscanf(args[0], "%p", &win) == 0) {
4525 report_count(1);
4526 report_error("BAD ARGUMENT");
4527 return;
4530 ch = (chtype *) args[1];
4532 report_count(1);
4533 report_return(waddch(win, ch[0]));
4537 void
4538 cmd_waddchnstr(int nargs, char **args)
4540 WINDOW *win;
4541 int count;
4543 if (check_arg_count(nargs, 3) == 1)
4544 return;
4546 if (sscanf(args[0], "%p", &win) == 0) {
4547 report_count(1);
4548 report_error("BAD ARGUMENT");
4549 return;
4552 if (sscanf(args[2], "%d", &count) == 0) {
4553 report_count(1);
4554 report_error("BAD ARGUMENT");
4555 return;
4558 report_count(1);
4559 report_return(waddchnstr(win, (chtype *) args[1], count));
4563 void
4564 cmd_waddchstr(int nargs, char **args)
4566 WINDOW *win;
4568 if (check_arg_count(nargs, 2) == 1)
4569 return;
4571 if (sscanf(args[0], "%p", &win) == 0) {
4572 report_count(1);
4573 report_error("BAD ARGUMENT");
4574 return;
4577 report_count(1);
4578 report_return(waddchstr(win, (chtype *) args[1]));
4582 void
4583 cmd_waddnstr(int nargs, char **args)
4585 WINDOW *win;
4586 int count;
4588 if (check_arg_count(nargs, 1) == 3)
4589 return;
4591 if (sscanf(args[0], "%p", &win) == 0) {
4592 report_count(1);
4593 report_error("BAD ARGUMENT");
4594 return;
4597 if (sscanf(args[2], "%d", &count) == 0) {
4598 report_count(1);
4599 report_error("BAD ARGUMENT");
4600 return;
4603 report_count(1);
4604 report_return(waddnstr(win, args[1], count));
4609 void
4610 cmd_wattr_get(int nargs, char **args)
4612 WINDOW *win;
4613 int attr;
4614 short pair;
4616 if (check_arg_count(nargs, 1) == 1)
4617 return;
4619 if (sscanf(args[0], "%p", &win) == 0) {
4620 report_count(1);
4621 report_error("BAD ARGUMENT");
4622 return;
4625 /* XXX - call3 */
4626 report_count(3);
4627 report_return(wattr_get(win, &attr, &pair, NULL));
4628 report_int(attr);
4629 report_int(pair);
4633 void
4634 cmd_wattr_off(int nargs, char **args)
4636 WINDOW *win;
4637 int attr;
4639 if (check_arg_count(nargs, 2) == 1)
4640 return;
4642 if (sscanf(args[0], "%p", &win) == 0) {
4643 report_count(1);
4644 report_error("BAD ARGUMENT");
4645 return;
4648 if (sscanf(args[1], "%d", &attr) == 0) {
4649 report_count(1);
4650 report_error("BAD ARGUMENT");
4651 return;
4654 report_count(1);
4655 report_return(wattr_off(win, attr, NULL));
4659 void
4660 cmd_wattr_on(int nargs, char **args)
4662 WINDOW *win;
4663 int attr;
4665 if (check_arg_count(nargs, 2) == 1)
4666 return;
4668 if (sscanf(args[0], "%p", &win) == 0) {
4669 report_count(1);
4670 report_error("BAD ARGUMENT");
4671 return;
4674 if (sscanf(args[1], "%d", &attr) == 0) {
4675 report_count(1);
4676 report_error("BAD ARGUMENT");
4677 return;
4680 report_count(1);
4681 report_return(wattr_on(win, attr, NULL));
4685 void
4686 cmd_wattr_set(int nargs, char **args)
4688 WINDOW *win;
4689 int attr;
4690 short pair;
4692 if (check_arg_count(nargs, 3) == 1)
4693 return;
4695 if (sscanf(args[0], "%p", &win) == 0) {
4696 report_count(1);
4697 report_error("BAD ARGUMENT");
4698 return;
4701 if (sscanf(args[1], "%d", &attr) == 0) {
4702 report_count(1);
4703 report_error("BAD ARGUMENT");
4704 return;
4707 if (sscanf(args[2], "%hd", &pair) == 0) {
4708 report_count(1);
4709 report_error("BAD ARGUMENT");
4710 return;
4713 report_count(1);
4714 report_return(wattr_set(win, attr, pair, NULL));
4718 void
4719 cmd_wattroff(int nargs, char **args)
4721 WINDOW *win;
4722 int attr;
4724 if (check_arg_count(nargs, 2) == 1)
4725 return;
4727 if (sscanf(args[0], "%p", &win) == 0) {
4728 report_count(1);
4729 report_error("BAD ARGUMENT");
4730 return;
4733 if (sscanf(args[1], "%d", &attr) == 0) {
4734 report_count(1);
4735 report_error("BAD ARGUMENT");
4736 return;
4739 report_count(1);
4740 report_return(wattroff(win, attr));
4744 void
4745 cmd_wattron(int nargs, char **args)
4747 WINDOW *win;
4748 int attr;
4750 if (check_arg_count(nargs, 2) == 1)
4751 return;
4753 if (sscanf(args[0], "%p", &win) == 0) {
4754 report_count(1);
4755 report_error("BAD ARGUMENT");
4756 return;
4759 if (sscanf(args[1], "%d", &attr) == 0) {
4760 report_count(1);
4761 report_error("BAD ARGUMENT");
4762 return;
4765 report_count(1);
4766 report_return(wattron(win, attr));
4770 void
4771 cmd_wattrset(int nargs, char **args)
4773 WINDOW *win;
4774 int attr;
4776 if (check_arg_count(nargs, 2) == 1)
4777 return;
4779 if (sscanf(args[0], "%p", &win) == 0) {
4780 report_count(1);
4781 report_error("BAD ARGUMENT");
4782 return;
4785 if (sscanf(args[1], "%d", &attr) == 0) {
4786 report_count(1);
4787 report_error("BAD ARGUMENT");
4788 return;
4791 report_count(1);
4792 report_return(wattrset(win, attr));
4796 void
4797 cmd_wbkgd(int nargs, char **args)
4799 WINDOW *win;
4800 chtype *ch;
4802 if (check_arg_count(nargs, 2) == 1)
4803 return;
4805 if (sscanf(args[0], "%p", &win) == 0) {
4806 report_count(1);
4807 report_error("BAD ARGUMENT");
4808 return;
4811 ch = (chtype *) args[1];
4812 report_count(1);
4813 report_return(wbkgd(win, ch[0]));
4817 void
4818 cmd_wbkgdset(int nargs, char **args)
4820 WINDOW *win;
4821 int ch;
4823 if (check_arg_count(nargs, 2) == 1)
4824 return;
4826 if (sscanf(args[0], "%p", &win) == 0) {
4827 report_count(1);
4828 report_error("BAD ARGUMENT");
4829 return;
4832 if (sscanf(args[1], "%d", &ch) == 0) {
4833 report_count(1);
4834 report_error("BAD ARGUMENT");
4835 return;
4838 wbkgdset(win, ch); /* void return */
4839 report_count(1);
4840 report_return(OK);
4844 void
4845 cmd_wborder(int nargs, char **args)
4847 WINDOW *win;
4848 int ls, rs, ts, bs, tl, tr, bl, br;
4850 if (check_arg_count(nargs, 9) == 1)
4851 return;
4853 if (sscanf(args[0], "%p", &win) == 0) {
4854 report_count(1);
4855 report_error("BAD ARGUMENT");
4856 return;
4859 if (sscanf(args[1], "%d", &ls) == 0) {
4860 report_count(1);
4861 report_error("BAD ARGUMENT");
4862 return;
4865 if (sscanf(args[2], "%d", &rs) == 0) {
4866 report_count(1);
4867 report_error("BAD ARGUMENT");
4868 return;
4871 if (sscanf(args[3], "%d", &ts) == 0) {
4872 report_count(1);
4873 report_error("BAD ARGUMENT");
4874 return;
4877 if (sscanf(args[4], "%d", &bs) == 0) {
4878 report_count(1);
4879 report_error("BAD ARGUMENT");
4880 return;
4883 if (sscanf(args[5], "%d", &tl) == 0) {
4884 report_count(1);
4885 report_error("BAD ARGUMENT");
4886 return;
4889 if (sscanf(args[6], "%d", &tr) == 0) {
4890 report_count(1);
4891 report_error("BAD ARGUMENT");
4892 return;
4895 if (sscanf(args[7], "%d", &bl) == 0) {
4896 report_count(1);
4897 report_error("BAD ARGUMENT");
4898 return;
4901 if (sscanf(args[8], "%d", &br) == 0) {
4902 report_count(1);
4903 report_error("BAD ARGUMENT");
4904 return;
4907 report_count(1);
4908 report_return(wborder(win, ls, rs, ts, bs, tl, tr, bl, br));
4912 void
4913 cmd_wclear(int nargs, char **args)
4915 WINDOW *win;
4917 if (check_arg_count(nargs, 1) == 1)
4918 return;
4920 if (sscanf(args[0], "%p", &win) == 0) {
4921 report_count(1);
4922 report_error("BAD ARGUMENT");
4923 return;
4926 report_count(1);
4927 report_return(wclear(win));
4931 void
4932 cmd_wclrtobot(int nargs, char **args)
4934 WINDOW *win;
4936 if (check_arg_count(nargs, 1) == 1)
4937 return;
4939 if (sscanf(args[0], "%p", &win) == 0) {
4940 report_count(1);
4941 report_error("BAD ARGUMENT");
4942 return;
4945 report_count(1);
4946 report_return(wclrtobot(win));
4950 void
4951 cmd_wclrtoeol(int nargs, char **args)
4953 WINDOW *win;
4955 if (check_arg_count(nargs, 1) == 1)
4956 return;
4958 if (sscanf(args[0], "%p", &win) == 0) {
4959 report_count(1);
4960 report_error("BAD ARGUMENT");
4961 return;
4964 report_count(1);
4965 report_return(wclrtoeol(win));
4970 void
4971 cmd_wcolor_set(int nargs, char **args)
4973 WINDOW *win;
4974 short pair;
4976 if (check_arg_count(nargs, 2) == 1)
4977 return;
4979 if (sscanf(args[0], "%p", &win) == 0) {
4980 report_count(1);
4981 report_error("BAD ARGUMENT");
4982 return;
4985 if (sscanf(args[1], "%hd", &pair) == 0) {
4986 report_count(1);
4987 report_error("BAD ARGUMENT");
4988 return;
4991 report_count(1);
4992 report_return(wcolor_set(win, pair, NULL));
4996 void
4997 cmd_wdelch(int nargs, char **args)
4999 WINDOW *win;
5001 if (check_arg_count(nargs, 1) == 1)
5002 return;
5004 if (sscanf(args[0], "%p", &win) == 0) {
5005 report_count(1);
5006 report_error("BAD ARGUMENT");
5007 return;
5010 report_count(1);
5011 report_return(wdelch(win));
5015 void
5016 cmd_wdeleteln(int nargs, char **args)
5018 WINDOW *win;
5020 if (check_arg_count(nargs, 1) == 1)
5021 return;
5023 if (sscanf(args[0], "%p", &win) == 0) {
5024 report_count(1);
5025 report_error("BAD ARGUMENT");
5026 return;
5029 report_count(1);
5030 report_return(wdeleteln(win));
5035 void
5036 cmd_wechochar(int nargs, char **args)
5038 WINDOW *win;
5039 int ch;
5041 if (check_arg_count(nargs, 2) == 1)
5042 return;
5044 if (sscanf(args[0], "%p", &win) == 0) {
5045 report_count(1);
5046 report_error("BAD ARGUMENT");
5047 return;
5050 if (sscanf(args[1], "%d", &ch) == 0) {
5051 report_count(1);
5052 report_error("BAD ARGUMENT");
5053 return;
5056 report_count(1);
5057 report_return(wechochar(win, ch));
5061 void
5062 cmd_werase(int nargs, char **args)
5064 WINDOW *win;
5066 if (check_arg_count(nargs, 1) == 1)
5067 return;
5069 if (sscanf(args[0], "%p", &win) == 0) {
5070 report_count(1);
5071 report_error("BAD ARGUMENT");
5072 return;
5075 report_count(1);
5076 report_return(werase(win));
5080 void
5081 cmd_wgetch(int nargs, char **args)
5083 WINDOW *win;
5085 if (check_arg_count(nargs, 1) == 1)
5086 return;
5088 if (sscanf(args[0], "%p", &win) == 0) {
5089 report_count(1);
5090 report_error("BAD ARGUMENT");
5091 return;
5094 report_count(1);
5095 report_int(wgetch(win));
5099 void
5100 cmd_wgetnstr(int nargs, char **args)
5102 WINDOW *win;
5103 int count;
5104 char string[256];
5106 if (check_arg_count(nargs, 2) == 1)
5107 return;
5109 if (sscanf(args[0], "%p", &win) == 0) {
5110 report_count(1);
5111 report_error("BAD ARGUMENT");
5112 return;
5115 if (sscanf(args[1], "%d", &count) == 0) {
5116 report_count(1);
5117 report_error("BAD ARGUMENT");
5118 return;
5121 /* XXX - call2 */
5122 report_count(2);
5123 report_return(wgetnstr(win, string, count));
5124 report_status(string);
5128 void
5129 cmd_wgetstr(int nargs, char **args)
5131 WINDOW *win;
5132 char string[256];
5135 if (check_arg_count(nargs, 1) == 1)
5136 return;
5138 if (sscanf(args[0], "%p", &win) == 0) {
5139 report_count(1);
5140 report_error("BAD ARGUMENT");
5141 return;
5144 string[0] = '\0';
5146 report_count(2);
5147 report_return(wgetstr(win, string));
5148 report_status(string);
5152 void
5153 cmd_whline(int nargs, char **args)
5155 WINDOW *win;
5156 int ch, count;
5158 if (check_arg_count(nargs, 3) == 1)
5159 return;
5161 if (sscanf(args[0], "%p", &win) == 0) {
5162 report_count(1);
5163 report_error("BAD ARGUMENT");
5164 return;
5167 if (sscanf(args[1], "%d", &ch) == 0) {
5168 report_count(1);
5169 report_error("BAD ARGUMENT");
5170 return;
5173 if (sscanf(args[2], "%d", &count) == 0) {
5174 report_count(1);
5175 report_error("BAD ARGUMENT");
5176 return;
5179 report_count(1);
5180 report_return(whline(win, ch, count));
5184 void
5185 cmd_winch(int nargs, char **args)
5187 WINDOW *win;
5189 if (check_arg_count(nargs, 1) == 1)
5190 return;
5192 if (sscanf(args[0], "%p", &win) == 0) {
5193 report_count(1);
5194 report_error("BAD ARGUMENT");
5195 return;
5198 report_count(1);
5199 report_int(winch(win));
5203 void
5204 cmd_winchnstr(int nargs, char **args)
5206 WINDOW *win;
5207 chtype string[256];
5208 int count;
5210 if (check_arg_count(nargs, 2) == 1)
5211 return;
5213 if (sscanf(args[0], "%p", &win) == 0) {
5214 report_count(1);
5215 report_error("BAD ARGUMENT");
5216 return;
5219 if (sscanf(args[1], "%d", &count) == 0) {
5220 report_count(1);
5221 report_error("BAD ARGUMENT");
5222 return;
5225 /* XXX - call2 */
5226 report_count(2);
5227 report_return(winchnstr(win, string, count));
5228 report_nstr(string);
5232 void
5233 cmd_winchstr(int nargs, char **args)
5235 WINDOW *win;
5236 chtype string[256];
5238 if (check_arg_count(nargs, 1) == 1)
5239 return;
5241 if (sscanf(args[0], "%p", &win) == 0) {
5242 report_count(1);
5243 report_error("BAD ARGUMENT");
5244 return;
5247 /* XXX - call2 */
5248 report_count(2);
5249 report_return(winchstr(win, string));
5250 report_nstr(string);
5254 void
5255 cmd_winnstr(int nargs, char **args)
5257 WINDOW *win;
5258 char string[256];
5259 int count;
5261 if (check_arg_count(nargs, 2) == 1)
5262 return;
5264 if (sscanf(args[0], "%p", &win) == 0) {
5265 report_count(1);
5266 report_error("BAD ARGUMENT");
5267 return;
5270 if (sscanf(args[1], "%d", &count) == 0) {
5271 report_count(1);
5272 report_error("BAD ARGUMENT");
5273 return;
5276 /* XXX - call2 */
5277 report_count(2);
5278 report_return(winnstr(win, string, count));
5279 report_status(string);
5283 void
5284 cmd_winsch(int nargs, char **args)
5286 WINDOW *win;
5287 int ch;
5289 if (check_arg_count(nargs, 2) == 1)
5290 return;
5292 if (sscanf(args[0], "%p", &win) == 0) {
5293 report_count(1);
5294 report_error("BAD ARGUMENT");
5295 return;
5298 if (sscanf(args[1], "%d", &ch) == 0) {
5299 report_count(1);
5300 report_error("BAD ARGUMENT");
5301 return;
5304 report_count(1);
5305 report_return(winsch(win, ch));
5309 void
5310 cmd_winsdelln(int nargs, char **args)
5312 WINDOW *win;
5313 int count;
5315 if (check_arg_count(nargs, 2) == 1)
5316 return;
5318 if (sscanf(args[0], "%p", &win) == 0) {
5319 report_count(1);
5320 report_error("BAD ARGUMENT");
5321 return;
5324 if (sscanf(args[1], "%d", &count) == 0) {
5325 report_count(1);
5326 report_error("BAD ARGUMENT");
5327 return;
5330 report_count(1);
5331 report_return(winsdelln(win, count));
5335 void
5336 cmd_winsertln(int nargs, char **args)
5338 WINDOW *win;
5340 if (check_arg_count(nargs, 1) == 1)
5341 return;
5343 if (sscanf(args[0], "%p", &win) == 0) {
5344 report_count(1);
5345 report_error("BAD ARGUMENT");
5346 return;
5349 report_count(1);
5350 report_return(winsertln(win));
5354 void
5355 cmd_winstr(int nargs, char **args)
5357 WINDOW *win;
5358 char string[256];
5360 if (check_arg_count(nargs, 1) == 1)
5361 return;
5363 if (sscanf(args[0], "%p", &win) == 0) {
5364 report_count(1);
5365 report_error("BAD ARGUMENT");
5366 return;
5369 /* XXX - call2 */
5370 report_count(2);
5371 report_return(winstr(win, string));
5372 report_status(string);
5376 void
5377 cmd_wmove(int nargs, char **args)
5379 WINDOW *win;
5380 int y, x;
5382 if (check_arg_count(nargs, 3) == 1)
5383 return;
5385 if (sscanf(args[0], "%p", &win) == 0) {
5386 report_count(1);
5387 report_error("BAD ARGUMENT");
5388 return;
5391 if (sscanf(args[1], "%d", &y) == 0) {
5392 report_count(1);
5393 report_error("BAD ARGUMENT");
5394 return;
5397 if (sscanf(args[2], "%d", &x) == 0) {
5398 report_count(1);
5399 report_error("BAD ARGUMENT");
5400 return;
5403 report_count(1);
5404 report_return(wmove(win, y, x));
5408 void
5409 cmd_wnoutrefresh(int nargs, char **args)
5411 WINDOW *win;
5413 if (check_arg_count(nargs, 1) == 1)
5414 return;
5416 if (sscanf(args[0], "%p", &win) == 0) {
5417 report_count(1);
5418 report_error("BAD ARGUMENT");
5419 return;
5422 report_count(1);
5423 report_return(wnoutrefresh(win));
5427 void
5428 cmd_wprintw(int nargs, char **args)
5430 WINDOW *win;
5432 if (check_arg_count(nargs, 3) == 1)
5433 return;
5435 if (sscanf(args[0], "%p", &win) == 0) {
5436 report_count(1);
5437 report_error("BAD ARGUMENT");
5438 return;
5441 report_count(1);
5442 report_return(wprintw(win, args[1], args[2]));
5446 void
5447 cmd_wredrawln(int nargs, char **args)
5449 WINDOW *win;
5450 int beg_line, num_lines;
5452 if (check_arg_count(nargs, 3) == 1)
5453 return;
5455 if (sscanf(args[0], "%p", &win) == 0) {
5456 report_count(1);
5457 report_error("BAD ARGUMENT");
5458 return;
5461 if (sscanf(args[1], "%d", &beg_line) == 0) {
5462 report_count(1);
5463 report_error("BAD ARGUMENT");
5464 return;
5467 if (sscanf(args[2], "%d", &num_lines) == 0) {
5468 report_count(1);
5469 report_error("BAD ARGUMENT");
5470 return;
5473 report_count(1);
5474 report_return(wredrawln(win, beg_line, num_lines));
5478 void
5479 cmd_wrefresh(int nargs, char **args)
5481 WINDOW *win;
5483 if (check_arg_count(nargs, 1) == 1)
5484 return;
5486 if (sscanf(args[0], "%p", &win) == 0) {
5487 report_count(1);
5488 report_error("BAD ARGUMENT");
5489 return;
5492 /* XXX - generates output */
5493 report_count(1);
5494 report_return(wrefresh(win));
5498 void
5499 cmd_wresize(int nargs, char **args)
5501 WINDOW *win;
5502 int lines, cols;
5504 if (check_arg_count(nargs, 3) == 1)
5505 return;
5507 if (sscanf(args[0], "%p", &win) == 0) {
5508 report_count(1);
5509 report_error("BAD ARGUMENT");
5510 return;
5513 if (sscanf(args[1], "%d", &lines) == 0) {
5514 report_count(1);
5515 report_error("BAD ARGUMENT");
5516 return;
5519 if (sscanf(args[2], "%d", &cols) == 0) {
5520 report_count(1);
5521 report_error("BAD ARGUMENT");
5522 return;
5525 report_count(1);
5526 report_return(wresize(win, lines, cols));
5530 void
5531 cmd_wscanw(int nargs, char **args)
5533 WINDOW *win;
5534 char string[256];
5536 if (check_arg_count(nargs, 2) == 1)
5537 return;
5539 if (sscanf(args[0], "%p", &win) == 0) {
5540 report_count(1);
5541 report_error("BAD ARGUMENT");
5542 return;
5545 report_count(1);
5546 report_return(wscanw(win, args[1], &string));
5550 void
5551 cmd_wscrl(int nargs, char **args)
5553 WINDOW *win;
5554 int n;
5556 if (check_arg_count(nargs, 2) == 1)
5557 return;
5559 if (sscanf(args[0], "%p", &win) == 0) {
5560 report_count(1);
5561 report_error("BAD ARGUMENT");
5562 return;
5565 if (sscanf(args[1], "%d", &n) == 0) {
5566 report_count(1);
5567 report_error("BAD ARGUMENT");
5568 return;
5571 report_count(1);
5572 report_return(wscrl(win, n));
5576 void
5577 cmd_wsetscrreg(int nargs, char **args)
5579 WINDOW *win;
5580 int top, bottom;
5582 if (check_arg_count(nargs, 3) == 1)
5583 return;
5585 if (sscanf(args[0], "%p", &win) == 0) {
5586 report_count(1);
5587 report_error("BAD ARGUMENT");
5588 return;
5591 if (sscanf(args[1], "%d", &top) == 0) {
5592 report_count(1);
5593 report_error("BAD ARGUMENT");
5594 return;
5597 if (sscanf(args[2], "%d", &bottom) == 0) {
5598 report_count(1);
5599 report_error("BAD ARGUMENT");
5600 return;
5603 report_count(1);
5604 report_return(wsetscrreg(win, top, bottom));
5608 void
5609 cmd_wstandend(int nargs, char **args)
5611 WINDOW *win;
5613 if (check_arg_count(nargs, 1) == 1)
5614 return;
5616 if (sscanf(args[0], "%p", &win) == 0) {
5617 report_count(1);
5618 report_error("BAD ARGUMENT");
5619 return;
5622 report_count(1);
5623 report_return(wstandend(win));
5627 void
5628 cmd_wstandout(int nargs, char **args)
5630 WINDOW *win;
5632 if (check_arg_count(nargs, 1) == 1)
5633 return;
5635 if (sscanf(args[0], "%p", &win) == 0) {
5636 report_count(1);
5637 report_error("BAD ARGUMENT");
5638 return;
5641 report_count(1);
5642 report_return(wstandout(win));
5646 void
5647 cmd_wtimeout(int nargs, char **args)
5649 WINDOW *win;
5650 int tval;
5652 if (check_arg_count(nargs, 2) == 1)
5653 return;
5655 if (sscanf(args[0], "%p", &win) == 0) {
5656 report_count(1);
5657 report_error("BAD ARGUMENT");
5658 return;
5661 if (sscanf(args[1], "%d", &tval) == 0) {
5662 report_count(1);
5663 report_error("BAD ARGUMENT");
5664 return;
5667 wtimeout(win, tval); /* void return */
5668 report_count(1);
5669 report_return(OK);
5673 void
5674 cmd_wtouchln(int nargs, char **args)
5676 WINDOW *win;
5677 int line, n, changed;
5679 if (check_arg_count(nargs, 4) == 1)
5680 return;
5682 if (sscanf(args[0], "%p", &win) == 0) {
5683 report_count(1);
5684 report_error("BAD ARGUMENT");
5685 return;
5688 if (sscanf(args[1], "%d", &line) == 0) {
5689 report_count(1);
5690 report_error("BAD ARGUMENT");
5691 return;
5694 if (sscanf(args[2], "%d", &n) == 0) {
5695 report_count(1);
5696 report_error("BAD ARGUMENT");
5697 return;
5700 if (sscanf(args[3], "%d", &changed) == 0) {
5701 report_count(1);
5702 report_error("BAD ARGUMENT");
5703 return;
5706 report_count(1);
5707 report_return(wtouchln(win, line, n, changed));
5711 void
5712 cmd_wunderend(int nargs, char **args)
5714 WINDOW *win;
5716 if (check_arg_count(nargs, 1) == 1)
5717 return;
5719 if (sscanf(args[0], "%p", &win) == 0) {
5720 report_count(1);
5721 report_error("BAD ARGUMENT");
5722 return;
5725 report_count(1);
5726 report_return(wunderend(win));
5730 void
5731 cmd_wunderscore(int nargs, char **args)
5733 WINDOW *win;
5735 if (check_arg_count(nargs, 1) == 1)
5736 return;
5738 if (sscanf(args[0], "%p", &win) == 0) {
5739 report_count(1);
5740 report_error("BAD ARGUMENT");
5741 return;
5744 report_count(1);
5745 report_return(wunderscore(win));
5749 void
5750 cmd_wvline(int nargs, char **args)
5752 WINDOW *win;
5753 int n;
5754 chtype *ch;
5756 if (check_arg_count(nargs, 3) == 1)
5757 return;
5759 if (sscanf(args[0], "%p", &win) == 0) {
5760 report_count(1);
5761 report_error("BAD ARGUMENT");
5762 return;
5765 ch = (chtype *) args[1];
5767 if (sscanf(args[2], "%d", &n) == 0) {
5768 report_count(1);
5769 report_error("BAD ARGUMENT");
5770 return;
5773 report_count(1);
5774 report_return(wvline(win, ch[0], n));
5778 void
5779 cmd_insnstr(int nargs, char **args)
5781 int n;
5783 if (check_arg_count(nargs, 2) == 1)
5784 return;
5786 if (sscanf(args[1], "%d", &n) == 0) {
5787 report_count(1);
5788 report_error("BAD ARGUMENT");
5789 return;
5792 report_count(1);
5793 report_return(insnstr(args[0], n));
5797 void
5798 cmd_insstr(int nargs, char **args)
5800 if (check_arg_count(nargs, 1) == 1)
5801 return;
5803 report_count(1);
5804 report_return(insstr(args[0]));
5808 void
5809 cmd_mvinsnstr(int nargs, char **args)
5811 int y, x, n;
5813 if (check_arg_count(nargs, 4) == 1)
5814 return;
5816 if (sscanf(args[0], "%d", &y) == 0) {
5817 report_count(1);
5818 report_error("BAD ARGUMENT");
5819 return;
5822 if (sscanf(args[1], "%d", &x) == 0) {
5823 report_count(1);
5824 report_error("BAD ARGUMENT");
5825 return;
5828 if (sscanf(args[3], "%d", &n) == 0) {
5829 report_count(1);
5830 report_error("BAD ARGUMENT");
5831 return;
5834 report_count(1);
5835 report_return(mvinsnstr(y, x, args[2], n));
5839 void
5840 cmd_mvinsstr(int nargs, char **args)
5842 int y, x;
5844 if (check_arg_count(nargs, 3) == 1)
5845 return;
5847 if (sscanf(args[0], "%d", &y) == 0) {
5848 report_count(1);
5849 report_error("BAD ARGUMENT");
5850 return;
5853 if (sscanf(args[1], "%d", &x) == 0) {
5854 report_count(1);
5855 report_error("BAD ARGUMENT");
5856 return;
5859 report_count(1);
5860 report_return(mvinsstr(y, x, args[2]));
5864 void
5865 cmd_mvwinsnstr(int nargs, char **args)
5867 WINDOW *win;
5868 int y, x, n;
5870 if (check_arg_count(nargs, 5) == 1)
5871 return;
5873 if (sscanf(args[0], "%p", &win) == 0) {
5874 report_count(1);
5875 report_error("BAD ARGUMENT");
5876 return;
5879 if (sscanf(args[1], "%d", &y) == 0) {
5880 report_count(1);
5881 report_error("BAD ARGUMENT");
5882 return;
5885 if (sscanf(args[2], "%d", &x) == 0) {
5886 report_count(1);
5887 report_error("BAD ARGUMENT");
5888 return;
5891 if (sscanf(args[4], "%d", &n) == 0) {
5892 report_count(1);
5893 report_error("BAD ARGUMENT");
5894 return;
5897 report_count(1);
5898 report_return(mvwinsnstr(win, y, x, args[3], n));
5903 void
5904 cmd_mvwinsstr(int nargs, char **args)
5906 WINDOW *win;
5907 int y, x;
5909 if (check_arg_count(nargs, 4) == 1)
5910 return;
5912 if (sscanf(args[0], "%p", &win) == 0) {
5913 report_count(1);
5914 report_error("BAD ARGUMENT");
5915 return;
5918 if (sscanf(args[1], "%d", &y) == 0) {
5919 report_count(1);
5920 report_error("BAD ARGUMENT");
5921 return;
5924 if (sscanf(args[2], "%d", &x) == 0) {
5925 report_count(1);
5926 report_error("BAD ARGUMENT");
5927 return;
5930 report_count(1);
5931 report_return(mvwinsstr(win, y, x, args[3]));
5935 void
5936 cmd_winsnstr(int nargs, char **args)
5938 WINDOW *win;
5939 int n;
5941 if (check_arg_count(nargs, 3) == 1)
5942 return;
5944 if (sscanf(args[0], "%p", &win) == 0) {
5945 report_count(1);
5946 report_error("BAD ARGUMENT");
5947 return;
5950 if (sscanf(args[2], "%d", &n) == 0) {
5951 report_count(1);
5952 report_error("BAD ARGUMENT");
5953 return;
5956 report_count(1);
5957 report_return(winsnstr(win, args[1], n));
5961 void
5962 cmd_winsstr(int nargs, char **args)
5964 WINDOW *win;
5966 if (check_arg_count(nargs, 2) == 1)
5967 return;
5969 if (sscanf(args[0], "%p", &win) == 0) {
5970 report_count(1);
5971 report_error("BAD ARGUMENT");
5972 return;
5975 report_count(1);
5976 report_return(winsstr(win, args[1]));
5981 void
5982 cmd_chgat(int nargs, char **args)
5984 int n, attr, colour;
5986 if (check_arg_count(nargs, 4) == 1)
5987 return;
5989 if (sscanf(args[0], "%d", &n) == 0) {
5990 report_count(1);
5991 report_error("BAD ARGUMENT");
5992 return;
5995 if (sscanf(args[1], "%d", &attr) == 0) {
5996 report_count(1);
5997 report_error("BAD ARGUMENT");
5998 return;
6001 if (sscanf(args[2], "%d", &colour) == 0) {
6002 report_count(1);
6003 report_error("BAD ARGUMENT");
6004 return;
6007 /* Note: 4th argument unused in current curses implementation */
6008 report_count(1);
6009 report_return(chgat(n, attr, colour, NULL));
6013 void
6014 cmd_wchgat(int nargs, char **args)
6016 WINDOW *win;
6017 int n, attr;
6018 short colour;
6020 if (check_arg_count(nargs, 4) == 1)
6021 return;
6023 if (sscanf(args[0], "%p", &win) == 0) {
6024 report_count(1);
6025 report_error("BAD ARGUMENT");
6026 return;
6029 if (sscanf(args[1], "%d", &n) == 0) {
6030 report_count(1);
6031 report_error("BAD ARGUMENT");
6032 return;
6035 if (sscanf(args[2], "%d", &attr) == 0) {
6036 report_count(1);
6037 report_error("BAD ARGUMENT");
6038 return;
6041 if (sscanf(args[3], "%hd", &colour) == 0) {
6042 report_count(1);
6043 report_error("BAD ARGUMENT");
6044 return;
6047 report_count(1);
6048 report_return(wchgat(win, n, attr, colour, NULL));
6052 void
6053 cmd_mvchgat(int nargs, char **args)
6055 int y, x, n, attr;
6056 short colour;
6058 if (check_arg_count(nargs, 6) == 1)
6059 return;
6061 if (sscanf(args[0], "%d", &y) == 0) {
6062 report_count(1);
6063 report_error("BAD ARGUMENT");
6064 return;
6067 if (sscanf(args[1], "%d", &x) == 0) {
6068 report_count(1);
6069 report_error("BAD ARGUMENT");
6070 return;
6073 if (sscanf(args[2], "%d", &n) == 0) {
6074 report_count(1);
6075 report_error("BAD ARGUMENT");
6076 return;
6079 if (sscanf(args[3], "%d", &attr) == 0) {
6080 report_count(1);
6081 report_error("BAD ARGUMENT");
6082 return;
6085 if (sscanf(args[4], "%hd", &colour) == 0) {
6086 report_count(1);
6087 report_error("BAD ARGUMENT");
6088 return;
6091 report_count(1);
6092 report_return(mvchgat(y, x, n, attr, colour, NULL));
6096 void
6097 cmd_mvwchgat(int nargs, char **args)
6099 WINDOW *win;
6100 int y, x, n, attr, colour;
6102 if (check_arg_count(nargs, 6) == 1)
6103 return;
6105 if (sscanf(args[0], "%p", &win) == 0) {
6106 report_count(1);
6107 report_error("BAD ARGUMENT");
6108 return;
6111 if (sscanf(args[1], "%d", &y) == 0) {
6112 report_count(1);
6113 report_error("BAD ARGUMENT");
6114 return;
6117 if (sscanf(args[2], "%d", &x) == 0) {
6118 report_count(1);
6119 report_error("BAD ARGUMENT");
6120 return;
6123 if (sscanf(args[3], "%d", &n) == 0) {
6124 report_count(1);
6125 report_error("BAD ARGUMENT");
6126 return;
6129 if (sscanf(args[4], "%d", &attr) == 0) {
6130 report_count(1);
6131 report_error("BAD ARGUMENT");
6132 return;
6135 if (sscanf(args[5], "%d", &colour) == 0) {
6136 report_count(1);
6137 report_error("BAD ARGUMENT");
6138 return;
6141 report_count(1);
6142 report_return(mvwchgat(win, y, x, n, attr, colour, NULL));
6146 void
6147 cmd_add_wch(int nargs, char **args)
6149 if (check_arg_count(nargs, 1) == 1)
6150 return;
6152 report_count(1);
6153 report_error("UNSUPPORTED");
6157 void
6158 cmd_wadd_wch(int nargs, char **args)
6160 if (check_arg_count(nargs, 1) == 1)
6161 return;
6163 report_count(1);
6164 report_error("UNSUPPORTED");
6168 void
6169 cmd_mvadd_wch(int nargs, char **args)
6171 if (check_arg_count(nargs, 1) == 1)
6172 return;
6174 report_count(1);
6175 report_error("UNSUPPORTED");
6179 void
6180 cmd_mvwadd_wch(int nargs, char **args)
6182 if (check_arg_count(nargs, 1) == 1)
6183 return;
6185 report_count(1);
6186 report_error("UNSUPPORTED");
6191 void
6192 cmd_add_wchnstr(int nargs, char **args)
6194 if (check_arg_count(nargs, 1) == 1)
6195 return;
6197 report_count(1);
6198 report_error("UNSUPPORTED");
6202 void
6203 cmd_add_wchstr(int nargs, char **args)
6205 if (check_arg_count(nargs, 1) == 1)
6206 return;
6208 report_count(1);
6209 report_error("UNSUPPORTED");
6213 void
6214 cmd_wadd_wchnstr(int nargs, char **args)
6216 if (check_arg_count(nargs, 1) == 1)
6217 return;
6219 report_count(1);
6220 report_error("UNSUPPORTED");
6224 void
6225 cmd_wadd_wchstr(int nargs, char **args)
6227 if (check_arg_count(nargs, 1) == 1)
6228 return;
6230 report_count(1);
6231 report_error("UNSUPPORTED");
6235 void
6236 cmd_mvadd_wchnstr(int nargs, char **args)
6238 if (check_arg_count(nargs, 1) == 1)
6239 return;
6241 report_count(1);
6242 report_error("UNSUPPORTED");
6246 void
6247 cmd_mvadd_wchstr(int nargs, char **args)
6249 if (check_arg_count(nargs, 1) == 1)
6250 return;
6252 report_count(1);
6253 report_error("UNSUPPORTED");
6257 void
6258 cmd_mvwadd_wchnstr(int nargs, char **args)
6260 if (check_arg_count(nargs, 1) == 1)
6261 return;
6263 report_count(1);
6264 report_error("UNSUPPORTED");
6268 void
6269 cmd_mvwadd_wchstr(int nargs, char **args)
6271 if (check_arg_count(nargs, 1) == 1)
6272 return;
6274 report_count(1);
6275 report_error("UNSUPPORTED");
6280 void
6281 cmd_addnwstr(int nargs, char **args)
6283 if (check_arg_count(nargs, 1) == 1)
6284 return;
6286 report_count(1);
6287 report_error("UNSUPPORTED");
6291 void
6292 cmd_addwstr(int nargs, char **args)
6294 if (check_arg_count(nargs, 1) == 1)
6295 return;
6297 report_count(1);
6298 report_error("UNSUPPORTED");
6302 void
6303 cmd_mvaddnwstr(int nargs, char **args)
6305 if (check_arg_count(nargs, 1) == 1)
6306 return;
6308 report_count(1);
6309 report_error("UNSUPPORTED");
6313 void
6314 cmd_mvaddwstr(int nargs, char **args)
6316 if (check_arg_count(nargs, 1) == 1)
6317 return;
6319 report_count(1);
6320 report_error("UNSUPPORTED");
6324 void
6325 cmd_mvwaddnwstr(int nargs, char **args)
6327 if (check_arg_count(nargs, 1) == 1)
6328 return;
6330 report_count(1);
6331 report_error("UNSUPPORTED");
6335 void
6336 cmd_mvwaddwstr(int nargs, char **args)
6338 if (check_arg_count(nargs, 1) == 1)
6339 return;
6341 report_count(1);
6342 report_error("UNSUPPORTED");
6346 void
6347 cmd_waddnwstr(int nargs, char **args)
6349 if (check_arg_count(nargs, 1) == 1)
6350 return;
6352 report_count(1);
6353 report_error("UNSUPPORTED");
6357 void
6358 cmd_waddwstr(int nargs, char **args)
6360 if (check_arg_count(nargs, 1) == 1)
6361 return;
6363 report_count(1);
6364 report_error("UNSUPPORTED");
6369 void
6370 cmd_echo_wchar(int nargs, char **args)
6372 if (check_arg_count(nargs, 1) == 1)
6373 return;
6375 report_count(1);
6376 report_error("UNSUPPORTED");
6380 void
6381 cmd_wecho_wchar(int nargs, char **args)
6383 if (check_arg_count(nargs, 1) == 1)
6384 return;
6386 report_count(1);
6387 report_error("UNSUPPORTED");
6391 void
6392 cmd_pecho_wchar(int nargs, char **args)
6394 if (check_arg_count(nargs, 1) == 1)
6395 return;
6397 report_count(1);
6398 report_error("UNSUPPORTED");
6403 /* insert */
6404 void
6405 cmd_ins_wch(int nargs, char **args)
6407 if (check_arg_count(nargs, 1) == 1)
6408 return;
6410 report_count(1);
6411 report_error("UNSUPPORTED");
6415 void
6416 cmd_wins_wch(int nargs, char **args)
6418 if (check_arg_count(nargs, 1) == 1)
6419 return;
6421 report_count(1);
6422 report_error("UNSUPPORTED");
6426 void
6427 cmd_mvins_wch(int nargs, char **args)
6429 if (check_arg_count(nargs, 1) == 1)
6430 return;
6432 report_count(1);
6433 report_error("UNSUPPORTED");
6437 void
6438 cmd_mvwins_wch(int nargs, char **args)
6440 if (check_arg_count(nargs, 1) == 1)
6441 return;
6443 report_count(1);
6444 report_error("UNSUPPORTED");
6449 void
6450 cmd_ins_nwstr(int nargs, char **args)
6452 if (check_arg_count(nargs, 1) == 1)
6453 return;
6455 report_count(1);
6456 report_error("UNSUPPORTED");
6460 void
6461 cmd_ins_wstr(int nargs, char **args)
6463 if (check_arg_count(nargs, 1) == 1)
6464 return;
6466 report_count(1);
6467 report_error("UNSUPPORTED");
6471 void
6472 cmd_mvins_nwstr(int nargs, char **args)
6474 if (check_arg_count(nargs, 1) == 1)
6475 return;
6477 report_count(1);
6478 report_error("UNSUPPORTED");
6482 void
6483 cmd_mvins_wstr(int nargs, char **args)
6485 if (check_arg_count(nargs, 1) == 1)
6486 return;
6488 report_count(1);
6489 report_error("UNSUPPORTED");
6493 void
6494 cmd_mvwins_nwstr(int nargs, char **args)
6496 if (check_arg_count(nargs, 1) == 1)
6497 return;
6499 report_count(1);
6500 report_error("UNSUPPORTED");
6504 void
6505 cmd_mvwins_wstr(int nargs, char **args)
6507 if (check_arg_count(nargs, 1) == 1)
6508 return;
6510 report_count(1);
6511 report_error("UNSUPPORTED");
6515 void
6516 cmd_wins_nwstr(int nargs, char **args)
6518 if (check_arg_count(nargs, 1) == 1)
6519 return;
6521 report_count(1);
6522 report_error("UNSUPPORTED");
6526 void
6527 cmd_wins_wstr(int nargs, char **args)
6529 if (check_arg_count(nargs, 1) == 1)
6530 return;
6532 report_count(1);
6533 report_error("UNSUPPORTED");
6538 /* input */
6539 void
6540 cmd_get_wch(int nargs, char **args)
6542 if (check_arg_count(nargs, 1) == 1)
6543 return;
6545 report_count(1);
6546 report_error("UNSUPPORTED");
6550 void
6551 cmd_unget_wch(int nargs, char **args)
6553 if (check_arg_count(nargs, 1) == 1)
6554 return;
6556 report_count(1);
6557 report_error("UNSUPPORTED");
6561 void
6562 cmd_mvget_wch(int nargs, char **args)
6564 if (check_arg_count(nargs, 1) == 1)
6565 return;
6567 report_count(1);
6568 report_error("UNSUPPORTED");
6572 void
6573 cmd_mvwget_wch(int nargs, char **args)
6575 if (check_arg_count(nargs, 1) == 1)
6576 return;
6578 report_count(1);
6579 report_error("UNSUPPORTED");
6583 void
6584 cmd_wget_wch(int nargs, char **args)
6586 if (check_arg_count(nargs, 1) == 1)
6587 return;
6589 report_count(1);
6590 report_error("UNSUPPORTED");
6595 void
6596 cmd_getn_wstr(int nargs, char **args)
6598 if (check_arg_count(nargs, 1) == 1)
6599 return;
6601 report_count(1);
6602 report_error("UNSUPPORTED");
6606 void
6607 cmd_get_wstr(int nargs, char **args)
6609 if (check_arg_count(nargs, 1) == 1)
6610 return;
6612 report_count(1);
6613 report_error("UNSUPPORTED");
6617 void
6618 cmd_mvgetn_wstr(int nargs, char **args)
6620 if (check_arg_count(nargs, 1) == 1)
6621 return;
6623 report_count(1);
6624 report_error("UNSUPPORTED");
6628 void
6629 cmd_mvget_wstr(int nargs, char **args)
6631 if (check_arg_count(nargs, 1) == 1)
6632 return;
6634 report_count(1);
6635 report_error("UNSUPPORTED");
6639 void
6640 cmd_mvwgetn_wstr(int nargs, char **args)
6642 if (check_arg_count(nargs, 1) == 1)
6643 return;
6645 report_count(1);
6646 report_error("UNSUPPORTED");
6650 void
6651 cmd_mvwget_wstr(int nargs, char **args)
6653 if (check_arg_count(nargs, 1) == 1)
6654 return;
6656 report_count(1);
6657 report_error("UNSUPPORTED");
6661 void
6662 cmd_wgetn_wstr(int nargs, char **args)
6664 if (check_arg_count(nargs, 1) == 1)
6665 return;
6667 report_count(1);
6668 report_error("UNSUPPORTED");
6672 void
6673 cmd_wget_wstr(int nargs, char **args)
6675 if (check_arg_count(nargs, 1) == 1)
6676 return;
6678 report_count(1);
6679 report_error("UNSUPPORTED");
6684 void
6685 cmd_in_wch(int nargs, char **args)
6687 if (check_arg_count(nargs, 1) == 1)
6688 return;
6690 report_count(1);
6691 report_error("UNSUPPORTED");
6695 void
6696 cmd_mvin_wch(int nargs, char **args)
6698 if (check_arg_count(nargs, 1) == 1)
6699 return;
6701 report_count(1);
6702 report_error("UNSUPPORTED");
6706 void
6707 cmd_mvwin_wch(int nargs, char **args)
6709 if (check_arg_count(nargs, 1) == 1)
6710 return;
6712 report_count(1);
6713 report_error("UNSUPPORTED");
6717 void
6718 cmd_win_wch(int nargs, char **args)
6720 if (check_arg_count(nargs, 1) == 1)
6721 return;
6723 report_count(1);
6724 report_error("UNSUPPORTED");
6729 void
6730 cmd_in_wchnstr(int nargs, char **args)
6732 if (check_arg_count(nargs, 1) == 1)
6733 return;
6735 report_count(1);
6736 report_error("UNSUPPORTED");
6740 void
6741 cmd_in_wchstr(int nargs, char **args)
6743 if (check_arg_count(nargs, 1) == 1)
6744 return;
6746 report_count(1);
6747 report_error("UNSUPPORTED");
6751 void
6752 cmd_mvin_wchnstr(int nargs, char **args)
6754 if (check_arg_count(nargs, 1) == 1)
6755 return;
6757 report_count(1);
6758 report_error("UNSUPPORTED");
6762 void
6763 cmd_mvin_wchstr(int nargs, char **args)
6765 if (check_arg_count(nargs, 1) == 1)
6766 return;
6768 report_count(1);
6769 report_error("UNSUPPORTED");
6773 void
6774 cmd_mvwin_wchnstr(int nargs, char **args)
6776 if (check_arg_count(nargs, 1) == 1)
6777 return;
6779 report_count(1);
6780 report_error("UNSUPPORTED");
6784 void
6785 cmd_mvwin_wchstr(int nargs, char **args)
6787 if (check_arg_count(nargs, 1) == 1)
6788 return;
6790 report_count(1);
6791 report_error("UNSUPPORTED");
6795 void
6796 cmd_win_wchnstr(int nargs, char **args)
6798 if (check_arg_count(nargs, 1) == 1)
6799 return;
6801 report_count(1);
6802 report_error("UNSUPPORTED");
6806 void
6807 cmd_win_wchstr(int nargs, char **args)
6809 if (check_arg_count(nargs, 1) == 1)
6810 return;
6812 report_count(1);
6813 report_error("UNSUPPORTED");
6818 void
6819 cmd_innwstr(int nargs, char **args)
6821 if (check_arg_count(nargs, 1) == 1)
6822 return;
6824 report_count(1);
6825 report_error("UNSUPPORTED");
6829 void
6830 cmd_inwstr(int nargs, char **args)
6832 if (check_arg_count(nargs, 1) == 1)
6833 return;
6835 report_count(1);
6836 report_error("UNSUPPORTED");
6840 void
6841 cmd_mvinnwstr(int nargs, char **args)
6843 if (check_arg_count(nargs, 1) == 1)
6844 return;
6846 report_count(1);
6847 report_error("UNSUPPORTED");
6851 void
6852 cmd_mvinwstr(int nargs, char **args)
6854 if (check_arg_count(nargs, 1) == 1)
6855 return;
6857 report_count(1);
6858 report_error("UNSUPPORTED");
6862 void
6863 cmd_mvwinnwstr(int nargs, char **args)
6865 if (check_arg_count(nargs, 1) == 1)
6866 return;
6868 report_count(1);
6869 report_error("UNSUPPORTED");
6873 void
6874 cmd_mvwinwstr(int nargs, char **args)
6876 if (check_arg_count(nargs, 1) == 1)
6877 return;
6879 report_count(1);
6880 report_error("UNSUPPORTED");
6884 void
6885 cmd_winnwstr(int nargs, char **args)
6887 if (check_arg_count(nargs, 1) == 1)
6888 return;
6890 report_count(1);
6891 report_error("UNSUPPORTED");
6895 void
6896 cmd_winwstr(int nargs, char **args)
6898 if (check_arg_count(nargs, 1) == 1)
6899 return;
6901 report_count(1);
6902 report_error("UNSUPPORTED");
6907 /* cchar handlgin */
6908 void
6909 cmd_setcchar(int nargs, char **args)
6911 if (check_arg_count(nargs, 1) == 1)
6912 return;
6914 report_count(1);
6915 report_error("UNSUPPORTED");
6919 void
6920 cmd_getcchar(int nargs, char **args)
6922 if (check_arg_count(nargs, 1) == 1)
6923 return;
6925 report_count(1);
6926 report_error("UNSUPPORTED");
6931 /* misc */
6932 void
6933 cmd_key_name(int nargs, char **args)
6935 int w;
6937 if (check_arg_count(nargs, 1) == 1)
6938 return;
6940 if (sscanf(args[0], "%d", &w) == 0) {
6941 report_count(1);
6942 report_error("BAD ARGUMENT");
6943 return;
6946 report_count(1);
6947 report_status(key_name(w));
6951 void
6952 cmd_border_set(int nargs, char **args)
6954 if (check_arg_count(nargs, 1) == 1)
6955 return;
6957 report_count(1);
6958 report_error("UNSUPPORTED");
6962 void
6963 cmd_wborder_set(int nargs, char **args)
6965 if (check_arg_count(nargs, 1) == 1)
6966 return;
6968 report_count(1);
6969 report_error("UNSUPPORTED");
6973 void
6974 cmd_box_set(int nargs, char **args)
6976 if (check_arg_count(nargs, 1) == 1)
6977 return;
6979 report_count(1);
6980 report_error("UNSUPPORTED");
6984 void
6985 cmd_erasewchar(int nargs, char **args)
6987 wchar_t ch;
6989 if (check_arg_count(nargs, 0) == 1)
6990 return;
6992 /* XXX - call2 */
6993 report_count(2);
6994 report_return(erasewchar(&ch));
6995 report_int(ch);
6999 void
7000 cmd_killwchar(int nargs, char **args)
7002 wchar_t ch;
7004 if (check_arg_count(nargs, 0) == 1)
7005 return;
7007 /* XXX - call2 */
7008 report_count(2);
7009 report_return(erasewchar(&ch));
7010 report_int(ch);
7014 void
7015 cmd_hline_set(int nargs, char **args)
7017 if (check_arg_count(nargs, 1) == 1)
7018 return;
7020 report_count(1);
7021 report_error("UNSUPPORTED");
7025 void
7026 cmd_mvhline_set(int nargs, char **args)
7028 if (check_arg_count(nargs, 1) == 1)
7029 return;
7031 report_count(1);
7032 report_error("UNSUPPORTED");
7036 void
7037 cmd_mvvline_set(int nargs, char **args)
7039 if (check_arg_count(nargs, 1) == 1)
7040 return;
7042 report_count(1);
7043 report_error("UNSUPPORTED");
7047 void
7048 cmd_mvwhline_set(int nargs, char **args)
7050 if (check_arg_count(nargs, 1) == 1)
7051 return;
7053 report_count(1);
7054 report_error("UNSUPPORTED");
7058 void
7059 cmd_mvwvline_set(int nargs, char **args)
7061 if (check_arg_count(nargs, 1) == 1)
7062 return;
7064 report_count(1);
7065 report_error("UNSUPPORTED");
7069 void
7070 cmd_vline_set(int nargs, char **args)
7072 if (check_arg_count(nargs, 1) == 1)
7073 return;
7075 report_count(1);
7076 report_error("UNSUPPORTED");
7080 void
7081 cmd_whline_set(int nargs, char **args)
7083 if (check_arg_count(nargs, 1) == 1)
7084 return;
7086 report_count(1);
7087 report_error("UNSUPPORTED");
7091 void
7092 cmd_wvline_set(int nargs, char **args)
7094 if (check_arg_count(nargs, 1) == 1)
7095 return;
7097 report_count(1);
7098 report_error("UNSUPPORTED");
7102 void
7103 cmd_bkgrnd(int nargs, char **args)
7105 if (check_arg_count(nargs, 1) == 1)
7106 return;
7108 report_count(1);
7109 report_error("UNSUPPORTED");
7113 void
7114 cmd_bkgrndset(int nargs, char **args)
7116 if (check_arg_count(nargs, 1) == 1)
7117 return;
7119 report_count(1);
7120 report_error("UNSUPPORTED");
7124 void
7125 cmd_getbkgrnd(int nargs, char **args)
7127 if (check_arg_count(nargs, 1) == 1)
7128 return;
7130 report_count(1);
7131 report_error("UNSUPPORTED");
7135 void
7136 cmd_wbkgrnd(int nargs, char **args)
7138 if (check_arg_count(nargs, 1) == 1)
7139 return;
7141 report_count(1);
7142 report_error("UNSUPPORTED");
7146 void
7147 cmd_wbkgrndset(int nargs, char **args)
7149 if (check_arg_count(nargs, 1) == 1)
7150 return;
7152 report_count(1);
7153 report_error("UNSUPPORTED");
7157 void
7158 cmd_wgetbkgrnd(int nargs, char **args)
7160 if (check_arg_count(nargs, 1) == 1)
7161 return;
7163 report_count(1);
7164 report_error("UNSUPPORTED");