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