curses_commands.c revision 1.21 1 /* $NetBSD: curses_commands.c,v 1.21 2021/02/12 20:45:00 rillig 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 without 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 int
43 set_int(char *arg, int *x)
44 {
45 if (sscanf(arg, "%d", x) == 0) {
46 report_count(1);
47 report_error("BAD ARGUMENT");
48 return -1;
49 }
50
51 return 0;
52 }
53
54 int
55 set_uint(char *arg, unsigned int *x)
56 {
57 if (sscanf(arg, "%u", x) == 0) {
58 report_count(1);
59 report_error("BAD ARGUMENT");
60 return -1;
61 }
62
63 return 0;
64 }
65
66 int
67 set_short(char *arg, short *x)
68 {
69 if (sscanf(arg, "%hd", x) == 0) {
70 report_count(1);
71 report_error("BAD ARGUMENT");
72 return -1;
73 }
74
75 return 0;
76 }
77
78 int
79 set_win(char *arg, WINDOW **x)
80 {
81 if (sscanf(arg, "%p", x) == 0) {
82 report_count(1);
83 report_error("BAD ARGUMENT");
84 return -1;
85 }
86
87 return 0;
88 }
89
90 int
91 set_scrn(char *arg, SCREEN **x)
92 {
93 if (sscanf(arg, "%p", x) == 0) {
94 report_count(1);
95 report_error("BAD ARGUMENT");
96 return -1;
97 }
98
99 return 0;
100 }
101
102 #define ARGC(n) \
103 if (check_arg_count(nargs, n) == 1) \
104 return
105
106 #define ARG_SHORT(i, arg) \
107 short arg; \
108 if (set_short(args[i], &arg) != 0) \
109 return
110
111 #define ARG_INT(i, arg) \
112 int arg; \
113 if (set_int(args[i], &arg) != 0) \
114 return
115
116 #define ARG_UINT(i, arg) \
117 unsigned int arg; \
118 if (set_uint(args[i], &arg) != 0) \
119 return
120
121 #define ARG_CHTYPE(i, arg) \
122 chtype arg = ((const chtype *)args[i])[0]
123
124 #define ARG_WCHAR(i, arg) \
125 wchar_t arg = ((const wchar_t *)args[i])[0]
126
127 #define ARG_STRING(i, arg) \
128 const char *arg = args[i]
129
130 /* Only used for legacy interfaces that are missing the 'const'. */
131 #define ARG_MODIFIABLE_STRING(i, arg) \
132 char *arg = args[i]
133
134 #define ARG_CHTYPE_STRING(i, arg) \
135 const chtype *arg = (const chtype *)args[i]
136
137 #define ARG_CCHAR_STRING(i, arg) \
138 const cchar_t *arg = (const cchar_t *)args[i]
139
140 #define ARG_WCHAR_STRING(i, arg) \
141 wchar_t *arg = (wchar_t *)args[i]
142
143 #define ARG_WINDOW(i, arg) \
144 WINDOW *arg; \
145 if (set_win(args[i], &arg) != 0) \
146 return
147
148 #define ARG_SCREEN(i, arg) \
149 SCREEN *arg; \
150 if (set_scrn(args[i], &arg) != 0) \
151 return
152
153 /*
154 * Required by the API, intended for future extensions, but this
155 * implementation does not support the extension.
156 */
157 #define ARG_NULL(i) \
158 (void)0
159
160 #define ARG_IGNORE(i) \
161 (void)0
162
163 void
164 cmd_DRAIN(int nargs, char **args)
165 {
166 ARGC(1);
167 ARG_WINDOW(0, win);
168
169 while (wgetch(win) != ERR);
170 report_count(1);
171 report_return(OK);
172 }
173
174 void
175 cmd_addbytes(int nargs, char **args)
176 {
177 ARGC(2);
178 ARG_STRING(0, str);
179 ARG_INT(1, count);
180
181 report_count(1);
182 report_return(addbytes(str, count));
183 }
184
185
186 void
187 cmd_addch(int nargs, char **args)
188 {
189 ARGC(1);
190 ARG_CHTYPE(0, ch);
191
192 report_count(1);
193 report_return(addch(ch));
194 }
195
196
197 void
198 cmd_addchnstr(int nargs, char **args)
199 {
200 ARGC(2);
201 ARG_CHTYPE_STRING(0, chstr);
202 ARG_INT(1, count);
203
204 report_count(1);
205 report_return(addchnstr(chstr, count));
206 }
207
208
209 void
210 cmd_addchstr(int nargs, char **args)
211 {
212 ARGC(1);
213 ARG_CHTYPE_STRING(0, chstr);
214
215 report_count(1);
216 report_return(addchstr(chstr));
217 }
218
219
220 void
221 cmd_addnstr(int nargs, char **args)
222 {
223 ARGC(2);
224 ARG_STRING(0, str);
225 ARG_INT(1, count);
226
227 report_count(1);
228 report_return(addnstr(str, count));
229 }
230
231
232 void
233 cmd_addstr(int nargs, char **args)
234 {
235 ARGC(1);
236 ARG_STRING(0, str);
237
238 report_count(1);
239 report_return(addstr(str));
240 }
241
242
243 void
244 cmd_attr_get(int nargs, char **args)
245 {
246 attr_t attrs;
247 short colours;
248 int retval;
249
250 ARGC(0);
251
252 retval = attr_get(&attrs, &colours, NULL);
253
254 report_count(3);
255 report_return(retval);
256 report_int(attrs);
257 report_int(colours);
258 }
259
260
261 void
262 cmd_attr_off(int nargs, char **args)
263 {
264 ARGC(1);
265 ARG_INT(0, attrib);
266
267 report_count(1);
268 report_return(attr_off(attrib, NULL));
269 }
270
271
272 void
273 cmd_attr_on(int nargs, char **args)
274 {
275 ARGC(1);
276 ARG_INT(0, attrib);
277
278 report_count(1);
279 report_return(attr_on(attrib, NULL));
280 }
281
282
283 void
284 cmd_attr_set(int nargs, char **args)
285 {
286 ARGC(2);
287 ARG_INT(0, attrib);
288 ARG_SHORT(1, pair);
289
290 report_count(1);
291 report_return(attr_set(attrib, pair, NULL));
292 }
293
294
295 void
296 cmd_attroff(int nargs, char **args)
297 {
298 ARGC(1);
299 ARG_INT(0, attrib);
300
301 report_count(1);
302 report_return(attroff(attrib));
303 }
304
305
306 void
307 cmd_attron(int nargs, char **args)
308 {
309 ARGC(1);
310 ARG_INT(0, attrib);
311
312 report_count(1);
313 report_return(attron(attrib));
314 }
315
316
317 void
318 cmd_attrset(int nargs, char **args)
319 {
320 ARGC(1);
321 ARG_INT(0, attrib);
322
323 report_count(1);
324 report_return(attrset(attrib));
325 }
326
327
328 void
329 cmd_bkgd(int nargs, char **args)
330 {
331 ARGC(1);
332 ARG_CHTYPE(0, ch);
333
334 report_count(1);
335 report_return(bkgd(ch));
336 }
337
338
339 void
340 cmd_bkgdset(int nargs, char **args)
341 {
342 ARGC(1);
343 ARG_CHTYPE(0, ch);
344
345 bkgdset(ch); /* returns void */
346 report_count(1);
347 report_return(OK);
348 }
349
350
351 void
352 cmd_border(int nargs, char **args)
353 {
354 ARGC(8);
355 ARG_INT(0, ls);
356 ARG_INT(1, rs);
357 ARG_INT(2, ts);
358 ARG_INT(3, bs);
359 ARG_INT(4, tl);
360 ARG_INT(5, tr);
361 ARG_INT(6, bl);
362 ARG_INT(7, br);
363
364 report_count(1);
365 report_return(border(ls, rs, ts, bs, tl, tr, bl, br));
366 }
367
368
369 void
370 cmd_clear(int nargs, char **args)
371 {
372 ARGC(0);
373
374 report_count(1);
375 report_return(clear());
376 }
377
378
379 void
380 cmd_clrtobot(int nargs, char **args)
381 {
382 ARGC(0);
383
384 report_count(1);
385 report_return(clrtobot());
386 }
387
388
389 void
390 cmd_clrtoeol(int nargs, char **args)
391 {
392 ARGC(0);
393
394 report_count(1);
395 report_return(clrtoeol());
396 }
397
398
399 void
400 cmd_color_set(int nargs, char **args)
401 {
402 ARGC(2);
403 ARG_SHORT(0, colour_pair);
404 ARG_NULL(1);
405
406 report_count(1);
407 report_return(color_set(colour_pair, NULL));
408 }
409
410
411 void
412 cmd_delch(int nargs, char **args)
413 {
414 ARGC(0);
415
416 report_count(1);
417 report_return(delch());
418 }
419
420
421 void
422 cmd_deleteln(int nargs, char **args)
423 {
424 ARGC(0);
425
426 report_count(1);
427 report_return(deleteln());
428 }
429
430
431 void
432 cmd_echochar(int nargs, char **args)
433 {
434 ARGC(1);
435 ARG_CHTYPE(0, ch);
436
437 /* XXX causes refresh */
438 report_count(1);
439 report_return(echochar(ch));
440 }
441
442
443 void
444 cmd_erase(int nargs, char **args)
445 {
446 ARGC(0);
447
448 report_count(1);
449 report_return(erase());
450 }
451
452
453 void
454 cmd_getch(int nargs, char **args)
455 {
456 ARGC(0);
457
458 /* XXX causes refresh */
459 report_count(1);
460 report_int(getch());
461 }
462
463
464 void
465 cmd_getnstr(int nargs, char **args)
466 {
467 char *string;
468
469 ARGC(1);
470 ARG_INT(0, limit);
471
472 if ((string = malloc(limit + 1)) == NULL) {
473 report_count(1);
474 report_error("MALLOC_FAILED");
475 return;
476 }
477
478 report_count(2);
479 report_return(getnstr(string, limit));
480 report_status(string);
481 free(string);
482 }
483
484
485 void
486 cmd_getstr(int nargs, char **args)
487 {
488 char string[256];
489
490 ARGC(0);
491
492 report_count(2);
493 report_return(getstr(string));
494 report_status(string);
495 }
496
497
498 void
499 cmd_inch(int nargs, char **args)
500 {
501 ARGC(0);
502
503 report_count(1);
504 report_byte(inch());
505 }
506
507
508 void
509 cmd_inchnstr(int nargs, char **args)
510 {
511 chtype *string;
512
513 ARGC(1);
514 ARG_INT(0, limit);
515
516 if ((string = malloc((limit + 1) * sizeof(chtype))) == NULL) {
517 report_count(1);
518 report_error("MALLOC_FAILED");
519 return;
520 }
521
522 report_count(2);
523 report_return(inchnstr(string, limit));
524 report_nstr(string);
525 free(string);
526 }
527
528
529 void
530 cmd_inchstr(int nargs, char **args)
531 {
532 chtype string[256];
533
534 ARGC(0);
535
536 report_count(2);
537 report_return(inchstr(string));
538 report_nstr(string);
539 }
540
541
542 void
543 cmd_innstr(int nargs, char **args)
544 {
545 char *string;
546
547 ARGC(1);
548 ARG_INT(0, limit);
549
550 if ((string = malloc(limit + 1)) == NULL) {
551 report_count(1);
552 report_error("MALLOC_FAILED");
553 return;
554 }
555
556 report_count(2);
557 report_int(innstr(string, limit));
558 report_status(string);
559 free(string);
560 }
561
562
563 void
564 cmd_insch(int nargs, char **args)
565 {
566 ARGC(1);
567 ARG_CHTYPE(0, ch);
568
569 report_count(1);
570 report_return(insch(ch));
571 }
572
573
574 void
575 cmd_insdelln(int nargs, char **args)
576 {
577 ARGC(1);
578 ARG_INT(0, nlines);
579
580 report_count(1);
581 report_return(insdelln(nlines));
582 }
583
584
585 void
586 cmd_insertln(int nargs, char **args)
587 {
588 ARGC(0);
589
590 report_count(1);
591 report_return(insertln());
592 }
593
594
595 void
596 cmd_instr(int nargs, char **args)
597 {
598 char string[256];
599
600 ARGC(0);
601
602 report_count(2);
603 report_return(instr(string));
604 report_status(string);
605 }
606
607
608 void
609 cmd_move(int nargs, char **args)
610 {
611 ARGC(2);
612 ARG_INT(0, y);
613 ARG_INT(1, x);
614
615 report_count(1);
616 report_return(move(y, x));
617 }
618
619
620 void
621 cmd_refresh(int nargs, char **args)
622 {
623 ARGC(0);
624
625 report_count(1);
626 report_return(refresh());
627 }
628
629
630 void
631 cmd_scrl(int nargs, char **args)
632 {
633 ARGC(1);
634 ARG_INT(0, nlines);
635
636 report_count(1);
637 report_return(scrl(nlines));
638 }
639
640
641 void
642 cmd_setscrreg(int nargs, char **args)
643 {
644 ARGC(2);
645 ARG_INT(0, top);
646 ARG_INT(1, bottom);
647
648 report_count(1);
649 report_return(setscrreg(top, bottom));
650 }
651
652
653 void
654 cmd_standend(int nargs, char **args)
655 {
656 ARGC(0);
657
658 report_count(1);
659 report_int(standend());
660 }
661
662
663 void
664 cmd_standout(int nargs, char **args)
665 {
666 ARGC(0);
667
668 report_count(1);
669 report_int(standout());
670 }
671
672
673 void
674 cmd_timeout(int nargs, char **args)
675 {
676 ARGC(1);
677 ARG_INT(0, tval);
678
679 timeout(tval); /* void return */
680 report_count(1);
681 report_return(OK);
682 }
683
684
685 void
686 cmd_underscore(int nargs, char **args)
687 {
688 ARGC(0);
689
690 report_count(1);
691 report_int(underscore());
692 }
693
694
695 void
696 cmd_underend(int nargs, char **args)
697 {
698 ARGC(0);
699
700 report_count(1);
701 report_int(underend());
702 }
703
704
705 void
706 cmd_waddbytes(int nargs, char **args)
707 {
708 ARGC(3);
709 ARG_WINDOW(0, win);
710 ARG_STRING(1, str);
711 ARG_INT(2, count);
712
713 report_count(1);
714 report_return(waddbytes(win, str, count));
715 }
716
717
718 void
719 cmd_waddstr(int nargs, char **args)
720 {
721 ARGC(2);
722 ARG_WINDOW(0, win);
723 ARG_STRING(1, str);
724
725 report_count(1);
726 report_return(waddstr(win, str));
727 }
728
729
730 void
731 cmd_mvaddbytes(int nargs, char **args)
732 {
733 ARGC(4);
734 ARG_INT(0, y);
735 ARG_INT(1, x);
736 ARG_STRING(2, str);
737 ARG_INT(3, count);
738
739 report_count(1);
740 report_return(mvaddbytes(y, x, str, count));
741 }
742
743
744 void
745 cmd_mvaddch(int nargs, char **args)
746 {
747 ARGC(3);
748 ARG_INT(0, y);
749 ARG_INT(1, x);
750 ARG_CHTYPE(2, ch);
751
752 report_count(1);
753 report_return(mvaddch(y, x, ch));
754 }
755
756
757 void
758 cmd_mvaddchnstr(int nargs, char **args)
759 {
760 ARGC(4);
761 ARG_INT(0, y);
762 ARG_INT(1, x);
763 ARG_CHTYPE_STRING(2, chstr);
764 ARG_INT(3, count);
765
766 report_count(1);
767 report_return(mvaddchnstr(y, x, chstr, count));
768 }
769
770
771 void
772 cmd_mvaddchstr(int nargs, char **args)
773 {
774 ARGC(3);
775 ARG_INT(0, y);
776 ARG_INT(1, x);
777 ARG_CHTYPE_STRING(2, chstr);
778
779 report_count(1);
780 report_return(mvaddchstr(y, x, chstr));
781 }
782
783
784 void
785 cmd_mvaddnstr(int nargs, char **args)
786 {
787 ARGC(4);
788 ARG_INT(0, y);
789 ARG_INT(1, x);
790 ARG_STRING(2, str);
791 ARG_INT(3, count);
792
793 report_count(1);
794 report_return(mvaddnstr(y, x, str, count));
795 }
796
797
798 void
799 cmd_mvaddstr(int nargs, char **args)
800 {
801 ARGC(3);
802 ARG_INT(0, y);
803 ARG_INT(1, x);
804 ARG_STRING(2, str);
805
806 report_count(1);
807 report_return(mvaddstr(y, x, str));
808 }
809
810
811 void
812 cmd_mvdelch(int nargs, char **args)
813 {
814 ARGC(2);
815 ARG_INT(0, y);
816 ARG_INT(1, x);
817
818 report_count(1);
819 report_return(mvdelch(y, x));
820 }
821
822
823 void
824 cmd_mvgetch(int nargs, char **args)
825 {
826 ARGC(2);
827 ARG_INT(0, y);
828 ARG_INT(1, x);
829
830 report_count(1);
831 report_int(mvgetch(y, x));
832 }
833
834
835 void
836 cmd_mvgetnstr(int nargs, char **args)
837 {
838 char *string;
839
840 ARGC(3);
841 ARG_INT(0, y);
842 ARG_INT(1, x);
843 ARG_INT(2, count);
844
845 if ((string = malloc(count + 1)) == NULL) {
846 report_count(1);
847 report_error("MALLOC_FAILED");
848 return;
849 }
850
851 report_count(2);
852 report_return(mvgetnstr(y, x, string, count));
853 report_status(string);
854 free(string);
855 }
856
857
858 void
859 cmd_mvgetstr(int nargs, char **args)
860 {
861 char string[256];
862
863 ARGC(2);
864 ARG_INT(0, y);
865 ARG_INT(1, x);
866
867 report_count(2);
868 report_return(mvgetstr(y, x, string));
869 report_status(string);
870 }
871
872
873 void
874 cmd_mvinch(int nargs, char **args)
875 {
876 ARGC(2);
877 ARG_INT(0, y);
878 ARG_INT(1, x);
879
880 report_count(1);
881 report_byte(mvinch(y, x));
882 }
883
884
885 void
886 cmd_mvinchnstr(int nargs, char **args)
887 {
888 chtype *string;
889
890 ARGC(3);
891 ARG_INT(0, y);
892 ARG_INT(1, x);
893 ARG_INT(2, count);
894
895 if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
896 report_count(1);
897 report_error("MALLOC_FAILED");
898 return;
899 }
900
901 report_count(2);
902 report_return(mvinchnstr(y, x, string, count));
903 report_nstr(string);
904 free(string);
905 }
906
907
908 void
909 cmd_mvinchstr(int nargs, char **args)
910 {
911 chtype string[256];
912
913 ARGC(2);
914 ARG_INT(0, y);
915 ARG_INT(1, x);
916
917 report_count(2);
918 report_return(mvinchstr(y, x, string));
919 report_nstr(string);
920 }
921
922
923 void
924 cmd_mvinnstr(int nargs, char **args)
925 {
926 char *string;
927
928 ARGC(3);
929 ARG_INT(0, y);
930 ARG_INT(1, x);
931 ARG_INT(2, count);
932
933 if ((string = malloc(count + 1)) == NULL) {
934 report_count(1);
935 report_error("MALLOC_FAILED");
936 return;
937 }
938
939 report_count(2);
940 report_int(mvinnstr(y, x, string, count));
941 report_status(string);
942 free(string);
943 }
944
945
946 void
947 cmd_mvinsch(int nargs, char **args)
948 {
949 ARGC(3);
950 ARG_INT(0, y);
951 ARG_INT(1, x);
952 ARG_CHTYPE(2, ch);
953
954 report_count(1);
955 report_return(mvinsch(y, x, ch));
956 }
957
958
959 void
960 cmd_mvinstr(int nargs, char **args)
961 {
962 char string[256];
963
964 ARGC(2);
965 ARG_INT(0, y);
966 ARG_INT(1, x);
967
968 report_count(2);
969 report_return(mvinstr(y, x, string));
970 report_status(string);
971 }
972
973
974 void
975 cmd_mvwaddbytes(int nargs, char **args)
976 {
977 ARGC(5);
978 ARG_WINDOW(0, win);
979 ARG_INT(1, y);
980 ARG_INT(2, x);
981 ARG_STRING(3, str);
982 ARG_INT(4, count);
983
984 report_count(1);
985 report_return(mvwaddbytes(win, y, x, str, count));
986 }
987
988
989 void
990 cmd_mvwaddch(int nargs, char **args)
991 {
992 ARGC(4);
993 ARG_WINDOW(0, win);
994 ARG_INT(1, y);
995 ARG_INT(2, x);
996 ARG_CHTYPE(3, ch);
997
998 report_count(1);
999 report_return(mvwaddch(win, y, x, ch));
1000 }
1001
1002
1003 void
1004 cmd_mvwaddchnstr(int nargs, char **args)
1005 {
1006 ARGC(5);
1007 ARG_WINDOW(0, win);
1008 ARG_INT(1, y);
1009 ARG_INT(2, x);
1010 ARG_CHTYPE_STRING(3, chstr);
1011 ARG_INT(4, count);
1012
1013 report_count(1);
1014 report_return(mvwaddchnstr(win, y, x, chstr, count));
1015 }
1016
1017
1018 void
1019 cmd_mvwaddchstr(int nargs, char **args)
1020 {
1021 ARGC(4);
1022 ARG_WINDOW(0, win);
1023 ARG_INT(1, y);
1024 ARG_INT(2, x);
1025 ARG_CHTYPE_STRING(3, chstr);
1026
1027 report_count(1);
1028 report_return(mvwaddchstr(win, y, x, chstr));
1029 }
1030
1031
1032 void
1033 cmd_mvwaddnstr(int nargs, char **args)
1034 {
1035 ARGC(5);
1036 ARG_WINDOW(0, win);
1037 ARG_INT(1, y);
1038 ARG_INT(2, x);
1039 ARG_STRING(3, str);
1040 ARG_INT(4, count);
1041
1042 report_count(1);
1043 report_return(mvwaddnstr(win, y, x, str, count));
1044 }
1045
1046
1047 void
1048 cmd_mvwaddstr(int nargs, char **args)
1049 {
1050 ARGC(4);
1051 ARG_WINDOW(0, win);
1052 ARG_INT(1, y);
1053 ARG_INT(2, x);
1054 ARG_STRING(3, str);
1055
1056 report_count(1);
1057 report_return(mvwaddstr(win, y, x, str));
1058 }
1059
1060
1061 void
1062 cmd_mvwdelch(int nargs, char **args)
1063 {
1064 ARGC(3);
1065 ARG_WINDOW(0, win);
1066 ARG_INT(1, y);
1067 ARG_INT(2, x);
1068
1069 report_count(1);
1070 report_return(mvwdelch(win, y, x));
1071 }
1072
1073
1074 void
1075 cmd_mvwgetch(int nargs, char **args)
1076 {
1077 ARGC(3);
1078 ARG_WINDOW(0, win);
1079 ARG_INT(1, y);
1080 ARG_INT(2, x);
1081
1082 /* XXX - implicit refresh */
1083 report_count(1);
1084 report_int(mvwgetch(win, y, x));
1085 }
1086
1087
1088 void
1089 cmd_mvwgetnstr(int nargs, char **args)
1090 {
1091 char *string;
1092
1093 ARGC(4);
1094 ARG_WINDOW(0, win);
1095 ARG_INT(1, y);
1096 ARG_INT(2, x);
1097 ARG_INT(3, count);
1098
1099 if ((string = malloc(count + 1)) == NULL) {
1100 report_count(1);
1101 report_error("MALLOC_FAILED");
1102 return;
1103 }
1104
1105 report_count(2);
1106 report_return(mvwgetnstr(win, y, x, string, count));
1107 report_status(string);
1108 free(string);
1109 }
1110
1111
1112 void
1113 cmd_mvwgetstr(int nargs, char **args)
1114 {
1115 char string[256];
1116
1117 ARGC(3);
1118 ARG_WINDOW(0, win);
1119 ARG_INT(1, y);
1120 ARG_INT(2, x);
1121
1122 report_count(2);
1123 report_return(mvwgetstr(win, y, x, string));
1124 report_status(string);
1125 }
1126
1127
1128 void
1129 cmd_mvwinch(int nargs, char **args)
1130 {
1131 ARGC(3);
1132 ARG_WINDOW(0, win);
1133 ARG_INT(1, y);
1134 ARG_INT(2, x);
1135
1136 report_count(1);
1137 report_byte(mvwinch(win, y, x));
1138 }
1139
1140
1141 void
1142 cmd_mvwinsch(int nargs, char **args)
1143 {
1144 ARGC(4);
1145 ARG_WINDOW(0, win);
1146 ARG_INT(1, y);
1147 ARG_INT(2, x);
1148 ARG_CHTYPE(3, ch);
1149
1150 report_count(1);
1151 report_return(mvwinsch(win, y, x, ch));
1152 }
1153
1154
1155 void
1156 cmd_assume_default_colors(int nargs, char **args)
1157 {
1158 ARGC(2);
1159 ARG_SHORT(0, fore);
1160 ARG_SHORT(1, back);
1161
1162 report_count(1);
1163 report_return(assume_default_colors(fore, back));
1164 }
1165
1166
1167 void
1168 cmd_baudrate(int nargs, char **args)
1169 {
1170 ARGC(0);
1171
1172 report_count(1);
1173 report_int(baudrate());
1174 }
1175
1176
1177 void
1178 cmd_beep(int nargs, char **args)
1179 {
1180 ARGC(0);
1181
1182 report_count(1);
1183 report_return(beep());
1184 }
1185
1186
1187 void
1188 cmd_box(int nargs, char **args)
1189 {
1190 ARGC(3);
1191 ARG_WINDOW(0, win);
1192 ARG_CHTYPE(1, vertical);
1193 ARG_CHTYPE(2, horizontal);
1194
1195 report_count(1);
1196 report_return(box(win, vertical, horizontal));
1197 }
1198
1199
1200 void
1201 cmd_can_change_color(int nargs, char **args)
1202 {
1203 ARGC(0);
1204
1205 report_count(1);
1206 report_int(can_change_color());
1207 }
1208
1209
1210 void
1211 cmd_cbreak(int nargs, char **args)
1212 {
1213 ARGC(0);
1214
1215 report_count(1);
1216 report_return(cbreak());
1217 }
1218
1219
1220 void
1221 cmd_clearok(int nargs, char **args)
1222 {
1223 ARGC(2);
1224 ARG_WINDOW(0, win);
1225 ARG_INT(1, flag);
1226
1227 report_count(1);
1228 report_return(clearok(win, flag));
1229 }
1230
1231
1232 void
1233 cmd_color_content(int nargs, char **args)
1234 {
1235 ARGC(1);
1236 ARG_SHORT(0, colour);
1237
1238 short red, green, blue;
1239 int ret = color_content(colour, &red, &green, &blue);
1240
1241 report_count(4);
1242 report_return(ret);
1243 report_int(red);
1244 report_int(green);
1245 report_int(blue);
1246 }
1247
1248
1249 void
1250 cmd_copywin(int nargs, char **args)
1251 {
1252 ARGC(9);
1253 ARG_WINDOW(0, source);
1254 ARG_WINDOW(1, destination);
1255 ARG_INT(2, sminrow);
1256 ARG_INT(3, smincol);
1257 ARG_INT(4, dminrow);
1258 ARG_INT(5, dmincol);
1259 ARG_INT(6, dmaxrow);
1260 ARG_INT(7, dmaxcol);
1261 ARG_INT(8, ovlay);
1262
1263 report_count(1);
1264 report_return(copywin(source, destination, sminrow, smincol, dminrow,
1265 dmincol, dmaxrow, dmaxcol, ovlay));
1266 }
1267
1268
1269 void
1270 cmd_curs_set(int nargs, char **args)
1271 {
1272 ARGC(1);
1273 ARG_INT(0, vis);
1274
1275 report_count(1);
1276 report_int(curs_set(vis));
1277 }
1278
1279
1280 void
1281 cmd_def_prog_mode(int nargs, char **args)
1282 {
1283 ARGC(0);
1284
1285 report_count(1);
1286 report_return(def_prog_mode());
1287 }
1288
1289
1290 void
1291 cmd_def_shell_mode(int nargs, char **args)
1292 {
1293 ARGC(0);
1294
1295 report_count(1);
1296 report_return(def_shell_mode());
1297 }
1298
1299
1300 void
1301 cmd_define_key(int nargs, char **args)
1302 {
1303 ARGC(2);
1304 ARG_MODIFIABLE_STRING(0, sequence);
1305 ARG_INT(1, symbol);
1306
1307 report_count(1);
1308 report_return(define_key(sequence, symbol));
1309 }
1310
1311
1312 void
1313 cmd_delay_output(int nargs, char **args)
1314 {
1315 ARGC(1);
1316 ARG_INT(0, dtime);
1317
1318 report_count(1);
1319 report_return(delay_output(dtime));
1320 }
1321
1322
1323 void
1324 cmd_delscreen(int nargs, char **args)
1325 {
1326 ARGC(1);
1327 ARG_SCREEN(0, scrn);
1328
1329 delscreen(scrn); /* void return */
1330
1331 report_count(1);
1332 report_return(OK);
1333 }
1334
1335
1336 void
1337 cmd_delwin(int nargs, char **args)
1338 {
1339 ARGC(1);
1340 ARG_WINDOW(0, win);
1341
1342 report_count(1);
1343 report_return(delwin(win));
1344 }
1345
1346
1347 void
1348 cmd_derwin(int nargs, char **args)
1349 {
1350 ARGC(5);
1351 ARG_WINDOW(0, win);
1352 ARG_INT(1, lines);
1353 ARG_INT(2, cols);
1354 ARG_INT(3, y);
1355 ARG_INT(4, x);
1356
1357 report_count(1);
1358 report_ptr(derwin(win, lines, cols, y, x));
1359 }
1360
1361
1362 void
1363 cmd_dupwin(int nargs, char **args)
1364 {
1365 ARGC(1);
1366 ARG_WINDOW(0, win);
1367
1368 report_count(1);
1369 report_ptr(dupwin(win));
1370 }
1371
1372
1373 void
1374 cmd_doupdate(int nargs, char **args)
1375 {
1376 ARGC(0);
1377
1378 /* XXX - implicit refresh */
1379 report_count(1);
1380 report_return(doupdate());
1381 }
1382
1383
1384 void
1385 cmd_echo(int nargs, char **args)
1386 {
1387 ARGC(0);
1388
1389 report_count(1);
1390 report_return(echo());
1391 }
1392
1393
1394 void
1395 cmd_endwin(int nargs, char **args)
1396 {
1397 ARGC(0);
1398
1399 report_count(1);
1400 report_return(endwin());
1401 }
1402
1403
1404 void
1405 cmd_erasechar(int nargs, char **args)
1406 {
1407 ARGC(0);
1408
1409 report_count(1);
1410 report_int(erasechar());
1411 }
1412
1413
1414 void
1415 cmd_flash(int nargs, char **args)
1416 {
1417 ARGC(0);
1418
1419 report_count(1);
1420 report_return(flash());
1421 }
1422
1423
1424 void
1425 cmd_flushinp(int nargs, char **args)
1426 {
1427 ARGC(0);
1428
1429 report_count(1);
1430 report_return(flushinp());
1431 }
1432
1433
1434 void
1435 cmd_flushok(int nargs, char **args)
1436 {
1437 ARGC(2);
1438 ARG_WINDOW(0, win);
1439 ARG_INT(1, flag);
1440
1441 report_count(1);
1442 report_return(flushok(win, flag));
1443 }
1444
1445
1446 void
1447 cmd_fullname(int nargs, char **args)
1448 {
1449 char string[256];
1450
1451 ARGC(1);
1452 ARG_STRING(0, termbuf);
1453
1454 report_count(2);
1455 report_status(fullname(termbuf, string));
1456 report_status(string);
1457 }
1458
1459
1460 void
1461 cmd_getattrs(int nargs, char **args)
1462 {
1463 ARGC(1);
1464 ARG_WINDOW(0, win);
1465
1466 report_count(1);
1467 report_int(getattrs(win));
1468 }
1469
1470
1471 void
1472 cmd_getbkgd(int nargs, char **args)
1473 {
1474 ARGC(1);
1475 ARG_WINDOW(0, win);
1476
1477 report_count(1);
1478 report_byte(getbkgd(win));
1479 }
1480
1481
1482 void
1483 cmd_getcury(int nargs, char **args)
1484 {
1485 ARGC(1);
1486 ARG_WINDOW(0, win);
1487
1488 report_count(1);
1489 report_int(getcury(win));
1490 }
1491
1492
1493 void
1494 cmd_getcurx(int nargs, char **args)
1495 {
1496 ARGC(1);
1497 ARG_WINDOW(0, win);
1498
1499 report_count(1);
1500 report_int(getcurx(win));
1501 }
1502
1503
1504 void
1505 cmd_getyx(int nargs, char **args)
1506 {
1507 ARGC(1);
1508 ARG_WINDOW(0, win);
1509
1510 int y, x;
1511 getyx(win, y, x);
1512 report_count(2);
1513 report_int(y);
1514 report_int(x);
1515 }
1516
1517
1518 void
1519 cmd_getbegy(int nargs, char **args)
1520 {
1521 ARGC(1);
1522 ARG_WINDOW(0, win);
1523
1524 report_count(1);
1525 report_int(getbegy(win));
1526 }
1527
1528
1529 void
1530 cmd_getbegx(int nargs, char **args)
1531 {
1532 ARGC(1);
1533 ARG_WINDOW(0, win);
1534
1535 report_count(1);
1536 report_int(getbegx(win));
1537 }
1538
1539
1540 void
1541 cmd_getmaxy(int nargs, char **args)
1542 {
1543 ARGC(1);
1544 ARG_WINDOW(0, win);
1545
1546 report_count(1);
1547 report_int(getmaxy(win));
1548 }
1549
1550
1551 void
1552 cmd_getmaxx(int nargs, char **args)
1553 {
1554 ARGC(1);
1555 ARG_WINDOW(0, win);
1556
1557 report_count(1);
1558 report_int(getmaxx(win));
1559 }
1560
1561
1562 void
1563 cmd_getpary(int nargs, char **args)
1564 {
1565 ARGC(1);
1566 ARG_WINDOW(0, win);
1567
1568 report_count(1);
1569 report_int(getpary(win));
1570 }
1571
1572
1573 void
1574 cmd_getparx(int nargs, char **args)
1575 {
1576 ARGC(1);
1577 ARG_WINDOW(0, win);
1578
1579 report_count(1);
1580 report_int(getparx(win));
1581 }
1582
1583
1584 void
1585 cmd_getparyx(int nargs, char **args)
1586 {
1587 ARGC(1);
1588 ARG_WINDOW(0, win);
1589
1590 int y, x;
1591 report_count(2);
1592 getparyx(win, y, x);
1593 report_int(y);
1594 report_int(x);
1595 }
1596
1597 void
1598 cmd_getmaxyx(int nargs, char **args)
1599 {
1600 ARGC(1);
1601 ARG_WINDOW(0, win);
1602
1603 int y, x;
1604 getmaxyx(win, y, x);
1605
1606 report_count(2);
1607 report_int(y);
1608 report_int(x);
1609 }
1610
1611 void
1612 cmd_getbegyx(int nargs, char **args)
1613 {
1614 ARGC(1);
1615 ARG_WINDOW(0, win);
1616
1617 int y, x;
1618 getbegyx(win, y, x);
1619
1620 report_count(2);
1621 report_int(y);
1622 report_int(x);
1623 }
1624
1625 void
1626 cmd_setsyx(int nargs, char **args)
1627 {
1628 ARGC(2);
1629 ARG_INT(0, y);
1630 ARG_INT(1, x);
1631
1632 report_count(1);
1633 setsyx(y, x);
1634 report_return(OK);
1635 }
1636
1637 void
1638 cmd_getsyx(int nargs, char **args)
1639 {
1640 int y, x;
1641
1642 ARGC(0);
1643
1644 report_count(3);
1645 getsyx(y, x);
1646 report_return(OK);
1647 report_int(y);
1648 report_int(x);
1649 }
1650
1651 void
1652 cmd_gettmode(int nargs, char **args)
1653 {
1654 ARGC(0);
1655
1656 report_count(1);
1657 report_return(gettmode());
1658 }
1659
1660
1661 void
1662 cmd_getwin(int nargs, char **args)
1663 {
1664 FILE *fp;
1665
1666 ARGC(1);
1667 ARG_STRING(0, filename);
1668
1669 if ((fp = fopen(filename, "r")) == NULL) {
1670 report_count(1);
1671 report_error("BAD FILE_ARGUMENT");
1672 return;
1673 }
1674 report_count(1);
1675 report_ptr(getwin(fp));
1676 fclose(fp);
1677 }
1678
1679
1680 void
1681 cmd_halfdelay(int nargs, char **args)
1682 {
1683 ARGC(1);
1684 ARG_INT(0, ms);
1685
1686 report_count(1);
1687 report_return(halfdelay(ms));
1688 }
1689
1690
1691 void
1692 cmd_has_colors(int nargs, char **args)
1693 {
1694 ARGC(0);
1695
1696 report_count(1);
1697 report_int(has_colors());
1698 }
1699
1700
1701 void
1702 cmd_has_ic(int nargs, char **args)
1703 {
1704 ARGC(0);
1705
1706 report_count(1);
1707 report_int(has_ic());
1708 }
1709
1710
1711 void
1712 cmd_has_il(int nargs, char **args)
1713 {
1714 ARGC(0);
1715
1716 report_count(1);
1717 report_int(has_il());
1718 }
1719
1720
1721 void
1722 cmd_hline(int nargs, char **args)
1723 {
1724 ARGC(2);
1725 ARG_CHTYPE(0, ch);
1726 ARG_INT(1, count);
1727
1728 report_count(1);
1729 report_return(hline(ch, count));
1730 }
1731
1732
1733 void
1734 cmd_idcok(int nargs, char **args)
1735 {
1736 ARGC(2);
1737 ARG_WINDOW(0, win);
1738 ARG_INT(1, flag);
1739
1740 report_count(1);
1741 report_return(idcok(win, flag));
1742 }
1743
1744
1745 void
1746 cmd_idlok(int nargs, char **args)
1747 {
1748 ARGC(2);
1749 ARG_WINDOW(0, win);
1750 ARG_INT(1, flag);
1751
1752 report_count(1);
1753 report_return(idlok(win, flag));
1754 }
1755
1756
1757 void
1758 cmd_init_color(int nargs, char **args)
1759 {
1760 ARGC(4);
1761 ARG_SHORT(0, colour);
1762 ARG_SHORT(1, red);
1763 ARG_SHORT(2, green);
1764 ARG_SHORT(3, blue);
1765
1766 report_count(1);
1767 report_return(init_color(colour, red, green, blue));
1768 }
1769
1770
1771 void
1772 cmd_init_pair(int nargs, char **args)
1773 {
1774 ARGC(3);
1775 ARG_SHORT(0, pair);
1776 ARG_SHORT(1, fore);
1777 ARG_SHORT(2, back);
1778
1779 report_count(1);
1780 report_return(init_pair(pair, fore, back));
1781 }
1782
1783
1784 void
1785 cmd_initscr(int nargs, char **args)
1786 {
1787 ARGC(0);
1788
1789 report_count(1);
1790 report_ptr(initscr());
1791 }
1792
1793
1794 void
1795 cmd_intrflush(int nargs, char **args)
1796 {
1797 ARGC(2);
1798 ARG_WINDOW(0, win);
1799 ARG_INT(1, flag);
1800
1801 report_count(1);
1802 report_return(intrflush(win, flag));
1803 }
1804
1805
1806 void
1807 cmd_isendwin(int nargs, char **args)
1808 {
1809 ARGC(0);
1810
1811 report_count(1);
1812 report_int(isendwin());
1813 }
1814
1815
1816 void
1817 cmd_is_linetouched(int nargs, char **args)
1818 {
1819 ARGC(2);
1820 ARG_WINDOW(0, win);
1821 ARG_INT(1, line);
1822
1823 report_count(1);
1824 report_int(is_linetouched(win, line));
1825 }
1826
1827
1828 void
1829 cmd_is_wintouched(int nargs, char **args)
1830 {
1831 ARGC(1);
1832 ARG_WINDOW(0, win);
1833
1834 report_count(1);
1835 report_int(is_wintouched(win));
1836 }
1837
1838
1839 void
1840 cmd_keyok(int nargs, char **args)
1841 {
1842 ARGC(2);
1843 ARG_INT(0, keysym);
1844 ARG_INT(1, flag);
1845
1846 report_count(1);
1847 report_return(keyok(keysym, flag));
1848 }
1849
1850
1851 void
1852 cmd_keypad(int nargs, char **args)
1853 {
1854 ARGC(2);
1855 ARG_WINDOW(0, win);
1856 ARG_INT(1, flag);
1857
1858 report_count(1);
1859 report_return(keypad(win, flag));
1860 }
1861
1862 void
1863 cmd_is_keypad(int nargs, char **args)
1864 {
1865 ARGC(1);
1866 ARG_WINDOW(0, win);
1867
1868 report_count(1);
1869 report_int(is_keypad(win));
1870 }
1871
1872 void
1873 cmd_keyname(int nargs, char **args)
1874 {
1875 ARGC(1);
1876 ARG_UINT(0, key);
1877
1878 report_count(1);
1879 report_status(keyname(key));
1880 }
1881
1882
1883 void
1884 cmd_killchar(int nargs, char **args)
1885 {
1886 ARGC(0);
1887
1888 report_count(1);
1889 report_int(killchar());
1890 }
1891
1892
1893 void
1894 cmd_leaveok(int nargs, char **args)
1895 {
1896 ARGC(2);
1897 ARG_WINDOW(0, win);
1898 ARG_INT(1, flag);
1899
1900 report_count(1);
1901 report_return(leaveok(win, flag));
1902 }
1903
1904 void
1905 cmd_is_leaveok(int nargs, char **args)
1906 {
1907 ARGC(1);
1908 ARG_WINDOW(0, win);
1909
1910 report_count(1);
1911 report_int(is_leaveok(win));
1912 }
1913
1914 void
1915 cmd_meta(int nargs, char **args)
1916 {
1917 ARGC(2);
1918 ARG_WINDOW(0, win);
1919 ARG_INT(1, flag);
1920
1921 report_count(1);
1922 report_return(meta(win, flag));
1923 }
1924
1925
1926 void
1927 cmd_mvcur(int nargs, char **args)
1928 {
1929 ARGC(4);
1930 ARG_INT(0, oldy);
1931 ARG_INT(1, oldx);
1932 ARG_INT(2, y);
1933 ARG_INT(3, x);
1934
1935 report_count(1);
1936 report_return(mvcur(oldy, oldx, y, x));
1937 }
1938
1939
1940 void
1941 cmd_mvderwin(int nargs, char **args)
1942 {
1943 ARGC(3);
1944 ARG_WINDOW(0, win);
1945 ARG_INT(1, y);
1946 ARG_INT(2, x);
1947
1948 report_count(1);
1949 report_return(mvderwin(win, y, x));
1950 }
1951
1952
1953 void
1954 cmd_mvhline(int nargs, char **args)
1955 {
1956 ARGC(4);
1957 ARG_INT(0, y);
1958 ARG_INT(1, x);
1959 ARG_CHTYPE(2, ch);
1960 ARG_INT(3, n);
1961
1962 report_count(1);
1963 report_return(mvhline(y, x, ch, n));
1964 }
1965
1966
1967 void
1968 cmd_mvprintw(int nargs, char **args)
1969 {
1970 ARGC(4);
1971 ARG_INT(0, y);
1972 ARG_INT(1, x);
1973 ARG_STRING(2, fmt); /* Must have a single "%s" in this test. */
1974 ARG_STRING(3, arg);
1975
1976 report_count(1);
1977 report_return(mvprintw(y, x, fmt, arg));
1978 }
1979
1980
1981 void
1982 cmd_mvscanw(int nargs, char **args)
1983 {
1984 char string[256];
1985
1986 ARGC(3);
1987 ARG_INT(0, y);
1988 ARG_INT(1, x);
1989 ARG_STRING(2, fmt); /* Must have a single "%s" in this test. */
1990
1991 report_count(2);
1992 report_return(mvscanw(y, x, fmt, &string));
1993 report_status(string);
1994 }
1995
1996
1997 void
1998 cmd_mvvline(int nargs, char **args)
1999 {
2000 ARGC(4);
2001 ARG_INT(0, y);
2002 ARG_INT(1, x);
2003 ARG_CHTYPE(2, ch);
2004 ARG_INT(3, n);
2005
2006 report_count(1);
2007 report_return(mvvline(y, x, ch, n));
2008 }
2009
2010
2011 void
2012 cmd_mvwhline(int nargs, char **args)
2013 {
2014 ARGC(5);
2015 ARG_WINDOW(0, win);
2016 ARG_INT(1, y);
2017 ARG_INT(2, x);
2018 ARG_CHTYPE(3, ch);
2019 ARG_INT(4, n);
2020
2021 report_count(1);
2022 report_return(mvwhline(win, y, x, ch, n));
2023 }
2024
2025
2026 void
2027 cmd_mvwvline(int nargs, char **args)
2028 {
2029 ARGC(5);
2030 ARG_WINDOW(0, win);
2031 ARG_INT(1, y);
2032 ARG_INT(2, x);
2033 ARG_CHTYPE(3, ch);
2034 ARG_INT(4, n);
2035
2036 report_count(1);
2037 report_return(mvwvline(win, y, x, ch, n));
2038 }
2039
2040
2041 void
2042 cmd_mvwin(int nargs, char **args)
2043 {
2044 ARGC(3);
2045 ARG_WINDOW(0, win);
2046 ARG_INT(1, y);
2047 ARG_INT(2, x);
2048
2049 report_count(1);
2050 report_return(mvwin(win, y, x));
2051 }
2052
2053
2054 void
2055 cmd_mvwinchnstr(int nargs, char **args)
2056 {
2057 chtype *string;
2058
2059 ARGC(4);
2060 ARG_WINDOW(0, win);
2061 ARG_INT(1, y);
2062 ARG_INT(2, x);
2063 ARG_INT(3, count);
2064
2065 if ((string = malloc((count + 1) * sizeof(chtype))) == NULL) {
2066 report_count(1);
2067 report_error("MALLOC_FAILED");
2068 return;
2069 }
2070
2071 report_count(2);
2072 report_return(mvwinchnstr(win, y, x, string, count));
2073 report_nstr(string);
2074 free(string);
2075 }
2076
2077
2078 void
2079 cmd_mvwinchstr(int nargs, char **args)
2080 {
2081 chtype string[256];
2082
2083 ARGC(3);
2084 ARG_WINDOW(0, win);
2085 ARG_INT(1, y);
2086 ARG_INT(2, x);
2087
2088 report_count(2);
2089 report_return(mvwinchstr(win, y, x, string));
2090 report_nstr(string);
2091 }
2092
2093
2094 void
2095 cmd_mvwinnstr(int nargs, char **args)
2096 {
2097 char *string;
2098
2099 ARGC(4);
2100 ARG_WINDOW(0, win);
2101 ARG_INT(1, y);
2102 ARG_INT(2, x);
2103 ARG_INT(3, count);
2104
2105 if ((string = malloc(count + 1)) == NULL) {
2106 report_count(1);
2107 report_error("MALLOC_FAILED");
2108 return;
2109 }
2110
2111 report_count(2);
2112 report_int(mvwinnstr(win, y, x, string, count));
2113 report_status(string);
2114 free(string);
2115 }
2116
2117
2118 void
2119 cmd_mvwinstr(int nargs, char **args)
2120 {
2121 char string[256];
2122
2123 ARGC(3);
2124 ARG_WINDOW(0, win);
2125 ARG_INT(1, y);
2126 ARG_INT(2, x);
2127
2128 report_count(2);
2129 report_return(mvwinstr(win, y, x, string));
2130 report_status(string);
2131 }
2132
2133
2134 void
2135 cmd_mvwprintw(int nargs, char **args)
2136 {
2137 ARGC(5);
2138 ARG_WINDOW(0, win);
2139 ARG_INT(1, y);
2140 ARG_INT(2, x);
2141 ARG_STRING(3, fmt); /* Must have a single "%s" in this test. */
2142 ARG_STRING(4, arg);
2143
2144 report_count(1);
2145 report_return(mvwprintw(win, y, x, fmt, arg));
2146 }
2147
2148
2149 void
2150 cmd_mvwscanw(int nargs, char **args)
2151 {
2152 char string[256];
2153
2154 ARGC(4);
2155 ARG_WINDOW(0, win);
2156 ARG_INT(1, y);
2157 ARG_INT(2, x);
2158 ARG_STRING(3, fmt); /* Must have a single "%s" in this test. */
2159
2160 report_count(2);
2161 report_int(mvwscanw(win, y, x, fmt, &string));
2162 report_status(string);
2163 }
2164
2165
2166 void
2167 cmd_napms(int nargs, char **args)
2168 {
2169 ARGC(1);
2170 ARG_INT(0, naptime);
2171
2172 report_count(1);
2173 report_return(napms(naptime));
2174 }
2175
2176
2177 void
2178 cmd_newpad(int nargs, char **args)
2179 {
2180 ARGC(2);
2181 ARG_INT(0, y);
2182 ARG_INT(1, x);
2183
2184 report_count(1);
2185 report_ptr(newpad(y, x));
2186 }
2187
2188
2189 void
2190 cmd_newterm(int nargs, char **args)
2191 {
2192 FILE *in, *out;
2193
2194 ARGC(3);
2195 ARG_MODIFIABLE_STRING(0, type);
2196 ARG_STRING(1, in_fname);
2197 ARG_STRING(2, out_fname);
2198
2199 if ((in = fopen(in_fname, "rw")) == NULL) {
2200 report_count(1);
2201 report_error("BAD FILE_ARGUMENT");
2202 return;
2203 }
2204 if ((out = fopen(out_fname, "rw")) == NULL) {
2205 report_count(1);
2206 report_error("BAD FILE_ARGUMENT");
2207 return;
2208 }
2209
2210 report_count(1);
2211 report_ptr(newterm(type, out, in));
2212 }
2213
2214
2215 void
2216 cmd_newwin(int nargs, char **args)
2217 {
2218 ARGC(4);
2219 ARG_INT(0, lines);
2220 ARG_INT(1, cols);
2221 ARG_INT(2, begin_y);
2222 ARG_INT(3, begin_x);
2223
2224 report_count(1);
2225 report_ptr(newwin(lines, cols, begin_y, begin_x));
2226 }
2227
2228
2229 void
2230 cmd_nl(int nargs, char **args)
2231 {
2232 ARGC(0);
2233
2234 report_count(1);
2235 report_return(nl());
2236 }
2237
2238
2239 void
2240 cmd_no_color_attributes(int nargs, char **args)
2241 {
2242 ARGC(0);
2243
2244 report_count(1);
2245 report_int(no_color_attributes());
2246 }
2247
2248
2249 void
2250 cmd_nocbreak(int nargs, char **args)
2251 {
2252 ARGC(0);
2253
2254 report_count(1);
2255 report_return(nocbreak());
2256 }
2257
2258
2259 void
2260 cmd_nodelay(int nargs, char **args)
2261 {
2262 ARGC(2);
2263 ARG_WINDOW(0, win);
2264 ARG_INT(1, flag);
2265
2266 report_count(1);
2267 report_return(nodelay(win, flag));
2268 }
2269
2270
2271 void
2272 cmd_noecho(int nargs, char **args)
2273 {
2274 ARGC(0);
2275
2276 report_count(1);
2277 report_return(noecho());
2278 }
2279
2280
2281 void
2282 cmd_nonl(int nargs, char **args)
2283 {
2284 ARGC(0);
2285
2286 report_count(1);
2287 report_return(nonl());
2288 }
2289
2290
2291 void
2292 cmd_noqiflush(int nargs, char **args)
2293 {
2294 ARGC(0);
2295
2296 noqiflush();
2297 report_count(1);
2298 report_return(OK); /* fake a return, the call returns void */
2299 }
2300
2301
2302 void
2303 cmd_noraw(int nargs, char **args)
2304 {
2305 ARGC(0);
2306
2307 report_count(1);
2308 report_return(noraw());
2309 }
2310
2311
2312 void
2313 cmd_notimeout(int nargs, char **args)
2314 {
2315 ARGC(2);
2316 ARG_WINDOW(0, win);
2317 ARG_INT(1, flag);
2318
2319 report_count(1);
2320 report_return(notimeout(win, flag));
2321 }
2322
2323
2324 void
2325 cmd_overlay(int nargs, char **args)
2326 {
2327 ARGC(2);
2328 ARG_WINDOW(0, source);
2329 ARG_WINDOW(1, dest);
2330
2331 report_count(1);
2332 report_return(overlay(source, dest));
2333 }
2334
2335
2336 void
2337 cmd_overwrite(int nargs, char **args)
2338 {
2339 ARGC(2);
2340 ARG_WINDOW(0, source);
2341 ARG_WINDOW(1, dest);
2342
2343 report_count(1);
2344 report_return(overwrite(source, dest));
2345 }
2346
2347
2348 void
2349 cmd_pair_content(int nargs, char **args)
2350 {
2351 ARGC(1);
2352 ARG_SHORT(0, pair);
2353
2354 short fore, back;
2355 int ret = pair_content(pair, &fore, &back);
2356
2357 report_count(3);
2358 report_return(ret);
2359 report_int(fore);
2360 report_int(back);
2361 }
2362
2363
2364 void
2365 cmd_pechochar(int nargs, char **args)
2366 {
2367 ARGC(2);
2368 ARG_WINDOW(0, pad);
2369 ARG_CHTYPE(1, ch);
2370
2371 report_count(1);
2372 report_return(pechochar(pad, ch));
2373 }
2374
2375
2376 void
2377 cmd_pnoutrefresh(int nargs, char **args)
2378 {
2379 ARGC(7);
2380 ARG_WINDOW(0, pad);
2381 ARG_INT(1, pbeg_y);
2382 ARG_INT(2, pbeg_x);
2383 ARG_INT(3, sbeg_y);
2384 ARG_INT(4, sbeg_x);
2385 ARG_INT(5, smax_y);
2386 ARG_INT(6, smax_x);
2387
2388 report_count(1);
2389 report_return(pnoutrefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
2390 smax_x));
2391 }
2392
2393
2394 void
2395 cmd_prefresh(int nargs, char **args)
2396 {
2397 ARGC(7);
2398 ARG_WINDOW(0, pad);
2399 ARG_INT(1, pbeg_y);
2400 ARG_INT(2, pbeg_x);
2401 ARG_INT(3, sbeg_y);
2402 ARG_INT(4, sbeg_x);
2403 ARG_INT(5, smax_y);
2404 ARG_INT(6, smax_x);
2405
2406 /* XXX causes refresh */
2407 report_count(1);
2408 report_return(prefresh(pad, pbeg_y, pbeg_x, sbeg_y, sbeg_x, smax_y,
2409 smax_x));
2410 }
2411
2412
2413 void
2414 cmd_printw(int nargs, char **args)
2415 {
2416 ARGC(2);
2417 ARG_STRING(0, fmt); /* Must have a single "%s" in this test. */
2418 ARG_STRING(1, arg);
2419
2420 report_count(1);
2421 report_return(printw(fmt, arg));
2422 }
2423
2424
2425 void
2426 cmd_putwin(int nargs, char **args)
2427 {
2428 ARGC(2);
2429 ARG_WINDOW(0, win);
2430 ARG_STRING(1, filename);
2431
2432 FILE *fp;
2433 if ((fp = fopen(filename, "w")) == NULL) {
2434 report_count(1);
2435 report_error("BAD FILE_ARGUMENT");
2436 return;
2437 }
2438
2439 report_count(1);
2440 report_return(putwin(win, fp));
2441 fclose(fp);
2442 }
2443
2444
2445 void
2446 cmd_qiflush(int nargs, char **args)
2447 {
2448 ARGC(0);
2449
2450 qiflush();
2451 report_count(1);
2452 report_return(OK); /* fake a return because call returns void */
2453 }
2454
2455
2456 void
2457 cmd_raw(int nargs, char **args)
2458 {
2459 ARGC(0);
2460
2461 report_count(1);
2462 report_return(raw());
2463 }
2464
2465
2466 void
2467 cmd_redrawwin(int nargs, char **args)
2468 {
2469 ARGC(1);
2470 ARG_WINDOW(0, win);
2471
2472 report_count(1);
2473 report_return(redrawwin(win));
2474 }
2475
2476
2477 void
2478 cmd_reset_prog_mode(int nargs, char **args)
2479 {
2480 ARGC(0);
2481
2482 report_count(1);
2483 report_return(reset_prog_mode());
2484 }
2485
2486
2487 void
2488 cmd_reset_shell_mode(int nargs, char **args)
2489 {
2490 ARGC(0);
2491
2492 report_count(1);
2493 report_return(reset_shell_mode());
2494 }
2495
2496
2497 void
2498 cmd_resetty(int nargs, char **args)
2499 {
2500 ARGC(0);
2501
2502 report_count(1);
2503 report_return(resetty());
2504 }
2505
2506
2507 void
2508 cmd_resizeterm(int nargs, char **args)
2509 {
2510 ARGC(2);
2511 ARG_INT(0, rows);
2512 ARG_INT(1, cols);
2513
2514 report_count(1);
2515 report_return(resizeterm(rows, cols));
2516 }
2517
2518
2519 void
2520 cmd_savetty(int nargs, char **args)
2521 {
2522 ARGC(0);
2523
2524 report_count(1);
2525 report_return(savetty());
2526 }
2527
2528
2529 void
2530 cmd_scanw(int nargs, char **args)
2531 {
2532 char string[256];
2533
2534 ARGC(0);
2535
2536 report_count(2);
2537 report_return(scanw("%s", string));
2538 report_status(string);
2539 }
2540
2541
2542 void
2543 cmd_scroll(int nargs, char **args)
2544 {
2545 ARGC(1);
2546 ARG_WINDOW(0, win);
2547
2548 report_count(1);
2549 report_return(scroll(win));
2550 }
2551
2552
2553 void
2554 cmd_scrollok(int nargs, char **args)
2555 {
2556 ARGC(2);
2557 ARG_WINDOW(0, win);
2558 ARG_INT(1, flag);
2559
2560 report_count(1);
2561 report_return(scrollok(win, flag));
2562 }
2563
2564
2565 void
2566 cmd_setterm(int nargs, char **args)
2567 {
2568 ARGC(1);
2569 ARG_MODIFIABLE_STRING(0, name);
2570
2571 report_count(1);
2572 report_return(setterm(name));
2573 }
2574
2575
2576 void
2577 cmd_set_term(int nargs, char **args)
2578 {
2579 ARGC(1);
2580 ARG_SCREEN(0, scrn);
2581
2582 report_count(1);
2583 report_ptr(set_term(scrn));
2584 }
2585
2586
2587 void
2588 cmd_start_color(int nargs, char **args)
2589 {
2590 ARGC(0);
2591
2592 report_count(1);
2593 report_return(start_color());
2594 }
2595
2596
2597 void
2598 cmd_subpad(int nargs, char **args)
2599 {
2600 ARGC(5);
2601 ARG_WINDOW(0, pad);
2602 ARG_INT(1, lines);
2603 ARG_INT(2, cols);
2604 ARG_INT(3, begin_y);
2605 ARG_INT(4, begin_x);
2606
2607 report_count(1);
2608 report_ptr(subpad(pad, lines, cols, begin_y, begin_x));
2609 }
2610
2611
2612 void
2613 cmd_subwin(int nargs, char **args)
2614 {
2615 ARGC(5);
2616 ARG_WINDOW(0, win);
2617 ARG_INT(1, lines);
2618 ARG_INT(2, cols);
2619 ARG_INT(3, begin_y);
2620 ARG_INT(4, begin_x);
2621
2622 report_count(1);
2623 report_ptr(subwin(win, lines, cols, begin_y, begin_x));
2624 }
2625
2626
2627 void
2628 cmd_termattrs(int nargs, char **args)
2629 {
2630 ARGC(0);
2631
2632 report_count(1);
2633 report_int(termattrs());
2634 }
2635
2636
2637 void
2638 cmd_term_attrs(int nargs, char **args)
2639 {
2640 ARGC(0);
2641
2642 report_count(1);
2643 report_int(term_attrs());
2644 }
2645
2646
2647 void
2648 cmd_touchline(int nargs, char **args)
2649 {
2650 ARGC(3);
2651 ARG_WINDOW(0, win);
2652 ARG_INT(1, start);
2653 ARG_INT(2, count);
2654
2655 report_count(1);
2656 report_return(touchline(win, start, count));
2657 }
2658
2659
2660 void
2661 cmd_touchoverlap(int nargs, char **args)
2662 {
2663 ARGC(2);
2664 ARG_WINDOW(0, win1);
2665 ARG_WINDOW(1, win2);
2666
2667 report_count(1);
2668 report_return(touchoverlap(win1, win2));
2669 }
2670
2671
2672 void
2673 cmd_touchwin(int nargs, char **args)
2674 {
2675 ARGC(1);
2676 ARG_WINDOW(0, win);
2677
2678 report_count(1);
2679 report_return(touchwin(win));
2680 }
2681
2682
2683 void
2684 cmd_ungetch(int nargs, char **args)
2685 {
2686 ARGC(1);
2687 ARG_INT(0, ch);
2688
2689 report_count(1);
2690 report_return(ungetch(ch));
2691 }
2692
2693
2694 void
2695 cmd_untouchwin(int nargs, char **args)
2696 {
2697 ARGC(1);
2698 ARG_WINDOW(0, win);
2699
2700 report_count(1);
2701 report_return(untouchwin(win));
2702 }
2703
2704
2705 void
2706 cmd_use_default_colors(int nargs, char **args)
2707 {
2708 ARGC(0);
2709
2710 report_count(1);
2711 report_return(use_default_colors());
2712 }
2713
2714
2715 void
2716 cmd_vline(int nargs, char **args)
2717 {
2718 ARGC(2);
2719 ARG_CHTYPE(0, ch);
2720 ARG_INT(1, count);
2721
2722 report_count(1);
2723 report_return(vline(ch, count));
2724 }
2725
2726
2727 static int
2728 internal_vw_printw(WINDOW * win, const char *fmt, ...)
2729 {
2730 va_list va;
2731 int rv;
2732
2733 va_start(va, fmt);
2734 rv = vw_printw(win, fmt, va);
2735 va_end(va);
2736
2737 return rv;
2738 }
2739
2740 void
2741 cmd_vw_printw(int nargs, char **args)
2742 {
2743 ARGC(3);
2744 ARG_WINDOW(0, win);
2745 ARG_STRING(1, fmt); /* Must have a single "%s" in this test. */
2746 ARG_STRING(2, arg);
2747
2748 report_count(1);
2749 report_return(internal_vw_printw(win, fmt, arg));
2750 }
2751
2752
2753 static int
2754 internal_vw_scanw(WINDOW * win, const char *fmt, ...)
2755 {
2756 va_list va;
2757 int rv;
2758
2759 va_start(va, fmt);
2760 rv = vw_scanw(win, fmt, va);
2761 va_end(va);
2762
2763 return rv;
2764 }
2765
2766 void
2767 cmd_vw_scanw(int nargs, char **args)
2768 {
2769 char string[256];
2770
2771 ARGC(2);
2772 ARG_WINDOW(0, win);
2773 ARG_STRING(1, fmt);
2774
2775 report_count(2);
2776 report_int(internal_vw_scanw(win, fmt, string));
2777 report_status(string);
2778 }
2779
2780
2781 void
2782 cmd_vwprintw(int nargs, char **args)
2783 {
2784 cmd_vw_printw(nargs, args);
2785 }
2786
2787
2788 void
2789 cmd_vwscanw(int nargs, char **args)
2790 {
2791 cmd_vw_scanw(nargs, args);
2792 }
2793
2794
2795 void
2796 cmd_waddch(int nargs, char **args)
2797 {
2798 ARGC(2);
2799 ARG_WINDOW(0, win);
2800 ARG_CHTYPE(1, ch);
2801
2802 report_count(1);
2803 report_return(waddch(win, ch));
2804 }
2805
2806
2807 void
2808 cmd_waddchnstr(int nargs, char **args)
2809 {
2810 ARGC(3);
2811 ARG_WINDOW(0, win);
2812 ARG_CHTYPE_STRING(1, chstr);
2813 ARG_INT(2, count);
2814
2815 report_count(1);
2816 report_return(waddchnstr(win, chstr, count));
2817 }
2818
2819
2820 void
2821 cmd_waddchstr(int nargs, char **args)
2822 {
2823 ARGC(2);
2824 ARG_WINDOW(0, win);
2825 ARG_CHTYPE_STRING(1, chstr);
2826
2827 report_count(1);
2828 report_return(waddchstr(win, chstr));
2829 }
2830
2831
2832 void
2833 cmd_waddnstr(int nargs, char **args)
2834 {
2835 ARGC(3);
2836 ARG_WINDOW(0, win);
2837 ARG_STRING(1, str);
2838 ARG_INT(2, count);
2839
2840 report_count(1);
2841 report_return(waddnstr(win, str, count));
2842
2843 }
2844
2845
2846 void
2847 cmd_wattr_get(int nargs, char **args)
2848 {
2849 int attr;
2850 short pair;
2851
2852 ARGC(1);
2853 ARG_WINDOW(0, win);
2854
2855 report_count(3);
2856 report_return(wattr_get(win, &attr, &pair, NULL));
2857 report_int(attr);
2858 report_int(pair);
2859 }
2860
2861
2862 void
2863 cmd_wattr_off(int nargs, char **args)
2864 {
2865 ARGC(2);
2866 ARG_WINDOW(0, win);
2867 ARG_INT(1, attr);
2868
2869 report_count(1);
2870 report_return(wattr_off(win, attr, NULL));
2871 }
2872
2873
2874 void
2875 cmd_wattr_on(int nargs, char **args)
2876 {
2877 ARGC(2);
2878 ARG_WINDOW(0, win);
2879 ARG_INT(1, attr);
2880
2881 report_count(1);
2882 report_return(wattr_on(win, attr, NULL));
2883 }
2884
2885
2886 void
2887 cmd_wattr_set(int nargs, char **args)
2888 {
2889 ARGC(3);
2890 ARG_WINDOW(0, win);
2891 ARG_INT(1, attr);
2892 ARG_SHORT(2, pair);
2893
2894 report_count(1);
2895 report_return(wattr_set(win, attr, pair, NULL));
2896 }
2897
2898
2899 void
2900 cmd_wattroff(int nargs, char **args)
2901 {
2902 ARGC(2);
2903 ARG_WINDOW(0, win);
2904 ARG_INT(1, attr);
2905
2906 report_count(1);
2907 report_return(wattroff(win, attr));
2908 }
2909
2910
2911 void
2912 cmd_wattron(int nargs, char **args)
2913 {
2914 ARGC(2);
2915 ARG_WINDOW(0, win);
2916 ARG_INT(1, attr);
2917
2918 report_count(1);
2919 report_return(wattron(win, attr));
2920 }
2921
2922
2923 void
2924 cmd_wattrset(int nargs, char **args)
2925 {
2926 ARGC(2);
2927 ARG_WINDOW(0, win);
2928 ARG_INT(1, attr);
2929
2930 report_count(1);
2931 report_return(wattrset(win, attr));
2932 }
2933
2934
2935 void
2936 cmd_wbkgd(int nargs, char **args)
2937 {
2938 ARGC(2);
2939 ARG_WINDOW(0, win);
2940 ARG_CHTYPE(1, ch);
2941
2942 report_count(1);
2943 report_return(wbkgd(win, ch));
2944 }
2945
2946
2947 void
2948 cmd_wbkgdset(int nargs, char **args)
2949 {
2950 ARGC(2);
2951 ARG_WINDOW(0, win);
2952 ARG_CHTYPE(1, ch);
2953
2954 wbkgdset(win, ch); /* void return */
2955 report_count(1);
2956 report_return(OK);
2957 }
2958
2959
2960 void
2961 cmd_wborder(int nargs, char **args)
2962 {
2963 ARGC(9);
2964 ARG_WINDOW(0, win);
2965 ARG_INT(1, ls);
2966 ARG_INT(2, rs);
2967 ARG_INT(3, ts);
2968 ARG_INT(4, bs);
2969 ARG_INT(5, tl);
2970 ARG_INT(6, tr);
2971 ARG_INT(7, bl);
2972 ARG_INT(8, br);
2973
2974 report_count(1);
2975 report_return(wborder(win, ls, rs, ts, bs, tl, tr, bl, br));
2976 }
2977
2978
2979 void
2980 cmd_wclear(int nargs, char **args)
2981 {
2982 ARGC(1);
2983 ARG_WINDOW(0, win);
2984
2985 report_count(1);
2986 report_return(wclear(win));
2987 }
2988
2989
2990 void
2991 cmd_wclrtobot(int nargs, char **args)
2992 {
2993 ARGC(1);
2994 ARG_WINDOW(0, win);
2995
2996 report_count(1);
2997 report_return(wclrtobot(win));
2998 }
2999
3000
3001 void
3002 cmd_wclrtoeol(int nargs, char **args)
3003 {
3004 ARGC(1);
3005 ARG_WINDOW(0, win);
3006
3007 report_count(1);
3008 report_return(wclrtoeol(win));
3009
3010 }
3011
3012
3013 void
3014 cmd_wcolor_set(int nargs, char **args)
3015 {
3016 ARGC(3);
3017 ARG_WINDOW(0, win);
3018 ARG_SHORT(1, pair);
3019 ARG_NULL(2);
3020
3021 report_count(1);
3022 report_return(wcolor_set(win, pair, NULL));
3023 }
3024
3025
3026 void
3027 cmd_wdelch(int nargs, char **args)
3028 {
3029 ARGC(1);
3030 ARG_WINDOW(0, win);
3031
3032 report_count(1);
3033 report_return(wdelch(win));
3034 }
3035
3036
3037 void
3038 cmd_wdeleteln(int nargs, char **args)
3039 {
3040 ARGC(1);
3041 ARG_WINDOW(0, win);
3042
3043 report_count(1);
3044 report_return(wdeleteln(win));
3045
3046 }
3047
3048
3049 void
3050 cmd_wechochar(int nargs, char **args)
3051 {
3052 ARGC(2);
3053 ARG_WINDOW(0, win);
3054 ARG_CHTYPE(1, ch);
3055
3056 report_count(1);
3057 report_return(wechochar(win, ch));
3058 }
3059
3060
3061 void
3062 cmd_werase(int nargs, char **args)
3063 {
3064 ARGC(1);
3065 ARG_WINDOW(0, win);
3066
3067 report_count(1);
3068 report_return(werase(win));
3069 }
3070
3071
3072 void
3073 cmd_wgetch(int nargs, char **args)
3074 {
3075 ARGC(1);
3076 ARG_WINDOW(0, win);
3077
3078 report_count(1);
3079 report_int(wgetch(win));
3080 }
3081
3082
3083 void
3084 cmd_wgetnstr(int nargs, char **args)
3085 {
3086 char string[256];
3087
3088 ARGC(2);
3089 ARG_WINDOW(0, win);
3090 ARG_INT(1, count);
3091
3092 report_count(2);
3093 report_return(wgetnstr(win, string, count));
3094 report_status(string);
3095 }
3096
3097
3098 void
3099 cmd_wgetstr(int nargs, char **args)
3100 {
3101 char string[256];
3102
3103 ARGC(1);
3104 ARG_WINDOW(0, win);
3105
3106 string[0] = '\0';
3107
3108 report_count(2);
3109 report_return(wgetstr(win, string));
3110 report_status(string);
3111 }
3112
3113
3114 void
3115 cmd_whline(int nargs, char **args)
3116 {
3117 ARGC(3);
3118 ARG_WINDOW(0, win);
3119 ARG_CHTYPE(1, ch);
3120 ARG_INT(2, count);
3121
3122 report_count(1);
3123 report_return(whline(win, ch, count));
3124 }
3125
3126
3127 void
3128 cmd_winch(int nargs, char **args)
3129 {
3130 ARGC(1);
3131 ARG_WINDOW(0, win);
3132
3133 report_count(1);
3134 report_byte(winch(win));
3135 }
3136
3137
3138 void
3139 cmd_winchnstr(int nargs, char **args)
3140 {
3141 chtype string[256];
3142
3143 ARGC(2);
3144 ARG_WINDOW(0, win);
3145 ARG_INT(1, count);
3146
3147 report_count(2);
3148 report_return(winchnstr(win, string, count));
3149 report_nstr(string);
3150 }
3151
3152
3153 void
3154 cmd_winchstr(int nargs, char **args)
3155 {
3156 chtype string[256];
3157
3158 ARGC(1);
3159 ARG_WINDOW(0, win);
3160
3161 report_count(2);
3162 report_return(winchstr(win, string));
3163 report_nstr(string);
3164 }
3165
3166
3167 void
3168 cmd_winnstr(int nargs, char **args)
3169 {
3170 char string[256];
3171
3172 ARGC(2);
3173 ARG_WINDOW(0, win);
3174 ARG_INT(1, count);
3175
3176 report_count(2);
3177 report_int(winnstr(win, string, count));
3178 report_status(string);
3179 }
3180
3181
3182 void
3183 cmd_winsch(int nargs, char **args)
3184 {
3185 ARGC(2);
3186 ARG_WINDOW(0, win);
3187 ARG_CHTYPE(1, ch);
3188
3189 report_count(1);
3190 report_return(winsch(win, ch));
3191 }
3192
3193
3194 void
3195 cmd_winsdelln(int nargs, char **args)
3196 {
3197 ARGC(2);
3198 ARG_WINDOW(0, win);
3199 ARG_INT(1, count);
3200
3201 report_count(1);
3202 report_return(winsdelln(win, count));
3203 }
3204
3205
3206 void
3207 cmd_winsertln(int nargs, char **args)
3208 {
3209 ARGC(1);
3210 ARG_WINDOW(0, win);
3211
3212 report_count(1);
3213 report_return(winsertln(win));
3214 }
3215
3216
3217 void
3218 cmd_winstr(int nargs, char **args)
3219 {
3220 char string[256];
3221
3222 ARGC(1);
3223 ARG_WINDOW(0, win);
3224
3225 report_count(2);
3226 report_return(winstr(win, string));
3227 report_status(string);
3228 }
3229
3230
3231 void
3232 cmd_wmove(int nargs, char **args)
3233 {
3234 ARGC(3);
3235 ARG_WINDOW(0, win);
3236 ARG_INT(1, y);
3237 ARG_INT(2, x);
3238
3239 report_count(1);
3240 report_return(wmove(win, y, x));
3241 }
3242
3243
3244 void
3245 cmd_wnoutrefresh(int nargs, char **args)
3246 {
3247 ARGC(1);
3248 ARG_WINDOW(0, win);
3249
3250 report_count(1);
3251 report_return(wnoutrefresh(win));
3252 }
3253
3254
3255 void
3256 cmd_wprintw(int nargs, char **args)
3257 {
3258 ARGC(3);
3259 ARG_WINDOW(0, win);
3260 ARG_STRING(1, fmt);
3261 ARG_STRING(2, arg);
3262
3263 report_count(1);
3264 report_return(wprintw(win, fmt, arg));
3265 }
3266
3267
3268 void
3269 cmd_wredrawln(int nargs, char **args)
3270 {
3271 ARGC(3);
3272 ARG_WINDOW(0, win);
3273 ARG_INT(1, beg_line);
3274 ARG_INT(2, num_lines);
3275
3276 report_count(1);
3277 report_return(wredrawln(win, beg_line, num_lines));
3278 }
3279
3280
3281 void
3282 cmd_wrefresh(int nargs, char **args)
3283 {
3284 ARGC(1);
3285 ARG_WINDOW(0, win);
3286
3287 /* XXX - generates output */
3288 report_count(1);
3289 report_return(wrefresh(win));
3290 }
3291
3292
3293 void
3294 cmd_wresize(int nargs, char **args)
3295 {
3296 ARGC(3);
3297 ARG_WINDOW(0, win);
3298 ARG_INT(1, lines);
3299 ARG_INT(2, cols);
3300
3301 report_count(1);
3302 report_return(wresize(win, lines, cols));
3303 }
3304
3305
3306 void
3307 cmd_wscanw(int nargs, char **args)
3308 {
3309 char string[256];
3310
3311 ARGC(2);
3312 ARG_WINDOW(0, win);
3313 ARG_STRING(1, fmt);
3314
3315 report_count(1);
3316 report_return(wscanw(win, fmt, &string));
3317 }
3318
3319
3320 void
3321 cmd_wscrl(int nargs, char **args)
3322 {
3323 ARGC(2);
3324 ARG_WINDOW(0, win);
3325 ARG_INT(1, n);
3326
3327 report_count(1);
3328 report_return(wscrl(win, n));
3329 }
3330
3331
3332 void
3333 cmd_wsetscrreg(int nargs, char **args)
3334 {
3335 ARGC(3);
3336 ARG_WINDOW(0, win);
3337 ARG_INT(1, top);
3338 ARG_INT(2, bottom);
3339
3340 report_count(1);
3341 report_return(wsetscrreg(win, top, bottom));
3342 }
3343
3344
3345 void
3346 cmd_wstandend(int nargs, char **args)
3347 {
3348 ARGC(1);
3349 ARG_WINDOW(0, win);
3350
3351 report_count(1);
3352 report_int(wstandend(win));
3353 }
3354
3355
3356 void
3357 cmd_wstandout(int nargs, char **args)
3358 {
3359 ARGC(1);
3360 ARG_WINDOW(0, win);
3361
3362 report_count(1);
3363 report_int(wstandout(win));
3364 }
3365
3366
3367 void
3368 cmd_wtimeout(int nargs, char **args)
3369 {
3370 ARGC(2);
3371 ARG_WINDOW(0, win);
3372 ARG_INT(1, tval);
3373
3374 wtimeout(win, tval); /* void return */
3375 report_count(1);
3376 report_return(OK);
3377 }
3378
3379
3380 void
3381 cmd_wtouchln(int nargs, char **args)
3382 {
3383 ARGC(4);
3384 ARG_WINDOW(0, win);
3385 ARG_INT(1, line);
3386 ARG_INT(2, n);
3387 ARG_INT(3, changed);
3388
3389 report_count(1);
3390 report_return(wtouchln(win, line, n, changed));
3391 }
3392
3393
3394 void
3395 cmd_wunderend(int nargs, char **args)
3396 {
3397 ARGC(1);
3398 ARG_WINDOW(0, win);
3399
3400 report_count(1);
3401 report_int(wunderend(win));
3402 }
3403
3404
3405 void
3406 cmd_wunderscore(int nargs, char **args)
3407 {
3408 ARGC(1);
3409 ARG_WINDOW(0, win);
3410
3411 report_count(1);
3412 report_int(wunderscore(win));
3413 }
3414
3415
3416 void
3417 cmd_wvline(int nargs, char **args)
3418 {
3419 ARGC(3);
3420 ARG_WINDOW(0, win);
3421 ARG_CHTYPE(1, ch);
3422 ARG_INT(2, n);
3423
3424 report_count(1);
3425 report_return(wvline(win, ch, n));
3426 }
3427
3428
3429 void
3430 cmd_insnstr(int nargs, char **args)
3431 {
3432 ARGC(2);
3433 ARG_STRING(0, str);
3434 ARG_INT(1, n);
3435
3436 report_count(1);
3437 report_return(insnstr(str, n));
3438 }
3439
3440
3441 void
3442 cmd_insstr(int nargs, char **args)
3443 {
3444 ARGC(1);
3445 ARG_STRING(0, str);
3446
3447 report_count(1);
3448 report_return(insstr(str));
3449 }
3450
3451
3452 void
3453 cmd_mvinsnstr(int nargs, char **args)
3454 {
3455 ARGC(4);
3456 ARG_INT(0, y);
3457 ARG_INT(1, x);
3458 ARG_STRING(2, str);
3459 ARG_INT(3, n);
3460
3461 report_count(1);
3462 report_return(mvinsnstr(y, x, str, n));
3463 }
3464
3465
3466 void
3467 cmd_mvinsstr(int nargs, char **args)
3468 {
3469 ARGC(3);
3470 ARG_INT(0, y);
3471 ARG_INT(1, x);
3472 ARG_STRING(2, str);
3473
3474 report_count(1);
3475 report_return(mvinsstr(y, x, str));
3476 }
3477
3478
3479 void
3480 cmd_mvwinsnstr(int nargs, char **args)
3481 {
3482 ARGC(5);
3483 ARG_WINDOW(0, win);
3484 ARG_INT(1, y);
3485 ARG_INT(2, x);
3486 ARG_STRING(3, str);
3487 ARG_INT(4, n);
3488
3489 report_count(1);
3490 report_return(mvwinsnstr(win, y, x, str, n));
3491
3492 }
3493
3494
3495 void
3496 cmd_mvwinsstr(int nargs, char **args)
3497 {
3498 ARGC(4);
3499 ARG_WINDOW(0, win);
3500 ARG_INT(1, y);
3501 ARG_INT(2, x);
3502 ARG_STRING(3, str);
3503
3504 report_count(1);
3505 report_return(mvwinsstr(win, y, x, str));
3506 }
3507
3508
3509 void
3510 cmd_winsnstr(int nargs, char **args)
3511 {
3512 ARGC(3);
3513 ARG_WINDOW(0, win);
3514 ARG_STRING(1, str);
3515 ARG_INT(2, n);
3516
3517 report_count(1);
3518 report_return(winsnstr(win, str, n));
3519 }
3520
3521
3522 void
3523 cmd_winsstr(int nargs, char **args)
3524 {
3525 ARGC(2);
3526 ARG_WINDOW(0, win);
3527 ARG_STRING(1, str);
3528
3529 report_count(1);
3530 report_return(winsstr(win, str));
3531 }
3532
3533
3534 void
3535 cmd_chgat(int nargs, char **args)
3536 {
3537 ARGC(4);
3538 ARG_INT(0, n);
3539 ARG_INT(1, attr);
3540 ARG_INT(2, colour);
3541 ARG_NULL(3);
3542
3543 report_count(1);
3544 report_return(chgat(n, attr, colour, NULL));
3545 }
3546
3547
3548 void
3549 cmd_wchgat(int nargs, char **args)
3550 {
3551 ARGC(5);
3552 ARG_WINDOW(0, win);
3553 ARG_INT(1, n);
3554 ARG_INT(2, attr);
3555 ARG_SHORT(3, colour);
3556 ARG_NULL(4);
3557
3558 report_count(1);
3559 report_return(wchgat(win, n, attr, colour, NULL));
3560 }
3561
3562
3563 void
3564 cmd_mvchgat(int nargs, char **args)
3565 {
3566 ARGC(6);
3567 ARG_INT(0, y);
3568 ARG_INT(1, x);
3569 ARG_INT(2, n);
3570 ARG_INT(3, attr);
3571 ARG_SHORT(4, colour);
3572 ARG_NULL(5);
3573
3574 report_count(1);
3575 report_return(mvchgat(y, x, n, attr, colour, NULL));
3576 }
3577
3578
3579 void
3580 cmd_mvwchgat(int nargs, char **args)
3581 {
3582 ARGC(7);
3583 ARG_WINDOW(0, win);
3584 ARG_INT(1, y);
3585 ARG_INT(2, x);
3586 ARG_INT(3, n);
3587 ARG_INT(4, attr);
3588 ARG_SHORT(5, colour);
3589 ARG_NULL(6);
3590
3591 report_count(1);
3592 report_return(mvwchgat(win, y, x, n, attr, colour, NULL));
3593 }
3594
3595
3596 void
3597 cmd_add_wch(int nargs, char **args)
3598 {
3599 ARGC(1);
3600 ARG_CCHAR_STRING(0, ch);
3601
3602 report_count(1);
3603 report_return(add_wch(ch));
3604 }
3605
3606
3607 void
3608 cmd_wadd_wch(int nargs, char **args)
3609 {
3610 ARGC(2);
3611 ARG_WINDOW(0, win);
3612 ARG_CCHAR_STRING(1, ch);
3613
3614 report_count(1);
3615 report_return(wadd_wch(win, ch));
3616 }
3617
3618
3619 void
3620 cmd_mvadd_wch(int nargs, char **args)
3621 {
3622 ARGC(3);
3623 ARG_INT(0, y);
3624 ARG_INT(1, x);
3625 ARG_CCHAR_STRING(2, ch);
3626
3627 report_count(1);
3628 report_return(mvadd_wch(y, x, ch));
3629 }
3630
3631
3632 void
3633 cmd_mvwadd_wch(int nargs, char **args)
3634 {
3635 ARGC(4);
3636 ARG_WINDOW(0, win);
3637 ARG_INT(1, y);
3638 ARG_INT(2, x);
3639 ARG_CCHAR_STRING(3, ch);
3640
3641 report_count(1);
3642 report_return(mvwadd_wch(win, y, x, ch));
3643 }
3644
3645
3646 void
3647 cmd_add_wchnstr(int nargs, char **args)
3648 {
3649 ARGC(1);
3650 ARG_IGNORE(0);
3651
3652 report_count(1);
3653 report_error("UNSUPPORTED");
3654 }
3655
3656
3657 void
3658 cmd_add_wchstr(int nargs, char **args)
3659 {
3660 ARGC(1);
3661 ARG_IGNORE(0);
3662
3663 report_count(1);
3664 report_error("UNSUPPORTED");
3665 }
3666
3667
3668 void
3669 cmd_wadd_wchnstr(int nargs, char **args)
3670 {
3671 ARGC(1);
3672 ARG_IGNORE(0);
3673
3674 report_count(1);
3675 report_error("UNSUPPORTED");
3676 }
3677
3678
3679 void
3680 cmd_wadd_wchstr(int nargs, char **args)
3681 {
3682 ARGC(1);
3683 ARG_IGNORE(0);
3684
3685 report_count(1);
3686 report_error("UNSUPPORTED");
3687 }
3688
3689
3690 void
3691 cmd_mvadd_wchnstr(int nargs, char **args)
3692 {
3693 ARGC(1);
3694 ARG_IGNORE(0);
3695
3696 report_count(1);
3697 report_error("UNSUPPORTED");
3698 }
3699
3700
3701 void
3702 cmd_mvadd_wchstr(int nargs, char **args)
3703 {
3704 ARGC(1);
3705 ARG_IGNORE(0);
3706
3707 report_count(1);
3708 report_error("UNSUPPORTED");
3709 }
3710
3711
3712 void
3713 cmd_mvwadd_wchnstr(int nargs, char **args)
3714 {
3715 ARGC(1);
3716 ARG_IGNORE(0);
3717
3718 report_count(1);
3719 report_error("UNSUPPORTED");
3720 }
3721
3722
3723 void
3724 cmd_mvwadd_wchstr(int nargs, char **args)
3725 {
3726 ARGC(1);
3727 ARG_IGNORE(0);
3728
3729 report_count(1);
3730 report_error("UNSUPPORTED");
3731 }
3732
3733
3734 void
3735 cmd_addnwstr(int nargs, char **args)
3736 {
3737 ARGC(2);
3738 ARG_WCHAR_STRING(0, wstr);
3739 ARG_INT(1, n);
3740
3741 report_count(1);
3742 report_return(addnwstr(wstr, n));
3743 }
3744
3745
3746 void
3747 cmd_addwstr(int nargs, char **args)
3748 {
3749 ARGC(1);
3750 ARG_WCHAR_STRING(0, wstr);
3751
3752 report_count(1);
3753 report_return(addwstr(wstr));
3754 }
3755
3756
3757 void
3758 cmd_mvaddnwstr(int nargs, char **args)
3759 {
3760 ARGC(4);
3761 ARG_INT(0, y);
3762 ARG_INT(1, x);
3763 ARG_WCHAR_STRING(2, wstr);
3764 ARG_INT(3, n);
3765
3766 report_count(1);
3767 report_return(mvaddnwstr(y, x, wstr, n));
3768 }
3769
3770
3771 void
3772 cmd_mvaddwstr(int nargs, char **args)
3773 {
3774 ARGC(3);
3775 ARG_INT(0, y);
3776 ARG_INT(1, x);
3777 ARG_WCHAR_STRING(2, wstr);
3778
3779 report_count(1);
3780 report_return(mvaddwstr(y, x, wstr));
3781 }
3782
3783
3784 void
3785 cmd_mvwaddnwstr(int nargs, char **args)
3786 {
3787 ARGC(5);
3788 ARG_WINDOW(0, win);
3789 ARG_INT(1, y);
3790 ARG_INT(2, x);
3791 ARG_WCHAR_STRING(3, wstr);
3792 ARG_INT(4, n);
3793
3794 report_count(1);
3795 report_return(mvwaddnwstr(win, y, x, wstr, n));
3796 }
3797
3798
3799 void
3800 cmd_mvwaddwstr(int nargs, char **args)
3801 {
3802 ARGC(4);
3803 ARG_WINDOW(0, win);
3804 ARG_INT(1, y);
3805 ARG_INT(2, x);
3806 ARG_WCHAR_STRING(3, wstr);
3807
3808 report_count(1);
3809 report_return(mvwaddwstr(win, y, x, wstr));
3810 }
3811
3812
3813 void
3814 cmd_waddnwstr(int nargs, char **args)
3815 {
3816 ARGC(3);
3817 ARG_WINDOW(0, win);
3818 ARG_WCHAR_STRING(1, wstr);
3819 ARG_INT(2, n);
3820
3821 report_count(1);
3822 report_return(waddnwstr(win, wstr, n));
3823 }
3824
3825
3826 void
3827 cmd_waddwstr(int nargs, char **args)
3828 {
3829 ARGC(2);
3830 ARG_WINDOW(0, win);
3831 ARG_WCHAR_STRING(1, wstr);
3832
3833 report_count(1);
3834 report_return(waddwstr(win, wstr));
3835 }
3836
3837
3838 void
3839 cmd_echo_wchar(int nargs, char **args)
3840 {
3841 ARGC(1);
3842 ARG_CCHAR_STRING(0, ch);
3843
3844 report_count(1);
3845 report_return(echo_wchar(ch));
3846 }
3847
3848
3849 void
3850 cmd_wecho_wchar(int nargs, char **args)
3851 {
3852 ARGC(2);
3853 ARG_WINDOW(0, win);
3854 ARG_CCHAR_STRING(1, ch);
3855
3856 report_count(1);
3857 report_return(wecho_wchar(win, ch));
3858 }
3859
3860
3861 void
3862 cmd_pecho_wchar(int nargs, char **args)
3863 {
3864 ARGC(2);
3865 ARG_WINDOW(0, pad);
3866 ARG_CCHAR_STRING(1, wch);
3867
3868 report_count(1);
3869 report_return(pecho_wchar(pad, wch));
3870 }
3871
3872
3873 /* insert */
3874 void
3875 cmd_ins_wch(int nargs, char **args)
3876 {
3877 ARGC(1);
3878 ARG_CCHAR_STRING(0, wch);
3879
3880 report_count(1);
3881 report_return(ins_wch(wch));
3882 }
3883
3884
3885 void
3886 cmd_wins_wch(int nargs, char **args)
3887 {
3888 ARGC(2);
3889 ARG_WINDOW(0, win);
3890 ARG_CCHAR_STRING(1, wch);
3891
3892 report_count(1);
3893 report_return(wins_wch(win, wch));
3894 }
3895
3896
3897 void
3898 cmd_mvins_wch(int nargs, char **args)
3899 {
3900 ARGC(3);
3901 ARG_INT(0, y);
3902 ARG_INT(1, x);
3903 ARG_CCHAR_STRING(2, wch);
3904
3905 report_count(1);
3906 report_return(mvins_wch(y, x, wch));
3907 }
3908
3909
3910 void
3911 cmd_mvwins_wch(int nargs, char **args)
3912 {
3913 ARGC(4);
3914 ARG_WINDOW(0, win);
3915 ARG_INT(1, y);
3916 ARG_INT(2, x);
3917 ARG_CCHAR_STRING(3, wch);
3918
3919 report_count(1);
3920 report_return(mvwins_wch(win, y, x, wch));
3921 }
3922
3923
3924 void
3925 cmd_ins_nwstr(int nargs, char **args)
3926 {
3927 ARGC(2);
3928 ARG_WCHAR_STRING(0, wstr);
3929 ARG_INT(1, n);
3930
3931 report_count(1);
3932 report_return(ins_nwstr(wstr, n));
3933 }
3934
3935
3936 void
3937 cmd_ins_wstr(int nargs, char **args)
3938 {
3939 ARGC(1);
3940 ARG_WCHAR_STRING(0, wstr);
3941
3942 report_count(1);
3943 report_return(ins_wstr(wstr));
3944 }
3945
3946
3947 void
3948 cmd_mvins_nwstr(int nargs, char **args)
3949 {
3950 ARGC(4);
3951 ARG_INT(0, y);
3952 ARG_INT(1, x);
3953 ARG_WCHAR_STRING(2, wstr);
3954 ARG_INT(3, n);
3955
3956 report_count(1);
3957 report_return(mvins_nwstr(y, x, wstr, n));
3958 }
3959
3960
3961 void
3962 cmd_mvins_wstr(int nargs, char **args)
3963 {
3964 ARGC(3);
3965 ARG_INT(0, y);
3966 ARG_INT(1, x);
3967 ARG_WCHAR_STRING(2, wstr);
3968
3969 report_count(1);
3970 report_return(mvins_wstr(y, x, wstr));
3971 }
3972
3973
3974 void
3975 cmd_mvwins_nwstr(int nargs, char **args)
3976 {
3977 ARGC(5);
3978 ARG_WINDOW(0, win);
3979 ARG_INT(1, y);
3980 ARG_INT(2, x);
3981 ARG_WCHAR_STRING(3, wstr);
3982 ARG_INT(4, n);
3983
3984 report_count(1);
3985 report_return(mvwins_nwstr(win, y, x, wstr, n));
3986 }
3987
3988
3989 void
3990 cmd_mvwins_wstr(int nargs, char **args)
3991 {
3992 ARGC(4);
3993 ARG_WINDOW(0, win);
3994 ARG_INT(1, y);
3995 ARG_INT(2, x);
3996 ARG_WCHAR_STRING(3, wstr);
3997
3998 report_count(1);
3999 report_return(mvwins_wstr(win, y, x, wstr));
4000 }
4001
4002
4003 void
4004 cmd_wins_nwstr(int nargs, char **args)
4005 {
4006 ARGC(3);
4007 ARG_WINDOW(0, win);
4008 ARG_WCHAR_STRING(1, wstr);
4009 ARG_INT(2, n);
4010
4011 report_count(1);
4012 report_return(wins_nwstr(win, wstr, n));
4013 }
4014
4015
4016 void
4017 cmd_wins_wstr(int nargs, char **args)
4018 {
4019 ARGC(2);
4020 ARG_WINDOW(0, win);
4021 ARG_WCHAR_STRING(1, wstr);
4022
4023 report_count(1);
4024 report_return(wins_wstr(win, wstr));
4025 }
4026
4027
4028 /* input */
4029 void
4030 cmd_get_wch(int nargs, char **args)
4031 {
4032 wchar_t ch;
4033 ARGC(0);
4034
4035 report_count(2);
4036 report_return(get_wch(&ch));
4037 report_wchar(ch);
4038 }
4039
4040
4041 void
4042 cmd_unget_wch(int nargs, char **args)
4043 {
4044 ARGC(1);
4045 ARG_WCHAR(0, wch);
4046
4047 report_count(1);
4048 report_return(unget_wch(wch));
4049 }
4050
4051
4052 void
4053 cmd_mvget_wch(int nargs, char **args)
4054 {
4055 wchar_t ch;
4056
4057 ARGC(2);
4058 ARG_INT(0, y);
4059 ARG_INT(1, x);
4060
4061 report_count(2);
4062 report_return(mvget_wch(y, x, &ch));
4063 report_wchar(ch);
4064 }
4065
4066
4067 void
4068 cmd_mvwget_wch(int nargs, char **args)
4069 {
4070 wchar_t ch;
4071
4072 ARGC(1); /* FIXME: 3 */
4073 ARG_WINDOW(0, win);
4074 ARG_INT(1, y);
4075 ARG_INT(2, x);
4076
4077 report_count(2);
4078 report_return(mvwget_wch(win, y, x, &ch));
4079 report_wchar(ch);
4080 }
4081
4082
4083 void
4084 cmd_wget_wch(int nargs, char **args)
4085 {
4086 wchar_t ch;
4087
4088 ARGC(1);
4089 ARG_WINDOW(0, win);
4090
4091 report_count(2);
4092 report_return(wget_wch(win, &ch));
4093 report_wchar(ch);
4094 }
4095
4096
4097 void
4098 cmd_getn_wstr(int nargs, char **args)
4099 {
4100 wchar_t wstr[256];
4101
4102 ARGC(1);
4103 ARG_INT(0, n);
4104
4105 report_count(2);
4106 report_return(getn_wstr(wstr, n));
4107 report_wstr(wstr);
4108 }
4109
4110
4111 void
4112 cmd_get_wstr(int nargs, char **args)
4113 {
4114 wchar_t wstr[256];
4115
4116 ARGC(0);
4117
4118 report_count(2);
4119 report_return(get_wstr(wstr));
4120 report_wstr(wstr);
4121 }
4122
4123 void
4124 cmd_mvgetn_wstr(int nargs, char **args)
4125 {
4126 wchar_t wstr[256];
4127
4128 ARGC(3);
4129 ARG_INT(0, y);
4130 ARG_INT(1, x);
4131 ARG_INT(2, n);
4132
4133 report_count(2);
4134 report_return(mvgetn_wstr(y, x, wstr, n));
4135 report_wstr(wstr);
4136 }
4137
4138 void
4139 cmd_mvget_wstr(int nargs, char **args)
4140 {
4141 wchar_t wstr[256];
4142
4143 ARGC(2);
4144 ARG_INT(0, y);
4145 ARG_INT(1, x);
4146
4147 report_count(2);
4148 report_return(mvget_wstr(y, x, wstr));
4149 report_wstr(wstr);
4150 }
4151
4152
4153 void
4154 cmd_mvwgetn_wstr(int nargs, char **args)
4155 {
4156 wchar_t wstr[256];
4157
4158 ARGC(4);
4159 ARG_WINDOW(0, win);
4160 ARG_INT(1, y);
4161 ARG_INT(2, x);
4162 ARG_INT(3, n);
4163
4164 report_count(2);
4165 report_return(mvwgetn_wstr(win, y, x, wstr, n));
4166 report_wstr(wstr);
4167 }
4168
4169
4170 void
4171 cmd_mvwget_wstr(int nargs, char **args)
4172 {
4173 wchar_t wstr[256];
4174
4175 ARGC(3);
4176 ARG_WINDOW(0, win);
4177 ARG_INT(1, y);
4178 ARG_INT(2, x);
4179
4180 report_count(2);
4181 report_return(mvwget_wstr(win, y, x, wstr));
4182 report_wstr(wstr);
4183 }
4184
4185
4186 void
4187 cmd_wgetn_wstr(int nargs, char **args)
4188 {
4189 wchar_t wstr[256];
4190
4191 ARGC(2);
4192 ARG_WINDOW(0, win);
4193 ARG_INT(1, n);
4194
4195 report_count(2);
4196 report_return(wgetn_wstr(win, wstr, n));
4197 report_wstr(wstr);
4198 }
4199
4200
4201 void
4202 cmd_wget_wstr(int nargs, char **args)
4203 {
4204 wchar_t wstr[256];
4205
4206 ARGC(1);
4207 ARG_WINDOW(0, win);
4208
4209 report_count(2);
4210 report_return(wget_wstr(win, wstr));
4211 report_wstr(wstr);
4212 }
4213
4214
4215 void
4216 cmd_in_wch(int nargs, char **args)
4217 {
4218 cchar_t wcval;
4219 ARGC(0);
4220
4221 report_count(2);
4222 report_return(in_wch(&wcval));
4223 report_cchar(wcval);
4224 }
4225
4226
4227 void
4228 cmd_mvin_wch(int nargs, char **args)
4229 {
4230 cchar_t wcval;
4231
4232 ARGC(2);
4233 ARG_INT(0, y);
4234 ARG_INT(1, x);
4235
4236 report_count(2);
4237 report_return(mvin_wch(y, x, &wcval));
4238 report_cchar(wcval);
4239 }
4240
4241
4242 void
4243 cmd_mvwin_wch(int nargs, char **args)
4244 {
4245 cchar_t wcval;
4246
4247 ARGC(3);
4248 ARG_WINDOW(0, win);
4249 ARG_INT(1, y);
4250 ARG_INT(2, x);
4251
4252 report_count(2);
4253 report_return(mvwin_wch(win, y, x, &wcval));
4254 report_cchar(wcval);
4255 }
4256
4257
4258 void
4259 cmd_win_wch(int nargs, char **args)
4260 {
4261 cchar_t wcval;
4262
4263 ARGC(1);
4264 ARG_WINDOW(0, win);
4265
4266 report_count(2);
4267 report_return(win_wch(win, &wcval));
4268 report_cchar(wcval);
4269 }
4270
4271
4272 void
4273 cmd_in_wchnstr(int nargs, char **args)
4274 {
4275 ARGC(1);
4276 ARG_IGNORE(0);
4277
4278 report_count(1);
4279 report_error("UNSUPPORTED");
4280 }
4281
4282
4283 void
4284 cmd_in_wchstr(int nargs, char **args)
4285 {
4286 ARGC(1);
4287 ARG_IGNORE(0);
4288
4289 report_count(1);
4290 report_error("UNSUPPORTED");
4291 }
4292
4293
4294 void
4295 cmd_mvin_wchnstr(int nargs, char **args)
4296 {
4297 ARGC(1);
4298 ARG_IGNORE(0);
4299
4300 report_count(1);
4301 report_error("UNSUPPORTED");
4302 }
4303
4304
4305 void
4306 cmd_mvin_wchstr(int nargs, char **args)
4307 {
4308 ARGC(1);
4309 ARG_IGNORE(0);
4310
4311 report_count(1);
4312 report_error("UNSUPPORTED");
4313 }
4314
4315
4316 void
4317 cmd_mvwin_wchnstr(int nargs, char **args)
4318 {
4319 ARGC(1);
4320 ARG_IGNORE(0);
4321
4322 report_count(1);
4323 report_error("UNSUPPORTED");
4324 }
4325
4326
4327 void
4328 cmd_mvwin_wchstr(int nargs, char **args)
4329 {
4330 ARGC(1);
4331 ARG_IGNORE(0);
4332
4333 report_count(1);
4334 report_error("UNSUPPORTED");
4335 }
4336
4337
4338 void
4339 cmd_win_wchnstr(int nargs, char **args)
4340 {
4341 ARGC(1);
4342 ARG_IGNORE(0);
4343
4344 report_count(1);
4345 report_error("UNSUPPORTED");
4346 }
4347
4348
4349 void
4350 cmd_win_wchstr(int nargs, char **args)
4351 {
4352 ARGC(1);
4353 ARG_IGNORE(0);
4354
4355 report_count(1);
4356 report_error("UNSUPPORTED");
4357 }
4358
4359
4360 void
4361 cmd_innwstr(int nargs, char **args)
4362 {
4363 wchar_t wstr[256];
4364
4365 ARGC(1);
4366 ARG_INT(0, n);
4367
4368 report_count(2);
4369 report_int(innwstr(wstr, n));
4370 report_wstr(wstr);
4371 }
4372
4373
4374 void
4375 cmd_inwstr(int nargs, char **args)
4376 {
4377 wchar_t wstr[256];
4378 ARGC(0);
4379
4380 report_count(2);
4381 report_return(inwstr(wstr));
4382 report_wstr(wstr);
4383 }
4384
4385
4386 void
4387 cmd_mvinnwstr(int nargs, char **args)
4388 {
4389 wchar_t wstr[256];
4390
4391 ARGC(3);
4392 ARG_INT(0, y);
4393 ARG_INT(1, x);
4394 ARG_INT(2, n);
4395
4396 report_count(2);
4397 report_int(mvinnwstr(y, x, wstr, n));
4398 report_wstr(wstr);
4399 }
4400
4401
4402 void
4403 cmd_mvinwstr(int nargs, char **args)
4404 {
4405 wchar_t wstr[256];
4406
4407 ARGC(2);
4408 ARG_INT(0, y);
4409 ARG_INT(1, x);
4410
4411 report_count(2);
4412 report_return(mvinwstr(y, x, wstr));
4413 report_wstr(wstr);
4414 }
4415
4416
4417 void
4418 cmd_mvwinnwstr(int nargs, char **args)
4419 {
4420 wchar_t wstr[256];
4421
4422 ARGC(4);
4423 ARG_WINDOW(0, win);
4424 ARG_INT(1, y);
4425 ARG_INT(2, x);
4426 ARG_INT(3, n);
4427
4428 report_count(2);
4429 report_int(mvwinnwstr(win, y, x, wstr, n));
4430 report_wstr(wstr);
4431 }
4432
4433
4434 void
4435 cmd_mvwinwstr(int nargs, char **args)
4436 {
4437 wchar_t wstr[256];
4438
4439 ARGC(3);
4440 ARG_WINDOW(0, win);
4441 ARG_INT(1, y);
4442 ARG_INT(2, x);
4443
4444 report_count(2);
4445 report_return(mvwinwstr(win, y, x, wstr));
4446 report_wstr(wstr);
4447 }
4448
4449
4450 void
4451 cmd_winnwstr(int nargs, char **args)
4452 {
4453 wchar_t wstr[256];
4454
4455 ARGC(2);
4456 ARG_WINDOW(0, win);
4457 ARG_INT(1, n);
4458
4459 report_count(2);
4460 report_int(winnwstr(win, wstr, n));
4461 report_wstr(wstr);
4462 }
4463
4464
4465 void
4466 cmd_winwstr(int nargs, char **args)
4467 {
4468 wchar_t wstr[256];
4469
4470 ARGC(1);
4471 ARG_WINDOW(0, win);
4472
4473 report_count(2);
4474 report_return(winwstr(win, wstr));
4475 report_wstr(wstr);
4476 }
4477
4478
4479 /* cchar handling */
4480 void
4481 cmd_setcchar(int nargs, char **args)
4482 {
4483 cchar_t wcval;
4484
4485 ARGC(4);
4486 ARG_WCHAR_STRING(0, wch);
4487 ARG_INT(1, attrs);
4488 ARG_SHORT(2, color_pair);
4489 ARG_NULL(3);
4490
4491 report_count(2);
4492 report_return(setcchar(&wcval, wch, attrs, color_pair, NULL));
4493 report_cchar(wcval);
4494 }
4495
4496
4497 void
4498 cmd_getcchar(int nargs, char **args)
4499 {
4500 wchar_t wch[256];
4501 attr_t attrs;
4502 short color_pair;
4503
4504 /*
4505 * XXX - not handling passing of wch as NULL
4506 */
4507
4508 ARGC(2);
4509 ARG_CCHAR_STRING(0, wcval);
4510 ARG_NULL(1);
4511
4512 report_count(4);
4513 report_return(getcchar(wcval, wch, &attrs, &color_pair, NULL));
4514 report_wstr(wch);
4515 report_int(attrs);
4516 report_int(color_pair);
4517 }
4518
4519
4520 /* misc */
4521 void
4522 cmd_key_name(int nargs, char **args)
4523 {
4524 ARGC(1);
4525 ARG_WCHAR(0, w);
4526
4527 report_count(1);
4528 report_status(key_name(w));
4529 }
4530
4531
4532 void
4533 cmd_border_set(int nargs, char **args)
4534 {
4535 ARGC(8);
4536 ARG_CCHAR_STRING(0, ls);
4537 ARG_CCHAR_STRING(1, rs);
4538 ARG_CCHAR_STRING(2, ts);
4539 ARG_CCHAR_STRING(3, bs);
4540 ARG_CCHAR_STRING(4, tl);
4541 ARG_CCHAR_STRING(5, tr);
4542 ARG_CCHAR_STRING(6, bl);
4543 ARG_CCHAR_STRING(7, br);
4544
4545 report_count(1);
4546 report_return(border_set(ls, rs, ts, bs, tl, tr, bl, br));
4547 }
4548
4549
4550 void
4551 cmd_wborder_set(int nargs, char **args)
4552 {
4553 ARGC(9);
4554 ARG_WINDOW(0, win);
4555 ARG_CCHAR_STRING(1, ls);
4556 ARG_CCHAR_STRING(2, rs);
4557 ARG_CCHAR_STRING(3, ts);
4558 ARG_CCHAR_STRING(4, bs);
4559 ARG_CCHAR_STRING(5, tl);
4560 ARG_CCHAR_STRING(6, tr);
4561 ARG_CCHAR_STRING(7, bl);
4562 ARG_CCHAR_STRING(8, br);
4563
4564 report_count(1);
4565 report_return(wborder_set(win, ls, rs, ts, bs, tl, tr, bl, br));
4566 }
4567
4568
4569 void
4570 cmd_box_set(int nargs, char **args)
4571 {
4572 ARGC(3);
4573 ARG_WINDOW(0, win);
4574 ARG_CCHAR_STRING(1, verch);
4575 ARG_CCHAR_STRING(2, horch);
4576
4577 report_count(1);
4578 report_return(box_set(win, verch, horch));
4579 }
4580
4581
4582 void
4583 cmd_erasewchar(int nargs, char **args)
4584 {
4585 wchar_t ch;
4586
4587 ARGC(0);
4588
4589 report_count(2);
4590 report_return(erasewchar(&ch));
4591 report_wchar(ch);
4592 }
4593
4594
4595 void
4596 cmd_killwchar(int nargs, char **args)
4597 {
4598 wchar_t ch;
4599
4600 ARGC(0);
4601
4602 report_count(2);
4603 report_return(killwchar(&ch));
4604 report_wchar(ch);
4605 }
4606
4607
4608 void
4609 cmd_hline_set(int nargs, char **args)
4610 {
4611 ARGC(2);
4612 ARG_CCHAR_STRING(0, wch);
4613 ARG_INT(1, n);
4614
4615 report_count(1);
4616 report_return(hline_set(wch, n));
4617 }
4618
4619
4620 void
4621 cmd_mvhline_set(int nargs, char **args)
4622 {
4623 ARGC(4);
4624 ARG_INT(0, y);
4625 ARG_INT(1, x);
4626 ARG_CCHAR_STRING(2, wch);
4627 ARG_INT(3, n);
4628
4629 report_count(1);
4630 report_return(mvhline_set(y, x, wch, n));
4631 }
4632
4633
4634 void
4635 cmd_mvvline_set(int nargs, char **args)
4636 {
4637 ARGC(4);
4638 ARG_INT(0, y);
4639 ARG_INT(1, x);
4640 ARG_CCHAR_STRING(2, wch);
4641 ARG_INT(3, n);
4642
4643 report_count(1);
4644 report_return(mvvline_set(y, x, wch, n));
4645 }
4646
4647
4648 void
4649 cmd_mvwhline_set(int nargs, char **args)
4650 {
4651 ARGC(5);
4652 ARG_WINDOW(0, win);
4653 ARG_INT(1, y);
4654 ARG_INT(2, x);
4655 ARG_CCHAR_STRING(3, wch);
4656 ARG_INT(4, n);
4657
4658 report_count(1);
4659 report_return(mvwhline_set(win, y, x, wch, n));
4660 }
4661
4662
4663 void
4664 cmd_mvwvline_set(int nargs, char **args)
4665 {
4666 ARGC(5);
4667 ARG_WINDOW(0, win);
4668 ARG_INT(1, y);
4669 ARG_INT(2, x);
4670 ARG_CCHAR_STRING(3, wch);
4671 ARG_INT(4, n);
4672
4673 report_count(1);
4674 report_return(mvwvline_set(win, y, x, wch, n));
4675 }
4676
4677
4678 void
4679 cmd_vline_set(int nargs, char **args)
4680 {
4681 ARGC(2);
4682 ARG_CCHAR_STRING(0, wch);
4683 ARG_INT(1, n);
4684
4685 report_count(1);
4686 report_return(vline_set(wch, n));
4687 }
4688
4689
4690 void
4691 cmd_whline_set(int nargs, char **args)
4692 {
4693 ARGC(3);
4694 ARG_WINDOW(0, win);
4695 ARG_CCHAR_STRING(1, wch);
4696 ARG_INT(2, n);
4697
4698 report_count(1);
4699 report_return(whline_set(win, wch, n));
4700 }
4701
4702
4703 void
4704 cmd_wvline_set(int nargs, char **args)
4705 {
4706 ARGC(3);
4707 ARG_WINDOW(0, win);
4708 ARG_CCHAR_STRING(1, wch);
4709 ARG_INT(2, n);
4710
4711 report_count(1);
4712 report_return(wvline_set(win, wch, n));
4713 }
4714
4715
4716 void
4717 cmd_bkgrnd(int nargs, char **args)
4718 {
4719 ARGC(1);
4720 ARG_CCHAR_STRING(0, wch);
4721
4722 report_count(1);
4723 report_return(bkgrnd(wch));
4724 }
4725
4726
4727 void
4728 cmd_bkgrndset(int nargs, char **args)
4729 {
4730 ARGC(1);
4731 ARG_CCHAR_STRING(0, wch);
4732
4733 report_count(1);
4734 bkgrndset(wch);
4735 report_return(OK);
4736 }
4737
4738
4739 void
4740 cmd_getbkgrnd(int nargs, char **args)
4741 {
4742 cchar_t wch;
4743 ARGC(0);
4744
4745 report_count(2);
4746 report_return(getbkgrnd(&wch));
4747 report_cchar(wch);
4748 }
4749
4750
4751 void
4752 cmd_wbkgrnd(int nargs, char **args)
4753 {
4754 ARGC(2);
4755 ARG_WINDOW(0, win);
4756 ARG_CCHAR_STRING(1, wch);
4757
4758 report_count(1);
4759 report_return(wbkgrnd(win, wch));
4760 }
4761
4762
4763 void
4764 cmd_wbkgrndset(int nargs, char **args)
4765 {
4766 ARGC(2);
4767 ARG_WINDOW(0, win);
4768 ARG_CCHAR_STRING(1, wch);
4769
4770 report_count(1);
4771 wbkgrndset(win, wch);
4772 report_return(OK);
4773 }
4774
4775
4776 void
4777 cmd_wgetbkgrnd(int nargs, char **args)
4778 {
4779 cchar_t wch;
4780 ARGC(1);
4781 ARG_WINDOW(0, win);
4782
4783 report_count(2);
4784 report_return(wgetbkgrnd(win, &wch));
4785 report_cchar(wch);
4786 }
4787
4788
4789 void
4790 cmd_immedok(int nargs, char **args)
4791 {
4792 ARGC(2);
4793 ARG_WINDOW(0, win);
4794 ARG_INT(1, bf);
4795
4796 report_count(1);
4797 immedok(win, bf);
4798 report_return(OK);
4799 }
4800
4801 void
4802 cmd_syncok(int nargs, char **args)
4803 {
4804 ARGC(2);
4805 ARG_WINDOW(0, win);
4806 ARG_INT(1, bf);
4807
4808 report_count(1);
4809 report_return(syncok(win, bf));
4810 }
4811
4812 void
4813 cmd_wcursyncup(int nargs, char **args)
4814 {
4815 ARGC(1);
4816 ARG_WINDOW(0, win);
4817
4818 report_count(1);
4819 wcursyncup(win);
4820 report_return(OK);
4821 }
4822
4823 void
4824 cmd_wsyncup(int nargs, char **args)
4825 {
4826 ARGC(1);
4827 ARG_WINDOW(0, win);
4828
4829 report_count(1);
4830 wsyncup(win);
4831 report_return(OK);
4832 }
4833
4834 void
4835 cmd_wsyncdown(int nargs, char **args)
4836 {
4837 ARGC(1);
4838 ARG_WINDOW(0, win);
4839
4840 report_count(1);
4841 wsyncdown(win);
4842 report_return(OK);
4843 }
4844
4845
4846 /* Soft label key routines */
4847 void
4848 cmd_slk_attroff(int nargs, char **args)
4849 {
4850 ARGC(1);
4851 ARG_CHTYPE(0, ch);
4852
4853 report_count(1);
4854 report_return(slk_attroff(ch));
4855 }
4856
4857 void
4858 cmd_slk_attr_off(int nargs, char **args)
4859 {
4860 ARGC(1);
4861 ARG_INT(0, attrs);
4862
4863 report_count(1);
4864 report_return(slk_attr_off(attrs, NULL));
4865 }
4866
4867 void
4868 cmd_slk_attron(int nargs, char **args)
4869 {
4870 ARGC(1);
4871 ARG_CHTYPE(0, ch);
4872
4873 report_count(1);
4874 report_return(slk_attron(ch));
4875 }
4876
4877 void
4878 cmd_slk_attr_on(int nargs, char **args)
4879 {
4880 ARGC(1);
4881 ARG_INT(0, attrs);
4882
4883 report_count(1);
4884 report_return(slk_attr_on(attrs, NULL));
4885 }
4886
4887 void
4888 cmd_slk_attrset(int nargs, char **args)
4889 {
4890 ARGC(1);
4891 ARG_CHTYPE(0, ch);
4892
4893 report_count(1);
4894 report_return(slk_attrset(ch));
4895 }
4896
4897 void
4898 cmd_slk_attr_set(int nargs, char **args)
4899 {
4900 ARGC(2);
4901 ARG_INT(0, attrs);
4902 ARG_SHORT(1, color_pair_number);
4903
4904 report_count(1);
4905 report_return(slk_attr_set(attrs, color_pair_number, NULL));
4906 }
4907
4908 void
4909 cmd_slk_clear(int nargs, char **args)
4910 {
4911 ARGC(0);
4912
4913 report_count(1);
4914 report_return(slk_clear());
4915 }
4916
4917 void
4918 cmd_slk_color(int nargs, char **args)
4919 {
4920 ARGC(1);
4921 ARG_SHORT(0, color_pair_number);
4922
4923 report_count(1);
4924 report_return(slk_color(color_pair_number));
4925 }
4926
4927 void
4928 cmd_slk_label(int nargs, char **args)
4929 {
4930 char *label;
4931
4932 ARGC(1);
4933 ARG_INT(0, labnum);
4934
4935 label = slk_label(labnum);
4936 report_count(1);
4937 if (label == NULL)
4938 report_status("NULL");
4939 else
4940 report_status(label);
4941 }
4942
4943 void
4944 cmd_slk_noutrefresh(int nargs, char **args)
4945 {
4946 ARGC(0);
4947
4948 report_count(1);
4949 report_return(slk_noutrefresh());
4950 }
4951
4952 void
4953 cmd_slk_refresh(int nargs, char **args)
4954 {
4955 ARGC(0);
4956
4957 report_count(1);
4958 report_return(slk_refresh());
4959 }
4960
4961 void
4962 cmd_slk_restore(int nargs, char **args)
4963 {
4964 ARGC(0);
4965
4966 report_count(1);
4967 report_return(slk_restore());
4968 }
4969
4970 void
4971 cmd_slk_set(int nargs, char **args)
4972 {
4973 ARGC(3);
4974 ARG_INT(0, labnum);
4975 ARG_STRING(1, label);
4976 ARG_INT(2, justify);
4977
4978 report_count(1);
4979 report_return(slk_set(labnum, label, justify));
4980 }
4981
4982 void
4983 cmd_slk_touch(int nargs, char **args)
4984 {
4985 ARGC(0);
4986
4987 report_count(1);
4988 report_return(slk_touch());
4989 }
4990
4991 void
4992 cmd_slk_wset(int nargs, char **args)
4993 {
4994 ARGC(3);
4995 ARG_INT(0, labnum);
4996 ARG_WCHAR_STRING(1, label);
4997 ARG_INT(2, justify);
4998
4999 report_count(1);
5000 report_return(slk_wset(labnum, label, justify));
5001 }
5002
5003
5004 void
5005 cmd_slk_init(int nargs, char **args)
5006 {
5007 ARGC(1);
5008 ARG_INT(0, fmt);
5009
5010 report_count(1);
5011 report_return(slk_init(fmt));
5012 }
5013
5014 void
5015 cmd_use_env(int nargs, char **args)
5016 {
5017 ARGC(1);
5018 ARG_IGNORE(0);
5019
5020 report_count(1);
5021 report_error("UNSUPPORTED");
5022 }
5023
5024 void
5025 cmd_ripoffline(int nargs, char **args)
5026 {
5027 ARGC(1);
5028 ARG_IGNORE(0);
5029
5030 report_count(1);
5031 report_error("UNSUPPORTED");
5032 }
5033
5034 void
5035 cmd_filter(int nargs, char **args)
5036 {
5037 ARGC(0);
5038
5039 report_count(1);
5040 filter();
5041 report_return(OK);
5042 }
5043