11573Srgrimes/*	$NetBSD: curses_commands.c,v 1.5 2011/08/29 12:46:03 christos Exp $	*/
21573Srgrimes
31573Srgrimes/*-
41573Srgrimes * Copyright 2009 Brett Lymn <blymn@NetBSD.org>
51573Srgrimes *
61573Srgrimes * All rights reserved.
71573Srgrimes *
81573Srgrimes * This code has been donated to The NetBSD Foundation by the Author.
91573Srgrimes *
101573Srgrimes * Redistribution and use in source and binary forms, with or without
111573Srgrimes * modification, are permitted provided that the following conditions
121573Srgrimes * are met:
131573Srgrimes * 1. Redistributions of source code must retain the above copyright
141573Srgrimes *    notice, this list of conditions and the following disclaimer.
151573Srgrimes * 2. The name of the author may not be used to endorse or promote products
161573Srgrimes *    derived from this software withough specific prior written permission
171573Srgrimes *
181573Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
191573Srgrimes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
201573Srgrimes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
211573Srgrimes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
221573Srgrimes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
231573Srgrimes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
241573Srgrimes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
251573Srgrimes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
261573Srgrimes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
271573Srgrimes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
281573Srgrimes *
291573Srgrimes *
301573Srgrimes */
311573Srgrimes
321573Srgrimes#include <curses.h>
331573Srgrimes#include <stdio.h>
3455127Speter#include <stdlib.h>
351573Srgrimes#include <string.h>
361573Srgrimes#include <termios.h>
371573Srgrimes#include <stdarg.h>
381573Srgrimes
391573Srgrimes#include "slave.h"
401573Srgrimes#include "curses_commands.h"
411573Srgrimes
421573Srgrimesvoid
431573Srgrimescmd_DRAIN(int nargs, char **args)
441573Srgrimes{
451573Srgrimes	while (getch() != ERR);
461573Srgrimes	report_count(1);
471573Srgrimes	report_return(OK);
481573Srgrimes}
4950331Sbde
501856Sdgvoid
511573Srgrimescmd_addbytes(int nargs, char **args)
521573Srgrimes{
531573Srgrimes	int count;
541573Srgrimes
551573Srgrimes	if (check_arg_count(nargs, 2) == 1)
5612682Speter		return;
571573Srgrimes
581573Srgrimes	if (sscanf(args[1], "%d", &count) == 0) {
591573Srgrimes		report_count(1);
601573Srgrimes	report_error("BAD ARGUMENT");
611573Srgrimes		return;
621573Srgrimes	}
631573Srgrimes
64170772Ssimokawa	report_count(1);
65195838Sbz	report_return(addbytes(args[0], count));
66195838Sbz}
67195838Sbz
68195838Sbz
69195838Sbzvoid
70195838Sbzcmd_addch(int nargs, char **args)
711573Srgrimes{
721573Srgrimes	chtype *ch;
731573Srgrimes
741573Srgrimes	if (check_arg_count(nargs, 1) == 1)
751573Srgrimes		return;
7692941Sobrien
7792941Sobrien	ch = (chtype *) args[0];
7892917Sobrien	report_count(1);
7992917Sobrien	report_return(addch(ch[0]));
8092917Sobrien}
81147672Speter
8292917Sobrien
83195838Sbzvoid
8492917Sobriencmd_addchnstr(int nargs, char **args)
8592941Sobrien{
8692941Sobrien	int count;
8792917Sobrien
88195838Sbz	if (check_arg_count(nargs, 2) == 1)
89195838Sbz		return;
90195838Sbz
91157911Speter	if (sscanf(args[1], "%d", &count) == 0) {
92184728Sraj		report_count(1);
93157911Speter	report_error("BAD ARGUMENT");
94157911Speter		return;
95157911Speter	}
96157911Speter
97	report_count(1);
98	report_return(addchnstr((chtype *) args[0], count));
99}
100
101
102void
103cmd_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
113void
114cmd_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
132void
133cmd_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
143void
144cmd_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
163void
164cmd_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
182void
183cmd_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
201void
202cmd_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
227void
228cmd_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
246void
247cmd_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
265void
266cmd_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
284void
285cmd_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
298void
299cmd_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
313void
314cmd_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
367void
368cmd_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
378void
379cmd_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
389void
390cmd_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
400void
401cmd_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
419void
420cmd_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
430void
431cmd_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
441void
442cmd_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
453void
454cmd_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
464void
465cmd_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
476void
477cmd_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
505void
506cmd_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
520void
521cmd_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
532void
533cmd_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
561void
562cmd_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
576void
577cmd_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
605void
606cmd_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
616void
617cmd_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
635void
636cmd_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
646void
647cmd_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
661void
662cmd_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
686void
687cmd_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
697void
698cmd_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
716void
717cmd_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
741void
742cmd_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
752void
753cmd_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
763void
764cmd_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
783void
784cmd_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
794void
795cmd_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
805void
806cmd_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
831void
832cmd_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
850void
851cmd_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
881void
882cmd_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
908void
909cmd_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
939void
940cmd_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
964void
965cmd_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
995void
996cmd_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
1020void
1021cmd_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
1045void
1046cmd_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
1070void
1071cmd_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
1111void
1112cmd_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
1139void
1140cmd_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
1164void
1165cmd_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
1205void
1206cmd_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
1233void
1234cmd_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
1274void
1275cmd_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
1305void
1306cmd_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
1331void
1332cmd_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
1369void
1370cmd_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
1401void
1402cmd_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
1439void
1440cmd_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
1471void
1472cmd_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
1509void
1510cmd_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
1541void
1542cmd_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
1573void
1574cmd_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
1606void
1607cmd_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
1654void
1655cmd_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
1689void
1690cmd_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
1721void
1722cmd_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
1753void
1754cmd_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
1778void
1779cmd_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
1789void
1790cmd_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
1800void
1801cmd_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
1822void
1823cmd_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
1833void
1834cmd_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
1844void
1845cmd_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
1870void
1871cmd_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
1893void
1894cmd_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
1962void
1963cmd_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
1981void
1982cmd_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
1992void
1993cmd_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
2003void
2004cmd_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
2022void
2023cmd_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
2041void
2042cmd_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
2061void
2062cmd_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
2080void
2081cmd_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
2124void
2125cmd_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
2143void
2144cmd_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
2155void
2156cmd_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
2166void
2167cmd_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
2177void
2178cmd_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
2188void
2189cmd_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
2199void
2200cmd_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
2210void
2211cmd_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
2236void
2237cmd_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
2251void
2252cmd_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
2270void
2271cmd_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
2289void
2290cmd_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
2308void
2309cmd_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
2327void
2328cmd_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
2349void
2350cmd_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
2368void
2369cmd_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
2387void
2388cmd_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
2406void
2407cmd_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
2425void
2426cmd_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
2444void
2445cmd_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
2463void
2464cmd_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
2485void
2486cmd_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
2496void
2497cmd_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
2516void
2517cmd_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
2535void
2536cmd_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
2546void
2547cmd_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
2557void
2558cmd_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
2568void
2569cmd_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
2590void
2591cmd_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
2616void
2617cmd_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
2642void
2643cmd_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
2679void
2680cmd_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
2710void
2711cmd_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
2721void
2722cmd_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
2747void
2748cmd_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
2758void
2759cmd_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
2784void
2785cmd_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
2803void
2804cmd_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
2828void
2829cmd_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
2854void
2855cmd_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
2873void
2874cmd_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
2884void
2885cmd_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
2910void
2911cmd_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
2936void
2937cmd_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
2973void
2974cmd_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
3005void
3006cmd_mvhline(int nargs, char **args)
3007{
3008	int y, x, ch, n;
3009
3010	if (check_arg_count(nargs, 4) == 1)
3011		return;
3012
3013	if (sscanf(args[0], "%d", &y) == 0) {
3014		report_count(1);
3015		report_error("BAD ARGUMENT");
3016		return;
3017	}
3018
3019	if (sscanf(args[1], "%d", &x) == 0) {
3020		report_count(1);
3021		report_error("BAD ARGUMENT");
3022		return;
3023	}
3024
3025	if (sscanf(args[2], "%d", &ch) == 0) {
3026		report_count(1);
3027		report_error("BAD ARGUMENT");
3028		return;
3029	}
3030
3031	if (sscanf(args[3], "%d", &n) == 0) {
3032		report_count(1);
3033		report_error("BAD ARGUMENT");
3034		return;
3035	}
3036
3037	report_count(1);
3038	report_return(mvhline(y, x, ch, n));
3039}
3040
3041
3042void
3043cmd_mvprintw(int nargs, char **args)
3044{
3045	int y, x;
3046
3047	if (check_arg_count(nargs, 4) == 1)
3048		return;
3049
3050	if (sscanf(args[0], "%d", &y) == 0) {
3051		report_count(1);
3052		report_error("BAD ARGUMENT");
3053		return;
3054	}
3055
3056	if (sscanf(args[1], "%d", &x) == 0) {
3057		report_count(1);
3058		report_error("BAD ARGUMENT");
3059		return;
3060	}
3061
3062	report_count(1);
3063	report_return(mvprintw(y, x, args[2], args[3]));
3064}
3065
3066
3067void
3068cmd_mvscanw(int nargs, char **args)
3069{
3070	int y, x;
3071	char string[256];
3072
3073	if (check_arg_count(nargs, 3) == 1)
3074		return;
3075
3076	if (sscanf(args[0], "%d", &y) == 0) {
3077		report_count(1);
3078		report_error("BAD ARGUMENT");
3079		return;
3080	}
3081
3082	if (sscanf(args[1], "%d", &x) == 0) {
3083		report_count(1);
3084		report_error("BAD ARGUMENT");
3085		return;
3086	}
3087
3088	/* XXX - call2 */
3089	report_count(2);
3090	report_int(mvscanw(y, x, args[2], &string));
3091	report_status(string);
3092}
3093
3094
3095void
3096cmd_mvvline(int nargs, char **args)
3097{
3098	int y, x, ch, n;
3099
3100	if (check_arg_count(nargs, 4) == 1)
3101		return;
3102
3103	if (sscanf(args[0], "%d", &y) == 0) {
3104		report_count(1);
3105		report_error("BAD ARGUMENT");
3106		return;
3107	}
3108
3109	if (sscanf(args[1], "%d", &x) == 0) {
3110		report_count(1);
3111		report_error("BAD ARGUMENT");
3112		return;
3113	}
3114
3115	if (sscanf(args[2], "%d", &ch) == 0) {
3116		report_count(1);
3117		report_error("BAD ARGUMENT");
3118		return;
3119	}
3120
3121	if (sscanf(args[3], "%d", &n) == 0) {
3122		report_count(1);
3123		report_error("BAD ARGUMENT");
3124		return;
3125	}
3126
3127	report_count(1);
3128	report_return(mvvline(y, x, ch, n));
3129}
3130
3131
3132void
3133cmd_mvwhline(int nargs, char **args)
3134{
3135	int y, x, ch, n;
3136	WINDOW *win;
3137
3138	if (check_arg_count(nargs, 5) == 1)
3139		return;
3140
3141	if (sscanf(args[0], "%p", &win) == 0) {
3142		report_count(1);
3143		report_error("BAD ARGUMENT");
3144		return;
3145	}
3146
3147	if (sscanf(args[1], "%d", &y) == 0) {
3148		report_count(1);
3149		report_error("BAD ARGUMENT");
3150		return;
3151	}
3152
3153	if (sscanf(args[2], "%d", &x) == 0) {
3154		report_count(1);
3155		report_error("BAD ARGUMENT");
3156		return;
3157	}
3158
3159	if (sscanf(args[3], "%d", &ch) == 0) {
3160		report_count(1);
3161		report_error("BAD ARGUMENT");
3162		return;
3163	}
3164
3165	if (sscanf(args[4], "%d", &n) == 0) {
3166		report_count(1);
3167		report_error("BAD ARGUMENT");
3168		return;
3169	}
3170
3171	report_count(1);
3172	report_return(mvwhline(win, y, x, ch, n));
3173}
3174
3175
3176void
3177cmd_mvwvline(int nargs, char **args)
3178{
3179	int y, x, ch, n;
3180	WINDOW *win;
3181
3182	if (check_arg_count(nargs, 5) == 1)
3183		return;
3184
3185	if (sscanf(args[0], "%p", &win) == 0) {
3186		report_count(1);
3187		report_error("BAD ARGUMENT");
3188		return;
3189	}
3190
3191	if (sscanf(args[1], "%d", &y) == 0) {
3192		report_count(1);
3193		report_error("BAD ARGUMENT");
3194		return;
3195	}
3196
3197	if (sscanf(args[2], "%d", &x) == 0) {
3198		report_count(1);
3199		report_error("BAD ARGUMENT");
3200		return;
3201	}
3202
3203	if (sscanf(args[3], "%d", &ch) == 0) {
3204		report_count(1);
3205		report_error("BAD ARGUMENT");
3206		return;
3207	}
3208
3209	if (sscanf(args[4], "%d", &n) == 0) {
3210		report_count(1);
3211		report_error("BAD ARGUMENT");
3212		return;
3213	}
3214
3215	report_count(1);
3216	report_return(mvwvline(win, y, x, ch, n));
3217}
3218
3219
3220void
3221cmd_mvwin(int nargs, char **args)
3222{
3223	int y, x;
3224	WINDOW *win;
3225
3226	if (check_arg_count(nargs, 3) == 1)
3227		return;
3228
3229	if (sscanf(args[0], "%p", &win) == 0) {
3230		report_count(1);
3231		report_error("BAD ARGUMENT");
3232		return;
3233	}
3234
3235	if (sscanf(args[1], "%d", &y) == 0) {
3236		report_count(1);
3237		report_error("BAD ARGUMENT");
3238		return;
3239	}
3240
3241	if (sscanf(args[2], "%d", &x) == 0) {
3242		report_count(1);
3243		report_error("BAD ARGUMENT");
3244		return;
3245	}
3246
3247	report_count(1);
3248	report_return(mvwin(win, y, x));
3249}
3250
3251
3252void
3253cmd_mvwinchnstr(int nargs, char **args)
3254{
3255	int y, x, count;
3256	chtype *string;
3257	WINDOW *win;
3258
3259	if (check_arg_count(nargs, 4) == 1)
3260		return;
3261
3262	if (sscanf(args[0], "%p", &win) == 0) {
3263		report_count(1);
3264		report_error("BAD ARGUMENT");
3265		return;
3266	}
3267
3268	if (sscanf(args[1], "%d", &y) == 0) {
3269		report_count(1);
3270		report_error("BAD ARGUMENT");
3271		return;
3272	}
3273
3274	if (sscanf(args[2], "%d", &x) == 0) {
3275		report_count(1);
3276		report_error("BAD ARGUMENT");
3277		return;
3278	}
3279
3280	if (sscanf(args[3], "%d", &count) == 0) {
3281		report_count(1);
3282		report_error("BAD ARGUMENT");
3283		return;
3284	}
3285
3286	if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
3287		report_count(1);
3288		report_error("MALLOC_FAILED");
3289		return;
3290	}
3291
3292	/* XXX call2 */
3293	report_count(2);
3294	report_return(mvwinchnstr(win, y, x, string, count));
3295	report_nstr(string);
3296	free(string);
3297}
3298
3299
3300void
3301cmd_mvwinchstr(int nargs, char **args)
3302{
3303	int y, x;
3304	chtype string[256];
3305	WINDOW *win;
3306
3307	if (check_arg_count(nargs, 3) == 1)
3308		return;
3309
3310	if (sscanf(args[0], "%p", &win) == 0) {
3311		report_count(1);
3312		report_error("BAD ARGUMENT");
3313		return;
3314	}
3315
3316	if (sscanf(args[1], "%d", &y) == 0) {
3317		report_count(1);
3318		report_error("BAD ARGUMENT");
3319		return;
3320	}
3321
3322	if (sscanf(args[2], "%d", &x) == 0) {
3323		report_count(1);
3324		report_error("BAD ARGUMENT");
3325		return;
3326	}
3327
3328	/* XXX call2 */
3329	report_count(2);
3330	report_return(mvwinchstr(win, y, x, string));
3331	report_nstr(string);
3332}
3333
3334
3335void
3336cmd_mvwinnstr(int nargs, char **args)
3337{
3338	int y, x, count;
3339	char *string;
3340	WINDOW *win;
3341
3342	if (check_arg_count(nargs, 4) == 1)
3343		return;
3344
3345	if (sscanf(args[0], "%p", &win) == 0) {
3346		report_count(1);
3347		report_error("BAD ARGUMENT");
3348		return;
3349	}
3350
3351	if (sscanf(args[1], "%d", &y) == 0) {
3352		report_count(1);
3353		report_error("BAD ARGUMENT");
3354		return;
3355	}
3356
3357	if (sscanf(args[2], "%d", &x) == 0) {
3358		report_count(1);
3359		report_error("BAD ARGUMENT");
3360		return;
3361	}
3362
3363	if (sscanf(args[3], "%d", &count) == 0) {
3364		report_count(1);
3365		report_error("BAD ARGUMENT");
3366		return;
3367	}
3368
3369	if ((string = malloc(count + 1)) == NULL) {
3370		report_count(1);
3371		report_error("MALLOC_FAILED");
3372		return;
3373	}
3374
3375	/* XXX call2 */
3376	report_count(2);
3377	report_return(mvwinnstr(win, y, x, string, count));
3378	report_status(string);
3379	free(string);
3380}
3381
3382
3383void
3384cmd_mvwinstr(int nargs, char **args)
3385{
3386	int y, x;
3387	char string[256];
3388	WINDOW *win;
3389
3390	if (check_arg_count(nargs, 3) == 1)
3391		return;
3392
3393	if (sscanf(args[0], "%p", &win) == 0) {
3394		report_count(1);
3395		report_error("BAD ARGUMENT");
3396		return;
3397	}
3398
3399	if (sscanf(args[1], "%d", &y) == 0) {
3400		report_count(1);
3401		report_error("BAD ARGUMENT");
3402		return;
3403	}
3404
3405	if (sscanf(args[2], "%d", &x) == 0) {
3406		report_count(1);
3407		report_error("BAD ARGUMENT");
3408		return;
3409	}
3410
3411	/* XXX call2 */
3412	report_count(2);
3413	report_return(mvwinstr(win, y, x, string));
3414	report_status(string);
3415}
3416
3417
3418void
3419cmd_mvwprintw(int nargs, char **args)
3420{
3421	int y, x;
3422	WINDOW *win;
3423
3424	if (check_arg_count(nargs, 5) == 1)
3425		return;
3426
3427	if (sscanf(args[0], "%p", &win) == 0) {
3428		report_count(1);
3429		report_error("BAD ARGUMENT");
3430		return;
3431	}
3432
3433	if (sscanf(args[1], "%d", &y) == 0) {
3434		report_count(1);
3435		report_error("BAD ARGUMENT");
3436		return;
3437	}
3438
3439	if (sscanf(args[2], "%d", &x) == 0) {
3440		report_count(1);
3441		report_error("BAD ARGUMENT");
3442		return;
3443	}
3444
3445	report_count(1);
3446	report_return(mvwprintw(win, y, x, args[3], args[4]));
3447}
3448
3449
3450void
3451cmd_mvwscanw(int nargs, char **args)
3452{
3453	int y, x;
3454	WINDOW *win;
3455	char string[256];
3456
3457	if (check_arg_count(nargs, 4) == 1)
3458		return;
3459
3460	if (sscanf(args[0], "%p", &win) == 0) {
3461		report_count(1);
3462		report_error("BAD ARGUMENT");
3463		return;
3464	}
3465
3466	if (sscanf(args[1], "%d", &y) == 0) {
3467		report_count(1);
3468		report_error("BAD ARGUMENT");
3469		return;
3470	}
3471
3472	if (sscanf(args[2], "%d", &x) == 0) {
3473		report_count(1);
3474		report_error("BAD ARGUMENT");
3475		return;
3476	}
3477
3478	/* XXX - call2 */
3479	report_count(2);
3480	report_int(mvwscanw(win, y, x, args[3], &string));
3481	report_status(string);
3482}
3483
3484
3485void
3486cmd_napms(int nargs, char **args)
3487{
3488	int naptime;
3489
3490	if (check_arg_count(nargs, 1) == 1)
3491		return;
3492
3493	if (sscanf(args[0], "%d", &naptime) == 0) {
3494		report_count(1);
3495		report_error("BAD ARGUMENT");
3496		return;
3497	}
3498
3499	report_count(1);
3500	report_return(napms(naptime));
3501}
3502
3503
3504void
3505cmd_newpad(int nargs, char **args)
3506{
3507	int y, x;
3508
3509	if (check_arg_count(nargs, 2) == 1)
3510		return;
3511
3512	if (sscanf(args[0], "%d", &y) == 0) {
3513		report_count(1);
3514		report_error("BAD ARGUMENT");
3515		return;
3516	}
3517
3518	if (sscanf(args[1], "%d", &x) == 0) {
3519		report_count(1);
3520		report_error("BAD ARGUMENT");
3521		return;
3522	}
3523
3524	report_count(1);
3525	report_ptr(newpad(y, x));
3526}
3527
3528
3529void
3530cmd_newterm(int nargs, char **args)
3531{
3532	FILE *in, *out;
3533
3534	if (check_arg_count(nargs, 3) == 1)
3535		return;
3536
3537	if ((in = fopen(args[1], "rw")) == NULL) {
3538		report_count(1);
3539		report_error("BAD FILE_ARGUMENT");
3540		return;
3541	}
3542
3543
3544	if ((out = fopen(args[2], "rw")) == NULL) {
3545		report_count(1);
3546		report_error("BAD FILE_ARGUMENT");
3547		return;
3548	}
3549
3550	report_count(1);
3551	report_ptr(newterm(args[0], out, in));
3552}
3553
3554
3555void
3556cmd_newwin(int nargs, char **args)
3557{
3558	int lines, cols, begin_y, begin_x;
3559
3560	if (check_arg_count(nargs, 4) == 1)
3561		return;
3562
3563	if (sscanf(args[0], "%d", &lines) == 0) {
3564		report_count(1);
3565		report_error("BAD ARGUMENT");
3566		return;
3567	}
3568
3569	if (sscanf(args[1], "%d", &cols) == 0) {
3570		report_count(1);
3571		report_error("BAD ARGUMENT");
3572		return;
3573	}
3574
3575	if (sscanf(args[2], "%d", &begin_y) == 0) {
3576		report_count(1);
3577		report_error("BAD ARGUMENT");
3578		return;
3579	}
3580
3581	if (sscanf(args[3], "%d", &begin_x) == 0) {
3582		report_count(1);
3583		report_error("BAD ARGUMENT");
3584		return;
3585	}
3586
3587	report_count(1);
3588	report_ptr(newwin(lines, cols, begin_y, begin_x));
3589}
3590
3591
3592void
3593cmd_nl(int nargs, char **args)
3594{
3595	if (check_arg_count(nargs, 0) == 1)
3596		return;
3597
3598	report_count(1);
3599	report_return(nl());
3600}
3601
3602
3603void
3604cmd_no_color_attributes(int nargs, char **args)
3605{
3606	if (check_arg_count(nargs, 0) == 1)
3607		return;
3608
3609	report_count(1);
3610	report_int(no_color_attributes());
3611}
3612
3613
3614void
3615cmd_nocbreak(int nargs, char **args)
3616{
3617	if (check_arg_count(nargs, 0) == 1)
3618		return;
3619
3620	report_count(1);
3621	report_return(nocbreak());
3622}
3623
3624
3625void
3626cmd_nodelay(int nargs, char **args)
3627{
3628	int flag;
3629	WINDOW *win;
3630
3631	if (check_arg_count(nargs, 2) == 1)
3632		return;
3633
3634	if (sscanf(args[0], "%p", &win) == 0) {
3635		report_count(1);
3636		report_error("BAD ARGUMENT");
3637		return;
3638	}
3639
3640	if (sscanf(args[1], "%d", &flag) == 0) {
3641		report_count(1);
3642		report_error("BAD ARGUMENT");
3643		return;
3644	}
3645
3646	report_count(1);
3647	report_return(nodelay(win, flag));
3648}
3649
3650
3651void
3652cmd_noecho(int nargs, char **args)
3653{
3654	if (check_arg_count(nargs, 0) == 1)
3655		return;
3656
3657	report_count(1);
3658	report_return(noecho());
3659}
3660
3661
3662void
3663cmd_nonl(int nargs, char **args)
3664{
3665	if (check_arg_count(nargs, 0) == 1)
3666		return;
3667
3668	report_count(1);
3669	report_return(nonl());
3670}
3671
3672
3673void
3674cmd_noqiflush(int nargs, char **args)
3675{
3676	if (check_arg_count(nargs, 0) == 1)
3677		return;
3678
3679	noqiflush();
3680	report_count(1);
3681	report_return(OK); /* fake a return, the call returns void */
3682}
3683
3684
3685void
3686cmd_noraw(int nargs, char **args)
3687{
3688	if (check_arg_count(nargs, 0) == 1)
3689		return;
3690
3691	report_count(1);
3692	report_return(noraw());
3693}
3694
3695
3696void
3697cmd_notimeout(int nargs, char **args)
3698{
3699	int flag;
3700	WINDOW *win;
3701
3702	if (check_arg_count(nargs, 2) == 1)
3703		return;
3704
3705	if (sscanf(args[0], "%p", &win) == 0) {
3706		report_count(1);
3707		report_error("BAD ARGUMENT");
3708		return;
3709	}
3710
3711	if (sscanf(args[1], "%d", &flag) == 0) {
3712		report_count(1);
3713		report_error("BAD ARGUMENT");
3714		return;
3715	}
3716
3717	report_count(1);
3718	report_return(notimeout(win, flag));
3719}
3720
3721
3722void
3723cmd_overlay(int nargs, char **args)
3724{
3725	WINDOW *source, *dest;
3726
3727	if (check_arg_count(nargs, 2) == 1)
3728		return;
3729
3730	if (sscanf(args[0], "%p", &source) == 0) {
3731		report_count(1);
3732		report_error("BAD ARGUMENT");
3733		return;
3734	}
3735
3736	if (sscanf(args[1], "%p", &dest) == 0) {
3737		report_count(1);
3738		report_error("BAD ARGUMENT");
3739		return;
3740	}
3741
3742	report_count(1);
3743	report_return(overlay(source, dest));
3744}
3745
3746
3747void
3748cmd_overwrite(int nargs, char **args)
3749{
3750	WINDOW *source, *dest;
3751
3752	if (check_arg_count(nargs, 2) == 1)
3753		return;
3754
3755	if (sscanf(args[0], "%p", &source) == 0) {
3756		report_count(1);
3757		report_error("BAD ARGUMENT");
3758		return;
3759	}
3760
3761	if (sscanf(args[1], "%p", &dest) == 0) {
3762		report_count(1);
3763		report_error("BAD ARGUMENT");
3764		return;
3765	}
3766
3767	report_count(1);
3768	report_return(overwrite(source, dest));
3769}
3770
3771
3772void
3773cmd_pair_content(int nargs, char **args)
3774{
3775	short pair, fore, back;
3776
3777	if (check_arg_count(nargs, 1) == 1)
3778		return;
3779
3780	if (sscanf(args[0], "%hd", &pair) == 0) {
3781		report_count(1);
3782		report_error("BAD ARGUMENT");
3783		return;
3784	}
3785
3786	/* XXX - call3 */
3787	report_count(3);
3788	report_return(pair_content(pair, &fore, &back));
3789	report_int(fore);
3790	report_int(back);
3791}
3792
3793
3794void
3795cmd_pechochar(int nargs, char **args)
3796{
3797	int ch;
3798	WINDOW *pad;
3799
3800	if (check_arg_count(nargs, 2) == 1)
3801		return;
3802
3803	if (sscanf(args[0], "%p", &pad) == 0) {
3804		report_count(1);
3805		report_error("BAD ARGUMENT");
3806		return;
3807	}
3808
3809	if (sscanf(args[1], "%d", &ch) == 0) {
3810		report_count(1);
3811		report_error("BAD ARGUMENT");
3812		return;
3813	}
3814
3815	report_count(1);
3816	report_return(pechochar(pad, ch));
3817}
3818
3819
3820void
3821cmd_pnoutrefresh(int nargs, char **args)
3822{
3823	int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
3824	WINDOW *pad;
3825
3826	if (check_arg_count(nargs, 7) == 1)
3827		return;
3828
3829	if (sscanf(args[0], "%p", &pad) == 0) {
3830		report_count(1);
3831		report_error("BAD ARGUMENT");
3832		return;
3833	}
3834
3835	if (sscanf(args[1], "%d", &pbeg_y) == 0) {
3836		report_count(1);
3837		report_error("BAD ARGUMENT");
3838		return;
3839	}
3840
3841	if (sscanf(args[2], "%d", &pbeg_x) == 0) {
3842		report_count(1);
3843		report_error("BAD ARGUMENT");
3844		return;
3845	}
3846
3847	if (sscanf(args[3], "%d", &sbeg_y) == 0) {
3848		report_count(1);
3849		report_error("BAD ARGUMENT");
3850		return;
3851	}
3852
3853	if (sscanf(args[4], "%d", &sbeg_x) == 0) {
3854		report_count(1);
3855		report_error("BAD ARGUMENT");
3856		return;
3857	}
3858
3859	if (sscanf(args[5], "%d", &smax_y) == 0) {
3860		report_count(1);
3861		report_error("BAD ARGUMENT");
3862		return;
3863	}
3864
3865	if (sscanf(args[6], "%d", &smax_x) == 0) {
3866		report_count(1);
3867		report_error("BAD ARGUMENT");
3868		return;
3869	}
3870
3871	report_count(1);
3872	report_return(pnoutrefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
3873				   smax_x));
3874}
3875
3876
3877void
3878cmd_prefresh(int nargs, char **args)
3879{
3880	int pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y, smax_x;
3881	WINDOW *pad;
3882
3883	if (check_arg_count(nargs, 7) == 1)
3884		return;
3885
3886	if (sscanf(args[0], "%p", &pad) == 0) {
3887		report_count(1);
3888		report_error("BAD ARGUMENT");
3889		return;
3890	}
3891
3892	if (sscanf(args[1], "%d", &pbeg_y) == 0) {
3893		report_count(1);
3894		report_error("BAD ARGUMENT");
3895		return;
3896	}
3897
3898	if (sscanf(args[2], "%d", &pbeg_x) == 0) {
3899		report_count(1);
3900		report_error("BAD ARGUMENT");
3901		return;
3902	}
3903
3904	if (sscanf(args[3], "%d", &sbeg_y) == 0) {
3905		report_count(1);
3906		report_error("BAD ARGUMENT");
3907		return;
3908	}
3909
3910	if (sscanf(args[4], "%d", &sbeg_x) == 0) {
3911		report_count(1);
3912		report_error("BAD ARGUMENT");
3913		return;
3914	}
3915
3916	if (sscanf(args[5], "%d", &smax_y) == 0) {
3917		report_count(1);
3918		report_error("BAD ARGUMENT");
3919		return;
3920	}
3921
3922	if (sscanf(args[6], "%d", &smax_x) == 0) {
3923		report_count(1);
3924		report_error("BAD ARGUMENT");
3925		return;
3926	}
3927
3928	/* XXX causes refresh */
3929	report_count(1);
3930	report_return(prefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
3931			       smax_x));
3932
3933}
3934
3935
3936void
3937cmd_printw(int nargs, char **args)
3938{
3939	if (check_arg_count(nargs, 2) == 1)
3940		return;
3941
3942
3943	report_count(1);
3944	report_return(printw(args[0], args[1]));
3945}
3946
3947
3948void
3949cmd_putwin(int nargs, char **args)
3950{
3951	FILE *fp;
3952	WINDOW *win;
3953
3954	if (check_arg_count(nargs, 2) == 1)
3955		return;
3956
3957	if (sscanf(args[0], "%p", &win) == 0) {
3958		report_count(1);
3959		report_error("BAD ARGUMENT");
3960		return;
3961	}
3962
3963	if ((fp = fopen(args[1], "rw")) == NULL) {
3964		report_count(1);
3965		report_error("BAD FILE_ARGUMENT");
3966		return;
3967	}
3968
3969	report_count(1);
3970	report_return(putwin(win, fp));
3971}
3972
3973
3974void
3975cmd_qiflush(int nargs, char **args)
3976{
3977	if (check_arg_count(nargs, 0) == 1)
3978		return;
3979
3980	qiflush();
3981	report_count(1);
3982	report_return(OK); /* fake a return because call returns void */
3983}
3984
3985
3986void
3987cmd_raw(int nargs, char **args)
3988{
3989	if (check_arg_count(nargs, 0) == 1)
3990		return;
3991
3992	report_count(1);
3993	report_return(raw());
3994}
3995
3996
3997void
3998cmd_redrawwin(int nargs, char **args)
3999{
4000	WINDOW *win;
4001
4002	if (check_arg_count(nargs, 1) == 1)
4003		return;
4004
4005	if (sscanf(args[0], "%p", &win) == 0) {
4006		report_count(1);
4007		report_error("BAD ARGUMENT");
4008		return;
4009	}
4010
4011	report_count(1);
4012	report_return(redrawwin(win));
4013}
4014
4015
4016void
4017cmd_reset_prog_mode(int nargs, char **args)
4018{
4019	if (check_arg_count(nargs, 0) == 1)
4020		return;
4021
4022	report_count(1);
4023	report_return(reset_prog_mode());
4024}
4025
4026
4027void
4028cmd_reset_shell_mode(int nargs, char **args)
4029{
4030	if (check_arg_count(nargs, 0) == 1)
4031		return;
4032
4033	report_count(1);
4034	report_return(reset_shell_mode());
4035}
4036
4037
4038void
4039cmd_resetty(int nargs, char **args)
4040{
4041	if (check_arg_count(nargs, 0) == 1)
4042		return;
4043
4044	report_count(1);
4045	report_return(resetty());
4046}
4047
4048
4049void
4050cmd_resizeterm(int nargs, char **args)
4051{
4052	int rows, cols;
4053
4054	if (check_arg_count(nargs, 2) == 1)
4055		return;
4056
4057	if (sscanf(args[0], "%d", &rows) == 0) {
4058		report_count(1);
4059		report_error("BAD ARGUMENT");
4060		return;
4061	}
4062
4063	if (sscanf(args[1], "%d", &cols) == 0) {
4064		report_count(1);
4065		report_error("BAD ARGUMENT");
4066		return;
4067	}
4068
4069	report_count(1);
4070	report_return(resizeterm(rows, cols));
4071}
4072
4073
4074void
4075cmd_savetty(int nargs, char **args)
4076{
4077	if (check_arg_count(nargs, 0) == 1)
4078		return;
4079
4080	report_count(1);
4081	report_return(savetty());
4082}
4083
4084
4085void
4086cmd_scanw(int nargs, char **args)
4087{
4088	char string[256];
4089
4090	if (check_arg_count(nargs, 0) == 1)
4091		return;
4092
4093	/* XXX call2 */
4094	report_count(2);
4095	report_return(scanw("%s", string));
4096	report_status(string);
4097}
4098
4099
4100void
4101cmd_scroll(int nargs, char **args)
4102{
4103	WINDOW *win;
4104
4105	if (check_arg_count(nargs, 1) == 1)
4106		return;
4107
4108	if (sscanf(args[0], "%p", &win) == 0) {
4109		report_count(1);
4110		report_error("BAD ARGUMENT");
4111		return;
4112	}
4113
4114	report_count(1);
4115	report_return(scroll(win));
4116}
4117
4118
4119void
4120cmd_scrollok(int nargs, char **args)
4121{
4122	WINDOW *win;
4123	int flag;
4124
4125	if (check_arg_count(nargs, 2) == 1)
4126		return;
4127
4128	if (sscanf(args[0], "%p", &win) == 0) {
4129		report_count(1);
4130		report_error("BAD ARGUMENT");
4131		return;
4132	}
4133
4134	if (sscanf(args[1], "%d", &flag) == 0) {
4135		report_count(1);
4136		report_error("BAD ARGUMENT");
4137		return;
4138	}
4139
4140	report_count(1);
4141	report_return(scrollok(win, flag));
4142}
4143
4144
4145void
4146cmd_setterm(int nargs, char **args)
4147{
4148	if (check_arg_count(nargs, 1) == 1)
4149		return;
4150
4151	report_count(1);
4152	report_return(setterm(args[0]));
4153}
4154
4155
4156void
4157cmd_set_term(int nargs, char **args)
4158{
4159	SCREEN *scrn;
4160
4161	if (check_arg_count(nargs, 1) == 1)
4162		return;
4163
4164	if (sscanf(args[0], "%p", &scrn) == 0) {
4165		report_count(1);
4166		report_error("BAD ARGUMENT");
4167		return;
4168	}
4169
4170	report_count(1);
4171	report_ptr(set_term(scrn));
4172}
4173
4174
4175void
4176cmd_start_color(int nargs, char **args)
4177{
4178	if (check_arg_count(nargs, 0) == 1)
4179		return;
4180
4181	report_count(1);
4182	report_return(start_color());
4183}
4184
4185
4186void
4187cmd_subpad(int nargs, char **args)
4188{
4189	WINDOW *pad;
4190	int lines, cols, begin_y, begin_x;
4191
4192	if (check_arg_count(nargs, 5) == 1)
4193		return;
4194
4195	if (sscanf(args[0], "%p", &pad) == 0) {
4196		report_count(1);
4197		report_error("BAD ARGUMENT");
4198		return;
4199	}
4200
4201	if (sscanf(args[1], "%d", &lines) == 0) {
4202		report_count(1);
4203		report_error("BAD ARGUMENT");
4204		return;
4205	}
4206
4207	if (sscanf(args[2], "%d", &cols) == 0) {
4208		report_count(1);
4209		report_error("BAD ARGUMENT");
4210		return;
4211	}
4212
4213	if (sscanf(args[3], "%d", &begin_y) == 0) {
4214		report_count(1);
4215		report_error("BAD ARGUMENT");
4216		return;
4217	}
4218
4219	if (sscanf(args[4], "%d", &begin_x) == 0) {
4220		report_count(1);
4221		report_error("BAD ARGUMENT");
4222		return;
4223	}
4224
4225	report_count(1);
4226	report_ptr(subpad(pad, lines, cols, begin_y, begin_x));
4227}
4228
4229
4230void
4231cmd_subwin(int nargs, char **args)
4232{
4233	WINDOW *win;
4234	int lines, cols, begin_y, begin_x;
4235
4236	if (check_arg_count(nargs, 5) == 1)
4237		return;
4238
4239	if (sscanf(args[0], "%p", &win) == 0) {
4240		report_count(1);
4241		report_error("BAD ARGUMENT");
4242		return;
4243	}
4244
4245	if (sscanf(args[1], "%d", &lines) == 0) {
4246		report_count(1);
4247		report_error("BAD ARGUMENT");
4248		return;
4249	}
4250
4251	if (sscanf(args[2], "%d", &cols) == 0) {
4252		report_count(1);
4253		report_error("BAD ARGUMENT");
4254		return;
4255	}
4256
4257	if (sscanf(args[3], "%d", &begin_y) == 0) {
4258		report_count(1);
4259		report_error("BAD ARGUMENT");
4260		return;
4261	}
4262
4263	if (sscanf(args[4], "%d", &begin_x) == 0) {
4264		report_count(1);
4265		report_error("BAD ARGUMENT");
4266		return;
4267	}
4268
4269	report_count(1);
4270	report_ptr(subwin(win, lines, cols, begin_y, begin_x));
4271}
4272
4273
4274void
4275cmd_termattrs(int nargs, char **args)
4276{
4277	if (check_arg_count(nargs, 0) == 1)
4278		return;
4279
4280	report_count(1);
4281	report_int(termattrs());
4282}
4283
4284
4285void
4286cmd_term_attrs(int nargs, char **args)
4287{
4288	if (check_arg_count(nargs, 0) == 1)
4289		return;
4290
4291	report_count(1);
4292	report_int(term_attrs());
4293}
4294
4295
4296void
4297cmd_touchline(int nargs, char **args)
4298{
4299	WINDOW *win;
4300	int start, count;
4301
4302	if (check_arg_count(nargs, 3) == 1)
4303		return;
4304
4305	if (sscanf(args[0], "%p", &win) == 0) {
4306		report_count(1);
4307		report_error("BAD ARGUMENT");
4308		return;
4309	}
4310
4311	if (sscanf(args[1], "%d", &start) == 0) {
4312		report_count(1);
4313		report_error("BAD ARGUMENT");
4314		return;
4315	}
4316
4317	if (sscanf(args[2], "%d", &count) == 0) {
4318		report_count(1);
4319		report_error("BAD ARGUMENT");
4320		return;
4321	}
4322
4323	report_count(1);
4324	report_return(touchline(win, start, count));
4325}
4326
4327
4328void
4329cmd_touchoverlap(int nargs, char **args)
4330{
4331	WINDOW *win1, *win2;
4332
4333	if (check_arg_count(nargs, 2) == 1)
4334		return;
4335
4336	if (sscanf(args[0], "%p", &win1) == 0) {
4337		report_count(1);
4338		report_error("BAD ARGUMENT");
4339		return;
4340	}
4341
4342	if (sscanf(args[1], "%p", &win2) == 0) {
4343		report_count(1);
4344		report_error("BAD ARGUMENT");
4345		return;
4346	}
4347
4348	report_count(1);
4349	report_return(touchoverlap(win1, win2));
4350}
4351
4352
4353void
4354cmd_touchwin(int nargs, char **args)
4355{
4356	WINDOW *win;
4357
4358	if (check_arg_count(nargs, 1) == 1)
4359		return;
4360
4361	if (sscanf(args[0], "%p", &win) == 0) {
4362		report_count(1);
4363		report_error("BAD ARGUMENT");
4364		return;
4365	}
4366
4367	report_count(1);
4368	report_return(touchwin(win));
4369}
4370
4371
4372void
4373cmd_ungetch(int nargs, char **args)
4374{
4375	int ch;
4376
4377	if (check_arg_count(nargs, 1) == 1)
4378		return;
4379
4380	if (sscanf(args[0], "%d", &ch) == 0) {
4381		report_count(1);
4382		report_error("BAD ARGUMENT");
4383		return;
4384	}
4385
4386	report_count(1);
4387	report_return(ungetch(ch));
4388}
4389
4390
4391void
4392cmd_untouchwin(int nargs, char **args)
4393{
4394	WINDOW *win;
4395
4396	if (check_arg_count(nargs, 1) == 1)
4397		return;
4398
4399	if (sscanf(args[0], "%p", &win) == 0) {
4400		report_count(1);
4401		report_error("BAD ARGUMENT");
4402		return;
4403	}
4404
4405	report_count(1);
4406	report_return(untouchwin(win));
4407}
4408
4409
4410void
4411cmd_use_default_colors(int nargs, char **args)
4412{
4413	if (check_arg_count(nargs, 0) == 1)
4414		return;
4415
4416	report_count(1);
4417	report_return(use_default_colors());
4418}
4419
4420
4421void
4422cmd_vline(int nargs, char **args)
4423{
4424	int ch, count;
4425
4426	if (check_arg_count(nargs, 2) == 1)
4427		return;
4428
4429	if (sscanf(args[0], "%d", &ch) == 0) {
4430		report_count(1);
4431		report_error("BAD ARGUMENT");
4432		return;
4433	}
4434
4435	if (sscanf(args[1], "%d", &count) == 0) {
4436		report_count(1);
4437		report_error("BAD ARGUMENT");
4438		return;
4439	}
4440
4441	report_count(1);
4442	report_return(vline(ch, count));
4443}
4444
4445
4446static int
4447internal_vw_printw(WINDOW *win, char *arg1, ...)
4448{
4449	va_list va;
4450	int rv;
4451
4452	va_start(va, arg1);
4453	rv = vw_printw(win, arg1, va);
4454	va_end(va);
4455
4456	return rv;
4457}
4458
4459void
4460cmd_vw_printw(int nargs, char **args)
4461{
4462	WINDOW *win;
4463
4464	if (check_arg_count(nargs, 3) == 1)
4465		return;
4466
4467	if (sscanf(args[0], "%p", &win) == 0) {
4468		report_count(1);
4469		report_error("BAD ARGUMENT");
4470		return;
4471	}
4472
4473	report_count(1);
4474	report_return(internal_vw_printw(win, args[1], args[2]));
4475}
4476
4477
4478static int
4479internal_vw_scanw(WINDOW *win, char *arg1, ...)
4480{
4481	va_list va;
4482	int rv;
4483
4484	va_start(va, arg1);
4485	rv = vw_scanw(win, arg1, va);
4486	va_end(va);
4487
4488	return rv;
4489}
4490
4491void
4492cmd_vw_scanw(int nargs, char **args)
4493{
4494	WINDOW *win;
4495	char string[256];
4496
4497	if (check_arg_count(nargs, 2) == 1)
4498		return;
4499
4500	if (sscanf(args[0], "%p", &win) == 0) {
4501		report_count(1);
4502		report_error("BAD ARGUMENT");
4503		return;
4504	}
4505
4506	/* XXX - call2 */
4507	report_count(2);
4508	report_int(internal_vw_scanw(win, args[1], string));
4509	report_status(string);
4510}
4511
4512
4513void
4514cmd_vwprintw(int nargs, char **args)
4515{
4516	cmd_vw_printw(nargs, args);
4517}
4518
4519
4520void
4521cmd_vwscanw(int nargs, char **args)
4522{
4523	cmd_vw_scanw(nargs, args);
4524}
4525
4526
4527void
4528cmd_waddch(int nargs, char **args)
4529{
4530	WINDOW *win;
4531	chtype *ch;
4532
4533	if (check_arg_count(nargs, 2) == 1)
4534		return;
4535
4536	if (sscanf(args[0], "%p", &win) == 0) {
4537		report_count(1);
4538		report_error("BAD ARGUMENT");
4539		return;
4540	}
4541
4542	ch = (chtype *) args[1];
4543
4544	report_count(1);
4545	report_return(waddch(win, ch[0]));
4546}
4547
4548
4549void
4550cmd_waddchnstr(int nargs, char **args)
4551{
4552	WINDOW *win;
4553	int count;
4554
4555	if (check_arg_count(nargs, 3) == 1)
4556		return;
4557
4558	if (sscanf(args[0], "%p", &win) == 0) {
4559		report_count(1);
4560		report_error("BAD ARGUMENT");
4561		return;
4562	}
4563
4564	if (sscanf(args[2], "%d", &count) == 0) {
4565		report_count(1);
4566		report_error("BAD ARGUMENT");
4567		return;
4568	}
4569
4570	report_count(1);
4571	report_return(waddchnstr(win, (chtype *) args[1], count));
4572}
4573
4574
4575void
4576cmd_waddchstr(int nargs, char **args)
4577{
4578	WINDOW *win;
4579
4580	if (check_arg_count(nargs, 2) == 1)
4581		return;
4582
4583	if (sscanf(args[0], "%p", &win) == 0) {
4584		report_count(1);
4585		report_error("BAD ARGUMENT");
4586		return;
4587	}
4588
4589	report_count(1);
4590	report_return(waddchstr(win, (chtype *) args[1]));
4591}
4592
4593
4594void
4595cmd_waddnstr(int nargs, char **args)
4596{
4597	WINDOW *win;
4598	int count;
4599
4600	if (check_arg_count(nargs, 1) == 3)
4601		return;
4602
4603	if (sscanf(args[0], "%p", &win) == 0) {
4604		report_count(1);
4605		report_error("BAD ARGUMENT");
4606		return;
4607	}
4608
4609	if (sscanf(args[2], "%d", &count) == 0) {
4610		report_count(1);
4611		report_error("BAD ARGUMENT");
4612		return;
4613	}
4614
4615	report_count(1);
4616	report_return(waddnstr(win, args[1], count));
4617
4618}
4619
4620
4621void
4622cmd_wattr_get(int nargs, char **args)
4623{
4624	WINDOW *win;
4625	int attr;
4626	short pair;
4627
4628	if (check_arg_count(nargs, 1) == 1)
4629		return;
4630
4631	if (sscanf(args[0], "%p", &win) == 0) {
4632		report_count(1);
4633		report_error("BAD ARGUMENT");
4634		return;
4635	}
4636
4637	/* XXX - call3 */
4638	report_count(3);
4639	report_return(wattr_get(win, &attr, &pair, NULL));
4640	report_int(attr);
4641	report_int(pair);
4642}
4643
4644
4645void
4646cmd_wattr_off(int nargs, char **args)
4647{
4648	WINDOW *win;
4649	int attr;
4650
4651	if (check_arg_count(nargs, 2) == 1)
4652		return;
4653
4654	if (sscanf(args[0], "%p", &win) == 0) {
4655		report_count(1);
4656		report_error("BAD ARGUMENT");
4657		return;
4658	}
4659
4660	if (sscanf(args[1], "%d", &attr) == 0) {
4661		report_count(1);
4662		report_error("BAD ARGUMENT");
4663		return;
4664	}
4665
4666	report_count(1);
4667	report_return(wattr_off(win, attr, NULL));
4668}
4669
4670
4671void
4672cmd_wattr_on(int nargs, char **args)
4673{
4674	WINDOW *win;
4675	int attr;
4676
4677	if (check_arg_count(nargs, 2) == 1)
4678		return;
4679
4680	if (sscanf(args[0], "%p", &win) == 0) {
4681		report_count(1);
4682		report_error("BAD ARGUMENT");
4683		return;
4684	}
4685
4686	if (sscanf(args[1], "%d", &attr) == 0) {
4687		report_count(1);
4688		report_error("BAD ARGUMENT");
4689		return;
4690	}
4691
4692	report_count(1);
4693	report_return(wattr_on(win, attr, NULL));
4694}
4695
4696
4697void
4698cmd_wattr_set(int nargs, char **args)
4699{
4700	WINDOW *win;
4701	int attr;
4702	short pair;
4703
4704	if (check_arg_count(nargs, 3) == 1)
4705		return;
4706
4707	if (sscanf(args[0], "%p", &win) == 0) {
4708		report_count(1);
4709		report_error("BAD ARGUMENT");
4710		return;
4711	}
4712
4713	if (sscanf(args[1], "%d", &attr) == 0) {
4714		report_count(1);
4715		report_error("BAD ARGUMENT");
4716		return;
4717	}
4718
4719	if (sscanf(args[2], "%hd", &pair) == 0) {
4720		report_count(1);
4721		report_error("BAD ARGUMENT");
4722		return;
4723	}
4724
4725	report_count(1);
4726	report_return(wattr_set(win, attr, pair, NULL));
4727}
4728
4729
4730void
4731cmd_wattroff(int nargs, char **args)
4732{
4733	WINDOW *win;
4734	int attr;
4735
4736	if (check_arg_count(nargs, 2) == 1)
4737		return;
4738
4739	if (sscanf(args[0], "%p", &win) == 0) {
4740		report_count(1);
4741		report_error("BAD ARGUMENT");
4742		return;
4743	}
4744
4745	if (sscanf(args[1], "%d", &attr) == 0) {
4746		report_count(1);
4747		report_error("BAD ARGUMENT");
4748		return;
4749	}
4750
4751	report_count(1);
4752	report_return(wattroff(win, attr));
4753}
4754
4755
4756void
4757cmd_wattron(int nargs, char **args)
4758{
4759	WINDOW *win;
4760	int attr;
4761
4762	if (check_arg_count(nargs, 2) == 1)
4763		return;
4764
4765	if (sscanf(args[0], "%p", &win) == 0) {
4766		report_count(1);
4767		report_error("BAD ARGUMENT");
4768		return;
4769	}
4770
4771	if (sscanf(args[1], "%d", &attr) == 0) {
4772		report_count(1);
4773		report_error("BAD ARGUMENT");
4774		return;
4775	}
4776
4777	report_count(1);
4778	report_return(wattron(win, attr));
4779}
4780
4781
4782void
4783cmd_wattrset(int nargs, char **args)
4784{
4785	WINDOW *win;
4786	int attr;
4787
4788	if (check_arg_count(nargs, 2) == 1)
4789		return;
4790
4791	if (sscanf(args[0], "%p", &win) == 0) {
4792		report_count(1);
4793		report_error("BAD ARGUMENT");
4794		return;
4795	}
4796
4797	if (sscanf(args[1], "%d", &attr) == 0) {
4798		report_count(1);
4799		report_error("BAD ARGUMENT");
4800		return;
4801	}
4802
4803	report_count(1);
4804	report_return(wattrset(win, attr));
4805}
4806
4807
4808void
4809cmd_wbkgd(int nargs, char **args)
4810{
4811	WINDOW *win;
4812	chtype *ch;
4813
4814	if (check_arg_count(nargs, 2) == 1)
4815		return;
4816
4817	if (sscanf(args[0], "%p", &win) == 0) {
4818		report_count(1);
4819		report_error("BAD ARGUMENT");
4820		return;
4821	}
4822
4823	ch = (chtype *) args[1];
4824	report_count(1);
4825	report_return(wbkgd(win, ch[0]));
4826}
4827
4828
4829void
4830cmd_wbkgdset(int nargs, char **args)
4831{
4832	WINDOW *win;
4833	int ch;
4834
4835	if (check_arg_count(nargs, 2) == 1)
4836		return;
4837
4838	if (sscanf(args[0], "%p", &win) == 0) {
4839		report_count(1);
4840		report_error("BAD ARGUMENT");
4841		return;
4842	}
4843
4844	if (sscanf(args[1], "%d", &ch) == 0) {
4845		report_count(1);
4846		report_error("BAD ARGUMENT");
4847		return;
4848	}
4849
4850	wbkgdset(win, ch); /* void return */
4851	report_count(1);
4852	report_return(OK);
4853}
4854
4855
4856void
4857cmd_wborder(int nargs, char **args)
4858{
4859	WINDOW *win;
4860	int ls, rs, ts, bs, tl, tr, bl, br;
4861
4862	if (check_arg_count(nargs, 9) == 1)
4863		return;
4864
4865	if (sscanf(args[0], "%p", &win) == 0) {
4866		report_count(1);
4867		report_error("BAD ARGUMENT");
4868		return;
4869	}
4870
4871	if (sscanf(args[1], "%d", &ls) == 0) {
4872		report_count(1);
4873		report_error("BAD ARGUMENT");
4874		return;
4875	}
4876
4877	if (sscanf(args[2], "%d", &rs) == 0) {
4878		report_count(1);
4879		report_error("BAD ARGUMENT");
4880		return;
4881	}
4882
4883	if (sscanf(args[3], "%d", &ts) == 0) {
4884		report_count(1);
4885		report_error("BAD ARGUMENT");
4886		return;
4887	}
4888
4889	if (sscanf(args[4], "%d", &bs) == 0) {
4890		report_count(1);
4891		report_error("BAD ARGUMENT");
4892		return;
4893	}
4894
4895	if (sscanf(args[5], "%d", &tl) == 0) {
4896		report_count(1);
4897		report_error("BAD ARGUMENT");
4898		return;
4899	}
4900
4901	if (sscanf(args[6], "%d", &tr) == 0) {
4902		report_count(1);
4903		report_error("BAD ARGUMENT");
4904		return;
4905	}
4906
4907	if (sscanf(args[7], "%d", &bl) == 0) {
4908		report_count(1);
4909		report_error("BAD ARGUMENT");
4910		return;
4911	}
4912
4913	if (sscanf(args[8], "%d", &br) == 0) {
4914		report_count(1);
4915		report_error("BAD ARGUMENT");
4916		return;
4917	}
4918
4919	report_count(1);
4920	report_return(wborder(win, ls, rs, ts, bs, tl, tr, bl, br));
4921}
4922
4923
4924void
4925cmd_wclear(int nargs, char **args)
4926{
4927	WINDOW *win;
4928
4929	if (check_arg_count(nargs, 1) == 1)
4930		return;
4931
4932	if (sscanf(args[0], "%p", &win) == 0) {
4933		report_count(1);
4934		report_error("BAD ARGUMENT");
4935		return;
4936	}
4937
4938	report_count(1);
4939	report_return(wclear(win));
4940}
4941
4942
4943void
4944cmd_wclrtobot(int nargs, char **args)
4945{
4946	WINDOW *win;
4947
4948	if (check_arg_count(nargs, 1) == 1)
4949		return;
4950
4951	if (sscanf(args[0], "%p", &win) == 0) {
4952		report_count(1);
4953		report_error("BAD ARGUMENT");
4954		return;
4955	}
4956
4957	report_count(1);
4958	report_return(wclrtobot(win));
4959}
4960
4961
4962void
4963cmd_wclrtoeol(int nargs, char **args)
4964{
4965	WINDOW *win;
4966
4967	if (check_arg_count(nargs, 1) == 1)
4968		return;
4969
4970	if (sscanf(args[0], "%p", &win) == 0) {
4971		report_count(1);
4972		report_error("BAD ARGUMENT");
4973		return;
4974	}
4975
4976	report_count(1);
4977	report_return(wclrtoeol(win));
4978
4979}
4980
4981
4982void
4983cmd_wcolor_set(int nargs, char **args)
4984{
4985	WINDOW *win;
4986	short pair;
4987
4988	if (check_arg_count(nargs, 2) == 1)
4989		return;
4990
4991	if (sscanf(args[0], "%p", &win) == 0) {
4992		report_count(1);
4993		report_error("BAD ARGUMENT");
4994		return;
4995	}
4996
4997	if (sscanf(args[1], "%hd", &pair) == 0) {
4998		report_count(1);
4999		report_error("BAD ARGUMENT");
5000		return;
5001	}
5002
5003	report_count(1);
5004	report_return(wcolor_set(win, pair, NULL));
5005}
5006
5007
5008void
5009cmd_wdelch(int nargs, char **args)
5010{
5011	WINDOW *win;
5012
5013	if (check_arg_count(nargs, 1) == 1)
5014		return;
5015
5016	if (sscanf(args[0], "%p", &win) == 0) {
5017		report_count(1);
5018		report_error("BAD ARGUMENT");
5019		return;
5020	}
5021
5022	report_count(1);
5023	report_return(wdelch(win));
5024}
5025
5026
5027void
5028cmd_wdeleteln(int nargs, char **args)
5029{
5030	WINDOW *win;
5031
5032	if (check_arg_count(nargs, 1) == 1)
5033		return;
5034
5035	if (sscanf(args[0], "%p", &win) == 0) {
5036		report_count(1);
5037		report_error("BAD ARGUMENT");
5038		return;
5039	}
5040
5041	report_count(1);
5042	report_return(wdeleteln(win));
5043
5044}
5045
5046
5047void
5048cmd_wechochar(int nargs, char **args)
5049{
5050	WINDOW *win;
5051	int ch;
5052
5053	if (check_arg_count(nargs, 2) == 1)
5054		return;
5055
5056	if (sscanf(args[0], "%p", &win) == 0) {
5057		report_count(1);
5058		report_error("BAD ARGUMENT");
5059		return;
5060	}
5061
5062	if (sscanf(args[1], "%d", &ch) == 0) {
5063		report_count(1);
5064		report_error("BAD ARGUMENT");
5065		return;
5066	}
5067
5068	report_count(1);
5069	report_return(wechochar(win, ch));
5070}
5071
5072
5073void
5074cmd_werase(int nargs, char **args)
5075{
5076	WINDOW *win;
5077
5078	if (check_arg_count(nargs, 1) == 1)
5079		return;
5080
5081	if (sscanf(args[0], "%p", &win) == 0) {
5082		report_count(1);
5083		report_error("BAD ARGUMENT");
5084		return;
5085	}
5086
5087	report_count(1);
5088	report_return(werase(win));
5089}
5090
5091
5092void
5093cmd_wgetch(int nargs, char **args)
5094{
5095	WINDOW *win;
5096
5097	if (check_arg_count(nargs, 1) == 1)
5098		return;
5099
5100	if (sscanf(args[0], "%p", &win) == 0) {
5101		report_count(1);
5102		report_error("BAD ARGUMENT");
5103		return;
5104	}
5105
5106	report_count(1);
5107	report_int(wgetch(win));
5108}
5109
5110
5111void
5112cmd_wgetnstr(int nargs, char **args)
5113{
5114	WINDOW *win;
5115	int count;
5116	char string[256];
5117
5118	if (check_arg_count(nargs, 2) == 1)
5119		return;
5120
5121	if (sscanf(args[0], "%p", &win) == 0) {
5122		report_count(1);
5123		report_error("BAD ARGUMENT");
5124		return;
5125	}
5126
5127	if (sscanf(args[1], "%d", &count) == 0) {
5128		report_count(1);
5129		report_error("BAD ARGUMENT");
5130		return;
5131	}
5132
5133	/* XXX - call2 */
5134	report_count(2);
5135	report_return(wgetnstr(win, string, count));
5136	report_status(string);
5137}
5138
5139
5140void
5141cmd_wgetstr(int nargs, char **args)
5142{
5143	WINDOW *win;
5144	char string[256];
5145
5146
5147	if (check_arg_count(nargs, 1) == 1)
5148		return;
5149
5150	if (sscanf(args[0], "%p", &win) == 0) {
5151		report_count(1);
5152		report_error("BAD ARGUMENT");
5153		return;
5154	}
5155
5156	string[0] = '\0';
5157
5158	report_count(2);
5159	report_return(wgetstr(win, string));
5160	report_status(string);
5161}
5162
5163
5164void
5165cmd_whline(int nargs, char **args)
5166{
5167	WINDOW *win;
5168	int ch, count;
5169
5170	if (check_arg_count(nargs, 3) == 1)
5171		return;
5172
5173	if (sscanf(args[0], "%p", &win) == 0) {
5174		report_count(1);
5175		report_error("BAD ARGUMENT");
5176		return;
5177	}
5178
5179	if (sscanf(args[1], "%d", &ch) == 0) {
5180		report_count(1);
5181		report_error("BAD ARGUMENT");
5182		return;
5183	}
5184
5185	if (sscanf(args[2], "%d", &count) == 0) {
5186		report_count(1);
5187		report_error("BAD ARGUMENT");
5188		return;
5189	}
5190
5191	report_count(1);
5192	report_return(whline(win, ch, count));
5193}
5194
5195
5196void
5197cmd_winch(int nargs, char **args)
5198{
5199	WINDOW *win;
5200
5201	if (check_arg_count(nargs, 1) == 1)
5202		return;
5203
5204	if (sscanf(args[0], "%p", &win) == 0) {
5205		report_count(1);
5206		report_error("BAD ARGUMENT");
5207		return;
5208	}
5209
5210	report_count(1);
5211	report_int(winch(win));
5212}
5213
5214
5215void
5216cmd_winchnstr(int nargs, char **args)
5217{
5218	WINDOW *win;
5219	chtype string[256];
5220	int count;
5221
5222	if (check_arg_count(nargs, 2) == 1)
5223		return;
5224
5225	if (sscanf(args[0], "%p", &win) == 0) {
5226		report_count(1);
5227		report_error("BAD ARGUMENT");
5228		return;
5229	}
5230
5231	if (sscanf(args[1], "%d", &count) == 0) {
5232		report_count(1);
5233		report_error("BAD ARGUMENT");
5234		return;
5235	}
5236
5237	/* XXX - call2 */
5238	report_count(2);
5239	report_return(winchnstr(win, string, count));
5240	report_nstr(string);
5241}
5242
5243
5244void
5245cmd_winchstr(int nargs, char **args)
5246{
5247	WINDOW *win;
5248	chtype string[256];
5249
5250	if (check_arg_count(nargs, 1) == 1)
5251		return;
5252
5253	if (sscanf(args[0], "%p", &win) == 0) {
5254		report_count(1);
5255		report_error("BAD ARGUMENT");
5256		return;
5257	}
5258
5259	/* XXX - call2 */
5260	report_count(2);
5261	report_return(winchstr(win, string));
5262	report_nstr(string);
5263}
5264
5265
5266void
5267cmd_winnstr(int nargs, char **args)
5268{
5269	WINDOW *win;
5270	char string[256];
5271	int count;
5272
5273	if (check_arg_count(nargs, 2) == 1)
5274		return;
5275
5276	if (sscanf(args[0], "%p", &win) == 0) {
5277		report_count(1);
5278		report_error("BAD ARGUMENT");
5279		return;
5280	}
5281
5282	if (sscanf(args[1], "%d", &count) == 0) {
5283		report_count(1);
5284		report_error("BAD ARGUMENT");
5285		return;
5286	}
5287
5288	/* XXX - call2 */
5289	report_count(2);
5290	report_return(winnstr(win, string, count));
5291	report_status(string);
5292}
5293
5294
5295void
5296cmd_winsch(int nargs, char **args)
5297{
5298	WINDOW *win;
5299	int ch;
5300
5301	if (check_arg_count(nargs, 2) == 1)
5302		return;
5303
5304	if (sscanf(args[0], "%p", &win) == 0) {
5305		report_count(1);
5306		report_error("BAD ARGUMENT");
5307		return;
5308	}
5309
5310	if (sscanf(args[1], "%d", &ch) == 0) {
5311		report_count(1);
5312		report_error("BAD ARGUMENT");
5313		return;
5314	}
5315
5316	report_count(1);
5317	report_return(winsch(win, ch));
5318}
5319
5320
5321void
5322cmd_winsdelln(int nargs, char **args)
5323{
5324	WINDOW *win;
5325	int count;
5326
5327	if (check_arg_count(nargs, 2) == 1)
5328		return;
5329
5330	if (sscanf(args[0], "%p", &win) == 0) {
5331		report_count(1);
5332		report_error("BAD ARGUMENT");
5333		return;
5334	}
5335
5336	if (sscanf(args[1], "%d", &count) == 0) {
5337		report_count(1);
5338		report_error("BAD ARGUMENT");
5339		return;
5340	}
5341
5342	report_count(1);
5343	report_return(winsdelln(win, count));
5344}
5345
5346
5347void
5348cmd_winsertln(int nargs, char **args)
5349{
5350	WINDOW *win;
5351
5352	if (check_arg_count(nargs, 1) == 1)
5353		return;
5354
5355	if (sscanf(args[0], "%p", &win) == 0) {
5356		report_count(1);
5357		report_error("BAD ARGUMENT");
5358		return;
5359	}
5360
5361	report_count(1);
5362	report_return(winsertln(win));
5363}
5364
5365
5366void
5367cmd_winstr(int nargs, char **args)
5368{
5369	WINDOW *win;
5370	char string[256];
5371
5372	if (check_arg_count(nargs, 1) == 1)
5373		return;
5374
5375	if (sscanf(args[0], "%p", &win) == 0) {
5376		report_count(1);
5377		report_error("BAD ARGUMENT");
5378		return;
5379	}
5380
5381	/* XXX - call2 */
5382	report_count(2);
5383	report_return(winstr(win, string));
5384	report_status(string);
5385}
5386
5387
5388void
5389cmd_wmove(int nargs, char **args)
5390{
5391	WINDOW *win;
5392	int y, x;
5393
5394	if (check_arg_count(nargs, 3) == 1)
5395		return;
5396
5397	if (sscanf(args[0], "%p", &win) == 0) {
5398		report_count(1);
5399		report_error("BAD ARGUMENT");
5400		return;
5401	}
5402
5403	if (sscanf(args[1], "%d", &y) == 0) {
5404		report_count(1);
5405		report_error("BAD ARGUMENT");
5406		return;
5407	}
5408
5409	if (sscanf(args[2], "%d", &x) == 0) {
5410		report_count(1);
5411		report_error("BAD ARGUMENT");
5412		return;
5413	}
5414
5415	report_count(1);
5416	report_return(wmove(win, y, x));
5417}
5418
5419
5420void
5421cmd_wnoutrefresh(int nargs, char **args)
5422{
5423	WINDOW *win;
5424
5425	if (check_arg_count(nargs, 1) == 1)
5426		return;
5427
5428	if (sscanf(args[0], "%p", &win) == 0) {
5429		report_count(1);
5430		report_error("BAD ARGUMENT");
5431		return;
5432	}
5433
5434	report_count(1);
5435	report_return(wnoutrefresh(win));
5436}
5437
5438
5439void
5440cmd_wprintw(int nargs, char **args)
5441{
5442	WINDOW *win;
5443
5444	if (check_arg_count(nargs, 3) == 1)
5445		return;
5446
5447	if (sscanf(args[0], "%p", &win) == 0) {
5448		report_count(1);
5449		report_error("BAD ARGUMENT");
5450		return;
5451	}
5452
5453	report_count(1);
5454	report_return(wprintw(win, args[1], args[2]));
5455}
5456
5457
5458void
5459cmd_wredrawln(int nargs, char **args)
5460{
5461	WINDOW *win;
5462	int beg_line, num_lines;
5463
5464	if (check_arg_count(nargs, 3) == 1)
5465		return;
5466
5467	if (sscanf(args[0], "%p", &win) == 0) {
5468		report_count(1);
5469		report_error("BAD ARGUMENT");
5470		return;
5471	}
5472
5473	if (sscanf(args[1], "%d", &beg_line) == 0) {
5474		report_count(1);
5475		report_error("BAD ARGUMENT");
5476		return;
5477	}
5478
5479	if (sscanf(args[2], "%d", &num_lines) == 0) {
5480		report_count(1);
5481		report_error("BAD ARGUMENT");
5482		return;
5483	}
5484
5485	report_count(1);
5486	report_return(wredrawln(win, beg_line, num_lines));
5487}
5488
5489
5490void
5491cmd_wrefresh(int nargs, char **args)
5492{
5493	WINDOW *win;
5494
5495	if (check_arg_count(nargs, 1) == 1)
5496		return;
5497
5498	if (sscanf(args[0], "%p", &win) == 0) {
5499		report_count(1);
5500		report_error("BAD ARGUMENT");
5501		return;
5502	}
5503
5504	/* XXX - generates output */
5505	report_count(1);
5506	report_return(wrefresh(win));
5507}
5508
5509
5510void
5511cmd_wresize(int nargs, char **args)
5512{
5513	WINDOW *win;
5514	int lines, cols;
5515
5516	if (check_arg_count(nargs, 3) == 1)
5517		return;
5518
5519	if (sscanf(args[0], "%p", &win) == 0) {
5520		report_count(1);
5521		report_error("BAD ARGUMENT");
5522		return;
5523	}
5524
5525	if (sscanf(args[1], "%d", &lines) == 0) {
5526		report_count(1);
5527		report_error("BAD ARGUMENT");
5528		return;
5529	}
5530
5531	if (sscanf(args[2], "%d", &cols) == 0) {
5532		report_count(1);
5533		report_error("BAD ARGUMENT");
5534		return;
5535	}
5536
5537	report_count(1);
5538	report_return(wresize(win, lines, cols));
5539}
5540
5541
5542void
5543cmd_wscanw(int nargs, char **args)
5544{
5545	WINDOW *win;
5546	char string[256];
5547
5548	if (check_arg_count(nargs, 2) == 1)
5549		return;
5550
5551	if (sscanf(args[0], "%p", &win) == 0) {
5552		report_count(1);
5553		report_error("BAD ARGUMENT");
5554		return;
5555	}
5556
5557	report_count(1);
5558	report_return(wscanw(win, args[1], &string));
5559}
5560
5561
5562void
5563cmd_wscrl(int nargs, char **args)
5564{
5565	WINDOW *win;
5566	int n;
5567
5568	if (check_arg_count(nargs, 2) == 1)
5569		return;
5570
5571	if (sscanf(args[0], "%p", &win) == 0) {
5572		report_count(1);
5573		report_error("BAD ARGUMENT");
5574		return;
5575	}
5576
5577	if (sscanf(args[1], "%d", &n) == 0) {
5578		report_count(1);
5579		report_error("BAD ARGUMENT");
5580		return;
5581	}
5582
5583	report_count(1);
5584	report_return(wscrl(win, n));
5585}
5586
5587
5588void
5589cmd_wsetscrreg(int nargs, char **args)
5590{
5591	WINDOW *win;
5592	int top, bottom;
5593
5594	if (check_arg_count(nargs, 3) == 1)
5595		return;
5596
5597	if (sscanf(args[0], "%p", &win) == 0) {
5598		report_count(1);
5599		report_error("BAD ARGUMENT");
5600		return;
5601	}
5602
5603	if (sscanf(args[1], "%d", &top) == 0) {
5604		report_count(1);
5605		report_error("BAD ARGUMENT");
5606		return;
5607	}
5608
5609	if (sscanf(args[2], "%d", &bottom) == 0) {
5610		report_count(1);
5611		report_error("BAD ARGUMENT");
5612		return;
5613	}
5614
5615	report_count(1);
5616	report_return(wsetscrreg(win, top, bottom));
5617}
5618
5619
5620void
5621cmd_wstandend(int nargs, char **args)
5622{
5623	WINDOW *win;
5624
5625	if (check_arg_count(nargs, 1) == 1)
5626		return;
5627
5628	if (sscanf(args[0], "%p", &win) == 0) {
5629		report_count(1);
5630		report_error("BAD ARGUMENT");
5631		return;
5632	}
5633
5634	report_count(1);
5635	report_return(wstandend(win));
5636}
5637
5638
5639void
5640cmd_wstandout(int nargs, char **args)
5641{
5642	WINDOW *win;
5643
5644	if (check_arg_count(nargs, 1) == 1)
5645		return;
5646
5647	if (sscanf(args[0], "%p", &win) == 0) {
5648		report_count(1);
5649		report_error("BAD ARGUMENT");
5650		return;
5651	}
5652
5653	report_count(1);
5654	report_return(wstandout(win));
5655}
5656
5657
5658void
5659cmd_wtimeout(int nargs, char **args)
5660{
5661	WINDOW *win;
5662	int tval;
5663
5664	if (check_arg_count(nargs, 2) == 1)
5665		return;
5666
5667	if (sscanf(args[0], "%p", &win) == 0) {
5668		report_count(1);
5669		report_error("BAD ARGUMENT");
5670		return;
5671	}
5672
5673	if (sscanf(args[1], "%d", &tval) == 0) {
5674		report_count(1);
5675		report_error("BAD ARGUMENT");
5676		return;
5677	}
5678
5679	wtimeout(win, tval); /* void return */
5680	report_count(1);
5681	report_return(OK);
5682}
5683
5684
5685void
5686cmd_wtouchln(int nargs, char **args)
5687{
5688	WINDOW *win;
5689	int line, n, changed;
5690
5691	if (check_arg_count(nargs, 4) == 1)
5692		return;
5693
5694	if (sscanf(args[0], "%p", &win) == 0) {
5695		report_count(1);
5696		report_error("BAD ARGUMENT");
5697		return;
5698	}
5699
5700	if (sscanf(args[1], "%d", &line) == 0) {
5701		report_count(1);
5702		report_error("BAD ARGUMENT");
5703		return;
5704	}
5705
5706	if (sscanf(args[2], "%d", &n) == 0) {
5707		report_count(1);
5708		report_error("BAD ARGUMENT");
5709		return;
5710	}
5711
5712	if (sscanf(args[3], "%d", &changed) == 0) {
5713		report_count(1);
5714		report_error("BAD ARGUMENT");
5715		return;
5716	}
5717
5718	report_count(1);
5719	report_return(wtouchln(win, line, n, changed));
5720}
5721
5722
5723void
5724cmd_wunderend(int nargs, char **args)
5725{
5726	WINDOW *win;
5727
5728	if (check_arg_count(nargs, 1) == 1)
5729		return;
5730
5731	if (sscanf(args[0], "%p", &win) == 0) {
5732		report_count(1);
5733		report_error("BAD ARGUMENT");
5734		return;
5735	}
5736
5737	report_count(1);
5738	report_return(wunderend(win));
5739}
5740
5741
5742void
5743cmd_wunderscore(int nargs, char **args)
5744{
5745	WINDOW *win;
5746
5747	if (check_arg_count(nargs, 1) == 1)
5748		return;
5749
5750	if (sscanf(args[0], "%p", &win) == 0) {
5751		report_count(1);
5752		report_error("BAD ARGUMENT");
5753		return;
5754	}
5755
5756	report_count(1);
5757	report_return(wunderscore(win));
5758}
5759
5760
5761void
5762cmd_wvline(int nargs, char **args)
5763{
5764	WINDOW *win;
5765	int ch, n;
5766
5767	if (check_arg_count(nargs, 3) == 1)
5768		return;
5769
5770	if (sscanf(args[0], "%p", &win) == 0) {
5771		report_count(1);
5772		report_error("BAD ARGUMENT");
5773		return;
5774	}
5775
5776	if (sscanf(args[1], "%d", &ch) == 0) {
5777		report_count(1);
5778		report_error("BAD ARGUMENT");
5779		return;
5780	}
5781
5782	if (sscanf(args[2], "%d", &n) == 0) {
5783		report_count(1);
5784		report_error("BAD ARGUMENT");
5785		return;
5786	}
5787
5788	report_count(1);
5789	report_return(wvline(win, ch, n));
5790}
5791
5792
5793void
5794cmd_insnstr(int nargs, char **args)
5795{
5796	int n;
5797
5798	if (check_arg_count(nargs, 2) == 1)
5799		return;
5800
5801	if (sscanf(args[1], "%d", &n) == 0) {
5802		report_count(1);
5803		report_error("BAD ARGUMENT");
5804		return;
5805	}
5806
5807	report_count(1);
5808	report_return(insnstr(args[0], n));
5809}
5810
5811
5812void
5813cmd_insstr(int nargs, char **args)
5814{
5815	if (check_arg_count(nargs, 1) == 1)
5816		return;
5817
5818	report_count(1);
5819	report_return(insstr(args[0]));
5820}
5821
5822
5823void
5824cmd_mvinsnstr(int nargs, char **args)
5825{
5826	int y, x, n;
5827
5828	if (check_arg_count(nargs, 4) == 1)
5829		return;
5830
5831	if (sscanf(args[0], "%d", &y) == 0) {
5832		report_count(1);
5833		report_error("BAD ARGUMENT");
5834		return;
5835	}
5836
5837	if (sscanf(args[1], "%d", &x) == 0) {
5838		report_count(1);
5839		report_error("BAD ARGUMENT");
5840		return;
5841	}
5842
5843	if (sscanf(args[3], "%d", &n) == 0) {
5844		report_count(1);
5845		report_error("BAD ARGUMENT");
5846		return;
5847	}
5848
5849	report_count(1);
5850	report_return(mvinsnstr(y, x, args[2], n));
5851}
5852
5853
5854void
5855cmd_mvinsstr(int nargs, char **args)
5856{
5857	int y, x;
5858
5859	if (check_arg_count(nargs, 3) == 1)
5860		return;
5861
5862	if (sscanf(args[0], "%d", &y) == 0) {
5863		report_count(1);
5864		report_error("BAD ARGUMENT");
5865		return;
5866	}
5867
5868	if (sscanf(args[1], "%d", &x) == 0) {
5869		report_count(1);
5870		report_error("BAD ARGUMENT");
5871		return;
5872	}
5873
5874	report_count(1);
5875	report_return(mvinsstr(y, x, args[2]));
5876}
5877
5878
5879void
5880cmd_mvwinsnstr(int nargs, char **args)
5881{
5882	WINDOW *win;
5883	int y, x, n;
5884
5885	if (check_arg_count(nargs, 5) == 1)
5886		return;
5887
5888	if (sscanf(args[0], "%p", &win) == 0) {
5889		report_count(1);
5890		report_error("BAD ARGUMENT");
5891		return;
5892	}
5893
5894	if (sscanf(args[1], "%d", &y) == 0) {
5895		report_count(1);
5896		report_error("BAD ARGUMENT");
5897		return;
5898	}
5899
5900	if (sscanf(args[2], "%d", &x) == 0) {
5901		report_count(1);
5902		report_error("BAD ARGUMENT");
5903		return;
5904	}
5905
5906	if (sscanf(args[4], "%d", &n) == 0) {
5907		report_count(1);
5908		report_error("BAD ARGUMENT");
5909		return;
5910	}
5911
5912	report_count(1);
5913	report_return(mvwinsnstr(win, y, x, args[3], n));
5914
5915}
5916
5917
5918void
5919cmd_mvwinsstr(int nargs, char **args)
5920{
5921	WINDOW *win;
5922	int y, x;
5923
5924	if (check_arg_count(nargs, 4) == 1)
5925		return;
5926
5927	if (sscanf(args[0], "%p", &win) == 0) {
5928		report_count(1);
5929		report_error("BAD ARGUMENT");
5930		return;
5931	}
5932
5933	if (sscanf(args[1], "%d", &y) == 0) {
5934		report_count(1);
5935		report_error("BAD ARGUMENT");
5936		return;
5937	}
5938
5939	if (sscanf(args[2], "%d", &x) == 0) {
5940		report_count(1);
5941		report_error("BAD ARGUMENT");
5942		return;
5943	}
5944
5945	report_count(1);
5946	report_return(mvwinsstr(win, y, x, args[3]));
5947}
5948
5949
5950void
5951cmd_winsnstr(int nargs, char **args)
5952{
5953	WINDOW *win;
5954	int n;
5955
5956	if (check_arg_count(nargs, 3) == 1)
5957		return;
5958
5959	if (sscanf(args[0], "%p", &win) == 0) {
5960		report_count(1);
5961		report_error("BAD ARGUMENT");
5962		return;
5963	}
5964
5965	if (sscanf(args[2], "%d", &n) == 0) {
5966		report_count(1);
5967		report_error("BAD ARGUMENT");
5968		return;
5969	}
5970
5971	report_count(1);
5972	report_return(winsnstr(win, args[1], n));
5973}
5974
5975
5976void
5977cmd_winsstr(int nargs, char **args)
5978{
5979	WINDOW *win;
5980
5981	if (check_arg_count(nargs, 2) == 1)
5982		return;
5983
5984	if (sscanf(args[0], "%p", &win) == 0) {
5985		report_count(1);
5986		report_error("BAD ARGUMENT");
5987		return;
5988	}
5989
5990	report_count(1);
5991	report_return(winsstr(win, args[1]));
5992}
5993
5994
5995
5996void
5997cmd_chgat(int nargs, char **args)
5998{
5999	int n, attr, colour;
6000
6001	if (check_arg_count(nargs, 4) == 1)
6002		return;
6003
6004	if (sscanf(args[0], "%d", &n) == 0) {
6005		report_count(1);
6006		report_error("BAD ARGUMENT");
6007		return;
6008	}
6009
6010	if (sscanf(args[1], "%d", &attr) == 0) {
6011		report_count(1);
6012		report_error("BAD ARGUMENT");
6013		return;
6014	}
6015
6016	if (sscanf(args[2], "%d", &colour) == 0) {
6017		report_count(1);
6018		report_error("BAD ARGUMENT");
6019		return;
6020	}
6021
6022	/* Note: 4th argument unused in current curses implementation */
6023	report_count(1);
6024	report_return(chgat(n, attr, colour, NULL));
6025}
6026
6027
6028void
6029cmd_wchgat(int nargs, char **args)
6030{
6031	WINDOW *win;
6032	int n, attr;
6033	short colour;
6034
6035	if (check_arg_count(nargs, 4) == 1)
6036		return;
6037
6038	if (sscanf(args[0], "%p", &win) == 0) {
6039		report_count(1);
6040		report_error("BAD ARGUMENT");
6041		return;
6042	}
6043
6044	if (sscanf(args[1], "%d", &n) == 0) {
6045		report_count(1);
6046		report_error("BAD ARGUMENT");
6047		return;
6048	}
6049
6050	if (sscanf(args[2], "%d", &attr) == 0) {
6051		report_count(1);
6052		report_error("BAD ARGUMENT");
6053		return;
6054	}
6055
6056	if (sscanf(args[3], "%hd", &colour) == 0) {
6057		report_count(1);
6058		report_error("BAD ARGUMENT");
6059		return;
6060	}
6061
6062	report_count(1);
6063	report_return(wchgat(win, n, attr, colour, NULL));
6064}
6065
6066
6067void
6068cmd_mvchgat(int nargs, char **args)
6069{
6070	int y, x, n, attr;
6071	short colour;
6072
6073	if (check_arg_count(nargs, 6) == 1)
6074		return;
6075
6076	if (sscanf(args[0], "%d", &y) == 0) {
6077		report_count(1);
6078		report_error("BAD ARGUMENT");
6079		return;
6080	}
6081
6082	if (sscanf(args[1], "%d", &x) == 0) {
6083		report_count(1);
6084		report_error("BAD ARGUMENT");
6085		return;
6086	}
6087
6088	if (sscanf(args[2], "%d", &n) == 0) {
6089		report_count(1);
6090		report_error("BAD ARGUMENT");
6091		return;
6092	}
6093
6094	if (sscanf(args[3], "%d", &attr) == 0) {
6095		report_count(1);
6096		report_error("BAD ARGUMENT");
6097		return;
6098	}
6099
6100	if (sscanf(args[4], "%hd", &colour) == 0) {
6101		report_count(1);
6102		report_error("BAD ARGUMENT");
6103		return;
6104	}
6105
6106	report_count(1);
6107	report_return(mvchgat(y, x, n, attr, colour, NULL));
6108}
6109
6110
6111void
6112cmd_mvwchgat(int nargs, char **args)
6113{
6114	WINDOW *win;
6115	int y, x, n, attr, colour;
6116
6117	if (check_arg_count(nargs, 6) == 1)
6118		return;
6119
6120	if (sscanf(args[0], "%p", &win) == 0) {
6121		report_count(1);
6122		report_error("BAD ARGUMENT");
6123		return;
6124	}
6125
6126	if (sscanf(args[1], "%d", &y) == 0) {
6127		report_count(1);
6128		report_error("BAD ARGUMENT");
6129		return;
6130	}
6131
6132	if (sscanf(args[2], "%d", &x) == 0) {
6133		report_count(1);
6134		report_error("BAD ARGUMENT");
6135		return;
6136	}
6137
6138	if (sscanf(args[3], "%d", &n) == 0) {
6139		report_count(1);
6140		report_error("BAD ARGUMENT");
6141		return;
6142	}
6143
6144	if (sscanf(args[4], "%d", &attr) == 0) {
6145		report_count(1);
6146		report_error("BAD ARGUMENT");
6147		return;
6148	}
6149
6150	if (sscanf(args[5], "%d", &colour) == 0) {
6151		report_count(1);
6152		report_error("BAD ARGUMENT");
6153		return;
6154	}
6155
6156	report_count(1);
6157	report_return(mvwchgat(win, y, x, n, attr, colour, NULL));
6158}
6159
6160
6161void
6162cmd_add_wch(int nargs, char **args)
6163{
6164	if (check_arg_count(nargs, 1) == 1)
6165		return;
6166
6167	report_count(1);
6168	report_error("UNSUPPORTED");
6169}
6170
6171
6172void
6173cmd_wadd_wch(int nargs, char **args)
6174{
6175	if (check_arg_count(nargs, 1) == 1)
6176		return;
6177
6178	report_count(1);
6179	report_error("UNSUPPORTED");
6180}
6181
6182
6183void
6184cmd_mvadd_wch(int nargs, char **args)
6185{
6186	if (check_arg_count(nargs, 1) == 1)
6187		return;
6188
6189	report_count(1);
6190	report_error("UNSUPPORTED");
6191}
6192
6193
6194void
6195cmd_mvwadd_wch(int nargs, char **args)
6196{
6197	if (check_arg_count(nargs, 1) == 1)
6198		return;
6199
6200	report_count(1);
6201	report_error("UNSUPPORTED");
6202}
6203
6204
6205
6206void
6207cmd_add_wchnstr(int nargs, char **args)
6208{
6209	if (check_arg_count(nargs, 1) == 1)
6210		return;
6211
6212	report_count(1);
6213	report_error("UNSUPPORTED");
6214}
6215
6216
6217void
6218cmd_add_wchstr(int nargs, char **args)
6219{
6220	if (check_arg_count(nargs, 1) == 1)
6221		return;
6222
6223	report_count(1);
6224	report_error("UNSUPPORTED");
6225}
6226
6227
6228void
6229cmd_wadd_wchnstr(int nargs, char **args)
6230{
6231	if (check_arg_count(nargs, 1) == 1)
6232		return;
6233
6234	report_count(1);
6235	report_error("UNSUPPORTED");
6236}
6237
6238
6239void
6240cmd_wadd_wchstr(int nargs, char **args)
6241{
6242	if (check_arg_count(nargs, 1) == 1)
6243		return;
6244
6245	report_count(1);
6246	report_error("UNSUPPORTED");
6247}
6248
6249
6250void
6251cmd_mvadd_wchnstr(int nargs, char **args)
6252{
6253	if (check_arg_count(nargs, 1) == 1)
6254		return;
6255
6256	report_count(1);
6257	report_error("UNSUPPORTED");
6258}
6259
6260
6261void
6262cmd_mvadd_wchstr(int nargs, char **args)
6263{
6264	if (check_arg_count(nargs, 1) == 1)
6265		return;
6266
6267	report_count(1);
6268	report_error("UNSUPPORTED");
6269}
6270
6271
6272void
6273cmd_mvwadd_wchnstr(int nargs, char **args)
6274{
6275	if (check_arg_count(nargs, 1) == 1)
6276		return;
6277
6278	report_count(1);
6279	report_error("UNSUPPORTED");
6280}
6281
6282
6283void
6284cmd_mvwadd_wchstr(int nargs, char **args)
6285{
6286	if (check_arg_count(nargs, 1) == 1)
6287		return;
6288
6289	report_count(1);
6290	report_error("UNSUPPORTED");
6291}
6292
6293
6294
6295void
6296cmd_addnwstr(int nargs, char **args)
6297{
6298	if (check_arg_count(nargs, 1) == 1)
6299		return;
6300
6301	report_count(1);
6302	report_error("UNSUPPORTED");
6303}
6304
6305
6306void
6307cmd_addwstr(int nargs, char **args)
6308{
6309	if (check_arg_count(nargs, 1) == 1)
6310		return;
6311
6312	report_count(1);
6313	report_error("UNSUPPORTED");
6314}
6315
6316
6317void
6318cmd_mvaddnwstr(int nargs, char **args)
6319{
6320	if (check_arg_count(nargs, 1) == 1)
6321		return;
6322
6323	report_count(1);
6324	report_error("UNSUPPORTED");
6325}
6326
6327
6328void
6329cmd_mvaddwstr(int nargs, char **args)
6330{
6331	if (check_arg_count(nargs, 1) == 1)
6332		return;
6333
6334	report_count(1);
6335	report_error("UNSUPPORTED");
6336}
6337
6338
6339void
6340cmd_mvwaddnwstr(int nargs, char **args)
6341{
6342	if (check_arg_count(nargs, 1) == 1)
6343		return;
6344
6345	report_count(1);
6346	report_error("UNSUPPORTED");
6347}
6348
6349
6350void
6351cmd_mvwaddwstr(int nargs, char **args)
6352{
6353	if (check_arg_count(nargs, 1) == 1)
6354		return;
6355
6356	report_count(1);
6357	report_error("UNSUPPORTED");
6358}
6359
6360
6361void
6362cmd_waddnwstr(int nargs, char **args)
6363{
6364	if (check_arg_count(nargs, 1) == 1)
6365		return;
6366
6367	report_count(1);
6368	report_error("UNSUPPORTED");
6369}
6370
6371
6372void
6373cmd_waddwstr(int nargs, char **args)
6374{
6375	if (check_arg_count(nargs, 1) == 1)
6376		return;
6377
6378	report_count(1);
6379	report_error("UNSUPPORTED");
6380}
6381
6382
6383
6384void
6385cmd_echo_wchar(int nargs, char **args)
6386{
6387	if (check_arg_count(nargs, 1) == 1)
6388		return;
6389
6390	report_count(1);
6391	report_error("UNSUPPORTED");
6392}
6393
6394
6395void
6396cmd_wecho_wchar(int nargs, char **args)
6397{
6398	if (check_arg_count(nargs, 1) == 1)
6399		return;
6400
6401	report_count(1);
6402	report_error("UNSUPPORTED");
6403}
6404
6405
6406void
6407cmd_pecho_wchar(int nargs, char **args)
6408{
6409	if (check_arg_count(nargs, 1) == 1)
6410		return;
6411
6412	report_count(1);
6413	report_error("UNSUPPORTED");
6414}
6415
6416
6417
6418/* insert */
6419void
6420cmd_ins_wch(int nargs, char **args)
6421{
6422	if (check_arg_count(nargs, 1) == 1)
6423		return;
6424
6425	report_count(1);
6426	report_error("UNSUPPORTED");
6427}
6428
6429
6430void
6431cmd_wins_wch(int nargs, char **args)
6432{
6433	if (check_arg_count(nargs, 1) == 1)
6434		return;
6435
6436	report_count(1);
6437	report_error("UNSUPPORTED");
6438}
6439
6440
6441void
6442cmd_mvins_wch(int nargs, char **args)
6443{
6444	if (check_arg_count(nargs, 1) == 1)
6445		return;
6446
6447	report_count(1);
6448	report_error("UNSUPPORTED");
6449}
6450
6451
6452void
6453cmd_mvwins_wch(int nargs, char **args)
6454{
6455	if (check_arg_count(nargs, 1) == 1)
6456		return;
6457
6458	report_count(1);
6459	report_error("UNSUPPORTED");
6460}
6461
6462
6463
6464void
6465cmd_ins_nwstr(int nargs, char **args)
6466{
6467	if (check_arg_count(nargs, 1) == 1)
6468		return;
6469
6470	report_count(1);
6471	report_error("UNSUPPORTED");
6472}
6473
6474
6475void
6476cmd_ins_wstr(int nargs, char **args)
6477{
6478	if (check_arg_count(nargs, 1) == 1)
6479		return;
6480
6481	report_count(1);
6482	report_error("UNSUPPORTED");
6483}
6484
6485
6486void
6487cmd_mvins_nwstr(int nargs, char **args)
6488{
6489	if (check_arg_count(nargs, 1) == 1)
6490		return;
6491
6492	report_count(1);
6493	report_error("UNSUPPORTED");
6494}
6495
6496
6497void
6498cmd_mvins_wstr(int nargs, char **args)
6499{
6500	if (check_arg_count(nargs, 1) == 1)
6501		return;
6502
6503	report_count(1);
6504	report_error("UNSUPPORTED");
6505}
6506
6507
6508void
6509cmd_mvwins_nwstr(int nargs, char **args)
6510{
6511	if (check_arg_count(nargs, 1) == 1)
6512		return;
6513
6514	report_count(1);
6515	report_error("UNSUPPORTED");
6516}
6517
6518
6519void
6520cmd_mvwins_wstr(int nargs, char **args)
6521{
6522	if (check_arg_count(nargs, 1) == 1)
6523		return;
6524
6525	report_count(1);
6526	report_error("UNSUPPORTED");
6527}
6528
6529
6530void
6531cmd_wins_nwstr(int nargs, char **args)
6532{
6533	if (check_arg_count(nargs, 1) == 1)
6534		return;
6535
6536	report_count(1);
6537	report_error("UNSUPPORTED");
6538}
6539
6540
6541void
6542cmd_wins_wstr(int nargs, char **args)
6543{
6544	if (check_arg_count(nargs, 1) == 1)
6545		return;
6546
6547	report_count(1);
6548	report_error("UNSUPPORTED");
6549}
6550
6551
6552
6553/* input */
6554void
6555cmd_get_wch(int nargs, char **args)
6556{
6557	if (check_arg_count(nargs, 1) == 1)
6558		return;
6559
6560	report_count(1);
6561	report_error("UNSUPPORTED");
6562}
6563
6564
6565void
6566cmd_unget_wch(int nargs, char **args)
6567{
6568	if (check_arg_count(nargs, 1) == 1)
6569		return;
6570
6571	report_count(1);
6572	report_error("UNSUPPORTED");
6573}
6574
6575
6576void
6577cmd_mvget_wch(int nargs, char **args)
6578{
6579	if (check_arg_count(nargs, 1) == 1)
6580		return;
6581
6582	report_count(1);
6583	report_error("UNSUPPORTED");
6584}
6585
6586
6587void
6588cmd_mvwget_wch(int nargs, char **args)
6589{
6590	if (check_arg_count(nargs, 1) == 1)
6591		return;
6592
6593	report_count(1);
6594	report_error("UNSUPPORTED");
6595}
6596
6597
6598void
6599cmd_wget_wch(int nargs, char **args)
6600{
6601	if (check_arg_count(nargs, 1) == 1)
6602		return;
6603
6604	report_count(1);
6605	report_error("UNSUPPORTED");
6606}
6607
6608
6609
6610void
6611cmd_getn_wstr(int nargs, char **args)
6612{
6613	if (check_arg_count(nargs, 1) == 1)
6614		return;
6615
6616	report_count(1);
6617	report_error("UNSUPPORTED");
6618}
6619
6620
6621void
6622cmd_get_wstr(int nargs, char **args)
6623{
6624	if (check_arg_count(nargs, 1) == 1)
6625		return;
6626
6627	report_count(1);
6628	report_error("UNSUPPORTED");
6629}
6630
6631
6632void
6633cmd_mvgetn_wstr(int nargs, char **args)
6634{
6635	if (check_arg_count(nargs, 1) == 1)
6636		return;
6637
6638	report_count(1);
6639	report_error("UNSUPPORTED");
6640}
6641
6642
6643void
6644cmd_mvget_wstr(int nargs, char **args)
6645{
6646	if (check_arg_count(nargs, 1) == 1)
6647		return;
6648
6649	report_count(1);
6650	report_error("UNSUPPORTED");
6651}
6652
6653
6654void
6655cmd_mvwgetn_wstr(int nargs, char **args)
6656{
6657	if (check_arg_count(nargs, 1) == 1)
6658		return;
6659
6660	report_count(1);
6661	report_error("UNSUPPORTED");
6662}
6663
6664
6665void
6666cmd_mvwget_wstr(int nargs, char **args)
6667{
6668	if (check_arg_count(nargs, 1) == 1)
6669		return;
6670
6671	report_count(1);
6672	report_error("UNSUPPORTED");
6673}
6674
6675
6676void
6677cmd_wgetn_wstr(int nargs, char **args)
6678{
6679	if (check_arg_count(nargs, 1) == 1)
6680		return;
6681
6682	report_count(1);
6683	report_error("UNSUPPORTED");
6684}
6685
6686
6687void
6688cmd_wget_wstr(int nargs, char **args)
6689{
6690	if (check_arg_count(nargs, 1) == 1)
6691		return;
6692
6693	report_count(1);
6694	report_error("UNSUPPORTED");
6695}
6696
6697
6698
6699void
6700cmd_in_wch(int nargs, char **args)
6701{
6702	if (check_arg_count(nargs, 1) == 1)
6703		return;
6704
6705	report_count(1);
6706	report_error("UNSUPPORTED");
6707}
6708
6709
6710void
6711cmd_mvin_wch(int nargs, char **args)
6712{
6713	if (check_arg_count(nargs, 1) == 1)
6714		return;
6715
6716	report_count(1);
6717	report_error("UNSUPPORTED");
6718}
6719
6720
6721void
6722cmd_mvwin_wch(int nargs, char **args)
6723{
6724	if (check_arg_count(nargs, 1) == 1)
6725		return;
6726
6727	report_count(1);
6728	report_error("UNSUPPORTED");
6729}
6730
6731
6732void
6733cmd_win_wch(int nargs, char **args)
6734{
6735	if (check_arg_count(nargs, 1) == 1)
6736		return;
6737
6738	report_count(1);
6739	report_error("UNSUPPORTED");
6740}
6741
6742
6743
6744void
6745cmd_in_wchnstr(int nargs, char **args)
6746{
6747	if (check_arg_count(nargs, 1) == 1)
6748		return;
6749
6750	report_count(1);
6751	report_error("UNSUPPORTED");
6752}
6753
6754
6755void
6756cmd_in_wchstr(int nargs, char **args)
6757{
6758	if (check_arg_count(nargs, 1) == 1)
6759		return;
6760
6761	report_count(1);
6762	report_error("UNSUPPORTED");
6763}
6764
6765
6766void
6767cmd_mvin_wchnstr(int nargs, char **args)
6768{
6769	if (check_arg_count(nargs, 1) == 1)
6770		return;
6771
6772	report_count(1);
6773	report_error("UNSUPPORTED");
6774}
6775
6776
6777void
6778cmd_mvin_wchstr(int nargs, char **args)
6779{
6780	if (check_arg_count(nargs, 1) == 1)
6781		return;
6782
6783	report_count(1);
6784	report_error("UNSUPPORTED");
6785}
6786
6787
6788void
6789cmd_mvwin_wchnstr(int nargs, char **args)
6790{
6791	if (check_arg_count(nargs, 1) == 1)
6792		return;
6793
6794	report_count(1);
6795	report_error("UNSUPPORTED");
6796}
6797
6798
6799void
6800cmd_mvwin_wchstr(int nargs, char **args)
6801{
6802	if (check_arg_count(nargs, 1) == 1)
6803		return;
6804
6805	report_count(1);
6806	report_error("UNSUPPORTED");
6807}
6808
6809
6810void
6811cmd_win_wchnstr(int nargs, char **args)
6812{
6813	if (check_arg_count(nargs, 1) == 1)
6814		return;
6815
6816	report_count(1);
6817	report_error("UNSUPPORTED");
6818}
6819
6820
6821void
6822cmd_win_wchstr(int nargs, char **args)
6823{
6824	if (check_arg_count(nargs, 1) == 1)
6825		return;
6826
6827	report_count(1);
6828	report_error("UNSUPPORTED");
6829}
6830
6831
6832
6833void
6834cmd_innwstr(int nargs, char **args)
6835{
6836	if (check_arg_count(nargs, 1) == 1)
6837		return;
6838
6839	report_count(1);
6840	report_error("UNSUPPORTED");
6841}
6842
6843
6844void
6845cmd_inwstr(int nargs, char **args)
6846{
6847	if (check_arg_count(nargs, 1) == 1)
6848		return;
6849
6850	report_count(1);
6851	report_error("UNSUPPORTED");
6852}
6853
6854
6855void
6856cmd_mvinnwstr(int nargs, char **args)
6857{
6858	if (check_arg_count(nargs, 1) == 1)
6859		return;
6860
6861	report_count(1);
6862	report_error("UNSUPPORTED");
6863}
6864
6865
6866void
6867cmd_mvinwstr(int nargs, char **args)
6868{
6869	if (check_arg_count(nargs, 1) == 1)
6870		return;
6871
6872	report_count(1);
6873	report_error("UNSUPPORTED");
6874}
6875
6876
6877void
6878cmd_mvwinnwstr(int nargs, char **args)
6879{
6880	if (check_arg_count(nargs, 1) == 1)
6881		return;
6882
6883	report_count(1);
6884	report_error("UNSUPPORTED");
6885}
6886
6887
6888void
6889cmd_mvwinwstr(int nargs, char **args)
6890{
6891	if (check_arg_count(nargs, 1) == 1)
6892		return;
6893
6894	report_count(1);
6895	report_error("UNSUPPORTED");
6896}
6897
6898
6899void
6900cmd_winnwstr(int nargs, char **args)
6901{
6902	if (check_arg_count(nargs, 1) == 1)
6903		return;
6904
6905	report_count(1);
6906	report_error("UNSUPPORTED");
6907}
6908
6909
6910void
6911cmd_winwstr(int nargs, char **args)
6912{
6913	if (check_arg_count(nargs, 1) == 1)
6914		return;
6915
6916	report_count(1);
6917	report_error("UNSUPPORTED");
6918}
6919
6920
6921
6922/* cchar handlgin */
6923void
6924cmd_setcchar(int nargs, char **args)
6925{
6926	if (check_arg_count(nargs, 1) == 1)
6927		return;
6928
6929	report_count(1);
6930	report_error("UNSUPPORTED");
6931}
6932
6933
6934void
6935cmd_getcchar(int nargs, char **args)
6936{
6937	if (check_arg_count(nargs, 1) == 1)
6938		return;
6939
6940	report_count(1);
6941	report_error("UNSUPPORTED");
6942}
6943
6944
6945
6946/* misc */
6947void
6948cmd_key_name(int nargs, char **args)
6949{
6950	int w;
6951
6952	if (check_arg_count(nargs, 1) == 1)
6953		return;
6954
6955	if (sscanf(args[0], "%d", &w) == 0) {
6956		report_count(1);
6957		report_error("BAD ARGUMENT");
6958		return;
6959	}
6960
6961	report_count(1);
6962	report_status(key_name(w));
6963}
6964
6965
6966void
6967cmd_border_set(int nargs, char **args)
6968{
6969	if (check_arg_count(nargs, 1) == 1)
6970		return;
6971
6972	report_count(1);
6973	report_error("UNSUPPORTED");
6974}
6975
6976
6977void
6978cmd_wborder_set(int nargs, char **args)
6979{
6980	if (check_arg_count(nargs, 1) == 1)
6981		return;
6982
6983	report_count(1);
6984	report_error("UNSUPPORTED");
6985}
6986
6987
6988void
6989cmd_box_set(int nargs, char **args)
6990{
6991	if (check_arg_count(nargs, 1) == 1)
6992		return;
6993
6994	report_count(1);
6995	report_error("UNSUPPORTED");
6996}
6997
6998
6999void
7000cmd_erasewchar(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
7014void
7015cmd_killwchar(int nargs, char **args)
7016{
7017	wchar_t ch;
7018
7019	if (check_arg_count(nargs, 0) == 1)
7020		return;
7021
7022	/* XXX - call2 */
7023	report_count(2);
7024	report_return(erasewchar(&ch));
7025	report_int(ch);
7026}
7027
7028
7029void
7030cmd_hline_set(int nargs, char **args)
7031{
7032	if (check_arg_count(nargs, 1) == 1)
7033		return;
7034
7035	report_count(1);
7036	report_error("UNSUPPORTED");
7037}
7038
7039
7040void
7041cmd_mvhline_set(int nargs, char **args)
7042{
7043	if (check_arg_count(nargs, 1) == 1)
7044		return;
7045
7046	report_count(1);
7047	report_error("UNSUPPORTED");
7048}
7049
7050
7051void
7052cmd_mvvline_set(int nargs, char **args)
7053{
7054	if (check_arg_count(nargs, 1) == 1)
7055		return;
7056
7057	report_count(1);
7058	report_error("UNSUPPORTED");
7059}
7060
7061
7062void
7063cmd_mvwhline_set(int nargs, char **args)
7064{
7065	if (check_arg_count(nargs, 1) == 1)
7066		return;
7067
7068	report_count(1);
7069	report_error("UNSUPPORTED");
7070}
7071
7072
7073void
7074cmd_mvwvline_set(int nargs, char **args)
7075{
7076	if (check_arg_count(nargs, 1) == 1)
7077		return;
7078
7079	report_count(1);
7080	report_error("UNSUPPORTED");
7081}
7082
7083
7084void
7085cmd_vline_set(int nargs, char **args)
7086{
7087	if (check_arg_count(nargs, 1) == 1)
7088		return;
7089
7090	report_count(1);
7091	report_error("UNSUPPORTED");
7092}
7093
7094
7095void
7096cmd_whline_set(int nargs, char **args)
7097{
7098	if (check_arg_count(nargs, 1) == 1)
7099		return;
7100
7101	report_count(1);
7102	report_error("UNSUPPORTED");
7103}
7104
7105
7106void
7107cmd_wvline_set(int nargs, char **args)
7108{
7109	if (check_arg_count(nargs, 1) == 1)
7110		return;
7111
7112	report_count(1);
7113	report_error("UNSUPPORTED");
7114}
7115
7116
7117void
7118cmd_bkgrnd(int nargs, char **args)
7119{
7120	if (check_arg_count(nargs, 1) == 1)
7121		return;
7122
7123	report_count(1);
7124	report_error("UNSUPPORTED");
7125}
7126
7127
7128void
7129cmd_bkgrndset(int nargs, char **args)
7130{
7131	if (check_arg_count(nargs, 1) == 1)
7132		return;
7133
7134	report_count(1);
7135	report_error("UNSUPPORTED");
7136}
7137
7138
7139void
7140cmd_getbkgrnd(int nargs, char **args)
7141{
7142	if (check_arg_count(nargs, 1) == 1)
7143		return;
7144
7145	report_count(1);
7146	report_error("UNSUPPORTED");
7147}
7148
7149
7150void
7151cmd_wbkgrnd(int nargs, char **args)
7152{
7153	if (check_arg_count(nargs, 1) == 1)
7154		return;
7155
7156	report_count(1);
7157	report_error("UNSUPPORTED");
7158}
7159
7160
7161void
7162cmd_wbkgrndset(int nargs, char **args)
7163{
7164	if (check_arg_count(nargs, 1) == 1)
7165		return;
7166
7167	report_count(1);
7168	report_error("UNSUPPORTED");
7169}
7170
7171
7172void
7173cmd_wgetbkgrnd(int nargs, char **args)
7174{
7175	if (check_arg_count(nargs, 1) == 1)
7176		return;
7177
7178	report_count(1);
7179	report_error("UNSUPPORTED");
7180}
7181