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