xref: /netbsd-src/tests/lib/libcurses/slave/curses_commands.c (revision 46f5119e40af2e51998f686b2fdcc76b5488f7f3)
1 /*	$NetBSD: curses_commands.c,v 1.3 2011/04/11 09:06:24 blymn Exp $	*/
2 
3 /*-
4  * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
5  *
6  * All rights reserved.
7  *
8  * This code has been donated to The NetBSD Foundation by the Author.
9  *
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
17  *
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.
28  *
29  *
30  */
31 
32 #include <curses.h>
33 #include <stdio.h>
34 #include <stdlib.h>
35 #include <string.h>
36 #include <termios.h>
37 #include <stdarg.h>
38 
39 #include "slave.h"
40 #include "curses_commands.h"
41 
42 void
43 cmd_DRAIN(int nargs, char **args)
44 {
45 	while (getch() != ERR);
46 	report_count(1);
47 	report_return(OK);
48 }
49 
50 void
51 cmd_addbytes(int nargs, char **args)
52 {
53 	int count;
54 
55 	if (check_arg_count(nargs, 2) == 1)
56 		return;
57 
58 	if (sscanf(args[1], "%d", &count) == 0) {
59 		report_count(1);
60 	report_error("BAD ARGUMENT");
61 		return;
62 	}
63 
64 	report_count(1);
65 	report_return(addbytes(args[0], count));
66 }
67 
68 
69 void
70 cmd_addch(int nargs, char **args)
71 {
72 	chtype *ch;
73 
74 	if (check_arg_count(nargs, 1) == 1)
75 		return;
76 
77 	ch = (chtype *) args[0];
78 	report_count(1);
79 	report_return(addch(ch[0]));
80 }
81 
82 
83 void
84 cmd_addchnstr(int nargs, char **args)
85 {
86 	int count;
87 
88 	if (check_arg_count(nargs, 2) == 1)
89 		return;
90 
91 	if (sscanf(args[1], "%d", &count) == 0) {
92 		report_count(1);
93 	report_error("BAD ARGUMENT");
94 		return;
95 	}
96 
97 	report_count(1);
98 	report_return(addchnstr((chtype *) args[0], count));
99 }
100 
101 
102 void
103 cmd_addchstr(int nargs, char **args)
104 {
105 	if (check_arg_count(nargs, 1) == 1)
106 		return;
107 
108 	report_count(1);
109 	report_return(addchstr((chtype *) args[0]));
110 }
111 
112 
113 void
114 cmd_addnstr(int nargs, char **args)
115 {
116 	int count;
117 
118 	if (check_arg_count(nargs, 2) == 1)
119 		return;
120 
121 	if (sscanf(args[1], "%d", &count) == 0) {
122 		report_count(1);
123 	report_error("BAD ARGUMENT");
124 		return;
125 	}
126 
127 	report_count(1);
128 	report_return(addnstr(args[0], count));
129 }
130 
131 
132 void
133 cmd_addstr(int nargs, char **args)
134 {
135 	if (check_arg_count(nargs, 1) == 1)
136 		return;
137 
138 	report_count(1);
139 	report_return(addstr(args[0]));
140 }
141 
142 
143 void
144 cmd_attr_get(int nargs, char **args)
145 {
146 	attr_t attrs;
147 	short colours;
148 	int retval;
149 
150 	if (check_arg_count(nargs, 0) == 1)
151 		return;
152 
153 	retval = attr_get(&attrs, &colours, NULL);
154 
155 	/* XXXX - call3 */
156 	report_count(3);
157 	report_return(retval);
158 	report_int(attrs);
159 	report_int(colours);
160 }
161 
162 
163 void
164 cmd_attr_off(int nargs, char **args)
165 {
166 	int attrib;
167 
168 	if (check_arg_count(nargs, 1) == 1)
169 		return;
170 
171 	if (sscanf(args[0], "%d", &attrib) == 0) {
172 		report_count(1);
173 	report_error("BAD ARGUMENT");
174 		return;
175 	}
176 
177 	report_count(1);
178 	report_return(attr_off(attrib, NULL));
179 }
180 
181 
182 void
183 cmd_attr_on(int nargs, char **args)
184 {
185 	int attrib;
186 
187 	if (check_arg_count(nargs, 1) == 1)
188 		return;
189 
190 	if (sscanf(args[0], "%d", &attrib) == 0) {
191 		report_count(1);
192 	report_error("BAD ARGUMENT");
193 		return;
194 	}
195 
196 	report_count(1);
197 	report_return(attr_on(attrib, NULL));
198 }
199 
200 
201 void
202 cmd_attr_set(int nargs, char **args)
203 {
204 	int attrib;
205 	short pair;
206 
207 	if (check_arg_count(nargs, 2) == 1)
208 		return;
209 
210 	if (sscanf(args[0], "%d", &attrib) == 0) {
211 		report_count(1);
212 	report_error("BAD ARGUMENT");
213 		return;
214 	}
215 
216 	if (sscanf(args[1], "%hd", &pair) == 0) {
217 		report_count(1);
218 	report_error("BAD ARGUMENT");
219 		return;
220 	}
221 
222 	report_count(1);
223 	report_return(attr_set(attrib, pair, NULL));
224 }
225 
226 
227 void
228 cmd_attroff(int nargs, char **args)
229 {
230 	int attrib;
231 
232 	if (check_arg_count(nargs, 1) == 1)
233 		return;
234 
235 	if (sscanf(args[0], "%d", &attrib) == 0) {
236 		report_count(1);
237 	report_error("BAD ARGUMENT");
238 		return;
239 	}
240 
241 	report_count(1);
242 	report_return(attroff(attrib));
243 }
244 
245 
246 void
247 cmd_attron(int nargs, char **args)
248 {
249 	int attrib;
250 
251 	if (check_arg_count(nargs, 1) == 1)
252 		return;
253 
254 	if (sscanf(args[0], "%d", &attrib) == 0) {
255 		report_count(1);
256 	report_error("BAD ARGUMENT");
257 		return;
258 	}
259 
260 	report_count(1);
261 	report_return(attron(attrib));
262 }
263 
264 
265 void
266 cmd_attrset(int nargs, char **args)
267 {
268 	int attrib;
269 
270 	if (check_arg_count(nargs, 1) == 1)
271 		return;
272 
273 	if (sscanf(args[0], "%d", &attrib) == 0) {
274 		report_count(1);
275 	report_error("BAD ARGUMENT");
276 		return;
277 	}
278 
279 	report_count(1);
280 	report_return(attrset(attrib));
281 }
282 
283 
284 void
285 cmd_bkgd(int nargs, char **args)
286 {
287 	chtype *ch;
288 
289 	if (check_arg_count(nargs, 1) == 1)
290 		return;
291 
292 	ch = (chtype *) args[0];
293 	report_count(1);
294 	report_return(bkgd(ch[0]));
295 }
296 
297 
298 void
299 cmd_bkgdset(int nargs, char **args)
300 {
301 	chtype *ch;
302 
303 	if (check_arg_count(nargs, 1) == 1)
304 		return;
305 
306 	ch = (chtype *) args[0];
307 	bkgdset(ch[0]); /* returns void */
308 	report_count(1);
309 	report_return(OK);
310 }
311 
312 
313 void
314 cmd_border(int nargs, char **args)
315 {
316 	int ls, rs, ts, bs, tl, tr, bl, br;
317 
318 	if (check_arg_count(nargs, 8) == 1)
319 		return;
320 
321 	if (sscanf(args[0], "%d", &ls) == 0) {
322 		report_count(1);
323 		report_error("BAD ARGUMENT");
324 		return;
325 	}
326 	if (sscanf(args[1], "%d", &rs) == 0) {
327 		report_count(1);
328 		report_error("BAD ARGUMENT");
329 		return;
330 	}
331 	if (sscanf(args[2], "%d", &ts) == 0) {
332 		report_count(1);
333 		report_error("BAD ARGUMENT");
334 		return;
335 	}
336 	if (sscanf(args[3], "%d", &bs) == 0) {
337 		report_count(1);
338 		report_error("BAD ARGUMENT");
339 		return;
340 	}
341 	if (sscanf(args[4], "%d", &tl) == 0) {
342 		report_count(1);
343 		report_error("BAD ARGUMENT");
344 		return;
345 	}
346 	if (sscanf(args[5], "%d", &tr) == 0) {
347 		report_count(1);
348 		report_error("BAD ARGUMENT");
349 		return;
350 	}
351 	if (sscanf(args[6], "%d", &bl) == 0) {
352 		report_count(1);
353 		report_error("BAD ARGUMENT");
354 		return;
355 	}
356 	if (sscanf(args[7], "%d", &br) == 0) {
357 		report_count(1);
358 		report_error("BAD ARGUMENT");
359 		return;
360 	}
361 
362 	report_count(1);
363 	report_return(border(ls, rs, ts, bs, tl, tr, bl, br));
364 }
365 
366 
367 void
368 cmd_clear(int nargs, char **args)
369 {
370 	if (check_arg_count(nargs, 0) == 1)
371 		return;
372 
373 	report_count(1);
374 	report_return(clear());
375 }
376 
377 
378 void
379 cmd_clrtobot(int nargs, char **args)
380 {
381 	if (check_arg_count(nargs, 0) == 1)
382 		return;
383 
384 	report_count(1);
385 	report_return(clrtobot());
386 }
387 
388 
389 void
390 cmd_clrtoeol(int nargs, char **args)
391 {
392 	if (check_arg_count(nargs, 0) == 1)
393 		return;
394 
395 	report_count(1);
396 	report_return(clrtoeol());
397 }
398 
399 
400 void
401 cmd_color_set(int nargs, char **args)
402 {
403 	short colour_pair;
404 
405 	if (check_arg_count(nargs, 2) == 1)
406 		return;
407 
408 	if (sscanf(args[0], "%hd", &colour_pair) == 0) {
409 		report_count(1);
410 		report_error("BAD ARGUMENT");
411 		return;
412 	}
413 
414 	report_count(1);
415 	report_return(color_set(colour_pair, NULL));
416 }
417 
418 
419 void
420 cmd_delch(int nargs, char **args)
421 {
422 	if (check_arg_count(nargs, 0) == 1)
423 		return;
424 
425 	report_count(1);
426 	report_return(delch());
427 }
428 
429 
430 void
431 cmd_deleteln(int nargs, char **args)
432 {
433 	if (check_arg_count(nargs, 0) == 1)
434 		return;
435 
436 	report_count(1);
437 	report_return(deleteln());
438 }
439 
440 
441 void
442 cmd_echochar(int nargs, char **args)
443 {
444 	if (check_arg_count(nargs, 1) == 1)
445 		return;
446 
447 	/* XXX causes refresh */
448 	report_count(1);
449 	report_return(echochar(args[0][0]));
450 }
451 
452 
453 void
454 cmd_erase(int nargs, char **args)
455 {
456 	if (check_arg_count(nargs, 0) == 1)
457 		return;
458 
459 	report_count(1);
460 	report_return(erase());
461 }
462 
463 
464 void
465 cmd_getch(int nargs, char **args)
466 {
467 	if (check_arg_count(nargs, 0) == 1)
468 		return;
469 
470 	/* XXX causes refresh */
471 	report_count(1);
472 	report_int(getch());
473 }
474 
475 
476 void
477 cmd_getnstr(int nargs, char **args)
478 {
479 	int limit;
480 	char *string;
481 
482 	if (check_arg_count(nargs, 1) == 1)
483 		return;
484 
485 	if (sscanf(args[0], "%d", &limit) == 0) {
486 		report_count(1);
487 		report_error("BAD ARGUMENT");
488 		return;
489 	}
490 
491 	if ((string = malloc(limit + 1)) == NULL) {
492 		report_count(1);
493 		report_error("MALLOC_FAILED");
494 		return;
495 	}
496 
497 	/* XXX call2 */
498 	report_count(2);
499 	report_return(getnstr(string, limit));
500 	report_status(string);
501 	free(string);
502 }
503 
504 
505 void
506 cmd_getstr(int nargs, char **args)
507 {
508 	char string[256];
509 
510 	if (check_arg_count(nargs, 0) == 1)
511 		return;
512 
513 	/* XXX call2 */
514 	report_count(2);
515 	report_return(getstr(string));
516 	report_status(string);
517 }
518 
519 
520 void
521 cmd_inch(int nargs, char **args)
522 {
523 	if (check_arg_count(nargs, 0) == 1)
524 		return;
525 
526 
527 	report_count(1);
528 	report_int(inch());
529 }
530 
531 
532 void
533 cmd_inchnstr(int nargs, char **args)
534 {
535 	int limit;
536 	chtype *string;
537 
538 	if (check_arg_count(nargs, 1) == 1)
539 		return;
540 
541 	if (sscanf(args[0], "%d", &limit) == 0) {
542 		report_count(1);
543 		report_error("BAD ARGUMENT");
544 		return;
545 	}
546 
547 	if ((string = malloc((limit + 1) * sizeof(chtype))) == NULL) {
548 		report_count(1);
549 		report_error("MALLOC_FAILED");
550 		return;
551 	}
552 
553 	/* XXX call2 */
554 	report_count(2);
555 	report_return(inchnstr(string, limit));
556 	report_nstr(string);
557 	free(string);
558 }
559 
560 
561 void
562 cmd_inchstr(int nargs, char **args)
563 {
564 	chtype string[256];
565 
566 	if (check_arg_count(nargs, 1) == 1)
567 		return;
568 
569 	/* XXX call2 */
570 	report_count(2);
571 	report_return(inchstr(string));
572 	report_nstr(string);
573 }
574 
575 
576 void
577 cmd_innstr(int nargs, char **args)
578 {
579 	int limit;
580 	char *string;
581 
582 	if (check_arg_count(nargs, 1) == 1)
583 		return;
584 
585 	if (sscanf(args[0], "%d", &limit) == 0) {
586 		report_count(1);
587 		report_error("BAD ARGUMENT");
588 		return;
589 	}
590 
591 	if ((string = malloc(limit + 1)) == NULL) {
592 		report_count(1);
593 		report_error("MALLOC_FAILED");
594 		return;
595 	}
596 
597 	/* XXX call2 */
598 	report_count(2);
599 	report_return(innstr(string, limit));
600 	report_status(string);
601 	free(string);
602 }
603 
604 
605 void
606 cmd_insch(int nargs, char **args)
607 {
608 	if (check_arg_count(nargs, 1) == 1)
609 		return;
610 
611 	report_count(1);
612 	report_return(insch(args[0][0]));
613 }
614 
615 
616 void
617 cmd_insdelln(int nargs, char **args)
618 {
619 	int nlines;
620 
621 	if (check_arg_count(nargs, 1) == 1)
622 		return;
623 
624 	if (sscanf(args[0], "%d", &nlines) == 0) {
625 		report_count(1);
626 		report_error("BAD ARGUMENT");
627 		return;
628 	}
629 
630 	report_count(1);
631 	report_return(insdelln(nlines));
632 }
633 
634 
635 void
636 cmd_insertln(int nargs, char **args)
637 {
638 	if (check_arg_count(nargs, 0) == 1)
639 		return;
640 
641 	report_count(1);
642 	report_return(insertln());
643 }
644 
645 
646 void
647 cmd_instr(int nargs, char **args)
648 {
649 	char string[256];
650 
651 	if (check_arg_count(nargs, 1) == 1)
652 		return;
653 
654 	/* XXX call2 */
655 	report_count(2);
656 	report_return(instr(string));
657 	report_status(string);
658 }
659 
660 
661 void
662 cmd_move(int nargs, char **args)
663 {
664 	int y, x;
665 
666 	if (check_arg_count(nargs, 2) == 1)
667 		return;
668 
669 	if (sscanf(args[0], "%d", &y) == 0) {
670 		report_count(1);
671 		report_error("BAD ARGUMENT");
672 		return;
673 	}
674 
675 	if (sscanf(args[1], "%d", &x) == 0) {
676 		report_count(1);
677 		report_error("BAD ARGUMENT");
678 		return;
679 	}
680 
681 	report_count(1);
682 	report_return(move(y, x));
683 }
684 
685 
686 void
687 cmd_refresh(int nargs, char **args)
688 {
689 	if (check_arg_count(nargs, 0) == 1)
690 		return;
691 
692 	report_count(1);
693 	report_return(refresh());
694 }
695 
696 
697 void
698 cmd_scrl(int nargs, char **args)
699 {
700 	int nlines;
701 
702 	if (check_arg_count(nargs, 1) == 1)
703 		return;
704 
705 	if (sscanf(args[0], "%d", &nlines) == 0) {
706 		report_count(1);
707 		report_error("BAD ARGUMENT");
708 		return;
709 	}
710 
711 	report_count(1);
712 	report_return(scrl(nlines));
713 }
714 
715 
716 void
717 cmd_setscrreg(int nargs, char **args)
718 {
719 	int top, bottom;
720 
721 	if (check_arg_count(nargs, 2) == 1)
722 		return;
723 
724 	if (sscanf(args[0], "%d", &top) == 0) {
725 		report_count(1);
726 		report_error("BAD ARGUMENT");
727 		return;
728 	}
729 
730 	if (sscanf(args[1], "%d", &bottom) == 0) {
731 		report_count(1);
732 		report_error("BAD ARGUMENT");
733 		return;
734 	}
735 
736 	report_count(1);
737 	report_return(setscrreg(top, bottom));
738 }
739 
740 
741 void
742 cmd_standend(int nargs, char **args)
743 {
744 	if (check_arg_count(nargs, 0) == 1)
745 		return;
746 
747 	report_count(1);
748 	report_return(standend());
749 }
750 
751 
752 void
753 cmd_standout(int nargs, char **args)
754 {
755 	if (check_arg_count(nargs, 0) == 1)
756 		return;
757 
758 	report_count(1);
759 	report_return(standout());
760 }
761 
762 
763 void
764 cmd_timeout(int nargs, char **args)
765 {
766 	int tval;
767 
768 	if (check_arg_count(nargs, 1) == 1)
769 		return;
770 
771 	if (sscanf(args[0], "%d", &tval) == 0) {
772 		report_count(1);
773 		report_error("BAD ARGUMENT");
774 		return;
775 	}
776 
777 	timeout(tval); /* void return */
778 	report_count(1);
779 	report_return(OK);
780 }
781 
782 
783 void
784 cmd_underscore(int nargs, char **args)
785 {
786 	if (check_arg_count(nargs, 0) == 1)
787 		return;
788 
789 	report_count(1);
790 	report_return(underscore());
791 }
792 
793 
794 void
795 cmd_underend(int nargs, char **args)
796 {
797 	if (check_arg_count(nargs, 0) == 1)
798 		return;
799 
800 	report_count(1);
801 	report_return(underend());
802 }
803 
804 
805 void
806 cmd_waddbytes(int nargs, char **args)
807 {
808 	WINDOW *win;
809 	int count;
810 
811 	if (check_arg_count(nargs, 3) == 1)
812 		return;
813 
814 	if (sscanf(args[0], "%td", &win) == 0) {
815 		report_count(1);
816 		report_error("BAD ARGUMENT");
817 		return;
818 	}
819 
820 	if (sscanf(args[2], "%d", &count) == 0) {
821 		report_count(1);
822 		report_error("BAD ARGUMENT");
823 		return;
824 	}
825 
826 	report_count(1);
827 	report_return(waddbytes(win, args[1], count));
828 }
829 
830 
831 void
832 cmd_waddstr(int nargs, char **args)
833 {
834 	WINDOW *win;
835 
836 	if (check_arg_count(nargs, 2) == 1)
837 		return;
838 
839 	if (sscanf(args[0], "%td", &win) == 0) {
840 		report_count(1);
841 		report_error("BAD ARGUMENT");
842 		return;
843 	}
844 
845 	report_count(1);
846 	report_return(waddstr(win, args[1]));
847 }
848 
849 
850 void
851 cmd_mvaddbytes(int nargs, char **args)
852 {
853 	int y, x, count;
854 
855 	if (check_arg_count(nargs, 4) == 1)
856 		return;
857 
858 	if (sscanf(args[0], "%d", &y) == 0) {
859 		report_count(1);
860 		report_error("BAD ARGUMENT");
861 		return;
862 	}
863 
864 	if (sscanf(args[1], "%d", &x) == 0) {
865 		report_count(1);
866 		report_error("BAD ARGUMENT");
867 		return;
868 	}
869 
870 	if (sscanf(args[3], "%d", &count) == 0) {
871 		report_count(1);
872 		report_error("BAD ARGUMENT");
873 		return;
874 	}
875 
876 	report_count(1);
877 	report_return(mvaddbytes(y, x, args[2], count));
878 }
879 
880 
881 void
882 cmd_mvaddch(int nargs, char **args)
883 {
884 	int y, x;
885 
886 	if (check_arg_count(nargs, 3) == 1)
887 		return;
888 
889 	if (sscanf(args[0], "%d", &y) == 0) {
890 		report_count(1);
891 		report_error("BAD ARGUMENT");
892 		return;
893 	}
894 
895 	if (sscanf(args[1], "%d", &x) == 0) {
896 		report_count(1);
897 		report_error("BAD ARGUMENT");
898 		return;
899 	}
900 
901 	report_count(1);
902 	report_return(mvaddch(y, x, args[2][0]));
903 }
904 
905 
906 void
907 cmd_mvaddchnstr(int nargs, char **args)
908 {
909 	int y, x, count;
910 
911 	if (check_arg_count(nargs, 4) == 1)
912 		return;
913 
914 	if (sscanf(args[0], "%d", &y) == 0) {
915 		report_count(1);
916 		report_error("BAD ARGUMENT");
917 		return;
918 	}
919 
920 	if (sscanf(args[1], "%d", &x) == 0) {
921 		report_count(1);
922 		report_error("BAD ARGUMENT");
923 		return;
924 	}
925 
926 	if (sscanf(args[3], "%d", &count) == 0) {
927 		report_count(1);
928 		report_error("BAD ARGUMENT");
929 		return;
930 	}
931 
932 	report_count(1);
933 	report_return(mvaddchnstr(y, x, (chtype *) args[2], count));
934 }
935 
936 
937 void
938 cmd_mvaddchstr(int nargs, char **args)
939 {
940 	int y, x;
941 
942 	if (check_arg_count(nargs, 3) == 1)
943 		return;
944 
945 	if (sscanf(args[0], "%d", &y) == 0) {
946 		report_count(1);
947 		report_error("BAD ARGUMENT");
948 		return;
949 	}
950 
951 	if (sscanf(args[1], "%d", &x) == 0) {
952 		report_count(1);
953 		report_error("BAD ARGUMENT");
954 		return;
955 	}
956 
957 	report_count(1);
958 	report_return(mvaddchstr(y, x, (chtype *) args[2]));
959 }
960 
961 
962 void
963 cmd_mvaddnstr(int nargs, char **args)
964 {
965 	int y, x, count;
966 
967 	if (check_arg_count(nargs, 4) == 1)
968 		return;
969 
970 	if (sscanf(args[0], "%d", &y) == 0) {
971 		report_count(1);
972 		report_error("BAD ARGUMENT");
973 		return;
974 	}
975 
976 	if (sscanf(args[1], "%d", &x) == 0) {
977 		report_count(1);
978 		report_error("BAD ARGUMENT");
979 		return;
980 	}
981 
982 	if (sscanf(args[3], "%d", &count) == 0) {
983 		report_count(1);
984 		report_error("BAD ARGUMENT");
985 		return;
986 	}
987 
988 	report_count(1);
989 	report_return(mvaddnstr(y, x, args[2], count));
990 }
991 
992 
993 void
994 cmd_mvaddstr(int nargs, char **args)
995 {
996 	int y, x;
997 
998 	if (check_arg_count(nargs, 3) == 1)
999 		return;
1000 
1001 	if (sscanf(args[0], "%d", &y) == 0) {
1002 		report_count(1);
1003 		report_error("BAD ARGUMENT");
1004 		return;
1005 	}
1006 
1007 	if (sscanf(args[1], "%d", &x) == 0) {
1008 		report_count(1);
1009 		report_error("BAD ARGUMENT");
1010 		return;
1011 	}
1012 
1013 	report_count(1);
1014 	report_return(mvaddstr(y, x, args[2]));
1015 }
1016 
1017 
1018 void
1019 cmd_mvdelch(int nargs, char **args)
1020 {
1021 	int y, x;
1022 
1023 	if (check_arg_count(nargs, 2) == 1)
1024 		return;
1025 
1026 	if (sscanf(args[0], "%d", &y) == 0) {
1027 		report_count(1);
1028 		report_error("BAD ARGUMENT");
1029 		return;
1030 	}
1031 
1032 	if (sscanf(args[1], "%d", &x) == 0) {
1033 		report_count(1);
1034 		report_error("BAD ARGUMENT");
1035 		return;
1036 	}
1037 
1038 	report_count(1);
1039 	report_return(mvdelch(y, x));
1040 }
1041 
1042 
1043 void
1044 cmd_mvgetch(int nargs, char **args)
1045 {
1046 	int y, x;
1047 
1048 	if (check_arg_count(nargs, 2) == 1)
1049 		return;
1050 
1051 	if (sscanf(args[0], "%d", &y) == 0) {
1052 		report_count(1);
1053 		report_error("BAD ARGUMENT");
1054 		return;
1055 	}
1056 
1057 	if (sscanf(args[1], "%d", &x) == 0) {
1058 		report_count(1);
1059 		report_error("BAD ARGUMENT");
1060 		return;
1061 	}
1062 
1063 	report_count(1);
1064 	report_int(mvgetch(y, x));
1065 }
1066 
1067 
1068 void
1069 cmd_mvgetnstr(int nargs, char **args)
1070 {
1071 	int y, x, count;
1072 	char *string;
1073 
1074 	if (check_arg_count(nargs, 3) == 1)
1075 		return;
1076 
1077 	if (sscanf(args[0], "%d", &y) == 0) {
1078 		report_count(1);
1079 		report_error("BAD ARGUMENT");
1080 		return;
1081 	}
1082 
1083 	if (sscanf(args[1], "%d", &x) == 0) {
1084 		report_count(1);
1085 		report_error("BAD ARGUMENT");
1086 		return;
1087 	}
1088 
1089 	if (sscanf(args[2], "%d", &count) == 0) {
1090 		report_count(1);
1091 		report_error("BAD ARGUMENT");
1092 		return;
1093 	}
1094 
1095 	if ((string = malloc(count + 1)) == NULL) {
1096 		report_count(1);
1097 		report_error("MALLOC_FAILED");
1098 		return;
1099 	}
1100 
1101 	/* XXX call2 */
1102 	report_count(2);
1103 	report_return(mvgetnstr(y, x, string, count));
1104 	report_status(string);
1105 	free(string);
1106 }
1107 
1108 
1109 void
1110 cmd_mvgetstr(int nargs, char **args)
1111 {
1112 	int y, x;
1113 	char string[256];
1114 
1115 	if (check_arg_count(nargs, 2) == 1)
1116 		return;
1117 
1118 	if (sscanf(args[0], "%d", &y) == 0) {
1119 		report_count(1);
1120 		report_error("BAD ARGUMENT");
1121 		return;
1122 	}
1123 
1124 	if (sscanf(args[1], "%d", &x) == 0) {
1125 		report_count(1);
1126 		report_error("BAD ARGUMENT");
1127 		return;
1128 	}
1129 
1130 	/* XXX call2 */
1131 	report_count(2);
1132 	report_return(mvgetstr(y, x, string));
1133 	report_status(string);
1134 }
1135 
1136 
1137 void
1138 cmd_mvinch(int nargs, char **args)
1139 {
1140 	int y, x;
1141 
1142 	if (check_arg_count(nargs, 2) == 1)
1143 		return;
1144 
1145 	if (sscanf(args[0], "%d", &y) == 0) {
1146 		report_count(1);
1147 		report_error("BAD ARGUMENT");
1148 		return;
1149 	}
1150 
1151 	if (sscanf(args[1], "%d", &x) == 0) {
1152 		report_count(1);
1153 		report_error("BAD ARGUMENT");
1154 		return;
1155 	}
1156 
1157 	report_count(1);
1158 	report_int(mvinch(y, x));
1159 }
1160 
1161 
1162 void
1163 cmd_mvinchnstr(int nargs, char **args)
1164 {
1165 	int y, x, count;
1166 	chtype *string;
1167 
1168 	if (check_arg_count(nargs, 3) == 1)
1169 		return;
1170 
1171 	if (sscanf(args[0], "%d", &y) == 0) {
1172 		report_count(1);
1173 		report_error("BAD ARGUMENT");
1174 		return;
1175 	}
1176 
1177 	if (sscanf(args[1], "%d", &x) == 0) {
1178 		report_count(1);
1179 		report_error("BAD ARGUMENT");
1180 		return;
1181 	}
1182 
1183 	if (sscanf(args[2], "%d", &count) == 0) {
1184 		report_count(1);
1185 		report_error("BAD ARGUMENT");
1186 		return;
1187 	}
1188 
1189 	if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
1190 		report_count(1);
1191 		report_error("MALLOC_FAILED");
1192 		return;
1193 	}
1194 
1195 	/* XXX call2 */
1196 	report_count(2);
1197 	report_return(mvinchnstr(y, x, string, count));
1198 	report_nstr(string);
1199 	free(string);
1200 }
1201 
1202 
1203 void
1204 cmd_mvinchstr(int nargs, char **args)
1205 {
1206 	int y, x;
1207 	chtype string[256];
1208 
1209 	if (check_arg_count(nargs, 2) == 1)
1210 		return;
1211 
1212 	if (sscanf(args[0], "%d", &y) == 0) {
1213 		report_count(1);
1214 		report_error("BAD ARGUMENT");
1215 		return;
1216 	}
1217 
1218 	if (sscanf(args[1], "%d", &x) == 0) {
1219 		report_count(1);
1220 		report_error("BAD ARGUMENT");
1221 		return;
1222 	}
1223 
1224 	/* XXX call2 */
1225 	report_count(2);
1226 	report_return(mvinchstr(y, x, string));
1227 	report_nstr(string);
1228 }
1229 
1230 
1231 void
1232 cmd_mvinnstr(int nargs, char **args)
1233 {
1234 	int y, x, count;
1235 	char *string;
1236 
1237 	if (check_arg_count(nargs, 3) == 1)
1238 		return;
1239 
1240 	if (sscanf(args[0], "%d", &y) == 0) {
1241 		report_count(1);
1242 		report_error("BAD ARGUMENT");
1243 		return;
1244 	}
1245 
1246 	if (sscanf(args[1], "%d", &x) == 0) {
1247 		report_count(1);
1248 		report_error("BAD ARGUMENT");
1249 		return;
1250 	}
1251 
1252 	if (sscanf(args[2], "%d", &count) == 0) {
1253 		report_count(1);
1254 		report_error("BAD ARGUMENT");
1255 		return;
1256 	}
1257 
1258 	if ((string = malloc(count + 1)) == NULL) {
1259 		report_count(1);
1260 	report_error("MALLOC_FAILED");
1261 		return;
1262 	}
1263 
1264 	/* XXX call2 */
1265 	report_count(2);
1266 	report_return(mvinnstr(y, x, string, count));
1267 	report_status(string);
1268 	free(string);
1269 }
1270 
1271 
1272 void
1273 cmd_mvinsch(int nargs, char **args)
1274 {
1275 	int y, x, ch;
1276 
1277 	if (check_arg_count(nargs, 3) == 1)
1278 		return;
1279 
1280 	if (sscanf(args[0], "%d", &y) == 0) {
1281 		report_count(1);
1282 		report_error("BAD ARGUMENT");
1283 		return;
1284 	}
1285 
1286 	if (sscanf(args[1], "%d", &x) == 0) {
1287 		report_count(1);
1288 		report_error("BAD ARGUMENT");
1289 		return;
1290 	}
1291 
1292 	if (sscanf(args[2], "%d", &ch) == 0) {
1293 		report_count(1);
1294 		report_error("BAD ARGUMENT");
1295 		return;
1296 	}
1297 
1298 	report_count(1);
1299 	report_return(mvinsch(y, x, ch));
1300 }
1301 
1302 
1303 void
1304 cmd_mvinstr(int nargs, char **args)
1305 {
1306 	int y, x;
1307 
1308 	if (check_arg_count(nargs, 3) == 1)
1309 		return;
1310 
1311 	if (sscanf(args[0], "%d", &y) == 0) {
1312 		report_count(1);
1313 		report_error("BAD ARGUMENT");
1314 		return;
1315 	}
1316 
1317 	if (sscanf(args[1], "%d", &x) == 0) {
1318 		report_count(1);
1319 		report_error("BAD ARGUMENT");
1320 		return;
1321 	}
1322 
1323 	report_count(1);
1324 	report_return(mvinstr(y, x, args[2]));
1325 }
1326 
1327 
1328 
1329 void
1330 cmd_mvwaddbytes(int nargs, char **args)
1331 {
1332 	int y, x, count;
1333 	WINDOW *win;
1334 
1335 	if (check_arg_count(nargs, 5) == 1)
1336 		return;
1337 
1338 	if (sscanf(args[0], "%td", &win) == 0) {
1339 		report_count(1);
1340 		report_error("BAD ARGUMENT");
1341 		return;
1342 	}
1343 
1344 	if (sscanf(args[1], "%d", &y) == 0) {
1345 		report_count(1);
1346 		report_error("BAD ARGUMENT");
1347 		return;
1348 	}
1349 
1350 	if (sscanf(args[2], "%d", &x) == 0) {
1351 		report_count(1);
1352 		report_error("BAD ARGUMENT");
1353 		return;
1354 	}
1355 
1356 	if (sscanf(args[4], "%d", &count) == 0) {
1357 		report_count(1);
1358 		report_error("BAD ARGUMENT");
1359 		return;
1360 	}
1361 
1362 	report_count(1);
1363 	report_return(mvwaddbytes(win, y, x, args[3], count));
1364 }
1365 
1366 
1367 void
1368 cmd_mvwaddch(int nargs, char **args)
1369 {
1370 	int y, x;
1371 	WINDOW *win;
1372 
1373 	if (check_arg_count(nargs, 4) == 1)
1374 		return;
1375 
1376 	if (sscanf(args[0], "%td", &win) == 0) {
1377 		report_count(1);
1378 		report_error("BAD ARGUMENT");
1379 		return;
1380 	}
1381 
1382 	if (sscanf(args[1], "%d", &y) == 0) {
1383 		report_count(1);
1384 		report_error("BAD ARGUMENT");
1385 		return;
1386 	}
1387 
1388 	if (sscanf(args[2], "%d", &x) == 0) {
1389 		report_count(1);
1390 		report_error("BAD ARGUMENT");
1391 		return;
1392 	}
1393 
1394 	report_count(1);
1395 	report_return(mvwaddch(win, y, x, args[3][0]));
1396 }
1397 
1398 
1399 void
1400 cmd_mvwaddchnstr(int nargs, char **args)
1401 {
1402 	int y, x, count;
1403 	WINDOW *win;
1404 
1405 	if (check_arg_count(nargs, 5) == 1)
1406 		return;
1407 
1408 	if (sscanf(args[0], "%td", &win) == 0) {
1409 		report_count(1);
1410 		report_error("BAD ARGUMENT");
1411 		return;
1412 	}
1413 
1414 	if (sscanf(args[1], "%d", &y) == 0) {
1415 		report_count(1);
1416 		report_error("BAD ARGUMENT");
1417 		return;
1418 	}
1419 
1420 	if (sscanf(args[2], "%d", &x) == 0) {
1421 		report_count(1);
1422 		report_error("BAD ARGUMENT");
1423 		return;
1424 	}
1425 
1426 	if (sscanf(args[4], "%d", &count) == 0) {
1427 		report_count(1);
1428 		report_error("BAD ARGUMENT");
1429 		return;
1430 	}
1431 
1432 	report_count(1);
1433 	report_return(mvwaddchnstr(win, y, x, (chtype *) args[3], count));
1434 }
1435 
1436 
1437 void
1438 cmd_mvwaddchstr(int nargs, char **args)
1439 {
1440 	int y, x;
1441 	WINDOW *win;
1442 
1443 	if (check_arg_count(nargs, 4) == 1)
1444 		return;
1445 
1446 	if (sscanf(args[0], "%td", &win) == 0) {
1447 		report_count(1);
1448 		report_error("BAD ARGUMENT");
1449 		return;
1450 	}
1451 
1452 	if (sscanf(args[1], "%d", &y) == 0) {
1453 		report_count(1);
1454 		report_error("BAD ARGUMENT");
1455 		return;
1456 	}
1457 
1458 	if (sscanf(args[2], "%d", &x) == 0) {
1459 		report_count(1);
1460 		report_error("BAD ARGUMENT");
1461 		return;
1462 	}
1463 
1464 	report_count(1);
1465 	report_return(mvwaddchstr(win, y, x, (chtype *) args[3]));
1466 }
1467 
1468 
1469 void
1470 cmd_mvwaddnstr(int nargs, char **args)
1471 {
1472 	int y, x, count;
1473 	WINDOW *win;
1474 
1475 	if (check_arg_count(nargs, 5) == 1)
1476 		return;
1477 
1478 	if (sscanf(args[0], "%td", &win) == 0) {
1479 		report_count(1);
1480 		report_error("BAD ARGUMENT");
1481 		return;
1482 	}
1483 
1484 	if (sscanf(args[1], "%d", &y) == 0) {
1485 		report_count(1);
1486 		report_error("BAD ARGUMENT");
1487 		return;
1488 	}
1489 
1490 	if (sscanf(args[2], "%d", &x) == 0) {
1491 		report_count(1);
1492 		report_error("BAD ARGUMENT");
1493 		return;
1494 	}
1495 
1496 	if (sscanf(args[4], "%d", &count) == 0) {
1497 		report_count(1);
1498 		report_error("BAD ARGUMENT");
1499 		return;
1500 	}
1501 
1502 	report_count(1);
1503 	report_return(mvwaddnstr(win, y, x, args[3], count));
1504 }
1505 
1506 
1507 void
1508 cmd_mvwaddstr(int nargs, char **args)
1509 {
1510 	int y, x;
1511 	WINDOW *win;
1512 
1513 	if (check_arg_count(nargs, 4) == 1)
1514 		return;
1515 
1516 	if (sscanf(args[0], "%td", &win) == 0) {
1517 		report_count(1);
1518 		report_error("BAD ARGUMENT");
1519 		return;
1520 	}
1521 
1522 	if (sscanf(args[1], "%d", &y) == 0) {
1523 		report_count(1);
1524 		report_error("BAD ARGUMENT");
1525 		return;
1526 	}
1527 
1528 	if (sscanf(args[2], "%d", &x) == 0) {
1529 		report_count(1);
1530 		report_error("BAD ARGUMENT");
1531 		return;
1532 	}
1533 
1534 	report_count(1);
1535 	report_return(mvwaddstr(win, y, x, args[3]));
1536 }
1537 
1538 
1539 void
1540 cmd_mvwdelch(int nargs, char **args)
1541 {
1542 	int y, x;
1543 	WINDOW *win;
1544 
1545 	if (check_arg_count(nargs, 3) == 1)
1546 		return;
1547 
1548 	if (sscanf(args[0], "%td", &win) == 0) {
1549 		report_count(1);
1550 		report_error("BAD ARGUMENT");
1551 		return;
1552 	}
1553 
1554 	if (sscanf(args[1], "%d", &y) == 0) {
1555 		report_count(1);
1556 		report_error("BAD ARGUMENT");
1557 		return;
1558 	}
1559 
1560 	if (sscanf(args[2], "%d", &x) == 0) {
1561 		report_count(1);
1562 		report_error("BAD ARGUMENT");
1563 		return;
1564 	}
1565 
1566 	report_count(1);
1567 	report_return(mvwdelch(win, y, x));
1568 }
1569 
1570 
1571 void
1572 cmd_mvwgetch(int nargs, char **args)
1573 {
1574 	int y, x;
1575 	WINDOW *win;
1576 
1577 	if (check_arg_count(nargs, 3) == 1)
1578 		return;
1579 
1580 	if (sscanf(args[0], "%td", &win) == 0) {
1581 		report_count(1);
1582 		report_error("BAD ARGUMENT");
1583 		return;
1584 	}
1585 
1586 	if (sscanf(args[1], "%d", &y) == 0) {
1587 		report_count(1);
1588 		report_error("BAD ARGUMENT");
1589 		return;
1590 	}
1591 
1592 	if (sscanf(args[2], "%d", &x) == 0) {
1593 		report_count(1);
1594 		report_error("BAD ARGUMENT");
1595 		return;
1596 	}
1597 
1598 	/* XXX - implicit refresh */
1599 	report_count(1);
1600 	report_int(mvwgetch(win, y, x));
1601 }
1602 
1603 
1604 void
1605 cmd_mvwgetnstr(int nargs, char **args)
1606 {
1607 	int y, x, count;
1608 	char *string;
1609 	WINDOW *win;
1610 
1611 	if (check_arg_count(nargs, 4) == 1)
1612 		return;
1613 
1614 	if (sscanf(args[0], "%td", &win) == 0) {
1615 		report_count(1);
1616 		report_error("BAD ARGUMENT");
1617 		return;
1618 	}
1619 
1620 	if (sscanf(args[1], "%d", &y) == 0) {
1621 		report_count(1);
1622 		report_error("BAD ARGUMENT");
1623 		return;
1624 	}
1625 
1626 	if (sscanf(args[2], "%d", &x) == 0) {
1627 		report_count(1);
1628 		report_error("BAD ARGUMENT");
1629 		return;
1630 	}
1631 
1632 	if (sscanf(args[3], "%d", &count) == 0) {
1633 		report_count(1);
1634 		report_error("BAD ARGUMENT");
1635 		return;
1636 	}
1637 
1638 	if ((string = malloc(count + 1)) == NULL) {
1639 		report_count(1);
1640 		report_error("MALLOC_FAILED");
1641 		return;
1642 	}
1643 
1644 	/* XXX call2 */
1645 	report_count(2);
1646 	report_return(mvwgetnstr(win, y, x, string, count));
1647 	report_status(string);
1648 	free(string);
1649 }
1650 
1651 
1652 void
1653 cmd_mvwgetstr(int nargs, char **args)
1654 {
1655 	int y, x;
1656 	WINDOW *win;
1657 	char string[256];
1658 
1659 	if (check_arg_count(nargs, 3) == 1)
1660 		return;
1661 
1662 	if (sscanf(args[0], "%td", &win) == 0) {
1663 		report_count(1);
1664 		report_error("BAD ARGUMENT");
1665 		return;
1666 	}
1667 
1668 	if (sscanf(args[1], "%d", &y) == 0) {
1669 		report_count(1);
1670 		report_error("BAD ARGUMENT");
1671 		return;
1672 	}
1673 
1674 	if (sscanf(args[2], "%d", &x) == 0) {
1675 		report_count(1);
1676 		report_error("BAD ARGUMENT");
1677 		return;
1678 	}
1679 
1680 	/* XXX - call2 */
1681 	report_count(2);
1682 	report_return(mvwgetstr(win, y, x, string));
1683 	report_status(string);
1684 }
1685 
1686 
1687 void
1688 cmd_mvwinch(int nargs, char **args)
1689 {
1690 	int y, x;
1691 	WINDOW *win;
1692 
1693 	if (check_arg_count(nargs, 3) == 1)
1694 		return;
1695 
1696 	if (sscanf(args[0], "%td", &win) == 0) {
1697 		report_count(1);
1698 		report_error("BAD ARGUMENT");
1699 		return;
1700 	}
1701 
1702 	if (sscanf(args[1], "%d", &y) == 0) {
1703 		report_count(1);
1704 		report_error("BAD ARGUMENT");
1705 		return;
1706 	}
1707 
1708 	if (sscanf(args[2], "%d", &x) == 0) {
1709 		report_count(1);
1710 		report_error("BAD ARGUMENT");
1711 		return;
1712 	}
1713 
1714 	report_count(1);
1715 	report_int(mvwinch(win, y, x));
1716 }
1717 
1718 
1719 void
1720 cmd_mvwinsch(int nargs, char **args)
1721 {
1722 	int y, x;
1723 	WINDOW *win;
1724 
1725 	if (check_arg_count(nargs, 4) == 1)
1726 		return;
1727 
1728 	if (sscanf(args[0], "%td", &win) == 0) {
1729 		report_count(1);
1730 		report_error("BAD ARGUMENT");
1731 		return;
1732 	}
1733 
1734 	if (sscanf(args[1], "%d", &y) == 0) {
1735 		report_count(1);
1736 		report_error("BAD ARGUMENT");
1737 		return;
1738 	}
1739 
1740 	if (sscanf(args[2], "%d", &x) == 0) {
1741 		report_count(1);
1742 		report_error("BAD ARGUMENT");
1743 		return;
1744 	}
1745 
1746 	report_count(1);
1747 	report_int(mvwinsch(win, y, x, args[3][0]));
1748 }
1749 
1750 
1751 void
1752 cmd_assume_default_colors(int nargs, char **args)
1753 {
1754 	short fore, back;
1755 
1756 	if (check_arg_count(nargs, 2) == 1)
1757 		return;
1758 
1759 	if (sscanf(args[0], "%hd", &fore) == 0) {
1760 		report_count(1);
1761 		report_error("BAD ARGUMENT");
1762 		return;
1763 	}
1764 
1765 	if (sscanf(args[1], "%hd", &back) == 0) {
1766 		report_count(1);
1767 		report_error("BAD ARGUMENT");
1768 		return;
1769 	}
1770 
1771 	report_count(1);
1772 	report_return(assume_default_colors(fore, back));
1773 }
1774 
1775 
1776 void
1777 cmd_baudrate(int nargs, char **args)
1778 {
1779 	if (check_arg_count(nargs, 0) == 1)
1780 		return;
1781 
1782 	report_count(1);
1783 	report_int(baudrate());
1784 }
1785 
1786 
1787 void
1788 cmd_beep(int nargs, char **args)
1789 {
1790 	if (check_arg_count(nargs, 0) == 1)
1791 		return;
1792 
1793 	report_count(1);
1794 	report_int(beep());
1795 }
1796 
1797 
1798 void
1799 cmd_box(int nargs, char **args)
1800 {
1801 	WINDOW *win;
1802 	chtype *vertical, *horizontal;
1803 
1804 	if (check_arg_count(nargs, 3) == 1)
1805 		return;
1806 
1807 	if (sscanf(args[0], "%td", &win) == 0) {
1808 		report_count(1);
1809 		report_error("BAD ARGUMENT");
1810 		return;
1811 	}
1812 
1813 	vertical = (chtype *) args[1];
1814 	horizontal = (chtype *) args[2];
1815 	report_count(1);
1816 	report_return(box(win, vertical[0], horizontal[0]));
1817 }
1818 
1819 
1820 void
1821 cmd_can_change_color(int nargs, char **args)
1822 {
1823 	if (check_arg_count(nargs, 0) == 1)
1824 		return;
1825 
1826 	report_count(1);
1827 	report_int(can_change_color());
1828 }
1829 
1830 
1831 void
1832 cmd_cbreak(int nargs, char **args)
1833 {
1834 	if (check_arg_count(nargs, 0) == 1)
1835 		return;
1836 
1837 	report_count(1);
1838 	report_return(cbreak());
1839 }
1840 
1841 
1842 void
1843 cmd_clearok(int nargs, char **args)
1844 {
1845 	WINDOW *win;
1846 	int flag;
1847 
1848 	if (check_arg_count(nargs, 2) == 1)
1849 		return;
1850 
1851 	if (sscanf(args[0], "%td", &win) == 0) {
1852 		report_count(1);
1853 		report_error("BAD ARGUMENT");
1854 		return;
1855 	}
1856 
1857 	if (sscanf(args[1], "%d", &flag) == 0) {
1858 		report_count(1);
1859 		report_error("BAD ARGUMENT");
1860 		return;
1861 	}
1862 
1863 	report_count(1);
1864 	report_return(clearok(win, flag));
1865 }
1866 
1867 
1868 void
1869 cmd_color_content(int nargs, char **args)
1870 {
1871 	short colour, red, green, blue;
1872 
1873 	if (check_arg_count(nargs, 1) == 1)
1874 		return;
1875 
1876 	if (sscanf(args[0], "%hd", &colour) == 0) {
1877 		report_count(1);
1878 		report_error("BAD ARGUMENT");
1879 		return;
1880 	}
1881 
1882 	/* XXX - call4 */
1883 	report_count(4);
1884 	report_return(color_content(colour, &red, &green, &blue));
1885 	report_int(red);
1886 	report_int(green);
1887 	report_int(blue);
1888 }
1889 
1890 
1891 void
1892 cmd_copywin(int nargs, char **args)
1893 {
1894 	int sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol, overlay;
1895 	WINDOW *source, *destination;
1896 
1897 	if (check_arg_count(nargs, 9) == 1)
1898 		return;
1899 
1900 	if (sscanf(args[0], "%td", &source) == 0) {
1901 		report_count(1);
1902 		report_error("BAD ARGUMENT");
1903 		return;
1904 	}
1905 
1906 	if (sscanf(args[1], "%td", &destination) == 0) {
1907 		report_count(1);
1908 		report_error("BAD ARGUMENT");
1909 		return;
1910 	}
1911 
1912 	if (sscanf(args[2], "%d", &sminrow) == 0) {
1913 		report_count(1);
1914 		report_error("BAD ARGUMENT");
1915 		return;
1916 	}
1917 
1918 	if (sscanf(args[3], "%d", &smincol) == 0) {
1919 		report_count(1);
1920 		report_error("BAD ARGUMENT");
1921 		return;
1922 	}
1923 
1924 	if (sscanf(args[4], "%d", &dminrow) == 0) {
1925 		report_count(1);
1926 		report_error("BAD ARGUMENT");
1927 		return;
1928 	}
1929 
1930 	if (sscanf(args[5], "%d", &dmincol) == 0) {
1931 		report_count(1);
1932 		report_error("BAD ARGUMENT");
1933 		return;
1934 	}
1935 
1936 	if (sscanf(args[6], "%d", &dmaxrow) == 0) {
1937 		report_count(1);
1938 		report_error("BAD ARGUMENT");
1939 		return;
1940 	}
1941 
1942 	if (sscanf(args[7], "%d", &dmaxcol) == 0) {
1943 		report_count(1);
1944 		report_error("BAD ARGUMENT");
1945 		return;
1946 	}
1947 
1948 	if (sscanf(args[8], "%d", &overlay) == 0) {
1949 		report_count(1);
1950 		report_error("BAD ARGUMENT");
1951 		return;
1952 	}
1953 
1954 	report_count(1);
1955 	report_return(copywin(source, destination, sminrow, smincol, dminrow,
1956 			      dmincol, dmaxrow, dmaxcol, overlay));
1957 }
1958 
1959 
1960 void
1961 cmd_curs_set(int nargs, char **args)
1962 {
1963 	int vis;
1964 
1965 	if (check_arg_count(nargs, 1) == 1)
1966 		return;
1967 
1968 	if (sscanf(args[0], "%d", &vis) == 0) {
1969 		report_count(1);
1970 		report_error("BAD ARGUMENT");
1971 		return;
1972 	}
1973 
1974 	report_count(1);
1975 	report_int(curs_set(vis));
1976 }
1977 
1978 
1979 void
1980 cmd_def_prog_mode(int nargs, char **args)
1981 {
1982 	if (check_arg_count(nargs, 0) == 1)
1983 		return;
1984 
1985 	report_count(1);
1986 	report_return(def_prog_mode());
1987 }
1988 
1989 
1990 void
1991 cmd_def_shell_mode(int nargs, char **args)
1992 {
1993 	if (check_arg_count(nargs, 0) == 1)
1994 		return;
1995 
1996 	report_count(1);
1997 	report_return(def_shell_mode());
1998 }
1999 
2000 
2001 void
2002 cmd_define_key(int nargs, char **args)
2003 {
2004 	int symbol;
2005 
2006 	if (check_arg_count(nargs, 2) == 1)
2007 		return;
2008 
2009 	if (sscanf(args[1], "%d", &symbol) == 0) {
2010 		report_count(1);
2011 		report_error("BAD ARGUMENT");
2012 		return;
2013 	}
2014 
2015 	report_count(1);
2016 	report_return(define_key(args[0], symbol));
2017 }
2018 
2019 
2020 void
2021 cmd_delay_output(int nargs, char **args)
2022 {
2023 	int dtime;
2024 
2025 	if (check_arg_count(nargs, 1) == 1)
2026 		return;
2027 
2028 	if (sscanf(args[0], "%d", &dtime) == 0) {
2029 		report_count(1);
2030 		report_error("BAD ARGUMENT");
2031 		return;
2032 	}
2033 
2034 	report_count(1);
2035 	report_return(delay_output(dtime));
2036 }
2037 
2038 
2039 void
2040 cmd_delscreen(int nargs, char **args)
2041 {
2042 	SCREEN *scrn;
2043 
2044 	if (check_arg_count(nargs, 1) == 1)
2045 		return;
2046 
2047 	if (sscanf(args[0], "%td", &scrn) == 0) {
2048 		report_count(1);
2049 		report_error("BAD ARGUMENT");
2050 		return;
2051 	}
2052 
2053 	delscreen(scrn); /* void return */
2054 	report_count(1);
2055 	report_return(OK);
2056 }
2057 
2058 
2059 void
2060 cmd_delwin(int nargs, char **args)
2061 {
2062 	WINDOW *win;
2063 
2064 	if (check_arg_count(nargs, 1) == 1)
2065 		return;
2066 
2067 	if (sscanf(args[0], "%td", &win) == 0) {
2068 		report_count(1);
2069 		report_error("BAD ARGUMENT");
2070 		return;
2071 	}
2072 
2073 	report_count(1);
2074 	report_return(delwin(win));
2075 }
2076 
2077 
2078 void
2079 cmd_derwin(int nargs, char **args)
2080 {
2081 	int lines, cols, y, x;
2082 	WINDOW *win;
2083 
2084 	if (check_arg_count(nargs, 5) == 1)
2085 		return;
2086 
2087 	if (sscanf(args[0], "%td", &win) == 0) {
2088 		report_count(1);
2089 		report_error("BAD ARGUMENT");
2090 		return;
2091 	}
2092 
2093 	if (sscanf(args[1], "%d", &lines) == 0) {
2094 		report_count(1);
2095 		report_error("BAD ARGUMENT");
2096 		return;
2097 	}
2098 
2099 	if (sscanf(args[2], "%d", &cols) == 0) {
2100 		report_count(1);
2101 		report_error("BAD ARGUMENT");
2102 		return;
2103 	}
2104 
2105 	if (sscanf(args[3], "%d", &y) == 0) {
2106 		report_count(1);
2107 		report_error("BAD ARGUMENT");
2108 		return;
2109 	}
2110 
2111 	if (sscanf(args[4], "%d", &x) == 0) {
2112 		report_count(1);
2113 		report_error("BAD ARGUMENT");
2114 		return;
2115 	}
2116 
2117 	report_count(1);
2118 	report_ptr(derwin(win, lines, cols, y, x));
2119 }
2120 
2121 
2122 void
2123 cmd_dupwin(int nargs, char **args)
2124 {
2125 	WINDOW *win;
2126 
2127 	if (check_arg_count(nargs, 1) == 1)
2128 		return;
2129 
2130 	if (sscanf(args[0], "%td", &win) == 0) {
2131 		report_count(1);
2132 		report_error("BAD ARGUMENT");
2133 		return;
2134 	}
2135 
2136 	report_count(1);
2137 	report_ptr(dupwin(win));
2138 }
2139 
2140 
2141 void
2142 cmd_doupdate(int nargs, char **args)
2143 {
2144 	if (check_arg_count(nargs, 0) == 1)
2145 		return;
2146 
2147 	/* XXX - implicit refresh */
2148 	report_count(1);
2149 	report_return(doupdate());
2150 }
2151 
2152 
2153 void
2154 cmd_echo(int nargs, char **args)
2155 {
2156 	if (check_arg_count(nargs, 0) == 1)
2157 		return;
2158 
2159 	report_count(1);
2160 	report_return(echo());
2161 }
2162 
2163 
2164 void
2165 cmd_endwin(int nargs, char **args)
2166 {
2167 	if (check_arg_count(nargs, 0) == 1)
2168 		return;
2169 
2170 	report_count(1);
2171 	report_return(endwin());
2172 }
2173 
2174 
2175 void
2176 cmd_erasechar(int nargs, char **args)
2177 {
2178 	if (check_arg_count(nargs, 0) == 1)
2179 		return;
2180 
2181 	report_count(1);
2182 	report_return(erasechar());
2183 }
2184 
2185 
2186 void
2187 cmd_flash(int nargs, char **args)
2188 {
2189 	if (check_arg_count(nargs, 1) == 0)
2190 		return;
2191 
2192 	report_count(1);
2193 	report_return(flash());
2194 }
2195 
2196 
2197 void
2198 cmd_flushinp(int nargs, char **args)
2199 {
2200 	if (check_arg_count(nargs, 0) == 1)
2201 		return;
2202 
2203 	report_count(1);
2204 	report_return(flushinp());
2205 }
2206 
2207 
2208 void
2209 cmd_flushok(int nargs, char **args)
2210 {
2211 	int flag;
2212 	WINDOW *win;
2213 
2214 	if (check_arg_count(nargs, 2) == 1)
2215 		return;
2216 
2217 	if (sscanf(args[0], "%td", &win) == 0) {
2218 		report_count(1);
2219 		report_error("BAD ARGUMENT");
2220 		return;
2221 	}
2222 
2223 	if (sscanf(args[1], "%d", &flag) == 0) {
2224 		report_count(1);
2225 		report_error("BAD ARGUMENT");
2226 		return;
2227 	}
2228 
2229 	report_count(1);
2230 	report_return(flushok(win, flag));
2231 }
2232 
2233 
2234 void
2235 cmd_fullname(int nargs, char **args)
2236 {
2237 	char string[256];
2238 
2239 	if (check_arg_count(nargs, 1) == 1)
2240 		return;
2241 
2242 	/* XXX - call2 */
2243 	report_count(2);
2244 	report_status(fullname(args[0], string));
2245 	report_status(string);
2246 }
2247 
2248 
2249 void
2250 cmd_getattrs(int nargs, char **args)
2251 {
2252 	WINDOW *win;
2253 
2254 	if (check_arg_count(nargs, 1) == 1)
2255 		return;
2256 
2257 	if (sscanf(args[0], "%td", &win) == 0) {
2258 		report_count(1);
2259 		report_error("BAD ARGUMENT");
2260 		return;
2261 	}
2262 
2263 	report_count(1);
2264 	report_int(getattrs(win));
2265 }
2266 
2267 
2268 void
2269 cmd_getbkgd(int nargs, char **args)
2270 {
2271 	WINDOW *win;
2272 
2273 	if (check_arg_count(nargs, 1) == 1)
2274 		return;
2275 
2276 	if (sscanf(args[0], "%td", &win) == 0) {
2277 		report_count(1);
2278 		report_error("BAD ARGUMENT");
2279 		return;
2280 	}
2281 
2282 	report_count(1);
2283 	report_int(getbkgd(win));
2284 }
2285 
2286 
2287 void
2288 cmd_getcury(int nargs, char **args)
2289 {
2290 	WINDOW *win;
2291 
2292 	if (check_arg_count(nargs, 1) == 1)
2293 		return;
2294 
2295 	if (sscanf(args[0], "%td", &win) == 0) {
2296 		report_count(1);
2297 		report_error("BAD ARGUMENT");
2298 		return;
2299 	}
2300 
2301 	report_count(1);
2302 	report_int(getcury(win));
2303 }
2304 
2305 
2306 void
2307 cmd_getcurx(int nargs, char **args)
2308 {
2309 	WINDOW *win;
2310 
2311 	if (check_arg_count(nargs, 1) == 1)
2312 		return;
2313 
2314 	if (sscanf(args[0], "%td", &win) == 0) {
2315 		report_count(1);
2316 		report_error("BAD ARGUMENT");
2317 		return;
2318 	}
2319 
2320 	report_count(1);
2321 	report_int(getcurx(win));
2322 }
2323 
2324 
2325 void
2326 cmd_getbegy(int nargs, char **args)
2327 {
2328 	WINDOW *win;
2329 
2330 	if (check_arg_count(nargs, 1) == 1)
2331 		return;
2332 
2333 	if (sscanf(args[0], "%td", &win) == 0) {
2334 		report_count(1);
2335 		report_error("BAD ARGUMENT");
2336 		return;
2337 	}
2338 
2339 	report_count(1);
2340 	report_int(getbegy(win));
2341 }
2342 
2343 
2344 void
2345 cmd_getbegx(int nargs, char **args)
2346 {
2347 	WINDOW *win;
2348 
2349 	if (check_arg_count(nargs, 1) == 1)
2350 		return;
2351 
2352 	if (sscanf(args[0], "%td", &win) == 0) {
2353 		report_count(1);
2354 		report_error("BAD ARGUMENT");
2355 		return;
2356 	}
2357 
2358 	report_count(1);
2359 	report_int(getbegx(win));
2360 }
2361 
2362 
2363 void
2364 cmd_getmaxy(int nargs, char **args)
2365 {
2366 	WINDOW *win;
2367 
2368 	if (check_arg_count(nargs, 1) == 1)
2369 		return;
2370 
2371 	if (sscanf(args[0], "%td", &win) == 0) {
2372 		report_count(1);
2373 		report_error("BAD ARGUMENT");
2374 		return;
2375 	}
2376 
2377 	report_count(1);
2378 	report_int(getmaxy(win));
2379 }
2380 
2381 
2382 void
2383 cmd_getmaxx(int nargs, char **args)
2384 {
2385 	WINDOW *win;
2386 
2387 	if (check_arg_count(nargs, 1) == 1)
2388 		return;
2389 
2390 	if (sscanf(args[0], "%td", &win) == 0) {
2391 		report_count(1);
2392 		report_error("BAD ARGUMENT");
2393 		return;
2394 	}
2395 
2396 	report_count(1);
2397 	report_int(getmaxx(win));
2398 }
2399 
2400 
2401 void
2402 cmd_getpary(int nargs, char **args)
2403 {
2404 	WINDOW *win;
2405 
2406 	if (check_arg_count(nargs, 1) == 1)
2407 		return;
2408 
2409 	if (sscanf(args[0], "%td", &win) == 0) {
2410 		report_count(1);
2411 		report_error("BAD ARGUMENT");
2412 		return;
2413 	}
2414 
2415 	report_count(1);
2416 	report_int(getpary(win));
2417 }
2418 
2419 
2420 void
2421 cmd_getparx(int nargs, char **args)
2422 {
2423 	WINDOW *win;
2424 
2425 	if (check_arg_count(nargs, 1) == 1)
2426 		return;
2427 
2428 	if (sscanf(args[0], "%td", &win) == 0) {
2429 		report_count(1);
2430 		report_error("BAD ARGUMENT");
2431 		return;
2432 	}
2433 
2434 	report_count(1);
2435 	report_int(getparx(win));
2436 }
2437 
2438 
2439 void
2440 cmd_gettmode(int nargs, char **args)
2441 {
2442 	if (check_arg_count(nargs, 0) == 1)
2443 		return;
2444 
2445 	report_count(1);
2446 	report_return(gettmode());
2447 }
2448 
2449 
2450 void
2451 cmd_getwin(int nargs, char **args)
2452 {
2453 	FILE *fp;
2454 
2455 	if (check_arg_count(nargs, 1) == 1)
2456 		return;
2457 
2458 	if ((fp = fopen(args[0], "r")) == NULL) {
2459 		report_count(1);
2460 		report_error("BAD FILE_ARGUMENT");
2461 		return;
2462 	}
2463 
2464 	report_count(1);
2465 	report_ptr(getwin(fp));
2466 	fclose(fp);
2467 }
2468 
2469 
2470 void
2471 cmd_halfdelay(int nargs, char **args)
2472 {
2473 	int ms;
2474 
2475 	if (check_arg_count(nargs, 1) == 1)
2476 		return;
2477 
2478 	if (sscanf(args[0], "%d", &ms) == 0) {
2479 		report_count(1);
2480 		report_error("BAD ARGUMENT");
2481 		return;
2482 	}
2483 
2484 	report_count(1);
2485 	report_return(halfdelay(ms));
2486 }
2487 
2488 
2489 void
2490 cmd_has_colors(int nargs, char **args)
2491 {
2492 	if (check_arg_count(nargs, 0) == 1)
2493 		return;
2494 
2495 	report_count(1);
2496 	report_int(has_colors());
2497 }
2498 
2499 
2500 void
2501 cmd_has_ic(int nargs, char **args)
2502 {
2503 	if (check_arg_count(nargs, 0) == 1)
2504 		return;
2505 
2506 	report_count(1);
2507 	report_int(has_ic());
2508 }
2509 
2510 
2511 void
2512 cmd_has_il(int nargs, char **args)
2513 {
2514 	if (check_arg_count(nargs, 0) == 1)
2515 		return;
2516 
2517 	report_count(1);
2518 	report_int(has_il());
2519 }
2520 
2521 
2522 void
2523 cmd_hline(int nargs, char **args)
2524 {
2525 	int ch, count;
2526 
2527 	if (check_arg_count(nargs, 2) == 1)
2528 		return;
2529 
2530 	if (sscanf(args[0], "%d", &ch) == 0) {
2531 		report_count(1);
2532 		report_error("BAD ARGUMENT");
2533 		return;
2534 	}
2535 
2536 	if (sscanf(args[1], "%d", &count) == 0) {
2537 		report_count(1);
2538 		report_error("BAD ARGUMENT");
2539 		return;
2540 	}
2541 
2542 	report_count(1);
2543 	report_return(hline(ch, count));
2544 }
2545 
2546 
2547 void
2548 cmd_idcok(int nargs, char **args)
2549 {
2550 	int flag;
2551 	WINDOW *win;
2552 
2553 	if (check_arg_count(nargs, 2) == 1)
2554 		return;
2555 
2556 	if (sscanf(args[0], "%td", &win) == 0) {
2557 		report_count(1);
2558 	report_error("BAD ARGUMENT");
2559 		return;
2560 	}
2561 
2562 	if (sscanf(args[1], "%d", &flag) == 0) {
2563 		report_count(1);
2564 		report_error("BAD ARGUMENT");
2565 		return;
2566 	}
2567 
2568 	report_count(1);
2569 	report_return(idcok(win, flag));
2570 }
2571 
2572 
2573 void
2574 cmd_idlok(int nargs, char **args)
2575 {
2576 	int flag;
2577 	WINDOW *win;
2578 
2579 	if (check_arg_count(nargs, 2) == 1)
2580 		return;
2581 
2582 	if (sscanf(args[0], "%td", &win) == 0) {
2583 		report_count(1);
2584 		report_error("BAD ARGUMENT");
2585 		return;
2586 	}
2587 
2588 	if (sscanf(args[1], "%d", &flag) == 0) {
2589 		report_count(1);
2590 		report_error("BAD ARGUMENT");
2591 		return;
2592 	}
2593 
2594 	report_count(1);
2595 	report_return(idlok(win, flag));
2596 }
2597 
2598 
2599 void
2600 cmd_init_color(int nargs, char **args)
2601 {
2602 	short colour, red, green, blue;
2603 
2604 	if (check_arg_count(nargs, 4) == 1)
2605 		return;
2606 
2607 	if (sscanf(args[0], "%hd", &colour) == 0) {
2608 		report_count(1);
2609 		report_error("BAD ARGUMENT");
2610 		return;
2611 	}
2612 
2613 	if (sscanf(args[1], "%hd", &red) == 0) {
2614 		report_count(1);
2615 		report_error("BAD ARGUMENT");
2616 		return;
2617 	}
2618 
2619 	if (sscanf(args[2], "%hd", &green) == 0) {
2620 		report_count(1);
2621 		report_error("BAD ARGUMENT");
2622 		return;
2623 	}
2624 
2625 	if (sscanf(args[3], "%hd", &blue) == 0) {
2626 		report_count(1);
2627 		report_error("BAD ARGUMENT");
2628 		return;
2629 	}
2630 
2631 	report_count(1);
2632 	report_return(init_color(colour, red, green, blue));
2633 }
2634 
2635 
2636 void
2637 cmd_init_pair(int nargs, char **args)
2638 {
2639 	short pair, fore, back;
2640 
2641 	if (check_arg_count(nargs, 3) == 1)
2642 		return;
2643 
2644 	if (sscanf(args[0], "%hd", &pair) == 0) {
2645 		report_count(1);
2646 		report_error("BAD ARGUMENT");
2647 		return;
2648 	}
2649 
2650 	if (sscanf(args[1], "%hd", &fore) == 0) {
2651 		report_count(1);
2652 		report_error("BAD ARGUMENT");
2653 		return;
2654 	}
2655 
2656 	if (sscanf(args[2], "%hd", &back) == 0) {
2657 		report_count(1);
2658 		report_error("BAD ARGUMENT");
2659 		return;
2660 	}
2661 
2662 	report_count(1);
2663 	report_return(init_pair(pair, fore, back));
2664 }
2665 
2666 
2667 void
2668 cmd_initscr(int nargs, char **args)
2669 {
2670 	if (check_arg_count(nargs, 0) == 1)
2671 		return;
2672 
2673 	report_count(1);
2674 	report_ptr(initscr());
2675 }
2676 
2677 
2678 void
2679 cmd_intrflush(int nargs, char **args)
2680 {
2681 	int flag;
2682 	WINDOW *win;
2683 
2684 	if (check_arg_count(nargs, 2) == 1)
2685 		return;
2686 
2687 	if (sscanf(args[0], "%td", &win) == 0) {
2688 		report_count(1);
2689 		report_error("BAD ARGUMENT");
2690 		return;
2691 	}
2692 
2693 	if (sscanf(args[1], "%d", &flag) == 0) {
2694 		report_count(1);
2695 		report_error("BAD ARGUMENT");
2696 		return;
2697 	}
2698 
2699 	report_count(1);
2700 	report_return(intrflush(win, flag));
2701 }
2702 
2703 
2704 void
2705 cmd_isendwin(int nargs, char **args)
2706 {
2707 	if (check_arg_count(nargs, 0) == 1)
2708 		return;
2709 
2710 	report_count(1);
2711 	report_int(isendwin());
2712 }
2713 
2714 
2715 void
2716 cmd_is_linetouched(int nargs, char **args)
2717 {
2718 	int line;
2719 	WINDOW *win;
2720 
2721 	if (check_arg_count(nargs, 2) == 1)
2722 		return;
2723 
2724 	if (sscanf(args[0], "%td", &win) == 0) {
2725 		report_count(1);
2726 		report_error("BAD ARGUMENT");
2727 		return;
2728 	}
2729 
2730 	if (sscanf(args[1], "%d", &line) == 0) {
2731 		report_count(1);
2732 		report_error("BAD ARGUMENT");
2733 		return;
2734 	}
2735 
2736 	report_count(1);
2737 	report_int(is_linetouched(win, line));
2738 }
2739 
2740 
2741 void
2742 cmd_is_wintouched(int nargs, char **args)
2743 {
2744 	WINDOW *win;
2745 
2746 	if (check_arg_count(nargs, 1) == 1)
2747 		return;
2748 
2749 	if (sscanf(args[0], "%td", &win) == 0) {
2750 		report_count(1);
2751 		report_error("BAD ARGUMENT");
2752 		return;
2753 	}
2754 
2755 	report_count(1);
2756 	report_int(is_wintouched(win));
2757 }
2758 
2759 
2760 void
2761 cmd_keyok(int nargs, char **args)
2762 {
2763 	int keysym, flag;
2764 
2765 	if (check_arg_count(nargs, 2) == 1)
2766 		return;
2767 
2768 	if (sscanf(args[0], "%d", &keysym) == 0) {
2769 		report_count(1);
2770 		report_error("BAD ARGUMENT");
2771 		return;
2772 	}
2773 
2774 	if (sscanf(args[1], "%d", &flag) == 0) {
2775 		report_count(1);
2776 		report_error("BAD ARGUMENT");
2777 		return;
2778 	}
2779 
2780 	report_count(1);
2781 	report_return(keyok(keysym, flag));
2782 }
2783 
2784 
2785 void
2786 cmd_keypad(int nargs, char **args)
2787 {
2788 	int flag;
2789 	WINDOW *win;
2790 
2791 	if (check_arg_count(nargs, 2) == 1)
2792 		return;
2793 
2794 	if (sscanf(args[0], "%td", &win) == 0) {
2795 		report_count(1);
2796 		report_error("BAD ARGUMENT");
2797 		return;
2798 	}
2799 
2800 	if (sscanf(args[1], "%d", &flag) == 0) {
2801 		report_count(1);
2802 		report_error("BAD ARGUMENT");
2803 		return;
2804 	}
2805 
2806 	report_count(1);
2807 	report_return(keypad(win, flag));
2808 }
2809 
2810 
2811 void
2812 cmd_keyname(int nargs, char **args)
2813 {
2814 	int key;
2815 
2816 	if (check_arg_count(nargs, 1) == 1)
2817 		return;
2818 
2819 	if (sscanf(args[0], "%d", &key) == 0) {
2820 		report_count(1);
2821 		report_error("BAD ARGUMENT");
2822 		return;
2823 	}
2824 
2825 	report_count(1);
2826 	report_status(keyname(key));
2827 }
2828 
2829 
2830 void
2831 cmd_killchar(int nargs, char **args)
2832 {
2833 	if (check_arg_count(nargs, 0) == 1)
2834 		return;
2835 
2836 	report_count(1);
2837 	report_int(killchar());
2838 }
2839 
2840 
2841 void
2842 cmd_leaveok(int nargs, char **args)
2843 {
2844 	int flag;
2845 	WINDOW *win;
2846 
2847 	if (check_arg_count(nargs, 2) == 1)
2848 		return;
2849 
2850 	if (sscanf(args[0], "%td", &win) == 0) {
2851 		report_count(1);
2852 		report_error("BAD ARGUMENT");
2853 		return;
2854 	}
2855 
2856 	if (sscanf(args[1], "%d", &flag) == 0) {
2857 		report_count(1);
2858 		report_error("BAD ARGUMENT");
2859 		return;
2860 	}
2861 
2862 	report_count(1);
2863 	report_return(leaveok(win, flag));
2864 }
2865 
2866 
2867 void
2868 cmd_meta(int nargs, char **args)
2869 {
2870 	int flag;
2871 	WINDOW *win;
2872 
2873 	if (check_arg_count(nargs, 2) == 1)
2874 		return;
2875 
2876 	if (sscanf(args[0], "%td", &win) == 0) {
2877 		report_count(1);
2878 		report_error("BAD ARGUMENT");
2879 		return;
2880 	}
2881 
2882 	if (sscanf(args[1], "%d", &flag) == 0) {
2883 		report_count(1);
2884 		report_error("BAD ARGUMENT");
2885 		return;
2886 	}
2887 
2888 	report_count(1);
2889 	report_return(meta(win, flag));
2890 }
2891 
2892 
2893 void
2894 cmd_mvcur(int nargs, char **args)
2895 {
2896 	int oldy, oldx, y, x;
2897 
2898 	if (check_arg_count(nargs, 4) == 1)
2899 		return;
2900 
2901 	if (sscanf(args[0], "%d", &oldy) == 0) {
2902 		report_count(1);
2903 		report_error("BAD ARGUMENT");
2904 		return;
2905 	}
2906 
2907 	if (sscanf(args[1], "%d", &oldx) == 0) {
2908 		report_count(1);
2909 		report_error("BAD ARGUMENT");
2910 		return;
2911 	}
2912 
2913 	if (sscanf(args[2], "%d", &y) == 0) {
2914 		report_count(1);
2915 		report_error("BAD ARGUMENT");
2916 		return;
2917 	}
2918 
2919 	if (sscanf(args[3], "%d", &x) == 0) {
2920 		report_count(1);
2921 		report_error("BAD ARGUMENT");
2922 		return;
2923 	}
2924 
2925 	report_count(1);
2926 	report_return(mvcur(oldy, oldx, y, x));
2927 }
2928 
2929 
2930 void
2931 cmd_mvderwin(int nargs, char **args)
2932 {
2933 	int y, x;
2934 	WINDOW *win;
2935 
2936 	if (check_arg_count(nargs, 3) == 1)
2937 		return;
2938 
2939 	if (sscanf(args[0], "%td", &win) == 0) {
2940 		report_count(1);
2941 		report_error("BAD ARGUMENT");
2942 		return;
2943 	}
2944 
2945 	if (sscanf(args[1], "%d", &y) == 0) {
2946 		report_count(1);
2947 		report_error("BAD ARGUMENT");
2948 		return;
2949 	}
2950 
2951 	if (sscanf(args[2], "%d", &x) == 0) {
2952 		report_count(1);
2953 		report_error("BAD ARGUMENT");
2954 		return;
2955 	}
2956 
2957 	report_count(1);
2958 	report_return(mvderwin(win, y, x));
2959 }
2960 
2961 
2962 void
2963 cmd_mvhline(int nargs, char **args)
2964 {
2965 	int y, x, ch, n;
2966 
2967 	if (check_arg_count(nargs, 4) == 1)
2968 		return;
2969 
2970 	if (sscanf(args[0], "%d", &y) == 0) {
2971 		report_count(1);
2972 		report_error("BAD ARGUMENT");
2973 		return;
2974 	}
2975 
2976 	if (sscanf(args[1], "%d", &x) == 0) {
2977 		report_count(1);
2978 		report_error("BAD ARGUMENT");
2979 		return;
2980 	}
2981 
2982 	if (sscanf(args[2], "%d", &ch) == 0) {
2983 		report_count(1);
2984 		report_error("BAD ARGUMENT");
2985 		return;
2986 	}
2987 
2988 	if (sscanf(args[3], "%d", &n) == 0) {
2989 		report_count(1);
2990 		report_error("BAD ARGUMENT");
2991 		return;
2992 	}
2993 
2994 	report_count(1);
2995 	report_return(mvhline(y, x, ch, n));
2996 }
2997 
2998 
2999 void
3000 cmd_mvprintw(int nargs, char **args)
3001 {
3002 	int y, x;
3003 
3004 	if (check_arg_count(nargs, 4) == 1)
3005 		return;
3006 
3007 	if (sscanf(args[0], "%d", &y) == 0) {
3008 		report_count(1);
3009 		report_error("BAD ARGUMENT");
3010 		return;
3011 	}
3012 
3013 	if (sscanf(args[1], "%d", &x) == 0) {
3014 		report_count(1);
3015 		report_error("BAD ARGUMENT");
3016 		return;
3017 	}
3018 
3019 	report_count(1);
3020 	report_return(mvprintw(y, x, args[2], args[3]));
3021 }
3022 
3023 
3024 void
3025 cmd_mvscanw(int nargs, char **args)
3026 {
3027 	int y, x;
3028 	char string[256];
3029 
3030 	if (check_arg_count(nargs, 3) == 1)
3031 		return;
3032 
3033 	if (sscanf(args[0], "%d", &y) == 0) {
3034 		report_count(1);
3035 		report_error("BAD ARGUMENT");
3036 		return;
3037 	}
3038 
3039 	if (sscanf(args[1], "%d", &x) == 0) {
3040 		report_count(1);
3041 		report_error("BAD ARGUMENT");
3042 		return;
3043 	}
3044 
3045 	/* XXX - call2 */
3046 	report_count(2);
3047 	report_int(mvscanw(y, x, args[2], &string));
3048 	report_status(string);
3049 }
3050 
3051 
3052 void
3053 cmd_mvvline(int nargs, char **args)
3054 {
3055 	int y, x, ch, n;
3056 
3057 	if (check_arg_count(nargs, 4) == 1)
3058 		return;
3059 
3060 	if (sscanf(args[0], "%d", &y) == 0) {
3061 		report_count(1);
3062 		report_error("BAD ARGUMENT");
3063 		return;
3064 	}
3065 
3066 	if (sscanf(args[1], "%d", &x) == 0) {
3067 		report_count(1);
3068 		report_error("BAD ARGUMENT");
3069 		return;
3070 	}
3071 
3072 	if (sscanf(args[2], "%d", &ch) == 0) {
3073 		report_count(1);
3074 		report_error("BAD ARGUMENT");
3075 		return;
3076 	}
3077 
3078 	if (sscanf(args[3], "%d", &n) == 0) {
3079 		report_count(1);
3080 		report_error("BAD ARGUMENT");
3081 		return;
3082 	}
3083 
3084 	report_count(1);
3085 	report_return(mvvline(y, x, ch, n));
3086 }
3087 
3088 
3089 void
3090 cmd_mvwhline(int nargs, char **args)
3091 {
3092 	int y, x, ch, n;
3093 	WINDOW *win;
3094 
3095 	if (check_arg_count(nargs, 5) == 1)
3096 		return;
3097 
3098 	if (sscanf(args[0], "%td", &win) == 0) {
3099 		report_count(1);
3100 		report_error("BAD ARGUMENT");
3101 		return;
3102 	}
3103 
3104 	if (sscanf(args[1], "%d", &y) == 0) {
3105 		report_count(1);
3106 		report_error("BAD ARGUMENT");
3107 		return;
3108 	}
3109 
3110 	if (sscanf(args[2], "%d", &x) == 0) {
3111 		report_count(1);
3112 		report_error("BAD ARGUMENT");
3113 		return;
3114 	}
3115 
3116 	if (sscanf(args[3], "%d", &ch) == 0) {
3117 		report_count(1);
3118 		report_error("BAD ARGUMENT");
3119 		return;
3120 	}
3121 
3122 	if (sscanf(args[4], "%d", &n) == 0) {
3123 		report_count(1);
3124 		report_error("BAD ARGUMENT");
3125 		return;
3126 	}
3127 
3128 	report_count(1);
3129 	report_return(mvwhline(win, y, x, ch, n));
3130 }
3131 
3132 
3133 void
3134 cmd_mvwvline(int nargs, char **args)
3135 {
3136 	int y, x, ch, n;
3137 	WINDOW *win;
3138 
3139 	if (check_arg_count(nargs, 5) == 1)
3140 		return;
3141 
3142 	if (sscanf(args[0], "%td", &win) == 0) {
3143 		report_count(1);
3144 		report_error("BAD ARGUMENT");
3145 		return;
3146 	}
3147 
3148 	if (sscanf(args[1], "%d", &y) == 0) {
3149 		report_count(1);
3150 		report_error("BAD ARGUMENT");
3151 		return;
3152 	}
3153 
3154 	if (sscanf(args[2], "%d", &x) == 0) {
3155 		report_count(1);
3156 		report_error("BAD ARGUMENT");
3157 		return;
3158 	}
3159 
3160 	if (sscanf(args[3], "%d", &ch) == 0) {
3161 		report_count(1);
3162 		report_error("BAD ARGUMENT");
3163 		return;
3164 	}
3165 
3166 	if (sscanf(args[4], "%d", &n) == 0) {
3167 		report_count(1);
3168 		report_error("BAD ARGUMENT");
3169 		return;
3170 	}
3171 
3172 	report_count(1);
3173 	report_return(mvwvline(win, y, x, ch, n));
3174 }
3175 
3176 
3177 void
3178 cmd_mvwin(int nargs, char **args)
3179 {
3180 	int y, x;
3181 	WINDOW *win;
3182 
3183 	if (check_arg_count(nargs, 3) == 1)
3184 		return;
3185 
3186 	if (sscanf(args[0], "%td", &win) == 0) {
3187 		report_count(1);
3188 		report_error("BAD ARGUMENT");
3189 		return;
3190 	}
3191 
3192 	if (sscanf(args[1], "%d", &y) == 0) {
3193 		report_count(1);
3194 		report_error("BAD ARGUMENT");
3195 		return;
3196 	}
3197 
3198 	if (sscanf(args[2], "%d", &x) == 0) {
3199 		report_count(1);
3200 		report_error("BAD ARGUMENT");
3201 		return;
3202 	}
3203 
3204 	report_count(1);
3205 	report_return(mvwin(win, y, x));
3206 }
3207 
3208 
3209 void
3210 cmd_mvwinchnstr(int nargs, char **args)
3211 {
3212 	int y, x, count;
3213 	chtype *string;
3214 	WINDOW *win;
3215 
3216 	if (check_arg_count(nargs, 4) == 1)
3217 		return;
3218 
3219 	if (sscanf(args[0], "%td", &win) == 0) {
3220 		report_count(1);
3221 		report_error("BAD ARGUMENT");
3222 		return;
3223 	}
3224 
3225 	if (sscanf(args[1], "%d", &y) == 0) {
3226 		report_count(1);
3227 		report_error("BAD ARGUMENT");
3228 		return;
3229 	}
3230 
3231 	if (sscanf(args[2], "%d", &x) == 0) {
3232 		report_count(1);
3233 		report_error("BAD ARGUMENT");
3234 		return;
3235 	}
3236 
3237 	if (sscanf(args[3], "%d", &count) == 0) {
3238 		report_count(1);
3239 		report_error("BAD ARGUMENT");
3240 		return;
3241 	}
3242 
3243 	if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
3244 		report_count(1);
3245 		report_error("MALLOC_FAILED");
3246 		return;
3247 	}
3248 
3249 	/* XXX call2 */
3250 	report_count(2);
3251 	report_return(mvwinchnstr(win, y, x, string, count));
3252 	report_nstr(string);
3253 	free(string);
3254 }
3255 
3256 
3257 void
3258 cmd_mvwinchstr(int nargs, char **args)
3259 {
3260 	int y, x;
3261 	chtype string[256];
3262 	WINDOW *win;
3263 
3264 	if (check_arg_count(nargs, 3) == 1)
3265 		return;
3266 
3267 	if (sscanf(args[0], "%td", &win) == 0) {
3268 		report_count(1);
3269 		report_error("BAD ARGUMENT");
3270 		return;
3271 	}
3272 
3273 	if (sscanf(args[1], "%d", &y) == 0) {
3274 		report_count(1);
3275 		report_error("BAD ARGUMENT");
3276 		return;
3277 	}
3278 
3279 	if (sscanf(args[2], "%d", &x) == 0) {
3280 		report_count(1);
3281 		report_error("BAD ARGUMENT");
3282 		return;
3283 	}
3284 
3285 	/* XXX call2 */
3286 	report_count(2);
3287 	report_return(mvwinchstr(win, y, x, string));
3288 	report_nstr(string);
3289 }
3290 
3291 
3292 void
3293 cmd_mvwinnstr(int nargs, char **args)
3294 {
3295 	int y, x, count;
3296 	char *string;
3297 	WINDOW *win;
3298 
3299 	if (check_arg_count(nargs, 4) == 1)
3300 		return;
3301 
3302 	if (sscanf(args[0], "%td", &win) == 0) {
3303 		report_count(1);
3304 		report_error("BAD ARGUMENT");
3305 		return;
3306 	}
3307 
3308 	if (sscanf(args[1], "%d", &y) == 0) {
3309 		report_count(1);
3310 		report_error("BAD ARGUMENT");
3311 		return;
3312 	}
3313 
3314 	if (sscanf(args[2], "%d", &x) == 0) {
3315 		report_count(1);
3316 		report_error("BAD ARGUMENT");
3317 		return;
3318 	}
3319 
3320 	if (sscanf(args[3], "%d", &count) == 0) {
3321 		report_count(1);
3322 		report_error("BAD ARGUMENT");
3323 		return;
3324 	}
3325 
3326 	if ((string = malloc(count + 1)) == NULL) {
3327 		report_count(1);
3328 		report_error("MALLOC_FAILED");
3329 		return;
3330 	}
3331 
3332 	/* XXX call2 */
3333 	report_count(2);
3334 	report_return(mvwinnstr(win, y, x, string, count));
3335 	report_status(string);
3336 	free(string);
3337 }
3338 
3339 
3340 void
3341 cmd_mvwinstr(int nargs, char **args)
3342 {
3343 	int y, x;
3344 	char string[256];
3345 	WINDOW *win;
3346 
3347 	if (check_arg_count(nargs, 3) == 1)
3348 		return;
3349 
3350 	if (sscanf(args[0], "%td", &win) == 0) {
3351 		report_count(1);
3352 		report_error("BAD ARGUMENT");
3353 		return;
3354 	}
3355 
3356 	if (sscanf(args[1], "%d", &y) == 0) {
3357 		report_count(1);
3358 		report_error("BAD ARGUMENT");
3359 		return;
3360 	}
3361 
3362 	if (sscanf(args[2], "%d", &x) == 0) {
3363 		report_count(1);
3364 		report_error("BAD ARGUMENT");
3365 		return;
3366 	}
3367 
3368 	/* XXX call2 */
3369 	report_count(2);
3370 	report_return(mvwinstr(win, y, x, string));
3371 	report_status(string);
3372 }
3373 
3374 
3375 void
3376 cmd_mvwprintw(int nargs, char **args)
3377 {
3378 	int y, x;
3379 	WINDOW *win;
3380 
3381 	if (check_arg_count(nargs, 5) == 1)
3382 		return;
3383 
3384 	if (sscanf(args[0], "%td", &win) == 0) {
3385 		report_count(1);
3386 		report_error("BAD ARGUMENT");
3387 		return;
3388 	}
3389 
3390 	if (sscanf(args[1], "%d", &y) == 0) {
3391 		report_count(1);
3392 		report_error("BAD ARGUMENT");
3393 		return;
3394 	}
3395 
3396 	if (sscanf(args[2], "%d", &x) == 0) {
3397 		report_count(1);
3398 		report_error("BAD ARGUMENT");
3399 		return;
3400 	}
3401 
3402 	report_count(1);
3403 	report_return(mvwprintw(win, y, x, args[3], args[4]));
3404 }
3405 
3406 
3407 void
3408 cmd_mvwscanw(int nargs, char **args)
3409 {
3410 	int y, x;
3411 	WINDOW *win;
3412 	char string[256];
3413 
3414 	if (check_arg_count(nargs, 4) == 1)
3415 		return;
3416 
3417 	if (sscanf(args[0], "%td", &win) == 0) {
3418 		report_count(1);
3419 		report_error("BAD ARGUMENT");
3420 		return;
3421 	}
3422 
3423 	if (sscanf(args[1], "%d", &y) == 0) {
3424 		report_count(1);
3425 		report_error("BAD ARGUMENT");
3426 		return;
3427 	}
3428 
3429 	if (sscanf(args[2], "%d", &x) == 0) {
3430 		report_count(1);
3431 		report_error("BAD ARGUMENT");
3432 		return;
3433 	}
3434 
3435 	/* XXX - call2 */
3436 	report_count(2);
3437 	report_int(mvwscanw(win, y, x, args[3], &string));
3438 	report_status(string);
3439 }
3440 
3441 
3442 void
3443 cmd_napms(int nargs, char **args)
3444 {
3445 	int naptime;
3446 
3447 	if (check_arg_count(nargs, 1) == 1)
3448 		return;
3449 
3450 	if (sscanf(args[0], "%d", &naptime) == 0) {
3451 		report_count(1);
3452 		report_error("BAD ARGUMENT");
3453 		return;
3454 	}
3455 
3456 	report_count(1);
3457 	report_return(napms(naptime));
3458 }
3459 
3460 
3461 void
3462 cmd_newpad(int nargs, char **args)
3463 {
3464 	int y, x;
3465 
3466 	if (check_arg_count(nargs, 2) == 1)
3467 		return;
3468 
3469 	if (sscanf(args[0], "%d", &y) == 0) {
3470 		report_count(1);
3471 		report_error("BAD ARGUMENT");
3472 		return;
3473 	}
3474 
3475 	if (sscanf(args[1], "%d", &x) == 0) {
3476 		report_count(1);
3477 		report_error("BAD ARGUMENT");
3478 		return;
3479 	}
3480 
3481 	report_count(1);
3482 	report_ptr(newpad(y, x));
3483 }
3484 
3485 
3486 void
3487 cmd_newterm(int nargs, char **args)
3488 {
3489 	FILE *in, *out;
3490 
3491 	if (check_arg_count(nargs, 3) == 1)
3492 		return;
3493 
3494 	if ((in = fopen(args[1], "rw")) == NULL) {
3495 		report_count(1);
3496 		report_error("BAD FILE_ARGUMENT");
3497 		return;
3498 	}
3499 
3500 
3501 	if ((out = fopen(args[2], "rw")) == NULL) {
3502 		report_count(1);
3503 		report_error("BAD FILE_ARGUMENT");
3504 		return;
3505 	}
3506 
3507 	report_count(1);
3508 	report_ptr(newterm(args[0], out, in));
3509 }
3510 
3511 
3512 void
3513 cmd_newwin(int nargs, char **args)
3514 {
3515 	int lines, cols, begin_y, begin_x;
3516 
3517 	if (check_arg_count(nargs, 4) == 1)
3518 		return;
3519 
3520 	if (sscanf(args[0], "%d", &lines) == 0) {
3521 		report_count(1);
3522 		report_error("BAD ARGUMENT");
3523 		return;
3524 	}
3525 
3526 	if (sscanf(args[1], "%d", &cols) == 0) {
3527 		report_count(1);
3528 		report_error("BAD ARGUMENT");
3529 		return;
3530 	}
3531 
3532 	if (sscanf(args[0], "%d", &begin_y) == 0) {
3533 		report_count(1);
3534 		report_error("BAD ARGUMENT");
3535 		return;
3536 	}
3537 
3538 	if (sscanf(args[1], "%d", &begin_x) == 0) {
3539 		report_count(1);
3540 		report_error("BAD ARGUMENT");
3541 		return;
3542 	}
3543 
3544 	report_count(1);
3545 	report_ptr(newwin(lines, cols, begin_y, begin_x));
3546 }
3547 
3548 
3549 void
3550 cmd_nl(int nargs, char **args)
3551 {
3552 	if (check_arg_count(nargs, 0) == 1)
3553 		return;
3554 
3555 	report_count(1);
3556 	report_return(nl());
3557 }
3558 
3559 
3560 void
3561 cmd_no_color_attributes(int nargs, char **args)
3562 {
3563 	if (check_arg_count(nargs, 0) == 1)
3564 		return;
3565 
3566 	report_count(1);
3567 	report_int(no_color_attributes());
3568 }
3569 
3570 
3571 void
3572 cmd_nocbreak(int nargs, char **args)
3573 {
3574 	if (check_arg_count(nargs, 0) == 1)
3575 		return;
3576 
3577 	report_count(1);
3578 	report_return(nocbreak());
3579 }
3580 
3581 
3582 void
3583 cmd_nodelay(int nargs, char **args)
3584 {
3585 	int flag;
3586 	WINDOW *win;
3587 
3588 	if (check_arg_count(nargs, 2) == 1)
3589 		return;
3590 
3591 	if (sscanf(args[0], "%td", &win) == 0) {
3592 		report_count(1);
3593 		report_error("BAD ARGUMENT");
3594 		return;
3595 	}
3596 
3597 	if (sscanf(args[1], "%d", &flag) == 0) {
3598 		report_count(1);
3599 		report_error("BAD ARGUMENT");
3600 		return;
3601 	}
3602 
3603 	report_count(1);
3604 	report_return(nodelay(win, flag));
3605 }
3606 
3607 
3608 void
3609 cmd_noecho(int nargs, char **args)
3610 {
3611 	if (check_arg_count(nargs, 0) == 1)
3612 		return;
3613 
3614 	report_count(1);
3615 	report_return(noecho());
3616 }
3617 
3618 
3619 void
3620 cmd_nonl(int nargs, char **args)
3621 {
3622 	if (check_arg_count(nargs, 0) == 1)
3623 		return;
3624 
3625 	report_count(1);
3626 	report_return(nonl());
3627 }
3628 
3629 
3630 void
3631 cmd_noqiflush(int nargs, char **args)
3632 {
3633 	if (check_arg_count(nargs, 0) == 1)
3634 		return;
3635 
3636 	noqiflush();
3637 	report_count(1);
3638 	report_return(OK); /* fake a return, the call returns void */
3639 }
3640 
3641 
3642 void
3643 cmd_noraw(int nargs, char **args)
3644 {
3645 	if (check_arg_count(nargs, 0) == 1)
3646 		return;
3647 
3648 	report_count(1);
3649 	report_return(noraw());
3650 }
3651 
3652 
3653 void
3654 cmd_notimeout(int nargs, char **args)
3655 {
3656 	int flag;
3657 	WINDOW *win;
3658 
3659 	if (check_arg_count(nargs, 2) == 1)
3660 		return;
3661 
3662 	if (sscanf(args[0], "%td", &win) == 0) {
3663 		report_count(1);
3664 		report_error("BAD ARGUMENT");
3665 		return;
3666 	}
3667 
3668 	if (sscanf(args[1], "%d", &flag) == 0) {
3669 		report_count(1);
3670 		report_error("BAD ARGUMENT");
3671 		return;
3672 	}
3673 
3674 	report_count(1);
3675 	report_return(notimeout(win, flag));
3676 }
3677 
3678 
3679 void
3680 cmd_overlay(int nargs, char **args)
3681 {
3682 	WINDOW *source, *dest;
3683 
3684 	if (check_arg_count(nargs, 2) == 1)
3685 		return;
3686 
3687 	if (sscanf(args[0], "%td", &source) == 0) {
3688 		report_count(1);
3689 		report_error("BAD ARGUMENT");
3690 		return;
3691 	}
3692 
3693 	if (sscanf(args[1], "%td", &dest) == 0) {
3694 		report_count(1);
3695 		report_error("BAD ARGUMENT");
3696 		return;
3697 	}
3698 
3699 	report_count(1);
3700 	report_return(overlay(source, dest));
3701 }
3702 
3703 
3704 void
3705 cmd_overwrite(int nargs, char **args)
3706 {
3707 	WINDOW *source, *dest;
3708 
3709 	if (check_arg_count(nargs, 2) == 1)
3710 		return;
3711 
3712 	if (sscanf(args[0], "%td", &source) == 0) {
3713 		report_count(1);
3714 		report_error("BAD ARGUMENT");
3715 		return;
3716 	}
3717 
3718 	if (sscanf(args[1], "%td", &dest) == 0) {
3719 		report_count(1);
3720 		report_error("BAD ARGUMENT");
3721 		return;
3722 	}
3723 
3724 	report_count(1);
3725 	report_return(overwrite(source, dest));
3726 }
3727 
3728 
3729 void
3730 cmd_pair_content(int nargs, char **args)
3731 {
3732 	short pair, fore, back;
3733 
3734 	if (check_arg_count(nargs, 1) == 1)
3735 		return;
3736 
3737 	if (sscanf(args[0], "%d", &pair) == 0) {
3738 		report_count(1);
3739 		report_error("BAD ARGUMENT");
3740 		return;
3741 	}
3742 
3743 	/* XXX - call3 */
3744 	report_count(3);
3745 	report_return(pair_content(pair, &fore, &back));
3746 	report_int(fore);
3747 	report_int(back);
3748 }
3749 
3750 
3751 void
3752 cmd_pechochar(int nargs, char **args)
3753 {
3754 	int ch;
3755 	WINDOW *pad;
3756 
3757 	if (check_arg_count(nargs, 2) == 1)
3758 		return;
3759 
3760 	if (sscanf(args[0], "%td", &pad) == 0) {
3761 		report_count(1);
3762 		report_error("BAD ARGUMENT");
3763 		return;
3764 	}
3765 
3766 	if (sscanf(args[1], "%d", &ch) == 0) {
3767 		report_count(1);
3768 		report_error("BAD ARGUMENT");
3769 		return;
3770 	}
3771 
3772 	report_count(1);
3773 	report_return(pechochar(pad, ch));
3774 }
3775 
3776 
3777 void
3778 cmd_pnoutrefresh(int nargs, char **args)
3779 {
3780 	int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
3781 	WINDOW *pad;
3782 
3783 	if (check_arg_count(nargs, 7) == 1)
3784 		return;
3785 
3786 	if (sscanf(args[0], "%td", &pad) == 0) {
3787 		report_count(1);
3788 		report_error("BAD ARGUMENT");
3789 		return;
3790 	}
3791 
3792 	if (sscanf(args[1], "%d", &pbeg_y) == 0) {
3793 		report_count(1);
3794 		report_error("BAD ARGUMENT");
3795 		return;
3796 	}
3797 
3798 	if (sscanf(args[2], "%d", &pbeg_x) == 0) {
3799 		report_count(1);
3800 		report_error("BAD ARGUMENT");
3801 		return;
3802 	}
3803 
3804 	if (sscanf(args[3], "%d", &sbeg_y) == 0) {
3805 		report_count(1);
3806 		report_error("BAD ARGUMENT");
3807 		return;
3808 	}
3809 
3810 	if (sscanf(args[4], "%d", &sbeg_x) == 0) {
3811 		report_count(1);
3812 		report_error("BAD ARGUMENT");
3813 		return;
3814 	}
3815 
3816 	if (sscanf(args[5], "%d", &smax_y) == 0) {
3817 		report_count(1);
3818 		report_error("BAD ARGUMENT");
3819 		return;
3820 	}
3821 
3822 	if (sscanf(args[6], "%d", &smax_x) == 0) {
3823 		report_count(1);
3824 		report_error("BAD ARGUMENT");
3825 		return;
3826 	}
3827 
3828 	report_count(1);
3829 	report_return(pnoutrefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
3830 				   smax_x));
3831 }
3832 
3833 
3834 void
3835 cmd_prefresh(int nargs, char **args)
3836 {
3837 	int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
3838 	WINDOW *pad;
3839 
3840 	if (check_arg_count(nargs, 7) == 1)
3841 		return;
3842 
3843 	if (sscanf(args[0], "%td", &pad) == 0) {
3844 		report_count(1);
3845 		report_error("BAD ARGUMENT");
3846 		return;
3847 	}
3848 
3849 	if (sscanf(args[1], "%d", &pbeg_y) == 0) {
3850 		report_count(1);
3851 		report_error("BAD ARGUMENT");
3852 		return;
3853 	}
3854 
3855 	if (sscanf(args[2], "%d", &pbeg_x) == 0) {
3856 		report_count(1);
3857 		report_error("BAD ARGUMENT");
3858 		return;
3859 	}
3860 
3861 	if (sscanf(args[3], "%d", &sbeg_y) == 0) {
3862 		report_count(1);
3863 		report_error("BAD ARGUMENT");
3864 		return;
3865 	}
3866 
3867 	if (sscanf(args[4], "%d", &sbeg_x) == 0) {
3868 		report_count(1);
3869 		report_error("BAD ARGUMENT");
3870 		return;
3871 	}
3872 
3873 	if (sscanf(args[5], "%d", &smax_y) == 0) {
3874 		report_count(1);
3875 		report_error("BAD ARGUMENT");
3876 		return;
3877 	}
3878 
3879 	if (sscanf(args[6], "%d", &smax_x) == 0) {
3880 		report_count(1);
3881 		report_error("BAD ARGUMENT");
3882 		return;
3883 	}
3884 
3885 	/* XXX causes refresh */
3886 	report_count(1);
3887 	report_return(prefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
3888 			       smax_x));
3889 
3890 }
3891 
3892 
3893 void
3894 cmd_printw(int nargs, char **args)
3895 {
3896 	if (check_arg_count(nargs, 2) == 1)
3897 		return;
3898 
3899 
3900 	report_count(1);
3901 	report_return(printw(args[0], args[1]));
3902 }
3903 
3904 
3905 void
3906 cmd_putwin(int nargs, char **args)
3907 {
3908 	FILE *fp;
3909 	WINDOW *win;
3910 
3911 	if (check_arg_count(nargs, 2) == 1)
3912 		return;
3913 
3914 	if (sscanf(args[0], "%td", &win) == 0) {
3915 		report_count(1);
3916 		report_error("BAD ARGUMENT");
3917 		return;
3918 	}
3919 
3920 	if ((fp = fopen(args[1], "rw")) == NULL) {
3921 		report_count(1);
3922 		report_error("BAD FILE_ARGUMENT");
3923 		return;
3924 	}
3925 
3926 	report_count(1);
3927 	report_return(putwin(win, fp));
3928 }
3929 
3930 
3931 void
3932 cmd_qiflush(int nargs, char **args)
3933 {
3934 	if (check_arg_count(nargs, 0) == 1)
3935 		return;
3936 
3937 	qiflush();
3938 	report_count(1);
3939 	report_return(OK); /* fake a return because call returns void */
3940 }
3941 
3942 
3943 void
3944 cmd_raw(int nargs, char **args)
3945 {
3946 	if (check_arg_count(nargs, 0) == 1)
3947 		return;
3948 
3949 	report_count(1);
3950 	report_return(raw());
3951 }
3952 
3953 
3954 void
3955 cmd_redrawwin(int nargs, char **args)
3956 {
3957 	WINDOW *win;
3958 
3959 	if (check_arg_count(nargs, 1) == 1)
3960 		return;
3961 
3962 	if (sscanf(args[0], "%td", &win) == 0) {
3963 		report_count(1);
3964 		report_error("BAD ARGUMENT");
3965 		return;
3966 	}
3967 
3968 	report_count(1);
3969 	report_return(redrawwin(win));
3970 }
3971 
3972 
3973 void
3974 cmd_reset_prog_mode(int nargs, char **args)
3975 {
3976 	if (check_arg_count(nargs, 0) == 1)
3977 		return;
3978 
3979 	report_count(1);
3980 	report_return(reset_prog_mode());
3981 }
3982 
3983 
3984 void
3985 cmd_reset_shell_mode(int nargs, char **args)
3986 {
3987 	if (check_arg_count(nargs, 0) == 1)
3988 		return;
3989 
3990 	report_count(1);
3991 	report_return(reset_shell_mode());
3992 }
3993 
3994 
3995 void
3996 cmd_resetty(int nargs, char **args)
3997 {
3998 	if (check_arg_count(nargs, 0) == 1)
3999 		return;
4000 
4001 	report_count(1);
4002 	report_return(resetty());
4003 }
4004 
4005 
4006 void
4007 cmd_resizeterm(int nargs, char **args)
4008 {
4009 	int rows, cols;
4010 
4011 	if (check_arg_count(nargs, 2) == 1)
4012 		return;
4013 
4014 	if (sscanf(args[0], "%d", &rows) == 0) {
4015 		report_count(1);
4016 		report_error("BAD ARGUMENT");
4017 		return;
4018 	}
4019 
4020 	if (sscanf(args[1], "%d", &cols) == 0) {
4021 		report_count(1);
4022 		report_error("BAD ARGUMENT");
4023 		return;
4024 	}
4025 
4026 	report_count(1);
4027 	report_return(resizeterm(rows, cols));
4028 }
4029 
4030 
4031 void
4032 cmd_savetty(int nargs, char **args)
4033 {
4034 	if (check_arg_count(nargs, 0) == 1)
4035 		return;
4036 
4037 	report_count(1);
4038 	report_return(savetty());
4039 }
4040 
4041 
4042 void
4043 cmd_scanw(int nargs, char **args)
4044 {
4045 	char string[256];
4046 
4047 	if (check_arg_count(nargs, 0) == 1)
4048 		return;
4049 
4050 	/* XXX call2 */
4051 	report_count(2);
4052 	report_return(scanw("%s", &string));
4053 	report_status(string);
4054 }
4055 
4056 
4057 void
4058 cmd_scroll(int nargs, char **args)
4059 {
4060 	WINDOW *win;
4061 
4062 	if (check_arg_count(nargs, 1) == 1)
4063 		return;
4064 
4065 	if (sscanf(args[0], "%td", &win) == 0) {
4066 		report_count(1);
4067 		report_error("BAD ARGUMENT");
4068 		return;
4069 	}
4070 
4071 	report_count(1);
4072 	report_return(scroll(win));
4073 }
4074 
4075 
4076 void
4077 cmd_scrollok(int nargs, char **args)
4078 {
4079 	WINDOW *win;
4080 	int flag;
4081 
4082 	if (check_arg_count(nargs, 2) == 1)
4083 		return;
4084 
4085 	if (sscanf(args[0], "%td", &win) == 0) {
4086 		report_count(1);
4087 		report_error("BAD ARGUMENT");
4088 		return;
4089 	}
4090 
4091 	if (sscanf(args[0], "%d", &flag) == 0) {
4092 		report_count(1);
4093 		report_error("BAD ARGUMENT");
4094 		return;
4095 	}
4096 
4097 	report_count(1);
4098 	report_return(scrollok(win, flag));
4099 }
4100 
4101 
4102 void
4103 cmd_setterm(int nargs, char **args)
4104 {
4105 	if (check_arg_count(nargs, 1) == 1)
4106 		return;
4107 
4108 	report_count(1);
4109 	report_return(setterm(args[0]));
4110 }
4111 
4112 
4113 void
4114 cmd_set_term(int nargs, char **args)
4115 {
4116 	SCREEN *scrn;
4117 
4118 	if (check_arg_count(nargs, 1) == 1)
4119 		return;
4120 
4121 	if (sscanf(args[0], "%td", &scrn) == 0) {
4122 		report_count(1);
4123 		report_error("BAD ARGUMENT");
4124 		return;
4125 	}
4126 
4127 	report_count(1);
4128 	report_ptr(set_term(scrn));
4129 }
4130 
4131 
4132 void
4133 cmd_start_color(int nargs, char **args)
4134 {
4135 	if (check_arg_count(nargs, 0) == 1)
4136 		return;
4137 
4138 	report_count(1);
4139 	report_return(start_color());
4140 }
4141 
4142 
4143 void
4144 cmd_subpad(int nargs, char **args)
4145 {
4146 	WINDOW *pad;
4147 	int lines, cols, begin_y, begin_x;
4148 
4149 	if (check_arg_count(nargs, 5) == 1)
4150 		return;
4151 
4152 	if (sscanf(args[0], "%td", &pad) == 0) {
4153 		report_count(1);
4154 		report_error("BAD ARGUMENT");
4155 		return;
4156 	}
4157 
4158 	if (sscanf(args[1], "%d", &lines) == 0) {
4159 		report_count(1);
4160 		report_error("BAD ARGUMENT");
4161 		return;
4162 	}
4163 
4164 	if (sscanf(args[2], "%d", &cols) == 0) {
4165 		report_count(1);
4166 		report_error("BAD ARGUMENT");
4167 		return;
4168 	}
4169 
4170 	if (sscanf(args[3], "%d", &begin_y) == 0) {
4171 		report_count(1);
4172 		report_error("BAD ARGUMENT");
4173 		return;
4174 	}
4175 
4176 	if (sscanf(args[4], "%d", &begin_x) == 0) {
4177 		report_count(1);
4178 		report_error("BAD ARGUMENT");
4179 		return;
4180 	}
4181 
4182 	report_count(1);
4183 	report_ptr(subpad(pad, lines, cols, begin_y, begin_x));
4184 }
4185 
4186 
4187 void
4188 cmd_subwin(int nargs, char **args)
4189 {
4190 	WINDOW *win;
4191 	int lines, cols, begin_y, begin_x;
4192 
4193 	if (check_arg_count(nargs, 5) == 1)
4194 		return;
4195 
4196 	if (sscanf(args[0], "%td", &win) == 0) {
4197 		report_count(1);
4198 		report_error("BAD ARGUMENT");
4199 		return;
4200 	}
4201 
4202 	if (sscanf(args[1], "%d", &lines) == 0) {
4203 		report_count(1);
4204 		report_error("BAD ARGUMENT");
4205 		return;
4206 	}
4207 
4208 	if (sscanf(args[2], "%d", &cols) == 0) {
4209 		report_count(1);
4210 		report_error("BAD ARGUMENT");
4211 		return;
4212 	}
4213 
4214 	if (sscanf(args[3], "%d", &begin_y) == 0) {
4215 		report_count(1);
4216 		report_error("BAD ARGUMENT");
4217 		return;
4218 	}
4219 
4220 	if (sscanf(args[4], "%d", &begin_x) == 0) {
4221 		report_count(1);
4222 		report_error("BAD ARGUMENT");
4223 		return;
4224 	}
4225 
4226 	report_count(1);
4227 	report_ptr(subwin(win, lines, cols, begin_y, begin_x));
4228 }
4229 
4230 
4231 void
4232 cmd_termattrs(int nargs, char **args)
4233 {
4234 	if (check_arg_count(nargs, 0) == 1)
4235 		return;
4236 
4237 	report_count(1);
4238 	report_int(termattrs());
4239 }
4240 
4241 
4242 void
4243 cmd_term_attrs(int nargs, char **args)
4244 {
4245 	if (check_arg_count(nargs, 0) == 1)
4246 		return;
4247 
4248 	report_count(1);
4249 	report_int(term_attrs());
4250 }
4251 
4252 
4253 void
4254 cmd_touchline(int nargs, char **args)
4255 {
4256 	WINDOW *win;
4257 	int start, count;
4258 
4259 	if (check_arg_count(nargs, 3) == 1)
4260 		return;
4261 
4262 	if (sscanf(args[0], "%td", &win) == 0) {
4263 		report_count(1);
4264 		report_error("BAD ARGUMENT");
4265 		return;
4266 	}
4267 
4268 	if (sscanf(args[1], "%d", &start) == 0) {
4269 		report_count(1);
4270 		report_error("BAD ARGUMENT");
4271 		return;
4272 	}
4273 
4274 	if (sscanf(args[2], "%d", &count) == 0) {
4275 		report_count(1);
4276 		report_error("BAD ARGUMENT");
4277 		return;
4278 	}
4279 
4280 	report_count(1);
4281 	report_return(touchline(win, start, count));
4282 }
4283 
4284 
4285 void
4286 cmd_touchoverlap(int nargs, char **args)
4287 {
4288 	WINDOW *win1, *win2;
4289 
4290 	if (check_arg_count(nargs, 2) == 1)
4291 		return;
4292 
4293 	if (sscanf(args[0], "%td", &win1) == 0) {
4294 		report_count(1);
4295 		report_error("BAD ARGUMENT");
4296 		return;
4297 	}
4298 
4299 	if (sscanf(args[1], "%td", &win2) == 0) {
4300 		report_count(1);
4301 		report_error("BAD ARGUMENT");
4302 		return;
4303 	}
4304 
4305 	report_count(1);
4306 	report_return(touchoverlap(win1, win2));
4307 }
4308 
4309 
4310 void
4311 cmd_touchwin(int nargs, char **args)
4312 {
4313 	WINDOW *win;
4314 
4315 	if (check_arg_count(nargs, 1) == 1)
4316 		return;
4317 
4318 	if (sscanf(args[0], "%td", &win) == 0) {
4319 		report_count(1);
4320 		report_error("BAD ARGUMENT");
4321 		return;
4322 	}
4323 
4324 	report_count(1);
4325 	report_return(touchwin(win));
4326 }
4327 
4328 
4329 void
4330 cmd_ungetch(int nargs, char **args)
4331 {
4332 	int ch;
4333 
4334 	if (check_arg_count(nargs, 1) == 1)
4335 		return;
4336 
4337 	if (sscanf(args[0], "%d", &ch) == 0) {
4338 		report_count(1);
4339 		report_error("BAD ARGUMENT");
4340 		return;
4341 	}
4342 
4343 	report_count(1);
4344 	report_return(ungetch(ch));
4345 }
4346 
4347 
4348 void
4349 cmd_untouchwin(int nargs, char **args)
4350 {
4351 	WINDOW *win;
4352 
4353 	if (check_arg_count(nargs, 1) == 1)
4354 		return;
4355 
4356 	if (sscanf(args[0], "%td", &win) == 0) {
4357 		report_count(1);
4358 		report_error("BAD ARGUMENT");
4359 		return;
4360 	}
4361 
4362 	report_count(1);
4363 	report_return(untouchwin(win));
4364 }
4365 
4366 
4367 void
4368 cmd_use_default_colors(int nargs, char **args)
4369 {
4370 	if (check_arg_count(nargs, 0) == 1)
4371 		return;
4372 
4373 	report_count(1);
4374 	report_return(use_default_colors());
4375 }
4376 
4377 
4378 void
4379 cmd_vline(int nargs, char **args)
4380 {
4381 	int ch, count;
4382 
4383 	if (check_arg_count(nargs, 2) == 1)
4384 		return;
4385 
4386 	if (sscanf(args[0], "%d", &ch) == 0) {
4387 		report_count(1);
4388 		report_error("BAD ARGUMENT");
4389 		return;
4390 	}
4391 
4392 	if (sscanf(args[1], "%d", &count) == 0) {
4393 		report_count(1);
4394 		report_error("BAD ARGUMENT");
4395 		return;
4396 	}
4397 
4398 	report_count(1);
4399 	report_return(vline(ch, count));
4400 }
4401 
4402 
4403 static int
4404 internal_vw_printw(WINDOW *win, char *arg1, ...)
4405 {
4406 	va_list va;
4407 	int rv;
4408 
4409 	va_start(va, arg1);
4410 	rv = vw_printw(win, arg1, va);
4411 	va_end(va);
4412 
4413 	return rv;
4414 }
4415 
4416 void
4417 cmd_vw_printw(int nargs, char **args)
4418 {
4419 	WINDOW *win;
4420 
4421 	if (check_arg_count(nargs, 3) == 1)
4422 		return;
4423 
4424 	if (sscanf(args[0], "%td", &win) == 0) {
4425 		report_count(1);
4426 		report_error("BAD ARGUMENT");
4427 		return;
4428 	}
4429 
4430 	report_count(1);
4431 	report_return(internal_vw_printw(win, args[1], args[2]));
4432 }
4433 
4434 
4435 static int
4436 internal_vw_scanw(WINDOW *win, char *arg1, ...)
4437 {
4438 	va_list va;
4439 	int rv;
4440 
4441 	va_start(va, arg1);
4442 	rv = vw_scanw(win, arg1, va);
4443 	va_end(va);
4444 
4445 	return rv;
4446 }
4447 
4448 void
4449 cmd_vw_scanw(int nargs, char **args)
4450 {
4451 	WINDOW *win;
4452 	char string[256];
4453 
4454 	if (check_arg_count(nargs, 2) == 1)
4455 		return;
4456 
4457 	if (sscanf(args[0], "%td", &win) == 0) {
4458 		report_count(1);
4459 		report_error("BAD ARGUMENT");
4460 		return;
4461 	}
4462 
4463 	/* XXX - call2 */
4464 	report_count(2);
4465 	report_int(internal_vw_scanw(win, args[1], string));
4466 	report_status(string);
4467 }
4468 
4469 
4470 void
4471 cmd_vwprintw(int nargs, char **args)
4472 {
4473 	cmd_vw_printw(nargs, args);
4474 }
4475 
4476 
4477 void
4478 cmd_vwscanw(int nargs, char **args)
4479 {
4480 	cmd_vw_scanw(nargs, args);
4481 }
4482 
4483 
4484 void
4485 cmd_waddch(int nargs, char **args)
4486 {
4487 	WINDOW *win;
4488 	int ch;
4489 
4490 	if (check_arg_count(nargs, 2) == 1)
4491 		return;
4492 
4493 	if (sscanf(args[0], "%td", &win) == 0) {
4494 		report_count(1);
4495 		report_error("BAD ARGUMENT");
4496 		return;
4497 	}
4498 
4499 	if (sscanf(args[1], "%d", &ch) == 0) {
4500 		report_count(1);
4501 		report_error("BAD ARGUMENT");
4502 		return;
4503 	}
4504 
4505 	report_count(1);
4506 	report_return(waddch(win, ch));
4507 }
4508 
4509 
4510 void
4511 cmd_waddchnstr(int nargs, char **args)
4512 {
4513 	WINDOW *win;
4514 	int count;
4515 
4516 	if (check_arg_count(nargs, 3) == 1)
4517 		return;
4518 
4519 	if (sscanf(args[0], "%td", &win) == 0) {
4520 		report_count(1);
4521 		report_error("BAD ARGUMENT");
4522 		return;
4523 	}
4524 
4525 	if (sscanf(args[2], "%d", &count) == 0) {
4526 		report_count(1);
4527 		report_error("BAD ARGUMENT");
4528 		return;
4529 	}
4530 
4531 	report_count(1);
4532 	report_return(waddchnstr(win, (chtype *) args[1], count));
4533 }
4534 
4535 
4536 void
4537 cmd_waddchstr(int nargs, char **args)
4538 {
4539 	WINDOW *win;
4540 
4541 	if (check_arg_count(nargs, 2) == 1)
4542 		return;
4543 
4544 	if (sscanf(args[0], "%td", &win) == 0) {
4545 		report_count(1);
4546 		report_error("BAD ARGUMENT");
4547 		return;
4548 	}
4549 
4550 	report_count(1);
4551 	report_return(waddchstr(win, (chtype *) args[1]));
4552 }
4553 
4554 
4555 void
4556 cmd_waddnstr(int nargs, char **args)
4557 {
4558 	WINDOW *win;
4559 	int count;
4560 
4561 	if (check_arg_count(nargs, 1) == 3)
4562 		return;
4563 
4564 	if (sscanf(args[0], "%td", &win) == 0) {
4565 		report_count(1);
4566 		report_error("BAD ARGUMENT");
4567 		return;
4568 	}
4569 
4570 	if (sscanf(args[2], "%d", &count) == 0) {
4571 		report_count(1);
4572 		report_error("BAD ARGUMENT");
4573 		return;
4574 	}
4575 
4576 	report_count(1);
4577 	report_return(waddnstr(win, args[1], count));
4578 
4579 }
4580 
4581 
4582 void
4583 cmd_wattr_get(int nargs, char **args)
4584 {
4585 	WINDOW *win;
4586 	int attr;
4587 	short pair;
4588 
4589 	if (check_arg_count(nargs, 1) == 1)
4590 		return;
4591 
4592 	if (sscanf(args[0], "%td", &win) == 0) {
4593 		report_count(1);
4594 		report_error("BAD ARGUMENT");
4595 		return;
4596 	}
4597 
4598 	/* XXX - call3 */
4599 	report_count(3);
4600 	report_return(wattr_get(win, &attr, &pair, NULL));
4601 	report_int(attr);
4602 	report_int(pair);
4603 }
4604 
4605 
4606 void
4607 cmd_wattr_off(int nargs, char **args)
4608 {
4609 	WINDOW *win;
4610 	int attr;
4611 
4612 	if (check_arg_count(nargs, 2) == 1)
4613 		return;
4614 
4615 	if (sscanf(args[0], "%td", &win) == 0) {
4616 		report_count(1);
4617 		report_error("BAD ARGUMENT");
4618 		return;
4619 	}
4620 
4621 	if (sscanf(args[1], "%d", &attr) == 0) {
4622 		report_count(1);
4623 		report_error("BAD ARGUMENT");
4624 		return;
4625 	}
4626 
4627 	report_count(1);
4628 	report_return(wattr_off(win, attr, NULL));
4629 }
4630 
4631 
4632 void
4633 cmd_wattr_on(int nargs, char **args)
4634 {
4635 	WINDOW *win;
4636 	int attr;
4637 
4638 	if (check_arg_count(nargs, 2) == 1)
4639 		return;
4640 
4641 	if (sscanf(args[0], "%td", &win) == 0) {
4642 		report_count(1);
4643 		report_error("BAD ARGUMENT");
4644 		return;
4645 	}
4646 
4647 	if (sscanf(args[1], "%d", &attr) == 0) {
4648 		report_count(1);
4649 		report_error("BAD ARGUMENT");
4650 		return;
4651 	}
4652 
4653 	report_count(1);
4654 	report_return(wattr_on(win, attr, NULL));
4655 }
4656 
4657 
4658 void
4659 cmd_wattr_set(int nargs, char **args)
4660 {
4661 	WINDOW *win;
4662 	int attr;
4663 	short pair;
4664 
4665 	if (check_arg_count(nargs, 3) == 1)
4666 		return;
4667 
4668 	if (sscanf(args[0], "%td", &win) == 0) {
4669 		report_count(1);
4670 		report_error("BAD ARGUMENT");
4671 		return;
4672 	}
4673 
4674 	if (sscanf(args[1], "%d", &attr) == 0) {
4675 		report_count(1);
4676 		report_error("BAD ARGUMENT");
4677 		return;
4678 	}
4679 
4680 	if (sscanf(args[2], "%hd", &pair) == 0) {
4681 		report_count(1);
4682 		report_error("BAD ARGUMENT");
4683 		return;
4684 	}
4685 
4686 	report_count(1);
4687 	report_return(wattr_set(win, attr, pair, NULL));
4688 }
4689 
4690 
4691 void
4692 cmd_wattroff(int nargs, char **args)
4693 {
4694 	WINDOW *win;
4695 	int attr;
4696 
4697 	if (check_arg_count(nargs, 2) == 1)
4698 		return;
4699 
4700 	if (sscanf(args[0], "%td", &win) == 0) {
4701 		report_count(1);
4702 		report_error("BAD ARGUMENT");
4703 		return;
4704 	}
4705 
4706 	if (sscanf(args[1], "%d", &attr) == 0) {
4707 		report_count(1);
4708 		report_error("BAD ARGUMENT");
4709 		return;
4710 	}
4711 
4712 	report_count(1);
4713 	report_return(wattroff(win, attr));
4714 }
4715 
4716 
4717 void
4718 cmd_wattron(int nargs, char **args)
4719 {
4720 	WINDOW *win;
4721 	int attr;
4722 
4723 	if (check_arg_count(nargs, 2) == 1)
4724 		return;
4725 
4726 	if (sscanf(args[0], "%td", &win) == 0) {
4727 		report_count(1);
4728 		report_error("BAD ARGUMENT");
4729 		return;
4730 	}
4731 
4732 	if (sscanf(args[1], "%d", &attr) == 0) {
4733 		report_count(1);
4734 		report_error("BAD ARGUMENT");
4735 		return;
4736 	}
4737 
4738 	report_count(1);
4739 	report_return(wattron(win, attr));
4740 }
4741 
4742 
4743 void
4744 cmd_wattrset(int nargs, char **args)
4745 {
4746 	WINDOW *win;
4747 	int attr;
4748 
4749 	if (check_arg_count(nargs, 2) == 1)
4750 		return;
4751 
4752 	if (sscanf(args[0], "%td", &win) == 0) {
4753 		report_count(1);
4754 		report_error("BAD ARGUMENT");
4755 		return;
4756 	}
4757 
4758 	if (sscanf(args[1], "%d", &attr) == 0) {
4759 		report_count(1);
4760 		report_error("BAD ARGUMENT");
4761 		return;
4762 	}
4763 
4764 	report_count(1);
4765 	report_return(wattrset(win, attr));
4766 }
4767 
4768 
4769 void
4770 cmd_wbkgd(int nargs, char **args)
4771 {
4772 	WINDOW *win;
4773 	chtype *ch;
4774 
4775 	if (check_arg_count(nargs, 2) == 1)
4776 		return;
4777 
4778 	if (sscanf(args[0], "%td", &win) == 0) {
4779 		report_count(1);
4780 		report_error("BAD ARGUMENT");
4781 		return;
4782 	}
4783 
4784 	ch = (chtype *) args[1];
4785 	report_count(1);
4786 	report_return(wbkgd(win, ch[0]));
4787 }
4788 
4789 
4790 void
4791 cmd_wbkgdset(int nargs, char **args)
4792 {
4793 	WINDOW *win;
4794 	int ch;
4795 
4796 	if (check_arg_count(nargs, 2) == 1)
4797 		return;
4798 
4799 	if (sscanf(args[0], "%td", &win) == 0) {
4800 		report_count(1);
4801 		report_error("BAD ARGUMENT");
4802 		return;
4803 	}
4804 
4805 	if (sscanf(args[1], "%d", &ch) == 0) {
4806 		report_count(1);
4807 		report_error("BAD ARGUMENT");
4808 		return;
4809 	}
4810 
4811 	wbkgdset(win, ch); /* void return */
4812 	report_count(1);
4813 	report_return(OK);
4814 }
4815 
4816 
4817 void
4818 cmd_wborder(int nargs, char **args)
4819 {
4820 	WINDOW *win;
4821 	int ls, rs, ts, bs, tl, tr, bl, br;
4822 
4823 	if (check_arg_count(nargs, 9) == 1)
4824 		return;
4825 
4826 	if (sscanf(args[0], "%td", &win) == 0) {
4827 		report_count(1);
4828 		report_error("BAD ARGUMENT");
4829 		return;
4830 	}
4831 
4832 	if (sscanf(args[1], "%d", &ls) == 0) {
4833 		report_count(1);
4834 		report_error("BAD ARGUMENT");
4835 		return;
4836 	}
4837 
4838 	if (sscanf(args[2], "%d", &rs) == 0) {
4839 		report_count(1);
4840 		report_error("BAD ARGUMENT");
4841 		return;
4842 	}
4843 
4844 	if (sscanf(args[3], "%d", &ts) == 0) {
4845 		report_count(1);
4846 		report_error("BAD ARGUMENT");
4847 		return;
4848 	}
4849 
4850 	if (sscanf(args[4], "%d", &bs) == 0) {
4851 		report_count(1);
4852 		report_error("BAD ARGUMENT");
4853 		return;
4854 	}
4855 
4856 	if (sscanf(args[5], "%d", &tl) == 0) {
4857 		report_count(1);
4858 		report_error("BAD ARGUMENT");
4859 		return;
4860 	}
4861 
4862 	if (sscanf(args[6], "%d", &tr) == 0) {
4863 		report_count(1);
4864 		report_error("BAD ARGUMENT");
4865 		return;
4866 	}
4867 
4868 	if (sscanf(args[7], "%d", &bl) == 0) {
4869 		report_count(1);
4870 		report_error("BAD ARGUMENT");
4871 		return;
4872 	}
4873 
4874 	if (sscanf(args[8], "%d", &br) == 0) {
4875 		report_count(1);
4876 		report_error("BAD ARGUMENT");
4877 		return;
4878 	}
4879 
4880 	report_count(1);
4881 	report_return(wborder(win, ls, rs, ts, bs, tl, tr, bl, br));
4882 }
4883 
4884 
4885 void
4886 cmd_wclear(int nargs, char **args)
4887 {
4888 	WINDOW *win;
4889 
4890 	if (check_arg_count(nargs, 1) == 1)
4891 		return;
4892 
4893 	if (sscanf(args[0], "%td", &win) == 0) {
4894 		report_count(1);
4895 		report_error("BAD ARGUMENT");
4896 		return;
4897 	}
4898 
4899 	report_count(1);
4900 	report_return(wclear(win));
4901 }
4902 
4903 
4904 void
4905 cmd_wclrtobot(int nargs, char **args)
4906 {
4907 	WINDOW *win;
4908 
4909 	if (check_arg_count(nargs, 1) == 1)
4910 		return;
4911 
4912 	if (sscanf(args[0], "%td", &win) == 0) {
4913 		report_count(1);
4914 		report_error("BAD ARGUMENT");
4915 		return;
4916 	}
4917 
4918 	report_count(1);
4919 	report_return(wclrtobot(win));
4920 }
4921 
4922 
4923 void
4924 cmd_wclrtoeol(int nargs, char **args)
4925 {
4926 	WINDOW *win;
4927 
4928 	if (check_arg_count(nargs, 1) == 1)
4929 		return;
4930 
4931 	if (sscanf(args[0], "%td", &win) == 0) {
4932 		report_count(1);
4933 		report_error("BAD ARGUMENT");
4934 		return;
4935 	}
4936 
4937 	report_count(1);
4938 	report_return(wclrtoeol(win));
4939 
4940 }
4941 
4942 
4943 void
4944 cmd_wcolor_set(int nargs, char **args)
4945 {
4946 	WINDOW *win;
4947 	short pair;
4948 
4949 	if (check_arg_count(nargs, 2) == 1)
4950 		return;
4951 
4952 	if (sscanf(args[0], "%td", &win) == 0) {
4953 		report_count(1);
4954 		report_error("BAD ARGUMENT");
4955 		return;
4956 	}
4957 
4958 	if (sscanf(args[1], "%hd", &pair) == 0) {
4959 		report_count(1);
4960 		report_error("BAD ARGUMENT");
4961 		return;
4962 	}
4963 
4964 	report_count(1);
4965 	report_return(wcolor_set(win, pair, NULL));
4966 }
4967 
4968 
4969 void
4970 cmd_wdelch(int nargs, char **args)
4971 {
4972 	WINDOW *win;
4973 
4974 	if (check_arg_count(nargs, 1) == 1)
4975 		return;
4976 
4977 	if (sscanf(args[0], "%td", &win) == 0) {
4978 		report_count(1);
4979 		report_error("BAD ARGUMENT");
4980 		return;
4981 	}
4982 
4983 	report_count(1);
4984 	report_return(wdelch(win));
4985 }
4986 
4987 
4988 void
4989 cmd_wdeleteln(int nargs, char **args)
4990 {
4991 	WINDOW *win;
4992 
4993 	if (check_arg_count(nargs, 1) == 1)
4994 		return;
4995 
4996 	if (sscanf(args[0], "%td", &win) == 0) {
4997 		report_count(1);
4998 		report_error("BAD ARGUMENT");
4999 		return;
5000 	}
5001 
5002 	report_count(1);
5003 	report_return(wdeleteln(win));
5004 
5005 }
5006 
5007 
5008 void
5009 cmd_wechochar(int nargs, char **args)
5010 {
5011 	WINDOW *win;
5012 	int ch;
5013 
5014 	if (check_arg_count(nargs, 2) == 1)
5015 		return;
5016 
5017 	if (sscanf(args[0], "%td", &win) == 0) {
5018 		report_count(1);
5019 		report_error("BAD ARGUMENT");
5020 		return;
5021 	}
5022 
5023 	if (sscanf(args[1], "%d", &ch) == 0) {
5024 		report_count(1);
5025 		report_error("BAD ARGUMENT");
5026 		return;
5027 	}
5028 
5029 	report_count(1);
5030 	report_return(wechochar(win, ch));
5031 }
5032 
5033 
5034 void
5035 cmd_werase(int nargs, char **args)
5036 {
5037 	WINDOW *win;
5038 
5039 	if (check_arg_count(nargs, 1) == 1)
5040 		return;
5041 
5042 	if (sscanf(args[0], "%td", &win) == 0) {
5043 		report_count(1);
5044 		report_error("BAD ARGUMENT");
5045 		return;
5046 	}
5047 
5048 	report_count(1);
5049 	report_return(werase(win));
5050 }
5051 
5052 
5053 void
5054 cmd_wgetch(int nargs, char **args)
5055 {
5056 	WINDOW *win;
5057 
5058 	if (check_arg_count(nargs, 1) == 1)
5059 		return;
5060 
5061 	if (sscanf(args[0], "%td", &win) == 0) {
5062 		report_count(1);
5063 		report_error("BAD ARGUMENT");
5064 		return;
5065 	}
5066 
5067 	report_count(1);
5068 	report_int(wgetch(win));
5069 }
5070 
5071 
5072 void
5073 cmd_wgetnstr(int nargs, char **args)
5074 {
5075 	WINDOW *win;
5076 	int count;
5077 	char string[256];
5078 
5079 	if (check_arg_count(nargs, 2) == 1)
5080 		return;
5081 
5082 	if (sscanf(args[0], "%td", &win) == 0) {
5083 		report_count(1);
5084 		report_error("BAD ARGUMENT");
5085 		return;
5086 	}
5087 
5088 	if (sscanf(args[1], "%d", &count) == 0) {
5089 		report_count(1);
5090 		report_error("BAD ARGUMENT");
5091 		return;
5092 	}
5093 
5094 	/* XXX - call2 */
5095 	report_count(2);
5096 	report_return(wgetnstr(win, string, count));
5097 	report_status(string);
5098 }
5099 
5100 
5101 void
5102 cmd_wgetstr(int nargs, char **args)
5103 {
5104 	WINDOW *win;
5105 	char string[256];
5106 	int err, i;
5107 	struct termios attrs;
5108 
5109 
5110 	if (check_arg_count(nargs, 1) == 1)
5111 		return;
5112 
5113 	if (sscanf(args[0], "%td", &win) == 0) {
5114 		report_count(1);
5115 		report_error("BAD ARGUMENT");
5116 		return;
5117 	}
5118 
5119 	string[0] = '\0';
5120 
5121 	report_count(2);
5122 	report_return(wgetstr(win, string));
5123 	report_status(string);
5124 }
5125 
5126 
5127 void
5128 cmd_whline(int nargs, char **args)
5129 {
5130 	WINDOW *win;
5131 	int ch, count;
5132 
5133 	if (check_arg_count(nargs, 3) == 1)
5134 		return;
5135 
5136 	if (sscanf(args[0], "%td", &win) == 0) {
5137 		report_count(1);
5138 		report_error("BAD ARGUMENT");
5139 		return;
5140 	}
5141 
5142 	if (sscanf(args[1], "%d", &ch) == 0) {
5143 		report_count(1);
5144 		report_error("BAD ARGUMENT");
5145 		return;
5146 	}
5147 
5148 	if (sscanf(args[2], "%d", &count) == 0) {
5149 		report_count(1);
5150 		report_error("BAD ARGUMENT");
5151 		return;
5152 	}
5153 
5154 	report_count(1);
5155 	report_return(whline(win, ch, count));
5156 }
5157 
5158 
5159 void
5160 cmd_winch(int nargs, char **args)
5161 {
5162 	WINDOW *win;
5163 
5164 	if (check_arg_count(nargs, 1) == 1)
5165 		return;
5166 
5167 	if (sscanf(args[0], "%td", &win) == 0) {
5168 		report_count(1);
5169 		report_error("BAD ARGUMENT");
5170 		return;
5171 	}
5172 
5173 	report_count(1);
5174 	report_int(winch(win));
5175 }
5176 
5177 
5178 void
5179 cmd_winchnstr(int nargs, char **args)
5180 {
5181 	WINDOW *win;
5182 	chtype string[256];
5183 	int count;
5184 
5185 	if (check_arg_count(nargs, 2) == 1)
5186 		return;
5187 
5188 	if (sscanf(args[0], "%td", &win) == 0) {
5189 		report_count(1);
5190 		report_error("BAD ARGUMENT");
5191 		return;
5192 	}
5193 
5194 	if (sscanf(args[1], "%d", &count) == 0) {
5195 		report_count(1);
5196 		report_error("BAD ARGUMENT");
5197 		return;
5198 	}
5199 
5200 	/* XXX - call2 */
5201 	report_count(2);
5202 	report_return(winchnstr(win, string, count));
5203 	report_nstr(string);
5204 }
5205 
5206 
5207 void
5208 cmd_winchstr(int nargs, char **args)
5209 {
5210 	WINDOW *win;
5211 	chtype string[256];
5212 
5213 	if (check_arg_count(nargs, 1) == 1)
5214 		return;
5215 
5216 	if (sscanf(args[0], "%td", &win) == 0) {
5217 		report_count(1);
5218 		report_error("BAD ARGUMENT");
5219 		return;
5220 	}
5221 
5222 	/* XXX - call2 */
5223 	report_count(2);
5224 	report_return(winchstr(win, string));
5225 	report_nstr(string);
5226 }
5227 
5228 
5229 void
5230 cmd_winnstr(int nargs, char **args)
5231 {
5232 	WINDOW *win;
5233 	char string[256];
5234 	int count;
5235 
5236 	if (check_arg_count(nargs, 2) == 1)
5237 		return;
5238 
5239 	if (sscanf(args[0], "%td", &win) == 0) {
5240 		report_count(1);
5241 		report_error("BAD ARGUMENT");
5242 		return;
5243 	}
5244 
5245 	if (sscanf(args[1], "%d", &count) == 0) {
5246 		report_count(1);
5247 		report_error("BAD ARGUMENT");
5248 		return;
5249 	}
5250 
5251 	/* XXX - call2 */
5252 	report_count(2);
5253 	report_return(winnstr(win, string, count));
5254 	report_status(string);
5255 }
5256 
5257 
5258 void
5259 cmd_winsch(int nargs, char **args)
5260 {
5261 	WINDOW *win;
5262 	int ch;
5263 
5264 	if (check_arg_count(nargs, 2) == 1)
5265 		return;
5266 
5267 	if (sscanf(args[0], "%td", &win) == 0) {
5268 		report_count(1);
5269 		report_error("BAD ARGUMENT");
5270 		return;
5271 	}
5272 
5273 	if (sscanf(args[1], "%d", &ch) == 0) {
5274 		report_count(1);
5275 		report_error("BAD ARGUMENT");
5276 		return;
5277 	}
5278 
5279 	report_count(1);
5280 	report_return(winsch(win, ch));
5281 }
5282 
5283 
5284 void
5285 cmd_winsdelln(int nargs, char **args)
5286 {
5287 	WINDOW *win;
5288 	int count;
5289 
5290 	if (check_arg_count(nargs, 2) == 1)
5291 		return;
5292 
5293 	if (sscanf(args[0], "%td", &win) == 0) {
5294 		report_count(1);
5295 		report_error("BAD ARGUMENT");
5296 		return;
5297 	}
5298 
5299 	if (sscanf(args[1], "%d", &count) == 0) {
5300 		report_count(1);
5301 		report_error("BAD ARGUMENT");
5302 		return;
5303 	}
5304 
5305 	report_count(1);
5306 	report_return(winsdelln(win, count));
5307 }
5308 
5309 
5310 void
5311 cmd_winsertln(int nargs, char **args)
5312 {
5313 	WINDOW *win;
5314 
5315 	if (check_arg_count(nargs, 1) == 1)
5316 		return;
5317 
5318 	if (sscanf(args[0], "%td", &win) == 0) {
5319 		report_count(1);
5320 		report_error("BAD ARGUMENT");
5321 		return;
5322 	}
5323 
5324 	report_count(1);
5325 	report_return(winsertln(win));
5326 }
5327 
5328 
5329 void
5330 cmd_winstr(int nargs, char **args)
5331 {
5332 	WINDOW *win;
5333 	char string[256];
5334 
5335 	if (check_arg_count(nargs, 1) == 1)
5336 		return;
5337 
5338 	if (sscanf(args[0], "%td", &win) == 0) {
5339 		report_count(1);
5340 		report_error("BAD ARGUMENT");
5341 		return;
5342 	}
5343 
5344 	/* XXX - call2 */
5345 	report_count(2);
5346 	report_return(winstr(win, string));
5347 	report_status(string);
5348 }
5349 
5350 
5351 void
5352 cmd_wmove(int nargs, char **args)
5353 {
5354 	WINDOW *win;
5355 	int y, x;
5356 
5357 	if (check_arg_count(nargs, 3) == 1)
5358 		return;
5359 
5360 	if (sscanf(args[0], "%td", &win) == 0) {
5361 		report_count(1);
5362 		report_error("BAD ARGUMENT");
5363 		return;
5364 	}
5365 
5366 	if (sscanf(args[1], "%d", &y) == 0) {
5367 		report_count(1);
5368 		report_error("BAD ARGUMENT");
5369 		return;
5370 	}
5371 
5372 	if (sscanf(args[2], "%d", &x) == 0) {
5373 		report_count(1);
5374 		report_error("BAD ARGUMENT");
5375 		return;
5376 	}
5377 
5378 	report_count(1);
5379 	report_return(wmove(win, y, x));
5380 }
5381 
5382 
5383 void
5384 cmd_wnoutrefresh(int nargs, char **args)
5385 {
5386 	WINDOW *win;
5387 
5388 	if (check_arg_count(nargs, 1) == 1)
5389 		return;
5390 
5391 	if (sscanf(args[0], "%td", &win) == 0) {
5392 		report_count(1);
5393 		report_error("BAD ARGUMENT");
5394 		return;
5395 	}
5396 
5397 	report_count(1);
5398 	report_return(wnoutrefresh(win));
5399 }
5400 
5401 
5402 void
5403 cmd_wprintw(int nargs, char **args)
5404 {
5405 	WINDOW *win;
5406 
5407 	if (check_arg_count(nargs, 3) == 1)
5408 		return;
5409 
5410 	if (sscanf(args[0], "%td", &win) == 0) {
5411 		report_count(1);
5412 		report_error("BAD ARGUMENT");
5413 		return;
5414 	}
5415 
5416 	report_count(1);
5417 	report_return(wprintw(win, args[1], args[2]));
5418 }
5419 
5420 
5421 void
5422 cmd_wredrawln(int nargs, char **args)
5423 {
5424 	WINDOW *win;
5425 	int beg_line, num_lines;
5426 
5427 	if (check_arg_count(nargs, 3) == 1)
5428 		return;
5429 
5430 	if (sscanf(args[0], "%td", &win) == 0) {
5431 		report_count(1);
5432 		report_error("BAD ARGUMENT");
5433 		return;
5434 	}
5435 
5436 	if (sscanf(args[1], "%d", &beg_line) == 0) {
5437 		report_count(1);
5438 		report_error("BAD ARGUMENT");
5439 		return;
5440 	}
5441 
5442 	if (sscanf(args[2], "%d", &num_lines) == 0) {
5443 		report_count(1);
5444 		report_error("BAD ARGUMENT");
5445 		return;
5446 	}
5447 
5448 	report_count(1);
5449 	report_return(wredrawln(win, beg_line, num_lines));
5450 }
5451 
5452 
5453 void
5454 cmd_wrefresh(int nargs, char **args)
5455 {
5456 	WINDOW *win;
5457 
5458 	if (check_arg_count(nargs, 1) == 1)
5459 		return;
5460 
5461 	if (sscanf(args[0], "%td", &win) == 0) {
5462 		report_count(1);
5463 		report_error("BAD ARGUMENT");
5464 		return;
5465 	}
5466 
5467 	/* XXX - generates output */
5468 	report_count(1);
5469 	report_return(wrefresh(win));
5470 }
5471 
5472 
5473 void
5474 cmd_wresize(int nargs, char **args)
5475 {
5476 	WINDOW *win;
5477 	int lines, cols;
5478 
5479 	if (check_arg_count(nargs, 3) == 1)
5480 		return;
5481 
5482 	if (sscanf(args[0], "%td", &win) == 0) {
5483 		report_count(1);
5484 		report_error("BAD ARGUMENT");
5485 		return;
5486 	}
5487 
5488 	if (sscanf(args[1], "%d", &lines) == 0) {
5489 		report_count(1);
5490 		report_error("BAD ARGUMENT");
5491 		return;
5492 	}
5493 
5494 	if (sscanf(args[2], "%d", &cols) == 0) {
5495 		report_count(1);
5496 		report_error("BAD ARGUMENT");
5497 		return;
5498 	}
5499 
5500 	report_count(1);
5501 	report_return(wresize(win, lines, cols));
5502 }
5503 
5504 
5505 void
5506 cmd_wscanw(int nargs, char **args)
5507 {
5508 	WINDOW *win;
5509 	char string[256];
5510 
5511 	if (check_arg_count(nargs, 2) == 1)
5512 		return;
5513 
5514 	if (sscanf(args[0], "%td", &win) == 0) {
5515 		report_count(1);
5516 		report_error("BAD ARGUMENT");
5517 		return;
5518 	}
5519 
5520 	report_count(1);
5521 	report_return(wscanw(win, args[1], &string));
5522 }
5523 
5524 
5525 void
5526 cmd_wscrl(int nargs, char **args)
5527 {
5528 	WINDOW *win;
5529 	int n;
5530 
5531 	if (check_arg_count(nargs, 2) == 1)
5532 		return;
5533 
5534 	if (sscanf(args[0], "%td", &win) == 0) {
5535 		report_count(1);
5536 		report_error("BAD ARGUMENT");
5537 		return;
5538 	}
5539 
5540 	if (sscanf(args[1], "%d", &n) == 0) {
5541 		report_count(1);
5542 		report_error("BAD ARGUMENT");
5543 		return;
5544 	}
5545 
5546 	report_count(1);
5547 	report_return(wscrl(win, n));
5548 }
5549 
5550 
5551 void
5552 cmd_wsetscrreg(int nargs, char **args)
5553 {
5554 	WINDOW *win;
5555 	int top, bottom;
5556 
5557 	if (check_arg_count(nargs, 3) == 1)
5558 		return;
5559 
5560 	if (sscanf(args[0], "%td", &win) == 0) {
5561 		report_count(1);
5562 		report_error("BAD ARGUMENT");
5563 		return;
5564 	}
5565 
5566 	if (sscanf(args[1], "%d", &top) == 0) {
5567 		report_count(1);
5568 		report_error("BAD ARGUMENT");
5569 		return;
5570 	}
5571 
5572 	if (sscanf(args[2], "%d", &bottom) == 0) {
5573 		report_count(1);
5574 		report_error("BAD ARGUMENT");
5575 		return;
5576 	}
5577 
5578 	report_count(1);
5579 	report_return(wsetscrreg(win, top, bottom));
5580 }
5581 
5582 
5583 void
5584 cmd_wstandend(int nargs, char **args)
5585 {
5586 	WINDOW *win;
5587 
5588 	if (check_arg_count(nargs, 1) == 1)
5589 		return;
5590 
5591 	if (sscanf(args[0], "%td", &win) == 0) {
5592 		report_count(1);
5593 		report_error("BAD ARGUMENT");
5594 		return;
5595 	}
5596 
5597 	report_count(1);
5598 	report_return(wstandend(win));
5599 }
5600 
5601 
5602 void
5603 cmd_wstandout(int nargs, char **args)
5604 {
5605 	WINDOW *win;
5606 
5607 	if (check_arg_count(nargs, 1) == 1)
5608 		return;
5609 
5610 	if (sscanf(args[0], "%td", &win) == 0) {
5611 		report_count(1);
5612 		report_error("BAD ARGUMENT");
5613 		return;
5614 	}
5615 
5616 	report_count(1);
5617 	report_return(wstandout(win));
5618 }
5619 
5620 
5621 void
5622 cmd_wtimeout(int nargs, char **args)
5623 {
5624 	WINDOW *win;
5625 	int delay;
5626 
5627 	if (check_arg_count(nargs, 2) == 1)
5628 		return;
5629 
5630 	if (sscanf(args[0], "%td", &win) == 0) {
5631 		report_count(1);
5632 		report_error("BAD ARGUMENT");
5633 		return;
5634 	}
5635 
5636 	if (sscanf(args[1], "%d", &delay) == 0) {
5637 		report_count(1);
5638 		report_error("BAD ARGUMENT");
5639 		return;
5640 	}
5641 
5642 	wtimeout(win, delay); /* void return */
5643 	report_count(1);
5644 	report_return(OK);
5645 }
5646 
5647 
5648 void
5649 cmd_wtouchln(int nargs, char **args)
5650 {
5651 	WINDOW *win;
5652 	int line, n, changed;
5653 
5654 	if (check_arg_count(nargs, 4) == 1)
5655 		return;
5656 
5657 	if (sscanf(args[0], "%td", &win) == 0) {
5658 		report_count(1);
5659 		report_error("BAD ARGUMENT");
5660 		return;
5661 	}
5662 
5663 	if (sscanf(args[1], "%d", &line) == 0) {
5664 		report_count(1);
5665 		report_error("BAD ARGUMENT");
5666 		return;
5667 	}
5668 
5669 	if (sscanf(args[2], "%d", &n) == 0) {
5670 		report_count(1);
5671 		report_error("BAD ARGUMENT");
5672 		return;
5673 	}
5674 
5675 	if (sscanf(args[3], "%d", &changed) == 0) {
5676 		report_count(1);
5677 		report_error("BAD ARGUMENT");
5678 		return;
5679 	}
5680 
5681 	report_count(1);
5682 	report_return(wtouchln(win, line, n, changed));
5683 }
5684 
5685 
5686 void
5687 cmd_wunderend(int nargs, char **args)
5688 {
5689 	WINDOW *win;
5690 
5691 	if (check_arg_count(nargs, 1) == 1)
5692 		return;
5693 
5694 	if (sscanf(args[0], "%td", &win) == 0) {
5695 		report_count(1);
5696 		report_error("BAD ARGUMENT");
5697 		return;
5698 	}
5699 
5700 	report_count(1);
5701 	report_return(wunderend(win));
5702 }
5703 
5704 
5705 void
5706 cmd_wunderscore(int nargs, char **args)
5707 {
5708 	WINDOW *win;
5709 
5710 	if (check_arg_count(nargs, 1) == 1)
5711 		return;
5712 
5713 	if (sscanf(args[0], "%td", &win) == 0) {
5714 		report_count(1);
5715 		report_error("BAD ARGUMENT");
5716 		return;
5717 	}
5718 
5719 	report_count(1);
5720 	report_return(wunderscore(win));
5721 }
5722 
5723 
5724 void
5725 cmd_wvline(int nargs, char **args)
5726 {
5727 	WINDOW *win;
5728 	int ch, n;
5729 
5730 	if (check_arg_count(nargs, 3) == 1)
5731 		return;
5732 
5733 	if (sscanf(args[0], "%td", &win) == 0) {
5734 		report_count(1);
5735 		report_error("BAD ARGUMENT");
5736 		return;
5737 	}
5738 
5739 	if (sscanf(args[1], "%d", &ch) == 0) {
5740 		report_count(1);
5741 		report_error("BAD ARGUMENT");
5742 		return;
5743 	}
5744 
5745 	if (sscanf(args[2], "%d", &n) == 0) {
5746 		report_count(1);
5747 		report_error("BAD ARGUMENT");
5748 		return;
5749 	}
5750 
5751 	report_count(1);
5752 	report_return(wvline(win, ch, n));
5753 }
5754 
5755 
5756 void
5757 cmd_insnstr(int nargs, char **args)
5758 {
5759 	int n;
5760 
5761 	if (check_arg_count(nargs, 2) == 1)
5762 		return;
5763 
5764 	if (sscanf(args[1], "%d", &n) == 0) {
5765 		report_count(1);
5766 		report_error("BAD ARGUMENT");
5767 		return;
5768 	}
5769 
5770 	report_count(1);
5771 	report_return(insnstr(args[0], n));
5772 }
5773 
5774 
5775 void
5776 cmd_insstr(int nargs, char **args)
5777 {
5778 	if (check_arg_count(nargs, 1) == 1)
5779 		return;
5780 
5781 	report_count(1);
5782 	report_return(insstr(args[0]));
5783 }
5784 
5785 
5786 void
5787 cmd_mvinsnstr(int nargs, char **args)
5788 {
5789 	int y, x, n;
5790 
5791 	if (check_arg_count(nargs, 4) == 1)
5792 		return;
5793 
5794 	if (sscanf(args[0], "%d", &y) == 0) {
5795 		report_count(1);
5796 		report_error("BAD ARGUMENT");
5797 		return;
5798 	}
5799 
5800 	if (sscanf(args[1], "%d", &x) == 0) {
5801 		report_count(1);
5802 		report_error("BAD ARGUMENT");
5803 		return;
5804 	}
5805 
5806 	if (sscanf(args[3], "%d", &n) == 0) {
5807 		report_count(1);
5808 		report_error("BAD ARGUMENT");
5809 		return;
5810 	}
5811 
5812 	report_count(1);
5813 	report_return(mvinsnstr(y, x, args[2], n));
5814 }
5815 
5816 
5817 void
5818 cmd_mvinsstr(int nargs, char **args)
5819 {
5820 	int y, x;
5821 
5822 	if (check_arg_count(nargs, 3) == 1)
5823 		return;
5824 
5825 	if (sscanf(args[0], "%d", &y) == 0) {
5826 		report_count(1);
5827 		report_error("BAD ARGUMENT");
5828 		return;
5829 	}
5830 
5831 	if (sscanf(args[1], "%d", &x) == 0) {
5832 		report_count(1);
5833 		report_error("BAD ARGUMENT");
5834 		return;
5835 	}
5836 
5837 	report_count(1);
5838 	report_return(mvinsstr(y, x, args[2]));
5839 }
5840 
5841 
5842 void
5843 cmd_mvwinsnstr(int nargs, char **args)
5844 {
5845 	WINDOW *win;
5846 	int y, x, n;
5847 
5848 	if (check_arg_count(nargs, 5) == 1)
5849 		return;
5850 
5851 	if (sscanf(args[0], "%td", &win) == 0) {
5852 		report_count(1);
5853 		report_error("BAD ARGUMENT");
5854 		return;
5855 	}
5856 
5857 	if (sscanf(args[1], "%d", &y) == 0) {
5858 		report_count(1);
5859 		report_error("BAD ARGUMENT");
5860 		return;
5861 	}
5862 
5863 	if (sscanf(args[2], "%d", &x) == 0) {
5864 		report_count(1);
5865 		report_error("BAD ARGUMENT");
5866 		return;
5867 	}
5868 
5869 	if (sscanf(args[4], "%d", &n) == 0) {
5870 		report_count(1);
5871 		report_error("BAD ARGUMENT");
5872 		return;
5873 	}
5874 
5875 	report_count(1);
5876 	report_return(mvwinsnstr(win, y, x, args[3], n));
5877 
5878 }
5879 
5880 
5881 void
5882 cmd_mvwinsstr(int nargs, char **args)
5883 {
5884 	WINDOW *win;
5885 	int y, x, n;
5886 
5887 	if (check_arg_count(nargs, 4) == 1)
5888 		return;
5889 
5890 	if (sscanf(args[0], "%td", &win) == 0) {
5891 		report_count(1);
5892 		report_error("BAD ARGUMENT");
5893 		return;
5894 	}
5895 
5896 	if (sscanf(args[1], "%d", &y) == 0) {
5897 		report_count(1);
5898 		report_error("BAD ARGUMENT");
5899 		return;
5900 	}
5901 
5902 	if (sscanf(args[2], "%d", &x) == 0) {
5903 		report_count(1);
5904 		report_error("BAD ARGUMENT");
5905 		return;
5906 	}
5907 
5908 	report_count(1);
5909 	report_return(mvwinsstr(win, y, x, args[3]));
5910 }
5911 
5912 
5913 void
5914 cmd_winsnstr(int nargs, char **args)
5915 {
5916 	WINDOW *win;
5917 	int n;
5918 
5919 	if (check_arg_count(nargs, 3) == 1)
5920 		return;
5921 
5922 	if (sscanf(args[0], "%td", &win) == 0) {
5923 		report_count(1);
5924 		report_error("BAD ARGUMENT");
5925 		return;
5926 	}
5927 
5928 	if (sscanf(args[2], "%d", &n) == 0) {
5929 		report_count(1);
5930 		report_error("BAD ARGUMENT");
5931 		return;
5932 	}
5933 
5934 	report_count(1);
5935 	report_return(winsnstr(win, args[1], n));
5936 }
5937 
5938 
5939 void
5940 cmd_winsstr(int nargs, char **args)
5941 {
5942 	WINDOW *win;
5943 
5944 	if (check_arg_count(nargs, 2) == 1)
5945 		return;
5946 
5947 	if (sscanf(args[0], "%td", &win) == 0) {
5948 		report_count(1);
5949 		report_error("BAD ARGUMENT");
5950 		return;
5951 	}
5952 
5953 	report_count(1);
5954 	report_return(winsstr(win, args[1]));
5955 }
5956 
5957 
5958 
5959 void
5960 cmd_chgat(int nargs, char **args)
5961 {
5962 	int n, attr, colour;
5963 
5964 	if (check_arg_count(nargs, 4) == 1)
5965 		return;
5966 
5967 	if (sscanf(args[0], "%d", &n) == 0) {
5968 		report_count(1);
5969 		report_error("BAD ARGUMENT");
5970 		return;
5971 	}
5972 
5973 	if (sscanf(args[1], "%d", &attr) == 0) {
5974 		report_count(1);
5975 		report_error("BAD ARGUMENT");
5976 		return;
5977 	}
5978 
5979 	if (sscanf(args[2], "%d", &colour) == 0) {
5980 		report_count(1);
5981 		report_error("BAD ARGUMENT");
5982 		return;
5983 	}
5984 
5985 	/* Note: 4th argument unused in current curses implementation */
5986 	report_count(1);
5987 	report_return(chgat(n, attr, colour, NULL));
5988 }
5989 
5990 
5991 void
5992 cmd_wchgat(int nargs, char **args)
5993 {
5994 	WINDOW *win;
5995 	int n, attr, colour;
5996 
5997 	if (check_arg_count(nargs, 4) == 1)
5998 		return;
5999 
6000 	if (sscanf(args[0], "%td", &win) == 0) {
6001 		report_count(1);
6002 		report_error("BAD ARGUMENT");
6003 		return;
6004 	}
6005 
6006 	if (sscanf(args[1], "%d", &n) == 0) {
6007 		report_count(1);
6008 		report_error("BAD ARGUMENT");
6009 		return;
6010 	}
6011 
6012 	if (sscanf(args[2], "%d", &attr) == 0) {
6013 		report_count(1);
6014 		report_error("BAD ARGUMENT");
6015 		return;
6016 	}
6017 
6018 	if (sscanf(args[3], "%d", &colour) == 0) {
6019 		report_count(1);
6020 		report_error("BAD ARGUMENT");
6021 		return;
6022 	}
6023 
6024 	report_count(1);
6025 	report_return(wchgat(win, n, attr, colour, NULL));
6026 }
6027 
6028 
6029 void
6030 cmd_mvchgat(int nargs, char **args)
6031 {
6032 	if (check_arg_count(nargs, 5) == 1)
6033 		return;
6034 
6035 	int y, x, n, attr, colour;
6036 
6037 	if (check_arg_count(nargs, 3) == 1)
6038 		return;
6039 
6040 	if (sscanf(args[0], "%d", &y) == 0) {
6041 		report_count(1);
6042 		report_error("BAD ARGUMENT");
6043 		return;
6044 	}
6045 
6046 	if (sscanf(args[1], "%d", &x) == 0) {
6047 		report_count(1);
6048 		report_error("BAD ARGUMENT");
6049 		return;
6050 	}
6051 
6052 	if (sscanf(args[2], "%d", &n) == 0) {
6053 		report_count(1);
6054 		report_error("BAD ARGUMENT");
6055 		return;
6056 	}
6057 
6058 	if (sscanf(args[3], "%d", &attr) == 0) {
6059 		report_count(1);
6060 		report_error("BAD ARGUMENT");
6061 		return;
6062 	}
6063 
6064 	if (sscanf(args[4], "%d", &colour) == 0) {
6065 		report_count(1);
6066 		report_error("BAD ARGUMENT");
6067 		return;
6068 	}
6069 
6070 	report_count(1);
6071 	report_return(mvchgat(y, x, n, attr, colour, NULL));
6072 }
6073 
6074 
6075 void
6076 cmd_mvwchgat(int nargs, char **args)
6077 {
6078 	WINDOW *win;
6079 	int y, x, n, attr, colour;
6080 
6081 	if (check_arg_count(nargs, 6) == 1)
6082 		return;
6083 
6084 	if (sscanf(args[0], "%td", &win) == 0) {
6085 		report_count(1);
6086 		report_error("BAD ARGUMENT");
6087 		return;
6088 	}
6089 
6090 	if (sscanf(args[1], "%d", &y) == 0) {
6091 		report_count(1);
6092 		report_error("BAD ARGUMENT");
6093 		return;
6094 	}
6095 
6096 	if (sscanf(args[2], "%d", &x) == 0) {
6097 		report_count(1);
6098 		report_error("BAD ARGUMENT");
6099 		return;
6100 	}
6101 
6102 	if (sscanf(args[3], "%d", &n) == 0) {
6103 		report_count(1);
6104 		report_error("BAD ARGUMENT");
6105 		return;
6106 	}
6107 
6108 	if (sscanf(args[4], "%d", &attr) == 0) {
6109 		report_count(1);
6110 		report_error("BAD ARGUMENT");
6111 		return;
6112 	}
6113 
6114 	if (sscanf(args[5], "%d", &colour) == 0) {
6115 		report_count(1);
6116 		report_error("BAD ARGUMENT");
6117 		return;
6118 	}
6119 
6120 	report_count(1);
6121 	report_return(mvwchgat(win, y, x, n, attr, colour, NULL));
6122 }
6123 
6124 
6125 void
6126 cmd_add_wch(int nargs, char **args)
6127 {
6128 	if (check_arg_count(nargs, 1) == 1)
6129 		return;
6130 
6131 	report_count(1);
6132 	report_error("UNSUPPORTED");
6133 }
6134 
6135 
6136 void
6137 cmd_wadd_wch(int nargs, char **args)
6138 {
6139 	if (check_arg_count(nargs, 1) == 1)
6140 		return;
6141 
6142 	report_count(1);
6143 	report_error("UNSUPPORTED");
6144 }
6145 
6146 
6147 void
6148 cmd_mvadd_wch(int nargs, char **args)
6149 {
6150 	if (check_arg_count(nargs, 1) == 1)
6151 		return;
6152 
6153 	report_count(1);
6154 	report_error("UNSUPPORTED");
6155 }
6156 
6157 
6158 void
6159 cmd_mvwadd_wch(int nargs, char **args)
6160 {
6161 	if (check_arg_count(nargs, 1) == 1)
6162 		return;
6163 
6164 	report_count(1);
6165 	report_error("UNSUPPORTED");
6166 }
6167 
6168 
6169 
6170 void
6171 cmd_add_wchnstr(int nargs, char **args)
6172 {
6173 	if (check_arg_count(nargs, 1) == 1)
6174 		return;
6175 
6176 	report_count(1);
6177 	report_error("UNSUPPORTED");
6178 }
6179 
6180 
6181 void
6182 cmd_add_wchstr(int nargs, char **args)
6183 {
6184 	if (check_arg_count(nargs, 1) == 1)
6185 		return;
6186 
6187 	report_count(1);
6188 	report_error("UNSUPPORTED");
6189 }
6190 
6191 
6192 void
6193 cmd_wadd_wchnstr(int nargs, char **args)
6194 {
6195 	if (check_arg_count(nargs, 1) == 1)
6196 		return;
6197 
6198 	report_count(1);
6199 	report_error("UNSUPPORTED");
6200 }
6201 
6202 
6203 void
6204 cmd_wadd_wchstr(int nargs, char **args)
6205 {
6206 	if (check_arg_count(nargs, 1) == 1)
6207 		return;
6208 
6209 	report_count(1);
6210 	report_error("UNSUPPORTED");
6211 }
6212 
6213 
6214 void
6215 cmd_mvadd_wchnstr(int nargs, char **args)
6216 {
6217 	if (check_arg_count(nargs, 1) == 1)
6218 		return;
6219 
6220 	report_count(1);
6221 	report_error("UNSUPPORTED");
6222 }
6223 
6224 
6225 void
6226 cmd_mvadd_wchstr(int nargs, char **args)
6227 {
6228 	if (check_arg_count(nargs, 1) == 1)
6229 		return;
6230 
6231 	report_count(1);
6232 	report_error("UNSUPPORTED");
6233 }
6234 
6235 
6236 void
6237 cmd_mvwadd_wchnstr(int nargs, char **args)
6238 {
6239 	if (check_arg_count(nargs, 1) == 1)
6240 		return;
6241 
6242 	report_count(1);
6243 	report_error("UNSUPPORTED");
6244 }
6245 
6246 
6247 void
6248 cmd_mvwadd_wchstr(int nargs, char **args)
6249 {
6250 	if (check_arg_count(nargs, 1) == 1)
6251 		return;
6252 
6253 	report_count(1);
6254 	report_error("UNSUPPORTED");
6255 }
6256 
6257 
6258 
6259 void
6260 cmd_addnwstr(int nargs, char **args)
6261 {
6262 	if (check_arg_count(nargs, 1) == 1)
6263 		return;
6264 
6265 	report_count(1);
6266 	report_error("UNSUPPORTED");
6267 }
6268 
6269 
6270 void
6271 cmd_addwstr(int nargs, char **args)
6272 {
6273 	if (check_arg_count(nargs, 1) == 1)
6274 		return;
6275 
6276 	report_count(1);
6277 	report_error("UNSUPPORTED");
6278 }
6279 
6280 
6281 void
6282 cmd_mvaddnwstr(int nargs, char **args)
6283 {
6284 	if (check_arg_count(nargs, 1) == 1)
6285 		return;
6286 
6287 	report_count(1);
6288 	report_error("UNSUPPORTED");
6289 }
6290 
6291 
6292 void
6293 cmd_mvaddwstr(int nargs, char **args)
6294 {
6295 	if (check_arg_count(nargs, 1) == 1)
6296 		return;
6297 
6298 	report_count(1);
6299 	report_error("UNSUPPORTED");
6300 }
6301 
6302 
6303 void
6304 cmd_mvwaddnwstr(int nargs, char **args)
6305 {
6306 	if (check_arg_count(nargs, 1) == 1)
6307 		return;
6308 
6309 	report_count(1);
6310 	report_error("UNSUPPORTED");
6311 }
6312 
6313 
6314 void
6315 cmd_mvwaddwstr(int nargs, char **args)
6316 {
6317 	if (check_arg_count(nargs, 1) == 1)
6318 		return;
6319 
6320 	report_count(1);
6321 	report_error("UNSUPPORTED");
6322 }
6323 
6324 
6325 void
6326 cmd_waddnwstr(int nargs, char **args)
6327 {
6328 	if (check_arg_count(nargs, 1) == 1)
6329 		return;
6330 
6331 	report_count(1);
6332 	report_error("UNSUPPORTED");
6333 }
6334 
6335 
6336 void
6337 cmd_waddwstr(int nargs, char **args)
6338 {
6339 	if (check_arg_count(nargs, 1) == 1)
6340 		return;
6341 
6342 	report_count(1);
6343 	report_error("UNSUPPORTED");
6344 }
6345 
6346 
6347 
6348 void
6349 cmd_echo_wchar(int nargs, char **args)
6350 {
6351 	if (check_arg_count(nargs, 1) == 1)
6352 		return;
6353 
6354 	report_count(1);
6355 	report_error("UNSUPPORTED");
6356 }
6357 
6358 
6359 void
6360 cmd_wecho_wchar(int nargs, char **args)
6361 {
6362 	if (check_arg_count(nargs, 1) == 1)
6363 		return;
6364 
6365 	report_count(1);
6366 	report_error("UNSUPPORTED");
6367 }
6368 
6369 
6370 void
6371 cmd_pecho_wchar(int nargs, char **args)
6372 {
6373 	if (check_arg_count(nargs, 1) == 1)
6374 		return;
6375 
6376 	report_count(1);
6377 	report_error("UNSUPPORTED");
6378 }
6379 
6380 
6381 
6382 /* insert */
6383 void
6384 cmd_ins_wch(int nargs, char **args)
6385 {
6386 	if (check_arg_count(nargs, 1) == 1)
6387 		return;
6388 
6389 	report_count(1);
6390 	report_error("UNSUPPORTED");
6391 }
6392 
6393 
6394 void
6395 cmd_wins_wch(int nargs, char **args)
6396 {
6397 	if (check_arg_count(nargs, 1) == 1)
6398 		return;
6399 
6400 	report_count(1);
6401 	report_error("UNSUPPORTED");
6402 }
6403 
6404 
6405 void
6406 cmd_mvins_wch(int nargs, char **args)
6407 {
6408 	if (check_arg_count(nargs, 1) == 1)
6409 		return;
6410 
6411 	report_count(1);
6412 	report_error("UNSUPPORTED");
6413 }
6414 
6415 
6416 void
6417 cmd_mvwins_wch(int nargs, char **args)
6418 {
6419 	if (check_arg_count(nargs, 1) == 1)
6420 		return;
6421 
6422 	report_count(1);
6423 	report_error("UNSUPPORTED");
6424 }
6425 
6426 
6427 
6428 void
6429 cmd_ins_nwstr(int nargs, char **args)
6430 {
6431 	if (check_arg_count(nargs, 1) == 1)
6432 		return;
6433 
6434 	report_count(1);
6435 	report_error("UNSUPPORTED");
6436 }
6437 
6438 
6439 void
6440 cmd_ins_wstr(int nargs, char **args)
6441 {
6442 	if (check_arg_count(nargs, 1) == 1)
6443 		return;
6444 
6445 	report_count(1);
6446 	report_error("UNSUPPORTED");
6447 }
6448 
6449 
6450 void
6451 cmd_mvins_nwstr(int nargs, char **args)
6452 {
6453 	if (check_arg_count(nargs, 1) == 1)
6454 		return;
6455 
6456 	report_count(1);
6457 	report_error("UNSUPPORTED");
6458 }
6459 
6460 
6461 void
6462 cmd_mvins_wstr(int nargs, char **args)
6463 {
6464 	if (check_arg_count(nargs, 1) == 1)
6465 		return;
6466 
6467 	report_count(1);
6468 	report_error("UNSUPPORTED");
6469 }
6470 
6471 
6472 void
6473 cmd_mvwins_nwstr(int nargs, char **args)
6474 {
6475 	if (check_arg_count(nargs, 1) == 1)
6476 		return;
6477 
6478 	report_count(1);
6479 	report_error("UNSUPPORTED");
6480 }
6481 
6482 
6483 void
6484 cmd_mvwins_wstr(int nargs, char **args)
6485 {
6486 	if (check_arg_count(nargs, 1) == 1)
6487 		return;
6488 
6489 	report_count(1);
6490 	report_error("UNSUPPORTED");
6491 }
6492 
6493 
6494 void
6495 cmd_wins_nwstr(int nargs, char **args)
6496 {
6497 	if (check_arg_count(nargs, 1) == 1)
6498 		return;
6499 
6500 	report_count(1);
6501 	report_error("UNSUPPORTED");
6502 }
6503 
6504 
6505 void
6506 cmd_wins_wstr(int nargs, char **args)
6507 {
6508 	if (check_arg_count(nargs, 1) == 1)
6509 		return;
6510 
6511 	report_count(1);
6512 	report_error("UNSUPPORTED");
6513 }
6514 
6515 
6516 
6517 /* input */
6518 void
6519 cmd_get_wch(int nargs, char **args)
6520 {
6521 	if (check_arg_count(nargs, 1) == 1)
6522 		return;
6523 
6524 	report_count(1);
6525 	report_error("UNSUPPORTED");
6526 }
6527 
6528 
6529 void
6530 cmd_unget_wch(int nargs, char **args)
6531 {
6532 	if (check_arg_count(nargs, 1) == 1)
6533 		return;
6534 
6535 	report_count(1);
6536 	report_error("UNSUPPORTED");
6537 }
6538 
6539 
6540 void
6541 cmd_mvget_wch(int nargs, char **args)
6542 {
6543 	if (check_arg_count(nargs, 1) == 1)
6544 		return;
6545 
6546 	report_count(1);
6547 	report_error("UNSUPPORTED");
6548 }
6549 
6550 
6551 void
6552 cmd_mvwget_wch(int nargs, char **args)
6553 {
6554 	if (check_arg_count(nargs, 1) == 1)
6555 		return;
6556 
6557 	report_count(1);
6558 	report_error("UNSUPPORTED");
6559 }
6560 
6561 
6562 void
6563 cmd_wget_wch(int nargs, char **args)
6564 {
6565 	if (check_arg_count(nargs, 1) == 1)
6566 		return;
6567 
6568 	report_count(1);
6569 	report_error("UNSUPPORTED");
6570 }
6571 
6572 
6573 
6574 void
6575 cmd_getn_wstr(int nargs, char **args)
6576 {
6577 	if (check_arg_count(nargs, 1) == 1)
6578 		return;
6579 
6580 	report_count(1);
6581 	report_error("UNSUPPORTED");
6582 }
6583 
6584 
6585 void
6586 cmd_get_wstr(int nargs, char **args)
6587 {
6588 	if (check_arg_count(nargs, 1) == 1)
6589 		return;
6590 
6591 	report_count(1);
6592 	report_error("UNSUPPORTED");
6593 }
6594 
6595 
6596 void
6597 cmd_mvgetn_wstr(int nargs, char **args)
6598 {
6599 	if (check_arg_count(nargs, 1) == 1)
6600 		return;
6601 
6602 	report_count(1);
6603 	report_error("UNSUPPORTED");
6604 }
6605 
6606 
6607 void
6608 cmd_mvget_wstr(int nargs, char **args)
6609 {
6610 	if (check_arg_count(nargs, 1) == 1)
6611 		return;
6612 
6613 	report_count(1);
6614 	report_error("UNSUPPORTED");
6615 }
6616 
6617 
6618 void
6619 cmd_mvwgetn_wstr(int nargs, char **args)
6620 {
6621 	if (check_arg_count(nargs, 1) == 1)
6622 		return;
6623 
6624 	report_count(1);
6625 	report_error("UNSUPPORTED");
6626 }
6627 
6628 
6629 void
6630 cmd_mvwget_wstr(int nargs, char **args)
6631 {
6632 	if (check_arg_count(nargs, 1) == 1)
6633 		return;
6634 
6635 	report_count(1);
6636 	report_error("UNSUPPORTED");
6637 }
6638 
6639 
6640 void
6641 cmd_wgetn_wstr(int nargs, char **args)
6642 {
6643 	if (check_arg_count(nargs, 1) == 1)
6644 		return;
6645 
6646 	report_count(1);
6647 	report_error("UNSUPPORTED");
6648 }
6649 
6650 
6651 void
6652 cmd_wget_wstr(int nargs, char **args)
6653 {
6654 	if (check_arg_count(nargs, 1) == 1)
6655 		return;
6656 
6657 	report_count(1);
6658 	report_error("UNSUPPORTED");
6659 }
6660 
6661 
6662 
6663 void
6664 cmd_in_wch(int nargs, char **args)
6665 {
6666 	if (check_arg_count(nargs, 1) == 1)
6667 		return;
6668 
6669 	report_count(1);
6670 	report_error("UNSUPPORTED");
6671 }
6672 
6673 
6674 void
6675 cmd_mvin_wch(int nargs, char **args)
6676 {
6677 	if (check_arg_count(nargs, 1) == 1)
6678 		return;
6679 
6680 	report_count(1);
6681 	report_error("UNSUPPORTED");
6682 }
6683 
6684 
6685 void
6686 cmd_mvwin_wch(int nargs, char **args)
6687 {
6688 	if (check_arg_count(nargs, 1) == 1)
6689 		return;
6690 
6691 	report_count(1);
6692 	report_error("UNSUPPORTED");
6693 }
6694 
6695 
6696 void
6697 cmd_win_wch(int nargs, char **args)
6698 {
6699 	if (check_arg_count(nargs, 1) == 1)
6700 		return;
6701 
6702 	report_count(1);
6703 	report_error("UNSUPPORTED");
6704 }
6705 
6706 
6707 
6708 void
6709 cmd_in_wchnstr(int nargs, char **args)
6710 {
6711 	if (check_arg_count(nargs, 1) == 1)
6712 		return;
6713 
6714 	report_count(1);
6715 	report_error("UNSUPPORTED");
6716 }
6717 
6718 
6719 void
6720 cmd_in_wchstr(int nargs, char **args)
6721 {
6722 	if (check_arg_count(nargs, 1) == 1)
6723 		return;
6724 
6725 	report_count(1);
6726 	report_error("UNSUPPORTED");
6727 }
6728 
6729 
6730 void
6731 cmd_mvin_wchnstr(int nargs, char **args)
6732 {
6733 	if (check_arg_count(nargs, 1) == 1)
6734 		return;
6735 
6736 	report_count(1);
6737 	report_error("UNSUPPORTED");
6738 }
6739 
6740 
6741 void
6742 cmd_mvin_wchstr(int nargs, char **args)
6743 {
6744 	if (check_arg_count(nargs, 1) == 1)
6745 		return;
6746 
6747 	report_count(1);
6748 	report_error("UNSUPPORTED");
6749 }
6750 
6751 
6752 void
6753 cmd_mvwin_wchnstr(int nargs, char **args)
6754 {
6755 	if (check_arg_count(nargs, 1) == 1)
6756 		return;
6757 
6758 	report_count(1);
6759 	report_error("UNSUPPORTED");
6760 }
6761 
6762 
6763 void
6764 cmd_mvwin_wchstr(int nargs, char **args)
6765 {
6766 	if (check_arg_count(nargs, 1) == 1)
6767 		return;
6768 
6769 	report_count(1);
6770 	report_error("UNSUPPORTED");
6771 }
6772 
6773 
6774 void
6775 cmd_win_wchnstr(int nargs, char **args)
6776 {
6777 	if (check_arg_count(nargs, 1) == 1)
6778 		return;
6779 
6780 	report_count(1);
6781 	report_error("UNSUPPORTED");
6782 }
6783 
6784 
6785 void
6786 cmd_win_wchstr(int nargs, char **args)
6787 {
6788 	if (check_arg_count(nargs, 1) == 1)
6789 		return;
6790 
6791 	report_count(1);
6792 	report_error("UNSUPPORTED");
6793 }
6794 
6795 
6796 
6797 void
6798 cmd_innwstr(int nargs, char **args)
6799 {
6800 	if (check_arg_count(nargs, 1) == 1)
6801 		return;
6802 
6803 	report_count(1);
6804 	report_error("UNSUPPORTED");
6805 }
6806 
6807 
6808 void
6809 cmd_inwstr(int nargs, char **args)
6810 {
6811 	if (check_arg_count(nargs, 1) == 1)
6812 		return;
6813 
6814 	report_count(1);
6815 	report_error("UNSUPPORTED");
6816 }
6817 
6818 
6819 void
6820 cmd_mvinnwstr(int nargs, char **args)
6821 {
6822 	if (check_arg_count(nargs, 1) == 1)
6823 		return;
6824 
6825 	report_count(1);
6826 	report_error("UNSUPPORTED");
6827 }
6828 
6829 
6830 void
6831 cmd_mvinwstr(int nargs, char **args)
6832 {
6833 	if (check_arg_count(nargs, 1) == 1)
6834 		return;
6835 
6836 	report_count(1);
6837 	report_error("UNSUPPORTED");
6838 }
6839 
6840 
6841 void
6842 cmd_mvwinnwstr(int nargs, char **args)
6843 {
6844 	if (check_arg_count(nargs, 1) == 1)
6845 		return;
6846 
6847 	report_count(1);
6848 	report_error("UNSUPPORTED");
6849 }
6850 
6851 
6852 void
6853 cmd_mvwinwstr(int nargs, char **args)
6854 {
6855 	if (check_arg_count(nargs, 1) == 1)
6856 		return;
6857 
6858 	report_count(1);
6859 	report_error("UNSUPPORTED");
6860 }
6861 
6862 
6863 void
6864 cmd_winnwstr(int nargs, char **args)
6865 {
6866 	if (check_arg_count(nargs, 1) == 1)
6867 		return;
6868 
6869 	report_count(1);
6870 	report_error("UNSUPPORTED");
6871 }
6872 
6873 
6874 void
6875 cmd_winwstr(int nargs, char **args)
6876 {
6877 	if (check_arg_count(nargs, 1) == 1)
6878 		return;
6879 
6880 	report_count(1);
6881 	report_error("UNSUPPORTED");
6882 }
6883 
6884 
6885 
6886 /* cchar handlgin */
6887 void
6888 cmd_setcchar(int nargs, char **args)
6889 {
6890 	if (check_arg_count(nargs, 1) == 1)
6891 		return;
6892 
6893 	report_count(1);
6894 	report_error("UNSUPPORTED");
6895 }
6896 
6897 
6898 void
6899 cmd_getcchar(int nargs, char **args)
6900 {
6901 	if (check_arg_count(nargs, 1) == 1)
6902 		return;
6903 
6904 	report_count(1);
6905 	report_error("UNSUPPORTED");
6906 }
6907 
6908 
6909 
6910 /* misc */
6911 void
6912 cmd_key_name(int nargs, char **args)
6913 {
6914 	int w;
6915 
6916 	if (check_arg_count(nargs, 1) == 1)
6917 		return;
6918 
6919 	if (sscanf(args[0], "%d", &w) == 0) {
6920 		report_count(1);
6921 	report_error("BAD ARGUMENT");
6922 		return;
6923 	}
6924 
6925 	report_count(1);
6926 	report_status(key_name(w));
6927 }
6928 
6929 
6930 void
6931 cmd_border_set(int nargs, char **args)
6932 {
6933 	if (check_arg_count(nargs, 1) == 1)
6934 		return;
6935 
6936 	report_count(1);
6937 	report_error("UNSUPPORTED");
6938 }
6939 
6940 
6941 void
6942 cmd_wborder_set(int nargs, char **args)
6943 {
6944 	if (check_arg_count(nargs, 1) == 1)
6945 		return;
6946 
6947 	report_count(1);
6948 	report_error("UNSUPPORTED");
6949 }
6950 
6951 
6952 void
6953 cmd_box_set(int nargs, char **args)
6954 {
6955 	if (check_arg_count(nargs, 1) == 1)
6956 		return;
6957 
6958 	report_count(1);
6959 	report_error("UNSUPPORTED");
6960 }
6961 
6962 
6963 void
6964 cmd_erasewchar(int nargs, char **args)
6965 {
6966 	wchar_t ch;
6967 
6968 	if (check_arg_count(nargs, 0) == 1)
6969 		return;
6970 
6971 	/* XXX - call2 */
6972 	report_count(2);
6973 	report_return(erasewchar(&ch));
6974 	report_int(ch);
6975 }
6976 
6977 
6978 void
6979 cmd_killwchar(int nargs, char **args)
6980 {
6981 	wchar_t ch;
6982 
6983 	if (check_arg_count(nargs, 0) == 1)
6984 		return;
6985 
6986 	/* XXX - call2 */
6987 	report_count(2);
6988 	report_return(erasewchar(&ch));
6989 	report_int(ch);
6990 }
6991 
6992 
6993 void
6994 cmd_hline_set(int nargs, char **args)
6995 {
6996 	if (check_arg_count(nargs, 1) == 1)
6997 		return;
6998 
6999 	report_count(1);
7000 	report_error("UNSUPPORTED");
7001 }
7002 
7003 
7004 void
7005 cmd_mvhline_set(int nargs, char **args)
7006 {
7007 	if (check_arg_count(nargs, 1) == 1)
7008 		return;
7009 
7010 	report_count(1);
7011 	report_error("UNSUPPORTED");
7012 }
7013 
7014 
7015 void
7016 cmd_mvvline_set(int nargs, char **args)
7017 {
7018 	if (check_arg_count(nargs, 1) == 1)
7019 		return;
7020 
7021 	report_count(1);
7022 	report_error("UNSUPPORTED");
7023 }
7024 
7025 
7026 void
7027 cmd_mvwhline_set(int nargs, char **args)
7028 {
7029 	if (check_arg_count(nargs, 1) == 1)
7030 		return;
7031 
7032 	report_count(1);
7033 	report_error("UNSUPPORTED");
7034 }
7035 
7036 
7037 void
7038 cmd_mvwvline_set(int nargs, char **args)
7039 {
7040 	if (check_arg_count(nargs, 1) == 1)
7041 		return;
7042 
7043 	report_count(1);
7044 	report_error("UNSUPPORTED");
7045 }
7046 
7047 
7048 void
7049 cmd_vline_set(int nargs, char **args)
7050 {
7051 	if (check_arg_count(nargs, 1) == 1)
7052 		return;
7053 
7054 	report_count(1);
7055 	report_error("UNSUPPORTED");
7056 }
7057 
7058 
7059 void
7060 cmd_whline_set(int nargs, char **args)
7061 {
7062 	if (check_arg_count(nargs, 1) == 1)
7063 		return;
7064 
7065 	report_count(1);
7066 	report_error("UNSUPPORTED");
7067 }
7068 
7069 
7070 void
7071 cmd_wvline_set(int nargs, char **args)
7072 {
7073 	if (check_arg_count(nargs, 1) == 1)
7074 		return;
7075 
7076 	report_count(1);
7077 	report_error("UNSUPPORTED");
7078 }
7079 
7080 
7081 void
7082 cmd_bkgrnd(int nargs, char **args)
7083 {
7084 	if (check_arg_count(nargs, 1) == 1)
7085 		return;
7086 
7087 	report_count(1);
7088 	report_error("UNSUPPORTED");
7089 }
7090 
7091 
7092 void
7093 cmd_bkgrndset(int nargs, char **args)
7094 {
7095 	if (check_arg_count(nargs, 1) == 1)
7096 		return;
7097 
7098 	report_count(1);
7099 	report_error("UNSUPPORTED");
7100 }
7101 
7102 
7103 void
7104 cmd_getbkgrnd(int nargs, char **args)
7105 {
7106 	if (check_arg_count(nargs, 1) == 1)
7107 		return;
7108 
7109 	report_count(1);
7110 	report_error("UNSUPPORTED");
7111 }
7112 
7113 
7114 void
7115 cmd_wbkgrnd(int nargs, char **args)
7116 {
7117 	if (check_arg_count(nargs, 1) == 1)
7118 		return;
7119 
7120 	report_count(1);
7121 	report_error("UNSUPPORTED");
7122 }
7123 
7124 
7125 void
7126 cmd_wbkgrndset(int nargs, char **args)
7127 {
7128 	if (check_arg_count(nargs, 1) == 1)
7129 		return;
7130 
7131 	report_count(1);
7132 	report_error("UNSUPPORTED");
7133 }
7134 
7135 
7136 void
7137 cmd_wgetbkgrnd(int nargs, char **args)
7138 {
7139 	if (check_arg_count(nargs, 1) == 1)
7140 		return;
7141 
7142 	report_count(1);
7143 	report_error("UNSUPPORTED");
7144 }
7145