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