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