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