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