1 /*************************************************************** 2 3 bwbasic.h Header File 4 for Bywater BASIC Interpreter 5 6 Copyright (c) 1993, Ted A. Campbell 7 Bywater Software 8 9 email: tcamp@delphi.com 10 11 Copyright and Permissions Information: 12 13 All U.S. and international rights are claimed by the author, 14 Ted A. Campbell. 15 16 This software is released under the terms of the GNU General 17 Public License (GPL), which is distributed with this software 18 in the file "COPYING". The GPL specifies the terms under 19 which users may copy and use the software in this distribution. 20 21 A separate license is available for commercial distribution, 22 for information on which you should contact the author. 23 24 ***************************************************************/ 25 26 /*---------------------------------------------------------------*/ 27 /* NOTE: Modifications marked "JBV" were made by Jon B. Volkoff, */ 28 /* 11/1995 (eidetics@cerf.net). */ 29 /* */ 30 /* Those additionally marked with "DD" were at the suggestion of */ 31 /* Dale DePriest (daled@cadence.com). */ 32 /* */ 33 /* Version 3.00 by Howard Wulf, AF5NE */ 34 /* */ 35 /* Version 3.10 by Howard Wulf, AF5NE */ 36 /* */ 37 /* Version 3.20 by Howard Wulf, AF5NE */ 38 /* */ 39 /*---------------------------------------------------------------*/ 40 41 42 #define TRUE -1 43 #define FALSE 0 44 #define NDEBUG 1 45 46 #include <assert.h> 47 #include <ctype.h> 48 #include <errno.h> 49 #include <float.h> 50 #include <limits.h> 51 #include <locale.h> 52 #include <math.h> 53 #include <setjmp.h> 54 #include <signal.h> 55 #include <stdarg.h> 56 #include <stddef.h> 57 #include <stdio.h> 58 #include <stdlib.h> 59 #include <string.h> 60 #include <time.h> 61 62 63 /*************************************************************** 64 65 Definitions 66 67 ***************************************************************/ 68 69 /*************************************************************** 70 71 Define Major Hardware Implementation 72 73 TTY is the default implementation. 74 It is the most minimal, but the most 75 universal hardware implementation. 76 77 If you use TTY then check the settings 78 in bwx_tty.c for your system. 79 80 81 ***************************************************************/ 82 83 84 85 /* 86 ** 87 ** Here is where you should #include any implementation 88 ** specific files to #define your preferences 89 ** 90 ** 91 #include "bwb_user.h" 92 ** 93 ** 94 ** 95 ** 96 */ 97 98 /* 99 ** 100 ** Attempt to detect the Operating System 101 ** 102 */ 103 #if defined(HAVE_UNIX) 104 /* 105 ** 106 ** UNIX-style Operating Systems 107 ** 108 */ 109 #elif defined(HAVE_MSDOS) 110 /* 111 ** 112 ** MSDOS-style Operating Systems 113 ** 114 */ 115 #elif defined(HAVE_CMS) 116 /* 117 ** 118 ** GCC 3 for CMS on Hercules 119 ** 120 */ 121 #elif defined(HAVE_MVS) 122 /* 123 ** 124 ** GCC 3 for MVS on Hercules 125 ** 126 */ 127 #elif defined(__CMS__) 128 129 #define HAVE_CMS TRUE 130 131 #elif defined(__MVS__) 132 133 #define HAVE_MVS TRUE 134 135 #elif defined(_DOS) 136 137 #define HAVE_MSDOS TRUE 138 139 #elif defined(_WIN16) 140 141 #define HAVE_MSDOS TRUE 142 143 #elif defined(_WIN32) 144 145 #define HAVE_MSDOS TRUE 146 147 #elif defined(_WIN64) 148 149 #define HAVE_MSDOS TRUE 150 151 #elif defined(__unix__) 152 153 #define HAVE_UNIX TRUE 154 155 #elif defined(__unix) 156 157 #define HAVE_UNIX TRUE 158 159 #elif defined(__APPLE__) 160 161 #define HAVE_UNIX TRUE 162 163 #elif defined(__MACH__) 164 165 #define HAVE_UNIX TRUE 166 167 #elif defined(__BORLANDC__) 168 169 #define HAVE_MSDOS TRUE 170 171 #elif defined(__DMC__) 172 173 #define HAVE_MSDOS TRUE 174 175 #elif defined(__WATCOM__) 176 177 #define HAVE_MSDOS TRUE 178 179 #else 180 /* 181 ** 182 ** Unable to detect the operaating syystem 183 ** 184 */ 185 #endif 186 187 /*------------------------------------------------------------- 188 ENVIRONMENT specific configuration 189 -------------------------------------------------------------*/ 190 191 #if HAVE_UNIX 192 /* 193 ** 194 ** UNIX-style Operating Systems 195 ** 196 */ 197 /* 198 ** 199 ** If I understand correctly, my development environment is 200 ** GCC 4.9 for Linux via CCTools for Android in a BusyBox 201 ** environment under a Java simulation of an ARM processor 202 ** on a Barnes & Noble $69 Nook Tablet. What could possibly 203 ** go wrong? When you finish laughing, it actually works. 204 ** 205 ** I compile with: gcc -ansi -o bwbasic bw*.c 206 ** 207 */ 208 #include <unistd.h> 209 #include <sys/stat.h> 210 211 #ifndef DIRECTORY_CMDS 212 #define DIRECTORY_CMDS TRUE 213 #endif /* DIRECTORY_CMDS */ 214 215 #ifndef MKDIR_ONE_ARG 216 #define MKDIR_ONE_ARG FALSE 217 #endif /* MKDIR_ONE_ARG */ 218 219 #ifndef PERMISSIONS 220 #define PERMISSIONS 0x0644 221 #endif /* PERMISSIONS */ 222 223 #ifndef DEF_EDITOR 224 #define DEF_EDITOR "nano" 225 #endif /* DEF_EDITOR */ 226 227 #ifndef HAVE_UNIX_GCC 228 #if __GNUC__ 229 #define HAVE_UNIX_GCC TRUE 230 #else 231 #define HAVE_UNIX_GCC FALSE 232 #endif /* __GNUC__ */ 233 #endif /* HAVE_UNIX_GCC */ 234 235 #endif /* HAVE_UNIX */ 236 237 /*-----------------------------------------------------------*/ 238 239 #if HAVE_MSDOS 240 /* 241 ** 242 ** MSDOS-style Operating Systems 243 ** 244 */ 245 #if __WATCOM__ 246 #include <direct.h> /* OpenWatcom 1.9 for DOS */ 247 #else 248 #include <dir.h> /* all others */ 249 #endif /* __WATCOM__ */ 250 251 #ifndef DIRECTORY_CMDS 252 #define DIRECTORY_CMDS TRUE 253 #endif /* DIRECTORY_CMDS */ 254 255 #ifndef MKDIR_ONE_ARG 256 #define MKDIR_ONE_ARG TRUE 257 #endif /* MKDIR_ONE_ARG */ 258 259 #ifndef PERMISSIONS 260 #define PERMISSIONS 0 261 #endif /* PERMISSIONS */ 262 263 #ifndef DEF_EDITOR 264 #define DEF_EDITOR "edit" 265 #endif /* DEF_EDITOR */ 266 267 #ifndef DEF_FILES 268 #define DEF_FILES "dir /w" 269 #endif /* DEF_FILES */ 270 271 #ifndef HAVE_UNIX_GCC 272 #define HAVE_UNIX_GCC FALSE 273 #endif /* HAVE_UNIX_GCC */ 274 275 #endif /* HAVE_MSDOS */ 276 277 /*-----------------------------------------------------------*/ 278 279 #if HAVE_CMS 280 /* 281 ** 282 ** GCC 3 for CMS on Hercules 283 ** 284 */ 285 #include "bwd_six.h" 286 287 #ifndef PROFILENAME 288 #define PROFILENAME "PROFILE BAS" 289 #endif /* PROFILENAME */ 290 291 #if FALSE 292 /* 293 ** 294 ** bwBASIC 3.10: OPTION STDERR "LPRINT OUT" 295 ** 296 */ 297 #ifndef LPRINTFILENAME 298 #define LPRINTFILENAME "LPRINT OUT" 299 #endif /* LPRINTFILENAME */ 300 #endif /* FALSE */ 301 302 #if FALSE 303 /* 304 ** 305 ** bwBASIC 3.10: OPTION STDERR "ERROR OUT" 306 ** 307 */ 308 #ifndef ERRFILE 309 #define ERRFILE "ERROR OUT" 310 #endif /* ERRFILE */ 311 #endif /* FALSE */ 312 313 #if FALSE 314 /* 315 ** 316 ** bwBASIC 3.20: OPTION PROMPT "bwBASIC:" + CHR$(10) 317 ** 318 */ 319 #ifndef DEF_PROMPT 320 #define DEF_PROMPT "bwBASIC:\n" 321 #endif /* DEF_PROMPT */ 322 #endif /* FALSE */ 323 324 #ifndef DEF_EXTENSION 325 #define DEF_EXTENSION " BAS" 326 #endif /* DEF_EXTENSION */ 327 328 #ifndef DIRECTORY_CMDS 329 #define DIRECTORY_CMDS FALSE 330 #endif /* DIRECTORY_CMDS */ 331 332 #ifndef HAVE_UNIX_GCC 333 #define HAVE_UNIX_GCC FALSE 334 #endif /* HAVE_UNIX_GCC */ 335 336 #endif /* HAVE_CMS */ 337 338 /*---------------------------------------------------------------*/ 339 340 #ifdef HAVE_MVS 341 /* 342 ** 343 ** GCC 3 for MVS on Hercules 344 ** 345 */ 346 #include "bwd_six.h" 347 348 #ifndef PROFILENAME 349 #define PROFILENAME "dd:profile" 350 #endif /* PROFILENAME */ 351 352 #if FALSE 353 /* 354 ** 355 ** bwBASIC 3.10: OPTION STDERR "dd:lprint" 356 ** 357 */ 358 #ifndef LPRINTFILENAME 359 #define LPRINTFILENAME "dd:lprint" 360 #endif /* LPRINTFILENAME */ 361 #endif /* FALSE */ 362 363 #if FALSE 364 /* 365 ** 366 ** bwBASIC 3.10: OPTION STDERR "dd:errout" 367 ** 368 */ 369 #ifndef ERRFILE 370 #define ERRFILE "dd:errout" 371 #endif /* ERRFILE */ 372 #endif /* FALSE */ 373 374 #if FALSE 375 /* 376 ** 377 ** bwBASIC 3.20: OPTION PROMPT "bwBASIC:" + CHR$(10) 378 ** 379 */ 380 #ifndef DEF_PROMPT 381 #define DEF_PROMPT "bwBASIC:\n" 382 #endif /* DEF_PROMPT */ 383 #endif /* FALSE */ 384 385 #ifndef DEF_EXTENSION 386 #define DEF_EXTENSION "" 387 #endif /* DEF_EXTENSION */ 388 389 #ifndef DIRECTORY_CMDS 390 #define DIRECTORY_CMDS FALSE 391 #endif /* DIRECTORY_CMDS */ 392 393 #ifndef HAVE_UNIX_GCC 394 #define HAVE_UNIX_GCC FALSE 395 #endif /* HAVE_UNIX_GCC */ 396 397 #endif /* HAVE_MVS */ 398 399 400 /*************************************************************** 401 402 This ends the section of definitions that 403 users of bwBASIC might want to specify. 404 The following are internally defined. 405 406 Note that you might want to #define the default 407 FILES command and the default EDITOR above. 408 409 ***************************************************************/ 410 411 412 413 /* 414 ** 415 ** 416 ** If you want to change any of these values, 417 ** then you should #define them above. 418 ** 419 ** 420 */ 421 422 #ifndef HAVE_UNIX_GCC 423 /* 424 ** TRUE: 425 ** sleep() is an intrinsic C functions in GCC using -ansi 426 ** FALSE: 427 ** sleep() is defined in bwb_int.c to do nothing 428 ** 429 */ 430 #define HAVE_UNIX_GCC FALSE 431 #endif /* HAVE_UNIX_GCC */ 432 433 #ifndef PROFILE 434 /* 435 ** 436 ** TRUE: 437 ** automatically execute PROFILENAME line-by-line before parsing command line parameters 438 ** FALSE: 439 ** do not automatically execute PROFILENAME 440 ** 441 */ 442 #define PROFILE TRUE 443 #endif /* PROFILE */ 444 445 #ifndef PROFILENAME 446 /* 447 ** 448 ** Filename for PROFILE, only used when PROFILE == TRUE 449 ** This file contains the various OPTION commands 450 ** 451 */ 452 #define PROFILENAME "profile.bas" 453 #endif /* PROFILENAME */ 454 455 #if FALSE 456 /* 457 ** 458 ** bwBASIC 3.10: OPTION STDERR "err.out" 459 ** bwBASIC 3.10: OPTION STDERR "LPRINT.OUT" 460 ** 461 */ 462 #ifndef REDIRECT_STDERR 463 /* 464 ** 465 ** redirect STDERR 466 ** 467 */ 468 #define REDIRECT_STDERR FALSE 469 #endif /* REDIRECT_STDERR */ 470 #ifndef ERRFILE 471 /* 472 ** 473 ** Filename for redirected stderr 474 ** 475 */ 476 #define ERRFILE "err.out" 477 #endif /* ERRFILE */ 478 #ifndef LPRINTFILENAME 479 /* 480 ** 481 ** Filename for LPRINT output 482 ** 483 */ 484 #define LPRINTFILENAME "LPRINT.OUT" 485 #endif /* LPRINTFILENAME */ 486 #endif /* FALSE */ 487 488 #ifndef DIRECTORY_CMDS 489 /* 490 ** 491 ** enable MKDIR, CHDIR, RMDIR 492 ** 493 */ 494 #define DIRECTORY_CMDS TRUE 495 #endif /* DIRECTORY_CMDS */ 496 497 #ifndef MKDIR_ONE_ARG 498 /* 499 ** 500 ** TRUE if your mkdir has one argument 501 ** only used when DIRECTORY_CMDS == TRUE 502 ** 503 */ 504 #define MKDIR_ONE_ARG FALSE 505 #endif /* MKDIR_ONE_ARG */ 506 507 #ifndef PERMISSIONS 508 /* 509 ** 510 ** permissions to set in a Unix-type system 511 ** only used when MKDIR_ONE_ARG == FALSE 512 ** 513 */ 514 #define PERMISSIONS 0x0644 515 #endif /* PERMISSIONS */ 516 517 #if FALSE 518 /* 519 ** 520 ** bwBASIC 3.20: OPTION PROMPT "bwBASIC: " 521 ** 522 */ 523 #ifndef DEFVNAME_PROMPT 524 /* 525 ** 526 ** variable name for PROMPT 527 ** 528 */ 529 #define DEFVNAME_PROMPT "BWB.PROMPT$" 530 #endif /* DEFVNAME_PROMPT */ 531 #endif /* FALSE */ 532 533 #ifndef DEF_PROMPT 534 /* 535 ** 536 ** default value for OPTION PROMPT 537 ** 538 */ 539 #define DEF_PROMPT "bwBASIC: " 540 #endif /* DEF_PROMPT */ 541 542 #ifndef DEF_EXTENSION 543 /* 544 ** 545 ** default value for OPTION EXTENSION 546 ** 547 */ 548 #define DEF_EXTENSION ".bas" 549 #endif /* DEF_EXTENSION */ 550 551 #if FALSE 552 /* 553 ** 554 ** bwBASIC 3.20: OPTION EDIT "vi" 555 ** 556 */ 557 #ifndef DEFVNAME_EDITOR 558 /* 559 ** 560 ** variable name for EDIT command 561 ** 562 */ 563 #define DEFVNAME_EDITOR "BWB.EDITOR$" 564 #endif /* DEFVNAME_EDITOR */ 565 #endif /* FALSE */ 566 567 #ifndef DEF_EDITOR 568 /* 569 ** 570 ** default value for OPTION EDIT 571 ** 572 **/ 573 #define DEF_EDITOR "vi" 574 #endif /* DEF_EDITOR */ 575 576 #if FALSE 577 /* 578 ** 579 ** bwBASIC 3.20: OPTION FILES "ls -Fx" 580 ** 581 */ 582 #ifndef DEFVNAME_FILES 583 /* 584 ** 585 ** variable name for FILES command 586 ** 587 */ 588 #define DEFVNAME_FILES "BWB.FILES$" 589 #endif /* DEFVNAME_FILES */ 590 #endif /* FALSE */ 591 592 #ifndef DEF_FILES 593 /* 594 ** 595 ** default value for OPTION FILES 596 ** 597 */ 598 #define DEF_FILES "ls -Fx" 599 #endif /* DEF_FILES */ 600 601 #if FALSE 602 /* 603 ** 604 ** bwBASIC 3.20: not used 605 ** 606 */ 607 #ifndef DEFVNAME_COLORS 608 /* 609 ** 610 ** variable name for COLORS 611 ** 612 */ 613 #define DEFVNAME_COLORS "BWB.COLORS" 614 #endif /* DEFVNAME_COLORS */ 615 #ifndef DEF_COLORS 616 /* 617 ** 618 ** default value for COLORS 619 ** 620 */ 621 #define DEF_COLORS 256 622 #endif /* DEF_COLORS */ 623 #endif /* FALSE */ 624 625 #if FALSE 626 /* 627 ** 628 ** bwBASIC 3.20: not used 629 ** 630 */ 631 #ifndef DEFVNAME_IMPL 632 /* 633 ** 634 ** variable name for IMPLEMENTATION 635 ** 636 */ 637 #define DEFVNAME_IMPL "BWB.IMPLEMENTATION$" 638 #endif /* DEFVNAME_IMPL */ 639 #ifndef IMP_IDSTRING 640 /* 641 ** 642 ** default value for IMPLEMENTATION 643 ** 644 */ 645 #define IMP_IDSTRING "TTY" 646 #endif /* IMP_IDSTRING */ 647 #endif /* FALSE */ 648 649 #if FALSE 650 /* 651 ** 652 ** bwBASIC 3.20: OPTION RENUM "renum" 653 ** 654 */ 655 #ifndef DEFVNAME_RENUM 656 /* 657 ** 658 ** variable name for RENUM command 659 ** 660 */ 661 #define DEFVNAME_RENUM "BWB.RENUM$" 662 #endif /* DEFVNAME_RENUM */ 663 #endif /* FALSE */ 664 665 #ifndef DEF_RENUM 666 /* 667 ** 668 ** default value for OPTION RENUM 669 ** 670 */ 671 #define DEF_RENUM "renum" 672 #endif /* DEF_RENUM */ 673 674 #ifndef EXECLEVELS 675 /* 676 ** 677 ** maximum EXEC stack levels 678 ** only used to prevent run away recursion, such as: 679 ** 100 GOSUB 100 680 ** 681 */ 682 #define EXECLEVELS 255 683 #endif /* EXECLEVELS */ 684 685 #ifndef MAX_DIMS 686 /* 687 ** 688 ** maximum number of array dimensions 689 ** 690 */ 691 #define MAX_DIMS 3 692 #endif /* MAX_DIMS */ 693 694 #if FALSE 695 /* 696 ** 697 ** bwBASIC 3.10: not used 698 ** 699 */ 700 #ifndef ESTACKSIZE 701 /* 702 ** 703 ** maximum number of elements in expression stack 704 ** 705 */ 706 #define ESTACKSIZE 64 707 #endif /* ESTACKSIZE */ 708 #endif /* FALSE */ 709 710 /* 711 ** ============================================================ 712 ** 713 ** 714 ** UNLESS YOU ARE WORKING ON THE INTERNALS, 715 ** YOU SHOULD NOT GO BEYOND HERE. 716 ** CHANGING ANY OF THESE VALUES IS NOT SUPPORTED. 717 ** 718 ** ============================================================ 719 */ 720 721 722 723 /* 724 The relationship of numeric values is REQUIRED to be: 725 726 MAXDBL >= MAXSNG >= MAXCUR >= MAXLNG >= MAXINT > MAXLEN >= MAXBYT > 0 727 MINDBL <= MINSNG <= MINCUR <= MINLNG <= MININT < 0 728 MINLEN == MINBYT == MINDEV == 0 729 730 MAXDEV > 0 731 MAXBYT == 255 732 MAXINT >= 32000 733 MININT <= -32000 734 MAXSNG >= 1E37 735 MINSNG <= -1E37 736 */ 737 738 /* 739 740 switch( TypeCode ) 741 { 742 case ByteTypeCode: 743 break; 744 case IntegerTypeCode: 745 break; 746 case LongTypeCode: 747 break; 748 case CurrencyTypeCode: 749 break; 750 case SingleTypeCode: 751 break; 752 case DoubleTypeCode: 753 break; 754 case StringTypeCode: 755 break; 756 default: 757 { WARN_INTERNAL_ERROR; return ...; } 758 } 759 760 */ 761 762 763 /*------------------------------------------------------------- 764 BASIC BYTE 765 OPTION PUNCT BYTE "~" 766 -------------------------------------------------------------*/ 767 #ifndef ByteTypeCode 768 typedef unsigned char ByteType; 769 #define MINBYT 0 770 #define MAXBYT ( UCHAR_MAX ) 771 #define ByteTypeCode '1' 772 #endif /* ByteTypeCode */ 773 774 /*------------------------------------------------------------- 775 BASIC INTEGER 776 OPTION PUNCT INTEGER "%" 777 -------------------------------------------------------------*/ 778 #ifndef IntegerTypeCode 779 typedef int IntegerType; 780 #define MININT ( INT_MIN ) 781 #define MAXINT ( INT_MAX ) 782 /* 783 ** 784 ** minimum USER line number 785 ** must be > 0 786 ** 787 */ 788 #define MINLIN 1 789 /* 790 ** 791 ** maximum USER line number 792 ** must be < MAXINT 793 ** 794 */ 795 #define MAXLIN ( MAXINT - 1 ) 796 /* 797 ** 798 ** number of digits for line numbers 799 ** line numbers 1 to 99999 use 5 digits 800 ** 801 */ 802 #define LineNumberDigits 5 803 /* 804 ** 805 ** default maximum line length, must be < MAXINT 806 ** OPTION LINE 255 807 ** 808 */ 809 #define MAX_LINE_LENGTH 255 810 #define IntegerTypeCode '2' 811 #endif /* IntegerTypeCode */ 812 813 /*------------------------------------------------------------- 814 BASIC LONG 815 OPTION PUNCT LONG "&" 816 -------------------------------------------------------------*/ 817 #ifndef LongTypeCode 818 typedef long LongType; 819 #define MINLNG ( LONG_MIN ) 820 #define MAXLNG ( LONG_MAX ) 821 822 #define HexScanFormat "%lx%n" 823 #define OctScanFormat "%lo%n" 824 #define LongTypeCode '3' 825 #endif /* LongTypeCode */ 826 827 /*------------------------------------------------------------- 828 BASIC CURRENCY 829 OPTION PUNCT CURRENCY "@" 830 -------------------------------------------------------------*/ 831 #ifndef CurrencyTypeCode 832 /* 833 ** 834 ** Deprecated, to be removed in bwBASIC 3.30 835 ** 836 */ 837 typedef long CurrencyType; 838 #define MINCUR ( LONG_MIN ) 839 #define MAXCUR ( LONG_MAX ) 840 #define CurrencyTypeCode '4' 841 #endif /* CurrencyTypeCode */ 842 843 /*------------------------------------------------------------- 844 BASIC SINGLE 845 OPTION PUNCT SINGLE "!" 846 -------------------------------------------------------------*/ 847 #ifndef SingleTypeCode 848 typedef float SingleType; 849 #define MINSNG ( -FLT_MAX ) 850 #define MAXSNG ( FLT_MAX ) 851 #define SingleTypeCode '5' 852 #endif /* SingleTypeCode */ 853 854 /*------------------------------------------------------------- 855 BASIC DOUBLE 856 OPTION PUNCT DOUBLE "#" 857 -------------------------------------------------------------*/ 858 #ifndef DoubleTypeCode 859 typedef double DoubleType; 860 #define MINDBL ( -DBL_MAX ) 861 #define MAXDBL ( DBL_MAX ) 862 #define DecScanFormat "%lg%n" 863 #define DoubleTypeCode '6' 864 #endif /* DoubleTypeCode */ 865 866 /*------------------------------------------------------------- 867 BASIC STRING 868 OPTION PUNCT STRING "$" 869 -------------------------------------------------------------*/ 870 #ifndef StringTypeCode 871 /* 872 ** 873 ** minimum length of a BASIC string 874 ** must be zero 875 ** 876 */ 877 #define MINLEN 0 878 /* 879 ** 880 ** maximum length of a BASIC string 881 ** must be < MAXINT 882 */ 883 #define MAXLEN 255 884 #define StringTypeCode '7' 885 #endif /* StringTypeCode */ 886 887 888 /*------------------------------------------------------------- 889 BASIC DEVICE 890 -------------------------------------------------------------*/ 891 #ifndef MINDEV 892 /* 893 ** 894 ** minimum numbwe of OPEN files 895 ** must be zero 896 ** 897 */ 898 #define MINDEV 0 899 #endif /* MINDEV */ 900 901 #ifndef MAXDEV 902 /* 903 ** 904 ** maximum numbwe of OPEN files 905 ** not counting stdin, stdout, stderr 906 ** 907 */ 908 #define MAXDEV ( FOPEN_MAX - 3 ) 909 #endif /* MAXDEV */ 910 911 #if FALSE 912 /* 913 ** 914 ** bwBASIC 3.20: OPTION PUNCT FILENUM "#" 915 ** 916 */ 917 #ifndef FileNumberPrefix 918 #define FileNumberPrefix '#' 919 #endif /* FileNumberPrefix */ 920 #endif /* FALSE */ 921 922 923 /*------------------------------------------------------------- 924 BASIC MISCELLANEOUS 925 -------------------------------------------------------------*/ 926 927 928 #ifndef NameLengthMax 929 /* 930 ** 931 ** maximum BASIC keyword length 932 ** Applies to ALL keywords in BASIC, incuding: 933 ** variables, functions, subroutines, commands and labels. 934 ** 935 */ 936 #define NameLengthMax 40 937 #endif /* NameLengthMax */ 938 939 #ifndef SIGNIFICANT_DIGITS 940 /* 941 ** 942 ** default setting for OPTION DIGITS 943 ** minimum is 6 for BASIC 944 ** OPTION DIGITS 6 945 ** 946 */ 947 #define SIGNIFICANT_DIGITS 6 948 #endif /* SIGNIFICANT_DIGITS */ 949 950 #ifndef EXPONENT_DIGITS 951 /* 952 ** 953 ** number of exrad digits 954 ** minimum value is 2 for BASIC 955 ** 956 */ 957 #if (DBL_MAX_10_EXP) < 100 958 /* 959 ** 960 ** Exponenet range is within 1E-99 to 1E+99 961 ** ANSI C89 requires at least 1E-37 to 1E+37 962 ** 963 */ 964 #define EXPONENT_DIGITS 2 965 #elif (DBL_MAX_10_EXP) < 1000 966 /* 967 ** 968 ** Exponenet range is within 1E-999 to 1E+999 969 ** includes ANSI/IEEE Std 754-1985 970 ** 971 */ 972 #define EXPONENT_DIGITS 3 973 #elif (DBL_MAX_10_EXP) < 10000 974 /* 975 ** 976 ** Exponenet range is within 1E-9999 to 1E+9999 977 ** 978 */ 979 #define EXPONENT_DIGITS 4 980 #elif (DBL_MAX_10_EXP) < 100000 981 /* 982 ** 983 ** Exponenet range is within 1E-99999 to 1E+99999 984 ** 985 */ 986 #define EXPONENT_DIGITS 5 987 #else 988 /* 989 ** 990 ** Exponenet range is within 1E-999999 to 1E+999999 991 ** 992 */ 993 #define EXPONENT_DIGITS 6 994 #endif 995 #endif /* EXPONENT_DIGITS */ 996 997 #ifndef ZONE_WIDTH 998 /* 999 ** 1000 ** default setting for OPTION ZONE 1001 ** ECMA-55, Section 14.4 1002 ** 1003 */ 1004 #define ZONE_WIDTH ( SIGNIFICANT_DIGITS + EXPONENT_DIGITS + 6 ) 1005 #endif /* ZONE_WIDTH */ 1006 1007 #ifndef MINIMUM_DIGITS 1008 /* 1009 ** 1010 ** minimum setting for OPTION DIGITS 1011 ** 1012 */ 1013 #define MINIMUM_DIGITS 1 1014 #endif /* MINIMUM_DIGITS */ 1015 1016 #ifndef MAXIMUM_DIGITS 1017 /* 1018 ** 1019 ** maximum setting for OPTION DIGITS 1020 ** 1021 */ 1022 #define MAXIMUM_DIGITS ( DBL_DIG ) 1023 #endif /* MAXIMUM_DIGITS */ 1024 1025 #ifndef MINIMUM_SCALE 1026 /* 1027 ** 1028 ** minimum setting for OPTION SCALE 1029 ** zero disables scaling 1030 ** 1031 */ 1032 #define MINIMUM_SCALE 0 1033 #endif /* MINIMUM_SCALE */ 1034 1035 #ifndef MAXIMUM_SCALE 1036 /* 1037 ** 1038 ** maximum setting for OPTION SCALE 1039 ** 1040 */ 1041 #define MAXIMUM_SCALE ( DBL_DIG ) 1042 #endif /* MAXIMUM_SCALE */ 1043 1044 #ifndef MINIMUM_ZONE 1045 /* 1046 ** 1047 ** minimum setting for OPTION ZONE 1048 ** 1049 */ 1050 #define MINIMUM_ZONE 1 1051 #endif /* MINIMUM_ZONE */ 1052 1053 #ifndef MAXIMUM_ZONE 1054 /* 1055 ** 1056 ** maximum setting for OPTION ZONE 1057 ** 1058 */ 1059 #define MAXIMUM_ZONE 79 1060 #endif /* MAXIMUM_ZONE */ 1061 1062 #ifndef NUMLEN 1063 /* 1064 ** 1065 ** small buffer for converting numbers to strings 1066 ** FormatBasicNumber, sprintf("%f"), sprintf("%d") and so on 1067 ** 1068 */ 1069 #define NUMLEN 64 1070 #endif /* NUMLEN */ 1071 1072 #ifndef MAX_ERR_LENGTH 1073 /* 1074 ** 1075 ** maximum length of ERROR$ 1076 ** 1077 */ 1078 #define MAX_ERR_LENGTH 63 1079 #endif /* MAX_ERR_LENGTH */ 1080 1081 #ifndef MIN 1082 /* 1083 ** 1084 ** minimum of two numbers 1085 ** 1086 */ 1087 #define MIN( X, Y ) ( (X) < (Y) ? (X) : (Y) ) 1088 #endif /* MIN */ 1089 1090 #ifndef MAX 1091 /* 1092 ** 1093 ** maximum of two numbers 1094 ** 1095 */ 1096 #define MAX( X, Y ) ( (X) > (Y) ? (X) : (Y) ) 1097 #endif /* MAX */ 1098 1099 #if FALSE 1100 /* 1101 ** 1102 ** bwBASIC 3.20: not used 1103 ** 1104 */ 1105 #ifndef PRN_SPC 1106 /* 1107 ** 1108 ** internal code for SPC(X), next character is X. 1109 ** 1110 */ 1111 #define PRN_SPC 0x01 1112 #endif /* PRN_SPC */ 1113 #endif /* FALSE */ 1114 1115 #if FALSE 1116 /* 1117 ** 1118 ** bwBASIC 3.20: not used 1119 ** 1120 */ 1121 #ifndef PRN_TAB 1122 /* 1123 ** 1124 ** internal code for TAB(X), next character is X. 1125 ** 1126 */ 1127 #define PRN_TAB 0x02 1128 #endif /* PRN_TAB */ 1129 #endif /* FALSE */ 1130 1131 #ifndef NulChar 1132 /* 1133 ** 1134 ** the character that terminates a C string, commonly CHR$(0) 1135 ** 1136 */ 1137 #define NulChar '\0' /* NUL */ 1138 #endif /* NulChar */ 1139 1140 #ifndef THE_PRICE_IS_RIGHT 1141 /* 1142 ** 1143 ** enable various simple techinques to improve execution speed 1144 ** 1145 */ 1146 #define THE_PRICE_IS_RIGHT TRUE 1147 #endif /* THE_PRICE_IS_RIGHT */ 1148 1149 #ifndef MAINTAINER_BUFFER_LENGTH 1150 /* 1151 ** 1152 ** The length of buffers for MAINTINER commands 1153 ** 1154 **/ 1155 #define MAINTAINER_BUFFER_LENGTH 1023 1156 #endif /* MAINTAINER_BUFFER_LENGTH */ 1157 1158 /*------------------------------------------------------------- 1159 FUNCTION PARAMETER TYPES 1160 -------------------------------------------------------------*/ 1161 /* 1162 ** Bit 0 is the first parameter, bit 31 is the 32nd parameter. 1163 ** If the parameter is a string then the bit is set. 1164 ** If the parameter is a number then the bit is clear. 1165 */ 1166 typedef unsigned long ParamBitsType; 1167 1168 #ifndef MAX_FARGS 1169 #define MAX_FARGS ( sizeof( ParamBitsType ) * CHAR_BIT / 1 ) 1170 #endif /* MAX_FARGS */ 1171 1172 1173 #define PSTR( N ) ( 1 << ( N - 1 ) ) /* STRING parameter # 1 is bit 0 SET */ 1174 #define PNUM( N ) ( 0 ) /* NUMBER parameter # 1 is bit 0 CLR */ 1175 #define PNONE ( 0 ) /* function has no parameters */ 1176 1177 #define P1STR PSTR(1) 1178 #define P2STR PSTR(2) 1179 #define P3STR PSTR(3) 1180 #define P4STR PSTR(4) 1181 1182 #define P1NUM PNUM(1) 1183 #define P2NUM PNUM(2) 1184 #define P3NUM PNUM(3) 1185 #define P4NUM PNUM(4) 1186 1187 1188 /*------------------------------------------------------------- 1189 FUNCTION PARAMETER TESTS 1190 -------------------------------------------------------------*/ 1191 /* 1192 ** Nibble 0 is the first parameter, 1193 ** Nibble 7 is the 8th parameter. 1194 ** Each nibble is P1ANY and so on. 1195 */ 1196 typedef unsigned long ParamTestType; 1197 #define MAX_TESTS ( sizeof( ParamTestType ) * CHAR_BIT / 4 ) 1198 1199 /* 0x87654321 <- Parameter Number (max # of Range-Checked parameters to INTRINSIC functions is 8) */ 1200 #define P1ERR 0X00000000 /* INTERNAL ERROR */ 1201 #define P1ANY 0X00000001 /* X is any valid number , A$ is any valid string */ 1202 #define P1BYT 0x00000002 /* MIN_BYT <= X <= MAX_BYT , LEN(A$) >= sizeof(char) */ 1203 #define P1INT 0x00000003 /* SHRT_MIN <= X <= SHRT_MAX, LEN(A$) >= sizeof(int) */ 1204 #define P1LNG 0x00000004 /* LONG_MIN <= X <= LONG_MAX, LEN(A$) >= sizeof(long) */ 1205 #define P1CUR 0x00000005 /* LONG_MIN <= X <= LONG_MAX, LEN(A$) >= sizeof(long) */ 1206 #define P1FLT 0x00000006 /* MIN_FLT <= X <= MAX_FLT , LEN(A$) >= sizeof(float) */ 1207 #define P1DBL 0x00000007 /* MIN_DBL <= X <= MAX_DBL , LEN(A$) >= sizeof(double) */ 1208 #define P1DEV 0x00000008 /* RESERVED , RESERVED */ 1209 #define P1LEN 0x00000009 /* MIN_STR <= X <= MAX_STR , RESERVED */ 1210 #define P1POS 0x0000000A /* MIN_STR < X <= MAX_STR , RESERVED */ 1211 #define P1COM 0x0000000B /* X in (1,2,3,4) COMx , RESERVED */ 1212 #define P1LPT 0x0000000C /* X in (0,1,2,3) PRN,LPTx , RESERVED */ 1213 #define P1GTZ 0x0000000D /* X > 0 , RESERVED */ 1214 #define P1GEZ 0x0000000E /* X >= 0 , RESERVED */ 1215 #define P1NEZ 0x0000000F /* X <> 0 , RESERVED */ 1216 1217 #define P2ERR (P1ERR << 4) 1218 #define P2ANY (P1ANY << 4) 1219 #define P2BYT (P1BYT << 4) 1220 #define P2INT (P1INT << 4) 1221 #define P2LNG (P1LNG << 4) 1222 #define P2CUR (P1CUR << 4) 1223 #define P2FLT (P1FLT << 4) 1224 #define P2DBL (P1DBL << 4) 1225 #define P2DEV (P1DEV << 4) 1226 #define P2LEN (P1LEN << 4) 1227 #define P2POS (P1POS << 4) 1228 #define P2COM (P1COM << 4) 1229 #define P2LPT (P1LPT << 4) 1230 #define P2GTZ (P1GTZ << 4) 1231 #define P2GEZ (P1GEZ << 4) 1232 #define P2NEZ (P1NEZ << 4) 1233 1234 #define P3ERR (P1ERR << 8) 1235 #define P3ANY (P1ANY << 8) 1236 #define P3BYT (P1BYT << 8) 1237 #define P3INT (P1INT << 8) 1238 #define P3LNG (P1LNG << 8) 1239 #define P3CUR (P1CUR << 8) 1240 #define P3FLT (P1FLT << 8) 1241 #define P3DBL (P1DBL << 8) 1242 #define P3DEV (P1DEV << 8) 1243 #define P3LEN (P1LEN << 8) 1244 #define P3POS (P1POS << 8) 1245 #define P3COM (P1COM << 8) 1246 #define P3LPT (P1LPT << 8) 1247 #define P3GTZ (P1GTZ << 8) 1248 #define P3GEZ (P1GEZ << 8) 1249 #define P3NEZ (P1NEZ << 8) 1250 1251 #define P4ERR (P1ERR << 12) 1252 #define P4ANY (P1ANY << 12) 1253 #define P4BYT (P1BYT << 12) 1254 #define P4INT (P1INT << 12) 1255 #define P4LNG (P1LNG << 12) 1256 #define P4CUR (P1CUR << 12) 1257 #define P4FLT (P1FLT << 12) 1258 #define P4DBL (P1DBL << 12) 1259 #define P4DEV (P1DEV << 12) 1260 #define P4LEN (P1LEN << 12) 1261 #define P4POS (P1POS << 12) 1262 #define P4COM (P1COM << 12) 1263 #define P4LPT (P1LPT << 12) 1264 #define P4GTZ (P1GTZ << 12) 1265 #define P4GEZ (P1GEZ << 12) 1266 #define P4NEZ (P1NEZ << 12) 1267 1268 1269 1270 1271 1272 /*************************************************************** 1273 1274 Structures 1275 1276 ***************************************************************/ 1277 1278 /*------------------------------------------------------------- 1279 OPTION VERSION bitmask 1280 -------------------------------------------------------------*/ 1281 typedef unsigned long OptionVersionType; /* upto 32 BASIC dialects */ 1282 1283 /*------------------------------------------------------------- 1284 Result of attempt to parse 1285 -------------------------------------------------------------*/ 1286 typedef enum 1287 { 1288 RESULT_UNPARSED = 1, 1289 RESULT_ERROR, 1290 RESULT_SUCCESS 1291 } ResultType; 1292 1293 /*------------------------------------------------------------- 1294 STRINGS 1295 -------------------------------------------------------------*/ 1296 struct StringStructure 1297 { 1298 size_t length; /* length of string */ 1299 char *sbuffer; /* pointer to string buffer */ 1300 }; 1301 typedef struct StringStructure StringType; 1302 1303 1304 /*------------------------------------------------------------- 1305 VARIABLES 1306 -------------------------------------------------------------*/ 1307 union ValuePtrUnion 1308 { 1309 DoubleType *Number; /* memory for number */ 1310 StringType *String; /* memory for string */ 1311 }; 1312 typedef union ValuePtrUnion ValuePtrType; 1313 1314 struct VariableStructure 1315 { 1316 struct VariableStructure *next; /* next variable in chain */ 1317 char name[NameLengthMax + 1]; /* name */ 1318 ValuePtrType Value; /* memory for values */ 1319 size_t array_units; /* total number of units of memory */ 1320 int LBOUND[MAX_DIMS]; /* lower bound for each dimension */ 1321 int UBOUND[MAX_DIMS]; /* upper bound for each dimension */ 1322 int VINDEX[MAX_DIMS]; /* current index in each dimension */ 1323 int dimensions; /* number of dimensions, 0 == scalar */ 1324 unsigned char VariableFlags; /* VARIABLE_... */ 1325 char VariableTypeCode; /* StringTypeCode and so on */ 1326 }; 1327 typedef struct VariableStructure VariableType; 1328 #define VAR_IS_STRING( v ) ( v->VariableTypeCode == StringTypeCode ) 1329 /* VariableFlags */ 1330 #define VARIABLE_RESERVED_01 0x01 /* reserved for future use */ 1331 #define VARIABLE_RESERVED_02 0x02 /* reserved for future use */ 1332 #define VARIABLE_RESERVED_04 0x04 /* reserved for future use */ 1333 #define VARIABLE_CONSTANT 0x08 /* CONST variable: value cannot be changed again */ 1334 #define VARIABLE_VIRTUAL 0x10 /* VIRTUAL variable: values are stored in disk file */ 1335 #define VARIABLE_DISPLAY 0x20 /* DSP variable: display every assignment */ 1336 #define VARIABLE_PRESET 0x40 /* preset variable: CLEAR should not delete */ 1337 #define VARIABLE_COMMON 0x80 /* COMMON variable: available to CHAINed program */ 1338 1339 1340 /*------------------------------------------------------------- 1341 LINES 1342 -------------------------------------------------------------*/ 1343 struct LineStructure 1344 { 1345 struct LineStructure *next; /* pointer to next line in chain */ 1346 struct LineStructure *OtherLine; /* pointer to other line in loops */ 1347 char *buffer; /* buffer to hold the line */ 1348 int number; /* line number */ 1349 int position; /* current position in line */ 1350 int cmdnum; /* C_... */ 1351 int Startpos; /* start of rest of line read from buffer */ 1352 int Indention; /* structure command indention level */ 1353 int IncludeLevel; /* %INCLUDE file level */ 1354 unsigned char LineFlags; /* LINE_... */ 1355 }; 1356 typedef struct LineStructure LineType; 1357 /* LineFlags */ 1358 #define LINE_EXECUTED 0x01 /* line was executed */ 1359 #define LINE_NUMBERED 0x02 /* line was manually numbered */ 1360 #define LINE_BREAK 0x04 /* BREAK line */ 1361 #define LINE_USER 0x08 /* USER line executing from console */ 1362 #define LINE_RESERVED_10 0x10 /* reserved for future use */ 1363 #define LINE_RESERVED_20 0x20 /* reserved for future use */ 1364 #define LINE_RESERVED_40 0x40 /* reserved for future use */ 1365 #define LINE_RESERVED_80 0x80 /* reserved for future use */ 1366 1367 1368 /*------------------------------------------------------------- 1369 USER FUNCTIONS, SUBS and LABELS 1370 -------------------------------------------------------------*/ 1371 struct UserFunctionStructure 1372 { 1373 struct UserFunctionStructure *next; 1374 char *name; 1375 char ReturnTypeCode; /* StringTypeCode and so on */ 1376 unsigned char ParameterCount; /* 0..MAX_FARGS, 255 == VARIANT (...) */ 1377 ParamBitsType ParameterTypes; /* parameter signature, must hold MAX_FARGS bits */ 1378 LineType *line; /* points to the FUNCTION, SUB, or LABEL line */ 1379 int startpos; /* starting position in line */ 1380 VariableType *local_variable; /* local variables for this function or sub */ 1381 OptionVersionType OptionVersionBitmask; /* OPTION VERSION bitmask */ 1382 }; 1383 typedef struct UserFunctionStructure UserFunctionType; 1384 1385 1386 /*------------------------------------------------------------- 1387 INTRINSIC FUNCTIONS 1388 -------------------------------------------------------------*/ 1389 struct IntrinsicFunctionStructure 1390 { 1391 const int FunctionID; /* F_... */ 1392 const char *Syntax; /* the syntax of the function */ 1393 const char *Description; /* the description of the function */ 1394 const char *Name; /* the name of the function, such as "MID$" */ 1395 const char ReturnTypeCode; /* StringTypeCode and so on */ 1396 const unsigned char ParameterCount; /* 0..MAX_FARGS, 255 == VARIANT (...) */ 1397 const ParamBitsType ParameterTypes; /* parameter signature, holds MAX_FARGS bits */ 1398 const ParamTestType ParameterTests; /* parameter checks, must hold 8 nibbles, only first 8 parameters */ 1399 OptionVersionType OptionVersionBitmask; /* OPTION VERSION bitmask */ 1400 }; 1401 typedef struct IntrinsicFunctionStructure IntrinsicFunctionType; 1402 extern IntrinsicFunctionType IntrinsicFunctionTable[ /* NUM_FUNCTIONS */ ]; 1403 extern const size_t NUM_FUNCTIONS; 1404 1405 1406 /*------------------------------------------------------------- 1407 INTRINSIC COMMANDS 1408 -------------------------------------------------------------*/ 1409 struct CommandStructure 1410 { 1411 const int CommandID; /* C_... */ 1412 const char *Syntax; /* the syntax of the command */ 1413 const char *Description; /* the description of the command */ 1414 const char *name; /* the name of the command, such as "PRINT" */ 1415 OptionVersionType OptionVersionBitmask; /* OPTION VERSION bitmask */ 1416 }; 1417 typedef struct CommandStructure CommandType; 1418 extern CommandType IntrinsicCommandTable[ /* NUM_COMMANDS */ ]; 1419 extern const size_t NUM_COMMANDS; 1420 1421 1422 /*------------------------------------------------------------- 1423 FILES 1424 -------------------------------------------------------------*/ 1425 struct FileStructure 1426 { 1427 struct FileStructure *next; 1428 int FileNumber; /* 1-based file number used to OPEN the file ( 0 for SYSIN/SYSOUT, -1 for SYSPRN */ 1429 int DevMode; /* DEVMODE_... */ 1430 int width; /* 1-based width for OUTPUT and APPEND; reclen for RANDOM; not used for INPUT or BINARY */ 1431 int col; /* 1-based current column for OUTPUT and APPEND */ 1432 int row; /* 1-based current row for OUTPUT and APPEND */ 1433 int EOF_LineNumber; /* IF END # filenumber THEN EOF_linenumber */ 1434 FILE *cfp; /* C file pointer for this device */ 1435 char *buffer; /* pointer to character buffer for RANDOM */ 1436 char delimit; /* DELIMIT for READ and WRITE */ 1437 char *FileName; /* File Name */ 1438 }; 1439 typedef struct FileStructure FileType; 1440 /* DevMode */ 1441 #define DEVMODE_CLOSED 0x00 1442 #define DEVMODE_INPUT 0x01 1443 #define DEVMODE_OUTPUT 0x02 1444 #define DEVMODE_RANDOM 0x04 1445 #define DEVMODE_APPEND 0x08 1446 #define DEVMODE_VIRTUAL 0x10 1447 #define DEVMODE_BINARY 0x20 1448 #define DEVMODE_X40 0x40 /* reserved for future use */ 1449 #define DEVMODE_X80 0x80 /* reserved for future use */ 1450 #define DEVMODE_READ (DEVMODE_INPUT | DEVMODE_RANDOM | DEVMODE_BINARY ) 1451 #define DEVMODE_WRITE (DEVMODE_OUTPUT | DEVMODE_RANDOM | DEVMODE_APPEND | DEVMODE_BINARY ) 1452 1453 1454 /*------------------------------------------------------------- 1455 FIELDS in a RANDOM file 1456 -------------------------------------------------------------*/ 1457 struct FieldStructure 1458 { 1459 /* only used for RANDOM files in dialects with a FIELD command */ 1460 struct FieldStructure *next; 1461 FileType *File; 1462 int FieldOffset; 1463 int FieldLength; 1464 VariableType *Var; 1465 int VINDEX[MAX_DIMS]; /* current position in array */ 1466 }; 1467 typedef struct FieldStructure FieldType; 1468 1469 1470 /*------------------------------------------------------------- 1471 VIRTUAL VARIABLES 1472 -------------------------------------------------------------*/ 1473 struct VirtualStructure 1474 { 1475 /* only used for VIRTUAL variables in dialects with a DIM # command */ 1476 struct VirtualStructure *next; 1477 int FileNumber; /* note: the file can be opened AFTER the variable is declared */ 1478 size_t FileOffset; /* byte offset from the beginning of the file */ 1479 int FileLength; /* sizeof( DoubleType ) or Fixed String Length */ 1480 VariableType *Variable; /* the variable */ 1481 }; 1482 typedef struct VirtualStructure VirtualType; 1483 1484 1485 /*------------------------------------------------------------- 1486 STACK 1487 -------------------------------------------------------------*/ 1488 struct StackStructure 1489 { 1490 struct StackStructure *next; 1491 LineType *line; /* line for execution */ 1492 int ExecCode; /* EXEC_... */ 1493 VariableType *local_variable; /* local variables of FUNCTION and variable of FOR */ 1494 DoubleType for_step; /* STEP value of FOR */ 1495 DoubleType for_target; /* TO value of FOR */ 1496 LineType *LoopTopLine; /* top line of FOR, DO, WHILE, UNTIL */ 1497 int OnErrorGoto; /* ON ERROR GOTO line */ 1498 }; 1499 typedef struct StackStructure StackType; 1500 /* ExecCode */ 1501 #define EXEC_NORM 0 1502 #define EXEC_GOSUB 1 1503 #define EXEC_FOR 2 1504 #define EXEC_FUNCTION 3 1505 #define EXEC_POPPED 4 1506 1507 1508 /*------------------------------------------------------------- 1509 VERSION 1510 -------------------------------------------------------------*/ 1511 struct VersionStructure 1512 { 1513 const char *Name; /* OPTION VERSION name$ */ 1514 const OptionVersionType OptionVersionValue; /* ( D64 ,...) */ 1515 const char *ID; /* ("D64",...) */ 1516 const char *Description; /* short description of this dialect */ 1517 const char *ReferenceTitle; /* Reference document */ 1518 const char *ReferenceAuthor; /* Reference document */ 1519 const char *ReferenceCopyright; /* Reference document */ 1520 const char *ReferenceURL1; /* Reference document */ 1521 const char *ReferenceURL2; /* Reference document */ 1522 unsigned short OptionFlags; 1523 int OptionReclenInteger; /* OPTION RECLEN integer: Default RANDOM record length */ 1524 int OptionBaseInteger; /* OPTION BASE integer: Default lower bound for arrays */ 1525 char *OptionDateFormat; /* OPTION DATE format$: strftime() format for DATE$ */ 1526 char *OptionTimeFormat; /* OPTION TIME format$: strftime() format for TIME$ */ 1527 char OptionStringChar; /* OPTION STRING char$: Suffix for StringTypeCode , commonly '$' */ 1528 char OptionDoubleChar; /* OPTION DOUBLE char$: Suffix for DoubleTypeCode , commonly '#' */ 1529 char OptionSingleChar; /* OPTION SINGLE char$: Suffix for SingleTypeCode , commonly '!' */ 1530 char OptionCurrencyChar; /* OPTION CURRENCY char$: Suffix for CurrencyTypeCode, commonly '@' */ 1531 char OptionLongChar; /* OPTION LONG char$: Suffix for LongTypeCode , commonly '&' */ 1532 char OptionIntegerChar; /* OPTION INTEGER char$: Suffix for IntegerTypeCode , commonly '%' */ 1533 char OptionByteChar; /* OPTION BYTE char$: Suffix for ByteTypeCode , commonly '~' */ 1534 char OptionQuoteChar; /* OPTION QUOTE char$: Quote, commonly a double-quote */ 1535 char OptionCommentChar; /* OPTION COMMENT char$: Comment, commonly a single-quote */ 1536 char OptionStatementChar; /* OPTION STATEMENT char$: Statement Seperator, commonly ':' */ 1537 char OptionPrintChar; /* OPTION PRINT char$: PRINT Statement, commonly '?' */ 1538 char OptionInputChar; /* OPTION INPUT char$: INPUT Statement, commonly '!' */ 1539 char OptionImageChar; /* OPTION IMAGE char$: IMAGE Statement, commonly ':' */ 1540 char OptionLparenChar; /* OPTION LPAREN char$: Left Parenthesis, commonly '(' */ 1541 char OptionRparenChar; /* OPTION RPAREN char$: Right Parenthesis, commonly ')' */ 1542 char OptionFilenumChar; /* OPTION FILENUM char$: File Number, commonly '#' */ 1543 char OptionAtChar; /* OPTION AT char$: PRINT AT, commonly '@' */ 1544 char OptionUsingDigit; /* OPTION USING DIGIT char$: PRINT USING Digit placeholder, commonly '#' */ 1545 char OptionUsingComma; /* OPTION USING COMMA char$: PRINT USING Comma, such as thousands and millions, commonly ',' */ 1546 char OptionUsingPeriod; /* OPTION USING PERIOD char$: PRINT USING Period, such as between dollars and cents, commonly '.' */ 1547 char OptionUsingPlus; /* OPTION USING PLUS char$: PRINT USING Plus sign, positive value, commonly '+' */ 1548 char OptionUsingMinus; /* OPTION USING MINUS char$: PRINT USING Minus sign, negative value, commonly '-' */ 1549 char OptionUsingExrad; /* OPTION USING EXRAD char$: PRINT USING Exponential format, commonly '^' */ 1550 char OptionUsingDollar; /* OPTION USING DOLLAR char$: PRINT USING Currency symbol, such as dollar, commonly '$' */ 1551 char OptionUsingFiller; /* OPTION USING FILLER char$: PRINT USING Filler, such as payroll checks, commonly '*' */ 1552 char OptionUsingLiteral; /* OPTION USING LITERAL char$: PRINT USING Literal, commonly '_' */ 1553 char OptionUsingFirst; /* OPTION USING FIRST char$: PRINT USING First character of a string, commonly '!' */ 1554 char OptionUsingAll; /* OPTION USING ALL char$: PRINT USING All of a string, commonly '&' */ 1555 char OptionUsingLength; /* OPTION USING LENGTH char$: PRINT USING Length of a string, commonly '%' */ 1556 }; 1557 typedef struct VersionStructure VersionType; 1558 extern VersionType bwb_vertable[ /* NUM_VERSIONS */ ]; /* table of predefined versions */ 1559 extern const size_t NUM_VERSIONS; /* upto 32 BASIC dialects */ 1560 /* OptionVersionValue */ 1561 #define B15 (1UL<< 0) /* Bywater */ 1562 #define S70 (1UL<< 1) /* CALL/360 */ 1563 #define C77 (1UL<< 2) /* CBASIC-II */ 1564 #define D64 (1UL<< 3) /* Dartmouth */ 1565 #define E78 (1UL<< 4) /* ECMA-55 */ 1566 #define E86 (1UL<< 5) /* ECMA-116 */ 1567 #define G74 (1UL<< 6) /* GCOS */ 1568 #define HB1 (1UL<< 7) /* Handbook1 */ 1569 #define HB2 (1UL<< 8) /* Handbook2 */ 1570 #define H80 (1UL<< 9) /* Heath */ 1571 #define G65 (1UL<<10) /* Mark-I */ 1572 #define G67 (1UL<<11) /* Mark-II */ 1573 #define M80 (1UL<<12) /* MBASIC */ 1574 #define D73 (1UL<<13) /* PDP-8 */ 1575 #define D70 (1UL<<14) /* PDP-11 */ 1576 #define R86 (1UL<<15) /* RBASIC */ 1577 #define D71 (1UL<<16) /* RSTS-11 */ 1578 #define I70 (1UL<<17) /* System/360 */ 1579 #define I73 (1UL<<18) /* System/370 */ 1580 #define T80 (1UL<<19) /* TRS-80 */ 1581 #define V09 (1UL<<20) /* Vintage */ 1582 #define T79 (1UL<<21) /* XBASIC */ 1583 #define H14 (1UL<<22) /* Haart */ 1584 #define B93 (1UL<<23) /* Bywater-2 */ 1585 1586 /* OptionFlags */ 1587 #define OPTION_STRICT_ON 0x0001 /* Do NOT allow implicit DIM */ 1588 #define OPTION_ANGLE_DEGREES 0x0002 /* Use degrees instead of radians */ 1589 #define OPTION_BUGS_ON 0x0004 /* ON ... , FOR ..., VAL("X") */ 1590 #define OPTION_LABELS_ON 0x0008 /* Labels allowed */ 1591 #define OPTION_COMPARE_TEXT 0x0010 /* Case-Insensitive string comparison */ 1592 #define OPTION_BUGS_BOOLEAN 0x0020 /* Boolean returns 1 or 0 instead of bitwise */ 1593 #define OPTION_COVERAGE_ON 0x0040 /* track BASIC lines actually executed */ 1594 #define OPTION_TRACE_ON 0x0080 /* dump BASIC stack trace when FATAL error */ 1595 #define OPTION_ERROR_GOSUB 0X0100 /* error causes GOSUB instead of GOTO */ 1596 #define OPTION_EXPLICIT_ON 0x0200 /* all variables must be declared via DIM */ 1597 #define OPTION_ANGLE_GRADIANS 0x0400 /* Use gradians instead of radians */ 1598 #define OPTION_RESERVED_0800 0x0800 /* reserved for future use */ 1599 #define OPTION_RESERVED_1000 0x1000 /* reserved for future use */ 1600 #define OPTION_RESERVED_2000 0x2000 /* reserved for future use */ 1601 #define OPTION_RESERVED_4000 0x4000 /* reserved for future use */ 1602 #define OPTION_RESERVED_8000 0x8000 /* reserved for future use */ 1603 #define IS_CHAR( X, Y ) ( (X) == (Y) && (Y) != NulChar ) /* used with the Option...Char settings */ 1604 1605 1606 /*------------------------------------------------------------- 1607 VARIANT 1608 -------------------------------------------------------------*/ 1609 struct VariantStructure 1610 { 1611 char VariantTypeCode; /* StringTypeCode and so on, NulChar == unknown */ 1612 DoubleType Number; /* only when VariamtTypeCode != StringTypeCode */ 1613 size_t Length; /* only when VariantTypeCode == StringTypeCode */ 1614 char *Buffer; /* only when VariantTypeCode == StringTypeCode */ 1615 }; 1616 typedef struct VariantStructure VariantType; 1617 #define CLEAR_VARIANT( X ) bwb_memset( (X), 0, sizeof( VariantType ) ) 1618 #define RELEASE_VARIANT( X ) if( (X)->Buffer != NULL ) { free( (X)->Buffer ); (X)->Buffer = NULL; (X)->Length = 0; } 1619 /* 1620 any routine changing the TypeCode is required to calloc() or free() the Buffer, 1621 this is checked by is_string_type() and is_number_type() in bwb_exp.c 1622 */ 1623 1624 1625 /*------------------------------------------------------------- 1626 GLOBAL 1627 -------------------------------------------------------------*/ 1628 struct GlobalStruct 1629 { 1630 /* these values are not changed by OPTION VERSION */ 1631 jmp_buf mark; /* break_handler() jumps here */ 1632 int program_run; /* has the command-line program been run? */ 1633 VersionType *CurrentVersion; /* OPTION VERSION */ 1634 LineType *ThisLine; /* currently executing line */ 1635 int IsScanRequired; /* TRUE == program needs to be rescanned */ 1636 int IsTraceOn; /* TRUE == TRON, FALSE == TROFF */ 1637 int IsInteractive; /* always TRUE */ 1638 int IsCommandLineFile; /* TRUE == executing a program from the Operating System command line */ 1639 int IsErrorPending; /* TRUE == ERR, ERL and ERROR$ have been set */ 1640 int IsTimerOn; /* TRUE == ON TIMER ... GOSUB ... enabled */ 1641 int IsPrinter; /* CBASIC-II: LPRINTER sets to TRUE, CONSOLE sets to FALSE */ 1642 int LPRINT_NULLS; /* LPRINT_FILE_NUMBER */ 1643 int SCREEN_ROWS; /* CONSOLE_FILE_NUMBER */ 1644 int AutomaticLineNumber; /* AUTO */ 1645 int AutomaticLineIncrement; /* AUTO */ 1646 int LastInputCount; /* 0 == none */ 1647 int LastLineNumber; /* LIST, LLIST */ 1648 int LastFileNumber; /* 0 == none */ 1649 int StartTimeInteger; /* seconds after midnight when RUN was executed */ 1650 int NextValidLineNumber; /* verify line number order */ 1651 int StackDepthInteger; /* stack depth count */ 1652 LineType *DataLine; /* current DATA line for READ */ 1653 int DataPosition; /* current position in DataLine */ 1654 int ERR; /* ERR */ 1655 LineType *ERL; /* ERL */ 1656 char *ERROR4; /* ERROR$ */ 1657 DoubleType LastDeterminant; /* 0 == error */ 1658 DoubleType RESIDUE; /* for RBASIC's RESIDUE function */ 1659 FILE *ExternalInputFile; /* --TAPE tapefile.inp */ 1660 int OnTimerLineNumber; /* ON TIMER ... GOSUB ... */ 1661 DoubleType OnTimerCount; /* ON TIMER ... GOSUB ... */ 1662 DoubleType OnTimerExpires; /* ON TIMER ... GOSUB ... */ 1663 LineType *ContinueLine; /* CONT */ 1664 int IncludeLevel; /* %INCLUDE */ 1665 DoubleType OptionSleepDouble; /* OPTION SLEEP double */ 1666 int OptionIndentInteger; /* OPTION INDENT integer */ 1667 int OptionTerminalType; /* OPTION TERMINAL type */ 1668 int OptionRoundType; /* OPTION ROUND type */ 1669 char *OptionEditString; /* OPTION EDIT string$ */ 1670 char *OptionFilesString; /* OPTION FILES string$ */ 1671 char *OptionRenumString; /* OPTION RENUM string$ */ 1672 char *OptionPromptString; /* OPTION PROMPT string$ */ 1673 char *OptionExtensionString; /* OPTION EXTENSION string$ */ 1674 int OptionScaleInteger; /* OPTION SCALE integer */ 1675 int OptionDigitsInteger; /* OPTION DIGITS integer */ 1676 int OptionZoneInteger; /* OPTION ZONE integer */ 1677 LineType *StartMarker; /* BASIC program starting marker */ 1678 LineType *UserMarker; /* USER (immediate mode) starting marker */ 1679 LineType *EndMarker; /* ending marker for both StartMarker and UserMarker */ 1680 char *MaxLenBuffer; /* MAXLEN, for bwb_exp.c */ 1681 char *NumLenBuffer; /* NUMLEN, for FormatBasicNumber(), sprintf("%d") and so on */ 1682 char *ConsoleOutput; /* MAX_LINE_LENGTH, usually prompts and error messages */ 1683 char *ConsoleInput; /* MAX_LINE_LENGTH, usually console and INPUT */ 1684 VariableType *VariableHead; /* USER Variable list */ 1685 UserFunctionType *UserFunctionHead; /* USER function-sub-label list */ 1686 StackType *StackHead; /* USER Stack list */ 1687 FileType *FileHead; /* USER file list (not SYSIN, SYSOUT, or SYSPRN) */ 1688 FieldType *FieldHead; /* USER field list */ 1689 VirtualType *VirtualHead; /* USER Virtual cross-reference list */ 1690 FileType *SYSIN; /* FileNumber = 0, INPUT, usually stdin, OPTION SYSIN */ 1691 FileType *SYSOUT; /* FileNumber = 0, PRINT, usually stdout, OPTION SYSOUT */ 1692 FileType *SYSPRN; /* FileNumber < 0, LPRINT, usually stderr, OPTION SYSPRN */ 1693 FileType *CurrentFile; /* current file for PRINT or INPUT */ 1694 char *UseParameterString; /* CHAIN ... USE */ 1695 int DefaultVariableType[26]; /* VariableTypeCode, A-Z */ 1696 #if THE_PRICE_IS_RIGHT 1697 int CommandStart[26]; /* IntrinsicCommandTable->name[0], A-Z */ 1698 int IntrinsicFunctionStart[26]; /* IntrinsicFunctionTable->name[0], A-Z */ 1699 #endif /* THE_PRICE_IS_RIGHT */ 1700 char *COMMAND4[10]; /* command line parameters, COMMAND$(0-9) */ 1701 char *ProgramFilename; /* last BASIC program filename */ 1702 }; 1703 typedef struct GlobalStruct GlobalType; 1704 extern GlobalType *My; 1705 1706 #define PARAM_NUMBER *argn->Value.Number 1707 #define PARAM_LENGTH argn->Value.String->length 1708 #define PARAM_BUFFER argn->Value.String->sbuffer 1709 #define RESULT_NUMBER *argv->Value.Number 1710 #define RESULT_BUFFER argv->Value.String->sbuffer 1711 #define RESULT_LENGTH argv->Value.String->length 1712 1713 1714 /*************************************************************** 1715 1716 Compiler Specific Prototypes 1717 1718 ***************************************************************/ 1719 1720 1721 #if __WATCOM__ 1722 /* 1723 ** 1724 ** OpenWatcom 1.9 for DOS does not declare putenv() 1725 ** 1726 */ 1727 extern int putenv (const char *buffer); 1728 #endif /* __WATCOM__ */ 1729 1730 #if HAVE_UNIX_GCC 1731 /* 1732 ** 1733 ** sleep() is an intrinsic C functions in GCC using -ansi 1734 ** 1735 */ 1736 #else 1737 /* 1738 ** 1739 ** sleep() is defined in bwb_int.c to do nothing 1740 ** 1741 */ 1742 extern unsigned int sleep (unsigned int X); 1743 #endif /* HAVE_UNIX_GCC */ 1744 1745 #ifndef isnan 1746 #define isnan(x) (x != x) 1747 #endif 1748 1749 #ifndef isinf 1750 #define isinf(x) (!isnan(x) && isnan(x - x)) 1751 #endif 1752 1753 /*************************************************************** 1754 1755 Function Prototypes 1756 1757 ***************************************************************/ 1758 1759 /*------------------------------------------------------------- 1760 BASIC COMMANDS 1761 -------------------------------------------------------------*/ 1762 extern LineType *bwb_APPEND (LineType * l); 1763 extern LineType *bwb_AS (LineType * L); 1764 extern LineType *bwb_AUTO (LineType * L); 1765 extern LineType *bwb_BACKSPACE (LineType * Line); 1766 extern LineType *bwb_BREAK (LineType * l); 1767 extern LineType *bwb_BUILD (LineType * L); 1768 extern LineType *bwb_BYE (LineType * l); 1769 extern LineType *bwb_CALL (LineType * l); 1770 extern LineType *bwb_CASE (LineType * l); 1771 extern LineType *bwb_CASE_ELSE (LineType * l); 1772 extern LineType *bwb_CHAIN (LineType * l); 1773 extern LineType *bwb_CHANGE (LineType * l); 1774 extern LineType *bwb_CLEAR (LineType * l); 1775 extern LineType *bwb_CLOAD (LineType * Line); 1776 extern LineType *bwb_CLOAD8 (LineType * l); 1777 extern LineType *bwb_CLOSE (LineType * Line); 1778 extern LineType *bwb_CLR (LineType * l); 1779 extern LineType *bwb_CMDS (LineType * l); 1780 extern LineType *bwb_COMMON (LineType * l); 1781 extern LineType *bwb_CONSOLE (LineType * l); 1782 extern LineType *bwb_CONST (LineType * L); 1783 extern LineType *bwb_CONT (LineType * l); 1784 extern LineType *bwb_CONTINUE (LineType * l); 1785 extern LineType *bwb_COPY (LineType * Line); 1786 extern LineType *bwb_CREATE (LineType * l); 1787 extern LineType *bwb_CSAVE (LineType * Line); 1788 extern LineType *bwb_CSAVE8 (LineType * l); 1789 extern LineType *bwb_DATA (LineType * Line); 1790 extern LineType *bwb_DEC (LineType * L); 1791 extern LineType *bwb_DEF (LineType * l); 1792 extern LineType *bwb_DEF8LBL (LineType * l); 1793 extern LineType *bwb_DEFBYT (LineType * l); 1794 extern LineType *bwb_DEFCUR (LineType * l); 1795 extern LineType *bwb_DEFDBL (LineType * l); 1796 extern LineType *bwb_DEFINT (LineType * l); 1797 extern LineType *bwb_DEFLNG (LineType * l); 1798 extern LineType *bwb_DEFSNG (LineType * l); 1799 extern LineType *bwb_DEFSTR (LineType * l); 1800 extern LineType *bwb_DELETE (LineType * l); 1801 extern LineType *bwb_DELIMIT (LineType * l); 1802 extern LineType *bwb_DIM (LineType * l); 1803 extern LineType *bwb_DISPLAY (LineType * Line); 1804 extern LineType *bwb_DO (LineType * l); 1805 extern LineType *bwb_DOS (LineType * l); 1806 extern LineType *bwb_DSP (LineType * l); 1807 extern LineType *bwb_EDIT (LineType * Line); 1808 extern LineType *bwb_ELSE (LineType * l); 1809 extern LineType *bwb_ELSEIF (LineType * l); 1810 extern LineType *bwb_END (LineType * l); 1811 extern LineType *bwb_END_FUNCTION (LineType * l); 1812 extern LineType *bwb_END_IF (LineType * l); 1813 extern LineType *bwb_END_SELECT (LineType * l); 1814 extern LineType *bwb_END_SUB (LineType * l); 1815 extern LineType *bwb_ERASE (LineType * l); 1816 extern LineType *bwb_EXCHANGE (LineType * l); 1817 extern LineType *bwb_EXIT (LineType * l); 1818 extern LineType *bwb_EXIT_DO (LineType * l); 1819 extern LineType *bwb_EXIT_FOR (LineType * l); 1820 extern LineType *bwb_EXIT_FUNCTION (LineType * l); 1821 extern LineType *bwb_EXIT_REPEAT (LineType * l); 1822 extern LineType *bwb_EXIT_SUB (LineType * l); 1823 extern LineType *bwb_EXIT_WHILE (LineType * l); 1824 extern LineType *bwb_FEND (LineType * l); 1825 extern LineType *bwb_FIELD (LineType * l); 1826 extern LineType *bwb_FILE (LineType * l); 1827 extern LineType *bwb_FILES (LineType * l); 1828 extern LineType *bwb_FLEX (LineType * l); 1829 extern LineType *bwb_FNCS (LineType * l); 1830 extern LineType *bwb_FNEND (LineType * l); 1831 extern LineType *bwb_FOR (LineType * l); 1832 extern LineType *bwb_FUNCTION (LineType * l); 1833 extern LineType *bwb_GET (LineType * Line); 1834 extern LineType *bwb_GO (LineType * L); 1835 extern LineType *bwb_GOODBYE (LineType * l); 1836 extern LineType *bwb_GOSUB (LineType * l); 1837 extern LineType *bwb_GOTO (LineType * l); 1838 extern LineType *bwb_GO_SUB (LineType * l); 1839 extern LineType *bwb_GO_TO (LineType * l); 1840 extern LineType *bwb_HELP (LineType * l); 1841 extern LineType *bwb_IF (LineType * l); 1842 extern LineType *bwb_IF8THEN (LineType * l); 1843 extern LineType *bwb_IF_END (LineType * l); 1844 extern LineType *bwb_IF_MORE (LineType * l); 1845 extern LineType *bwb_IMAGE (LineType * L); 1846 extern LineType *bwb_INC (LineType * L); 1847 extern LineType *bwb_INPUT (LineType * Line); 1848 extern LineType *bwb_INPUT_LINE (LineType * Line); 1849 extern LineType *bwb_LET (LineType * L); 1850 extern LineType *bwb_LINE (LineType * Line); 1851 extern LineType *bwb_LINE_INPUT (LineType * Line); 1852 extern LineType *bwb_LIST (LineType * l); 1853 extern LineType *bwb_LISTNH (LineType * l); 1854 extern LineType *bwb_LLIST (LineType * l); 1855 extern LineType *bwb_LOAD (LineType * Line); 1856 extern LineType *bwb_LOCAL (LineType * l); 1857 extern LineType *bwb_LOOP (LineType * l); 1858 extern LineType *bwb_LPRINT (LineType * l); 1859 extern LineType *bwb_LPRINTER (LineType * l); 1860 extern LineType *bwb_LPT (LineType * l); 1861 extern LineType *bwb_LSET (LineType * l); 1862 extern LineType *bwb_MAINTAINER (LineType * l); 1863 extern LineType *bwb_MAINTAINER_CMDS (LineType * l); 1864 extern LineType *bwb_MAINTAINER_CMDS_HTML (LineType * l); 1865 extern LineType *bwb_MAINTAINER_CMDS_ID (LineType * l); 1866 extern LineType *bwb_MAINTAINER_CMDS_MANUAL (LineType * l); 1867 extern LineType *bwb_MAINTAINER_CMDS_SWITCH (LineType * l); 1868 extern LineType *bwb_MAINTAINER_CMDS_TABLE (LineType * l); 1869 extern LineType *bwb_MAINTAINER_DEBUG (LineType * l); 1870 extern LineType *bwb_MAINTAINER_DEBUG_OFF (LineType * l); 1871 extern LineType *bwb_MAINTAINER_DEBUG_ON (LineType * l); 1872 extern LineType *bwb_MAINTAINER_FNCS (LineType * l); 1873 extern LineType *bwb_MAINTAINER_FNCS_HTML (LineType * l); 1874 extern LineType *bwb_MAINTAINER_FNCS_ID (LineType * l); 1875 extern LineType *bwb_MAINTAINER_FNCS_MANUAL (LineType * l); 1876 extern LineType *bwb_MAINTAINER_FNCS_SWITCH (LineType * l); 1877 extern LineType *bwb_MAINTAINER_FNCS_TABLE (LineType * l); 1878 extern LineType *bwb_MAINTAINER_MANUAL (LineType * l); 1879 extern LineType *bwb_MAINTAINER_STACK (LineType * l); 1880 extern LineType *bwb_MARGIN (LineType * l); 1881 extern LineType *bwb_MAT (LineType * l); 1882 extern LineType *bwb_MAT_GET (LineType * Line); 1883 extern LineType *bwb_MAT_INPUT (LineType * Line); 1884 extern LineType *bwb_MAT_PRINT (LineType * l); 1885 extern LineType *bwb_MAT_PUT (LineType * l); 1886 extern LineType *bwb_MAT_READ (LineType * Line); 1887 extern LineType *bwb_MAT_WRITE (LineType * l); 1888 extern LineType *bwb_MERGE (LineType * l); 1889 extern LineType *bwb_MID4 (LineType * l); 1890 extern LineType *bwb_MON (LineType * l); 1891 extern LineType *bwb_NAME (LineType * l); 1892 extern LineType *bwb_NEW (LineType * l); 1893 extern LineType *bwb_NEXT (LineType * l); 1894 extern LineType *bwb_OF (LineType * L); 1895 extern LineType *bwb_OLD (LineType * Line); 1896 extern LineType *bwb_ON (LineType * l); 1897 extern LineType *bwb_ON_ERROR (LineType * l); 1898 extern LineType *bwb_ON_ERROR_GOSUB (LineType * l); 1899 extern LineType *bwb_ON_ERROR_GOTO (LineType * l); 1900 extern LineType *bwb_ON_ERROR_RESUME (LineType * l); 1901 extern LineType *bwb_ON_ERROR_RESUME_NEXT (LineType * l); 1902 extern LineType *bwb_ON_ERROR_RETURN (LineType * l); 1903 extern LineType *bwb_ON_ERROR_RETURN_NEXT (LineType * l); 1904 extern LineType *bwb_ON_TIMER (LineType * l); 1905 extern LineType *bwb_OPEN (LineType * l); 1906 extern LineType *bwb_OPTION (LineType * l); 1907 extern LineType *bwb_OPTION_ANGLE (LineType * l); 1908 extern LineType *bwb_OPTION_ANGLE_DEGREES (LineType * l); 1909 extern LineType *bwb_OPTION_ANGLE_GRADIANS (LineType * l); 1910 extern LineType *bwb_OPTION_ANGLE_RADIANS (LineType * l); 1911 extern LineType *bwb_OPTION_ARITHMETIC (LineType * l); 1912 extern LineType *bwb_OPTION_ARITHMETIC_DECIMAL (LineType * l); 1913 extern LineType *bwb_OPTION_ARITHMETIC_FIXED (LineType * l); 1914 extern LineType *bwb_OPTION_ARITHMETIC_NATIVE (LineType * l); 1915 extern LineType *bwb_OPTION_PUNCT_AT (LineType * l); 1916 extern LineType *bwb_OPTION_BASE (LineType * l); 1917 extern LineType *bwb_OPTION_BUGS (LineType * l); 1918 extern LineType *bwb_OPTION_BUGS_BOOLEAN (LineType * l); 1919 extern LineType *bwb_OPTION_BUGS_OFF (LineType * l); 1920 extern LineType *bwb_OPTION_BUGS_ON (LineType * l); 1921 extern LineType *bwb_OPTION_PUNCT_BYTE (LineType * l); 1922 extern LineType *bwb_OPTION_PUNCT_COMMENT (LineType * l); 1923 extern LineType *bwb_OPTION_COMPARE (LineType * l); 1924 extern LineType *bwb_OPTION_COMPARE_BINARY (LineType * l); 1925 extern LineType *bwb_OPTION_COMPARE_DATABASE (LineType * l); 1926 extern LineType *bwb_OPTION_COMPARE_TEXT (LineType * l); 1927 extern LineType *bwb_OPTION_COVERAGE (LineType * l); 1928 extern LineType *bwb_OPTION_COVERAGE_OFF (LineType * l); 1929 extern LineType *bwb_OPTION_COVERAGE_ON (LineType * l); 1930 extern LineType *bwb_OPTION_PUNCT_CURRENCY (LineType * l); 1931 extern LineType *bwb_OPTION_DATE (LineType * l); 1932 extern LineType *bwb_OPTION_DIGITS (LineType * l); 1933 extern LineType *bwb_OPTION_DISABLE (LineType * l); 1934 extern LineType *bwb_OPTION_DISABLE_COMMAND (LineType * l); 1935 extern LineType *bwb_OPTION_DISABLE_FUNCTION (LineType * l); 1936 extern LineType *bwb_OPTION_DISABLE_OPERATOR (LineType * l); 1937 extern LineType *bwb_OPTION_PUNCT_DOUBLE (LineType * l); 1938 extern LineType *bwb_OPTION_EDIT (LineType * l); 1939 extern LineType *bwb_OPTION_ENABLE (LineType * l); 1940 extern LineType *bwb_OPTION_ENABLE_COMMAND (LineType * l); 1941 extern LineType *bwb_OPTION_ENABLE_FUNCTION (LineType * l); 1942 extern LineType *bwb_OPTION_ENABLE_OPERATOR (LineType * l); 1943 extern LineType *bwb_OPTION_ERROR (LineType * l); 1944 extern LineType *bwb_OPTION_ERROR_GOSUB (LineType * l); 1945 extern LineType *bwb_OPTION_ERROR_GOTO (LineType * l); 1946 extern LineType *bwb_OPTION_EXPLICIT (LineType * l); 1947 extern LineType *bwb_OPTION_PUNCT_FILENUM (LineType * l); 1948 extern LineType *bwb_OPTION_FILES (LineType * l); 1949 extern LineType *bwb_OPTION_PUNCT_IMAGE (LineType * l); 1950 extern LineType *bwb_OPTION_IMPLICIT (LineType * l); 1951 extern LineType *bwb_OPTION_INDENT (LineType * l); 1952 extern LineType *bwb_OPTION_PUNCT_INPUT (LineType * l); 1953 extern LineType *bwb_OPTION_PUNCT_INTEGER (LineType * l); 1954 extern LineType *bwb_OPTION_LABELS (LineType * l); 1955 extern LineType *bwb_OPTION_LABELS_OFF (LineType * l); 1956 extern LineType *bwb_OPTION_LABELS_ON (LineType * l); 1957 extern LineType *bwb_OPTION_PUNCT_LONG (LineType * l); 1958 extern LineType *bwb_OPTION_PUNCT_LPAREN (LineType * l); 1959 extern LineType *bwb_OPTION_PUNCT_PRINT (LineType * l); 1960 extern LineType *bwb_OPTION_PROMPT (LineType * l); 1961 extern LineType *bwb_OPTION_PUNCT_QUOTE (LineType * l); 1962 extern LineType *bwb_OPTION_RECLEN (LineType * l); 1963 extern LineType *bwb_OPTION_RENUM (LineType * l); 1964 extern LineType *bwb_OPTION_ROUND (LineType * l); 1965 extern LineType *bwb_OPTION_ROUND_BANK (LineType * l); 1966 extern LineType *bwb_OPTION_ROUND_MATH (LineType * l); 1967 extern LineType *bwb_OPTION_ROUND_TRUNCATE (LineType * l); 1968 extern LineType *bwb_OPTION_PUNCT_RPAREN (LineType * l); 1969 extern LineType *bwb_OPTION_SCALE (LineType * l); 1970 extern LineType *bwb_OPTION_PUNCT_SINGLE (LineType * l); 1971 extern LineType *bwb_OPTION_SLEEP (LineType * l); 1972 extern LineType *bwb_OPTION_PUNCT_STATEMENT (LineType * l); 1973 extern LineType *bwb_OPTION_STDERR (LineType * l); 1974 extern LineType *bwb_OPTION_STDIN (LineType * l); 1975 extern LineType *bwb_OPTION_STDOUT (LineType * l); 1976 extern LineType *bwb_OPTION_STRICT (LineType * l); 1977 extern LineType *bwb_OPTION_STRICT_OFF (LineType * l); 1978 extern LineType *bwb_OPTION_STRICT_ON (LineType * l); 1979 extern LineType *bwb_OPTION_PUNCT_STRING (LineType * l); 1980 extern LineType *bwb_OPTION_TERMINAL (LineType * l); 1981 extern LineType *bwb_OPTION_TERMINAL_ADM (LineType * l); 1982 extern LineType *bwb_OPTION_TERMINAL_ANSI (LineType * l); 1983 extern LineType *bwb_OPTION_TERMINAL_NONE (LineType * l); 1984 extern LineType *bwb_OPTION_TIME (LineType * l); 1985 extern LineType *bwb_OPTION_TRACE (LineType * l); 1986 extern LineType *bwb_OPTION_TRACE_OFF (LineType * l); 1987 extern LineType *bwb_OPTION_TRACE_ON (LineType * l); 1988 extern LineType *bwb_OPTION_USING (LineType * l); 1989 extern LineType *bwb_OPTION_USING_ALL (LineType * l); 1990 extern LineType *bwb_OPTION_USING_COMMA (LineType * l); 1991 extern LineType *bwb_OPTION_USING_DIGIT (LineType * l); 1992 extern LineType *bwb_OPTION_USING_DOLLAR (LineType * l); 1993 extern LineType *bwb_OPTION_USING_EXRAD (LineType * l); 1994 extern LineType *bwb_OPTION_USING_FILLER (LineType * l); 1995 extern LineType *bwb_OPTION_USING_FIRST (LineType * l); 1996 extern LineType *bwb_OPTION_USING_LENGTH (LineType * l); 1997 extern LineType *bwb_OPTION_USING_LITERAL (LineType * l); 1998 extern LineType *bwb_OPTION_USING_MINUS (LineType * l); 1999 extern LineType *bwb_OPTION_USING_PERIOD (LineType * l); 2000 extern LineType *bwb_OPTION_USING_PLUS (LineType * l); 2001 extern LineType *bwb_OPTION_VERSION (LineType * l); 2002 extern LineType *bwb_OPTION_ZONE (LineType * l); 2003 extern LineType *bwb_PAUSE (LineType * l); 2004 extern LineType *bwb_PDEL (LineType * l); 2005 extern LineType *bwb_POP (LineType * l); 2006 extern LineType *bwb_PRINT (LineType * l); 2007 extern LineType *bwb_PTP (LineType * l); 2008 extern LineType *bwb_PTR (LineType * l); 2009 extern LineType *bwb_PUT (LineType * Line); 2010 extern LineType *bwb_QUIT (LineType * l); 2011 extern LineType *bwb_READ (LineType * Line); 2012 extern LineType *bwb_RECALL (LineType * l); 2013 extern LineType *bwb_REM (LineType * L); 2014 extern LineType *bwb_RENAME (LineType * l); 2015 extern LineType *bwb_RENUM (LineType * Line); 2016 extern LineType *bwb_RENUMBER (LineType * Line); 2017 extern LineType *bwb_REPEAT (LineType * l); 2018 extern LineType *bwb_REPLACE (LineType * Line); 2019 extern LineType *bwb_RESET (LineType * Line); 2020 extern LineType *bwb_RESTORE (LineType * Line); 2021 extern LineType *bwb_RESUME (LineType * l); 2022 extern LineType *bwb_RETURN (LineType * l); 2023 extern LineType *bwb_RSET (LineType * l); 2024 extern LineType *bwb_RUN (LineType * L); 2025 extern LineType *bwb_RUNNH (LineType * L); 2026 extern LineType *bwb_SAVE (LineType * l); 2027 extern LineType *bwb_SCRATCH (LineType * l); 2028 extern LineType *bwb_SELECT (LineType * l); 2029 extern LineType *bwb_SELECT_CASE (LineType * l); 2030 extern LineType *bwb_STEP (LineType * L); 2031 extern LineType *bwb_STOP (LineType * l); 2032 extern LineType *bwb_STORE (LineType * l); 2033 extern LineType *bwb_SUB (LineType * l); 2034 extern LineType *bwb_SUBEND (LineType * l); 2035 extern LineType *bwb_SUBEXIT (LineType * l); 2036 extern LineType *bwb_SUB_END (LineType * l); 2037 extern LineType *bwb_SUB_EXIT (LineType * l); 2038 extern LineType *bwb_SWAP (LineType * l); 2039 extern LineType *bwb_SYSTEM (LineType * l); 2040 extern LineType *bwb_TEXT (LineType * l); 2041 extern LineType *bwb_THEN (LineType * L); 2042 extern LineType *bwb_TIMER (LineType * l); 2043 extern LineType *bwb_TIMER_OFF (LineType * l); 2044 extern LineType *bwb_TIMER_ON (LineType * l); 2045 extern LineType *bwb_TIMER_STOP (LineType * l); 2046 extern LineType *bwb_TLOAD (LineType * Line); 2047 extern LineType *bwb_TO (LineType * L); 2048 extern LineType *bwb_TRACE (LineType * l); 2049 extern LineType *bwb_TRACE_OFF (LineType * l); 2050 extern LineType *bwb_TRACE_ON (LineType * l); 2051 extern LineType *bwb_TSAVE (LineType * Line); 2052 extern LineType *bwb_TTY (LineType * l); 2053 extern LineType *bwb_TTY_IN (LineType * l); 2054 extern LineType *bwb_TTY_OUT (LineType * l); 2055 extern LineType *bwb_UNTIL (LineType * l); 2056 extern LineType *bwb_USE (LineType * l); 2057 extern LineType *bwb_VARS (LineType * l); 2058 extern LineType *bwb_vector (LineType * l); 2059 extern LineType *bwb_WEND (LineType * l); 2060 extern LineType *bwb_WHILE (LineType * l); 2061 extern LineType *bwb_WRITE (LineType * l); 2062 extern LineType *bwb_OPTION_PUNCT (LineType * l); 2063 extern LineType *bwb_OPTION_EXTENSION (LineType * l); 2064 2065 /*------------------------------------------------------------- 2066 INTERNALS 2067 -------------------------------------------------------------*/ 2068 extern int binary_get_put (VariableType * Variable, int IsPUT); 2069 extern int buff_is_eol (char *buffer, int *position); 2070 extern int buff_peek_array_dimensions (char *buffer, int *position, 2071 int *n_params); 2072 extern int buff_peek_char (char *buffer, int *position, char find); 2073 extern int buff_peek_EqualChar (char *buffer, int *position); 2074 extern int buff_peek_LparenChar (char *buffer, int *position); 2075 extern int buff_peek_QuoteChar (char *buffer, int *position); 2076 #if FALSE /* kepp this ... */ 2077 extern int buff_peek_word (char *buffer, int *position, char *find); 2078 #endif 2079 extern int buff_read_array_dimensions (char *buffer, int *position, 2080 int *n_params, int params[]); 2081 extern int buff_read_array_redim (char *buffer, int *position, 2082 int *dimensions, int LBOUND[], 2083 int UBOUND[]); 2084 extern ResultType buff_read_decimal_constant (char *buffer, int *position, 2085 VariantType * X, 2086 int IsConsoleInput); 2087 extern int buff_read_expression (char *buffer, int *position, 2088 VariantType * X); 2089 extern ResultType buff_read_hexadecimal_constant (char *buffer, int *position, 2090 VariantType * X, 2091 int IsConsoleInput); 2092 extern int buff_read_index_item (char *buffer, int *position, int Index, 2093 int *Value); 2094 extern int buff_read_integer_expression (char *buffer, int *position, 2095 int *Value); 2096 extern int buff_read_label (char *buffer, int *position, char *label); 2097 extern int buff_read_letter_sequence (char *buffer, int *position, char *head, 2098 char *tail); 2099 extern int buff_read_line_number (char *buffer, int *position, int *linenum); 2100 extern int buff_read_line_sequence (char *buffer, int *position, int *head, 2101 int *tail); 2102 extern VariableType *buff_read_matrix (char *buffer, int *position); 2103 extern int buff_read_numeric_expression (char *buffer, int *position, 2104 DoubleType * Value); 2105 extern ResultType buff_read_octal_constant (char *buffer, int *position, 2106 VariantType * X, 2107 int IsConsoleInput); 2108 extern VariableType *buff_read_scalar (char *buffer, int *position); 2109 extern int buff_read_string_expression (char *buffer, int *position, 2110 char **Value); 2111 extern char buff_read_type_declaration (char *buffer, int *position); 2112 extern int buff_read_varname (char *buffer, int *position, char *varname); 2113 extern int buff_skip_AtChar (char *buffer, int *position); 2114 extern int buff_skip_char (char *buffer, int *position, char find); 2115 extern int buff_skip_CommaChar (char *buffer, int *position); 2116 extern void buff_skip_eol (char *buffer, int *position); 2117 extern int buff_skip_EqualChar (char *buffer, int *position); 2118 extern int buff_skip_FilenumChar (char *buffer, int *position); 2119 extern int buff_skip_LparenChar (char *buffer, int *position); 2120 extern int buff_skip_MinusChar (char *buffer, int *position); 2121 extern int buff_skip_PlusChar (char *buffer, int *position); 2122 extern int buff_skip_RparenChar (char *buffer, int *position); 2123 extern int buff_skip_SemicolonChar (char *buffer, int *position); 2124 extern char buff_skip_seperator (char *buffer, int *position); 2125 extern void buff_skip_spaces (char *buffer, int *position); 2126 extern int buff_skip_StarChar (char *buffer, int *position); 2127 extern int buff_skip_word (char *buffer, int *position, char *find); 2128 extern void bwb_clrexec (void); 2129 extern void bwb_decexec (void); 2130 extern void bwb_execline (void); 2131 extern void bwb_fclose (FILE * file); 2132 extern void bwb_file_open (char A, int x, char *B, int y); 2133 extern int bwb_fload (char *FileName); 2134 extern int bwb_freeline (LineType * l); 2135 extern int bwb_incexec (void); 2136 extern int bwb_isalnum (int C); 2137 extern int bwb_isalpha (int C); 2138 #if FALSE /* keep this ... */ 2139 extern int bwb_iscntrl (int C); 2140 #endif 2141 extern int bwb_isdigit (int C); 2142 extern int bwb_isgraph (int C); 2143 #if FALSE /* keep this ... */ 2144 extern int bwb_islower (int C); 2145 #endif 2146 extern int bwb_isprint (int C); 2147 extern int bwb_ispunct (int C); 2148 #if FALSE /* keep this ... */ 2149 extern int bwb_isspace (int C); 2150 #endif 2151 #if FALSE /* keep this ... */ 2152 extern int bwb_isupper (int C); 2153 #endif 2154 extern int bwb_isxdigit (int C); 2155 extern int bwb_is_eof (FILE * fp); 2156 extern void bwb_mainloop (void); 2157 #if FALSE /* keep this ... */ 2158 extern void *bwb_memchr (const void *s, int c, size_t n); 2159 #endif 2160 extern int bwb_memcmp (const void *s1, const void *s2, size_t n); 2161 extern void *bwb_memcpy (void *s1, const void *s2, size_t n); 2162 #if FALSE /* keep this ... */ 2163 extern void *bwb_memmove (void *s1, const void *s2, size_t n); 2164 #endif 2165 extern void *bwb_memset (void *s, int c, size_t n); 2166 extern LineType *bwb_option_punct_char (LineType * l, char *c); 2167 extern LineType *bwb_option_range_integer (LineType * l, int *Integer, 2168 int MinVal, int MaxVal); 2169 extern double bwb_rint (double x); 2170 extern int bwb_scan (void); 2171 extern char *bwb_strcat (char *s1, const char *s2); 2172 extern char *bwb_strchr (const char *s, int c); 2173 extern int bwb_strcmp (const char *s1, const char *s2); 2174 extern char *bwb_strcpy (char *s1, const char *s2); 2175 extern char *bwb_strdup (char *s); 2176 extern char *bwb_strdup2 (char *s, char *t); 2177 extern int bwb_stricmp (const char *s1, const char *s2); 2178 extern size_t bwb_strlen (const char *s); 2179 #if FALSE /* keep this ... */ 2180 extern char *bwb_strncat (char *s1, const char *s2, size_t n); 2181 #endif 2182 #if FALSE /* keep this ... */ 2183 extern int bwb_strncmp (const char *s1, const char *s2, size_t n); 2184 #endif 2185 extern char *bwb_strncpy (char *s1, const char *s2, size_t n); 2186 extern int bwb_strnicmp (const char *s1, const char *s2, size_t n); 2187 extern char *bwb_strrchr (const char *s, int c); 2188 extern int bwb_tolower (int C); 2189 extern int bwb_toupper (int C); 2190 extern void bwb_xnew (LineType * l); 2191 extern void bwx_CLS (void); 2192 extern void bwx_COLOR (int Fore, int Back); 2193 extern int bwx_Error (int ERR, char *ErrorMessage); 2194 extern int bwx_input (char *prompt, int IsDisplayQuestionMark, char *answer, 2195 int MaxLen); 2196 extern void bwx_LOCATE (int Row, int Col); 2197 extern void bwx_STOP (int IsShowMessage); 2198 extern void bwx_terminate (void); 2199 extern DoubleType bwx_TIMER (DoubleType Seconds); 2200 extern char Char_to_TypeCode (char C); 2201 extern void CleanLine (char *buffer); 2202 extern void clear_virtual_by_file (int FileNumber); 2203 extern void Determinant (VariableType * v); 2204 extern void DumpAllCommandHtmlTable (FILE * file); 2205 extern void DumpAllCommandSwitchStatement (FILE * file); 2206 extern void DumpAllCommandSyntax (FILE * file, int IsXref, 2207 OptionVersionType OptionVersionValue); 2208 extern void DumpAllCommandTableDefinitions (FILE * file); 2209 extern void DumpAllCommandUniqueID (FILE * file); 2210 extern void DumpAllFuctionTableDefinitions (FILE * file); 2211 extern void DumpAllFunctionHtmlTable (FILE * file); 2212 extern void DumpAllFunctionSwitch (FILE * file); 2213 extern void DumpAllFunctionSyntax (FILE * file, int IsXref, 2214 OptionVersionType OptionVersionValue); 2215 extern void DumpAllFunctionUniqueID (FILE * file); 2216 extern void DumpAllOperatorSyntax (FILE * file, int IsXref, 2217 OptionVersionType OptionVersionValue); 2218 extern void DumpHeader (FILE * file); 2219 extern void DumpOneCommandSyntax (FILE * file, int IsXref, int n); 2220 extern void DumpOneFunctionSyntax (FILE * file, int IsXref, int n); 2221 extern void DumpOneOperatorSyntax (FILE * file, int IsXref, int n); 2222 extern void field_close_file (FileType * File); 2223 extern void field_free_variable (VariableType * Var); 2224 extern void field_get (FileType * File); 2225 extern void field_put (FileType * File); 2226 extern void file_clear (FileType * F); 2227 extern FileType *file_new (void); 2228 extern int file_next_number (void); 2229 extern FileType *find_file_by_name (char *FileName); 2230 extern FileType *find_file_by_number (int FileNumber); 2231 extern LineType *find_line_number (int number); 2232 extern void FixDescription (FILE * file, const char *left, const char *right); 2233 extern void FormatBasicNumber (DoubleType Input, char *Output); 2234 extern int GetOnError (void); 2235 extern void IntrinsicFunctionDefinitionCheck (IntrinsicFunctionType * f); 2236 extern void IntrinsicFunctionSyntax (IntrinsicFunctionType * f, char *Syntax); 2237 extern void IntrinsicFunctionUniqueID (IntrinsicFunctionType * f, 2238 char *UniqueID); 2239 extern VariableType *IntrinsicFunction_deffn (int argc, VariableType * argv, 2240 UserFunctionType * f); 2241 extern VariableType *IntrinsicFunction_execute (int argc, VariableType * argv, 2242 IntrinsicFunctionType * f); 2243 extern IntrinsicFunctionType *IntrinsicFunction_find_exact (char *name, 2244 int 2245 ParameterCount, 2246 ParamBitsType 2247 ParameterTypes); 2248 extern int IntrinsicFunction_init (void); 2249 extern int IntrinsicFunction_name (char *name); 2250 extern int InvertMatrix (VariableType * vOut, VariableType * vIn); 2251 extern int IsLastKeyword (LineType * l, char *Keyword); 2252 extern int IsLike (char *buffer, int *buffer_count, int buffer_Length, 2253 char *pattern, int *pattern_count, int pattern_Length); 2254 extern int is_empty_string (char *Buffer); 2255 extern int line_is_eol (LineType * line); 2256 #if FALSE /* kepp this ... */ 2257 extern int line_peek_array_dimensions (LineType * line, int *n_params); 2258 #endif 2259 #if FALSE /* kepp this ... */ 2260 extern int line_peek_char (LineType * line, char find); 2261 #endif 2262 extern int line_peek_EqualChar (LineType * line); 2263 extern int line_peek_LparenChar (LineType * line); 2264 extern int line_peek_QuoteChar (LineType * line); 2265 #if FALSE /* kepp this ... */ 2266 extern int line_peek_word (LineType * line, char *find); 2267 #endif 2268 #if FALSE /* kepp this ... */ 2269 extern int line_read_array_dimensions (LineType * line, int *n_params, 2270 int params[]); 2271 #endif 2272 extern int line_read_array_redim (LineType * line, int *dimensions, 2273 int LBOUND[], int UBOUND[]); 2274 extern int line_read_expression (LineType * line, VariantType * X); 2275 extern int line_read_index_item (LineType * line, int Index, int *Value); 2276 extern int line_read_integer_expression (LineType * line, int *Value); 2277 extern int line_read_label (LineType * line, char *label); 2278 extern int line_read_letter_sequence (LineType * line, char *head, 2279 char *tail); 2280 extern int line_read_line_number (LineType * line, int *linenum); 2281 extern int line_read_line_sequence (LineType * line, int *head, int *tail); 2282 extern VariableType *line_read_matrix (LineType * line); 2283 extern int line_read_numeric_expression (LineType * line, DoubleType * Value); 2284 extern VariableType *line_read_scalar (LineType * line); 2285 extern int line_read_string_expression (LineType * line, char **Value); 2286 extern char line_read_type_declaration (LineType * line); 2287 extern int line_read_varname (LineType * line, char *varname); 2288 extern int line_skip_AtChar (LineType * line); 2289 extern int line_skip_char (LineType * line, char find); 2290 extern int line_skip_CommaChar (LineType * line); 2291 extern void line_skip_eol (LineType * line); 2292 extern int line_skip_EqualChar (LineType * line); 2293 extern int line_skip_FilenumChar (LineType * line); 2294 extern int line_skip_LparenChar (LineType * line); 2295 extern int line_skip_MinusChar (LineType * line); 2296 extern int line_skip_PlusChar (LineType * line); 2297 extern int line_skip_RparenChar (LineType * line); 2298 extern int line_skip_SemicolonChar (LineType * line); 2299 extern char line_skip_seperator (LineType * line); 2300 extern void line_skip_spaces (LineType * line); 2301 extern int line_skip_StarChar (LineType * line); 2302 extern int line_skip_word (LineType * line, char *find); 2303 extern void line_start (LineType * l); 2304 extern int main (int argc, char **argv); 2305 extern VariableType *mat_find (char *name); 2306 extern int NumberValueCheck (ParamTestType ParameterTests, DoubleType X); 2307 extern void OptionVersionSet (int i); 2308 extern void ResetConsoleColumn (void); 2309 extern void SetOnError (int LineNumber); 2310 extern void SortAllCommands (void); 2311 extern void SortAllFunctions (void); 2312 extern void SortAllOperators (void); 2313 extern int StringLengthCheck (ParamTestType ParameterTests, int s); 2314 extern int str_btob (StringType * d, StringType * s); 2315 extern int str_cmp (StringType * a, StringType * b); 2316 extern int str_match (char *A, int A_Length, char *B, int B_Length, 2317 int I_Start); 2318 extern char TypeCode_to_Char (char TypeCode); 2319 extern int UserFunction_add (LineType * l); 2320 extern int UserFunction_addlocalvar (UserFunctionType * f, VariableType * v); 2321 extern UserFunctionType *UserFunction_find_exact (char *name, 2322 unsigned char 2323 ParameterCount, 2324 ParamBitsType 2325 ParameterTypes); 2326 extern int UserFunction_init (void); 2327 extern int UserFunction_name (char *name); 2328 extern int VarTypeIndex (char C); 2329 extern VariableType *var_chain (VariableType * argv); 2330 extern void var_CLEAR (void); 2331 extern int var_delcvars (void); 2332 extern VariableType *var_find (char *name, int dimensions, int IsImplicit); 2333 extern VariableType *var_free (VariableType * variable); 2334 extern int var_get (VariableType * variable, VariantType * variant); 2335 extern int var_init (void); 2336 extern int var_make (VariableType * variable, char TypeCode); 2337 extern char var_nametype (char *name); 2338 extern VariableType *var_new (char *name, char TypeCode); 2339 extern int var_set (VariableType * variable, VariantType * variant); 2340 2341 2342 /*------------------------------------------------------------- 2343 COMMANDS (CommandID) 2344 -------------------------------------------------------------*/ 2345 #define C_DEF8LBL -1 /* DEF*LBL */ 2346 /* COMMANDS */ 2347 #define C_APPEND 1 /* APPEND */ 2348 #define C_AS 2 /* AS */ 2349 #define C_AUTO 3 /* AUTO */ 2350 #define C_BACKSPACE 4 /* BACKSPACE */ 2351 #define C_BREAK 5 /* BREAK */ 2352 #define C_BUILD 6 /* BUILD */ 2353 #define C_BYE 7 /* BYE */ 2354 #define C_CALL 8 /* CALL */ 2355 #define C_CASE 9 /* CASE */ 2356 #define C_CASE_ELSE 10 /* CASE ELSE */ 2357 #define C_CHAIN 11 /* CHAIN */ 2358 #define C_CHANGE 12 /* CHANGE */ 2359 #define C_CLEAR 13 /* CLEAR */ 2360 #define C_CLOAD 14 /* CLOAD */ 2361 #define C_CLOAD8 15 /* CLOAD* */ 2362 #define C_CLOSE 16 /* CLOSE */ 2363 #define C_CLR 17 /* CLR */ 2364 #define C_CMDS 18 /* CMDS */ 2365 #define C_COMMON 19 /* COMMON */ 2366 #define C_CONSOLE 20 /* CONSOLE */ 2367 #define C_CONST 21 /* CONST */ 2368 #define C_CONT 22 /* CONT */ 2369 #define C_CONTINUE 23 /* CONTINUE */ 2370 #define C_COPY 24 /* COPY */ 2371 #define C_CREATE 25 /* CREATE */ 2372 #define C_CSAVE 26 /* CSAVE */ 2373 #define C_CSAVE8 27 /* CSAVE* */ 2374 #define C_DATA 28 /* DATA */ 2375 #define C_DEC 29 /* DEC */ 2376 #define C_DEF 30 /* DEF */ 2377 #define C_DEFBYT 31 /* DEFBYT */ 2378 #define C_DEFCUR 32 /* DEFCUR */ 2379 #define C_DEFDBL 33 /* DEFDBL */ 2380 #define C_DEFINT 34 /* DEFINT */ 2381 #define C_DEFLNG 35 /* DEFLNG */ 2382 #define C_DEFSNG 36 /* DEFSNG */ 2383 #define C_DEFSTR 37 /* DEFSTR */ 2384 #define C_DELETE 38 /* DELETE */ 2385 #define C_DELIMIT 39 /* DELIMIT */ 2386 #define C_DIM 40 /* DIM */ 2387 #define C_DISPLAY 41 /* DISPLAY */ 2388 #define C_DO 42 /* DO */ 2389 #define C_DOS 43 /* DOS */ 2390 #define C_DSP 44 /* DSP */ 2391 #define C_EDIT 45 /* EDIT */ 2392 #define C_ELSE 46 /* ELSE */ 2393 #define C_ELSEIF 47 /* ELSEIF */ 2394 #define C_END 48 /* END */ 2395 #define C_END_FUNCTION 49 /* END FUNCTION */ 2396 #define C_END_IF 50 /* END IF */ 2397 #define C_END_SELECT 51 /* END SELECT */ 2398 #define C_END_SUB 52 /* END SUB */ 2399 #define C_ERASE 53 /* ERASE */ 2400 #define C_EXCHANGE 54 /* EXCHANGE */ 2401 #define C_EXIT 55 /* EXIT */ 2402 #define C_EXIT_DO 56 /* EXIT DO */ 2403 #define C_EXIT_FOR 57 /* EXIT FOR */ 2404 #define C_EXIT_FUNCTION 58 /* EXIT FUNCTION */ 2405 #define C_EXIT_REPEAT 59 /* EXIT REPEAT */ 2406 #define C_EXIT_SUB 60 /* EXIT SUB */ 2407 #define C_EXIT_WHILE 61 /* EXIT WHILE */ 2408 #define C_FEND 62 /* FEND */ 2409 #define C_FIELD 63 /* FIELD */ 2410 #define C_FILE 64 /* FILE */ 2411 #define C_FILES 65 /* FILES */ 2412 #define C_FLEX 66 /* FLEX */ 2413 #define C_FNCS 67 /* FNCS */ 2414 #define C_FNEND 68 /* FNEND */ 2415 #define C_FOR 69 /* FOR */ 2416 #define C_FUNCTION 70 /* FUNCTION */ 2417 #define C_GET 71 /* GET */ 2418 #define C_GO 72 /* GO */ 2419 #define C_GO_SUB 73 /* GO SUB */ 2420 #define C_GO_TO 74 /* GO TO */ 2421 #define C_GOODBYE 75 /* GOODBYE */ 2422 #define C_GOSUB 76 /* GOSUB */ 2423 #define C_GOTO 77 /* GOTO */ 2424 #define C_HELP 78 /* HELP */ 2425 #define C_IF 79 /* IF */ 2426 #define C_IF_END 80 /* IF END */ 2427 #define C_IF_MORE 81 /* IF MORE */ 2428 #define C_IF8THEN 82 /* IF*THEN */ 2429 #define C_IMAGE 83 /* IMAGE */ 2430 #define C_INC 84 /* INC */ 2431 #define C_INPUT 85 /* INPUT */ 2432 #define C_INPUT_LINE 86 /* INPUT LINE */ 2433 #define C_LET 87 /* LET */ 2434 #define C_LINE 88 /* LINE */ 2435 #define C_LINE_INPUT 89 /* LINE INPUT */ 2436 #define C_LIST 90 /* LIST */ 2437 #define C_LISTNH 91 /* LISTNH */ 2438 #define C_LLIST 92 /* LLIST */ 2439 #define C_LOAD 93 /* LOAD */ 2440 #define C_LOCAL 94 /* LOCAL */ 2441 #define C_LOOP 95 /* LOOP */ 2442 #define C_LPRINT 96 /* LPRINT */ 2443 #define C_LPRINTER 97 /* LPRINTER */ 2444 #define C_LPT 98 /* LPT */ 2445 #define C_LSET 99 /* LSET */ 2446 #define C_MAINTAINER 100 /* MAINTAINER */ 2447 #define C_MAINTAINER_CMDS 101 /* MAINTAINER CMDS */ 2448 #define C_MAINTAINER_CMDS_HTML 102 /* MAINTAINER CMDS HTML */ 2449 #define C_MAINTAINER_CMDS_ID 103 /* MAINTAINER CMDS ID */ 2450 #define C_MAINTAINER_CMDS_MANUAL 104 /* MAINTAINER CMDS MANUAL */ 2451 #define C_MAINTAINER_CMDS_SWITCH 105 /* MAINTAINER CMDS SWITCH */ 2452 #define C_MAINTAINER_CMDS_TABLE 106 /* MAINTAINER CMDS TABLE */ 2453 #define C_MAINTAINER_DEBUG 107 /* MAINTAINER DEBUG */ 2454 #define C_MAINTAINER_DEBUG_OFF 108 /* MAINTAINER DEBUG OFF */ 2455 #define C_MAINTAINER_DEBUG_ON 109 /* MAINTAINER DEBUG ON */ 2456 #define C_MAINTAINER_FNCS 110 /* MAINTAINER FNCS */ 2457 #define C_MAINTAINER_FNCS_HTML 111 /* MAINTAINER FNCS HTML */ 2458 #define C_MAINTAINER_FNCS_ID 112 /* MAINTAINER FNCS ID */ 2459 #define C_MAINTAINER_FNCS_MANUAL 113 /* MAINTAINER FNCS MANUAL */ 2460 #define C_MAINTAINER_FNCS_SWITCH 114 /* MAINTAINER FNCS SWITCH */ 2461 #define C_MAINTAINER_FNCS_TABLE 115 /* MAINTAINER FNCS TABLE */ 2462 #define C_MAINTAINER_MANUAL 116 /* MAINTAINER MANUAL */ 2463 #define C_MAINTAINER_STACK 117 /* MAINTAINER STACK */ 2464 #define C_MARGIN 118 /* MARGIN */ 2465 #define C_MAT 119 /* MAT */ 2466 #define C_MAT_GET 120 /* MAT GET */ 2467 #define C_MAT_INPUT 121 /* MAT INPUT */ 2468 #define C_MAT_PRINT 122 /* MAT PRINT */ 2469 #define C_MAT_PUT 123 /* MAT PUT */ 2470 #define C_MAT_READ 124 /* MAT READ */ 2471 #define C_MAT_WRITE 125 /* MAT WRITE */ 2472 #define C_MERGE 126 /* MERGE */ 2473 #define C_MID4 127 /* MID$ */ 2474 #define C_MON 128 /* MON */ 2475 #define C_NAME 129 /* NAME */ 2476 #define C_NEW 130 /* NEW */ 2477 #define C_NEXT 131 /* NEXT */ 2478 #define C_OF 132 /* OF */ 2479 #define C_OLD 133 /* OLD */ 2480 #define C_ON 134 /* ON */ 2481 #define C_ON_ERROR 135 /* ON ERROR */ 2482 #define C_ON_ERROR_GOSUB 136 /* ON ERROR GOSUB */ 2483 #define C_ON_ERROR_GOTO 137 /* ON ERROR GOTO */ 2484 #define C_ON_ERROR_RESUME 138 /* ON ERROR RESUME */ 2485 #define C_ON_ERROR_RESUME_NEXT 139 /* ON ERROR RESUME NEXT */ 2486 #define C_ON_ERROR_RETURN 140 /* ON ERROR RETURN */ 2487 #define C_ON_ERROR_RETURN_NEXT 141 /* ON ERROR RETURN NEXT */ 2488 #define C_ON_TIMER 142 /* ON TIMER */ 2489 #define C_OPEN 143 /* OPEN */ 2490 #define C_OPTION 144 /* OPTION */ 2491 #define C_OPTION_ANGLE 145 /* OPTION ANGLE */ 2492 #define C_OPTION_ANGLE_DEGREES 146 /* OPTION ANGLE DEGREES */ 2493 #define C_OPTION_ANGLE_GRADIANS 147 /* OPTION ANGLE GRADIANS */ 2494 #define C_OPTION_ANGLE_RADIANS 148 /* OPTION ANGLE RADIANS */ 2495 #define C_OPTION_ARITHMETIC 149 /* OPTION ARITHMETIC */ 2496 #define C_OPTION_ARITHMETIC_DECIMAL 150 /* OPTION ARITHMETIC DECIMAL */ 2497 #define C_OPTION_ARITHMETIC_FIXED 151 /* OPTION ARITHMETIC FIXED */ 2498 #define C_OPTION_ARITHMETIC_NATIVE 152 /* OPTION ARITHMETIC NATIVE */ 2499 #define C_OPTION_BASE 153 /* OPTION BASE */ 2500 #define C_OPTION_BUGS 154 /* OPTION BUGS */ 2501 #define C_OPTION_BUGS_BOOLEAN 155 /* OPTION BUGS BOOLEAN */ 2502 #define C_OPTION_BUGS_OFF 156 /* OPTION BUGS OFF */ 2503 #define C_OPTION_BUGS_ON 157 /* OPTION BUGS ON */ 2504 #define C_OPTION_COMPARE 158 /* OPTION COMPARE */ 2505 #define C_OPTION_COMPARE_BINARY 159 /* OPTION COMPARE BINARY */ 2506 #define C_OPTION_COMPARE_DATABASE 160 /* OPTION COMPARE DATABASE */ 2507 #define C_OPTION_COMPARE_TEXT 161 /* OPTION COMPARE TEXT */ 2508 #define C_OPTION_COVERAGE 162 /* OPTION COVERAGE */ 2509 #define C_OPTION_COVERAGE_OFF 163 /* OPTION COVERAGE OFF */ 2510 #define C_OPTION_COVERAGE_ON 164 /* OPTION COVERAGE ON */ 2511 #define C_OPTION_DATE 165 /* OPTION DATE */ 2512 #define C_OPTION_DIGITS 166 /* OPTION DIGITS */ 2513 #define C_OPTION_DISABLE 167 /* OPTION DISABLE */ 2514 #define C_OPTION_DISABLE_COMMAND 168 /* OPTION DISABLE COMMAND */ 2515 #define C_OPTION_DISABLE_FUNCTION 169 /* OPTION DISABLE FUNCTION */ 2516 #define C_OPTION_DISABLE_OPERATOR 170 /* OPTION DISABLE OPERATOR */ 2517 #define C_OPTION_EDIT 171 /* OPTION EDIT */ 2518 #define C_OPTION_ENABLE 172 /* OPTION ENABLE */ 2519 #define C_OPTION_ENABLE_COMMAND 173 /* OPTION ENABLE COMMAND */ 2520 #define C_OPTION_ENABLE_FUNCTION 174 /* OPTION ENABLE FUNCTION */ 2521 #define C_OPTION_ENABLE_OPERATOR 175 /* OPTION ENABLE OPERATOR */ 2522 #define C_OPTION_ERROR 176 /* OPTION ERROR */ 2523 #define C_OPTION_ERROR_GOSUB 177 /* OPTION ERROR GOSUB */ 2524 #define C_OPTION_ERROR_GOTO 178 /* OPTION ERROR GOTO */ 2525 #define C_OPTION_EXPLICIT 179 /* OPTION EXPLICIT */ 2526 #define C_OPTION_EXTENSION 180 /* OPTION EXTENSION */ 2527 #define C_OPTION_FILES 181 /* OPTION FILES */ 2528 #define C_OPTION_IMPLICIT 182 /* OPTION IMPLICIT */ 2529 #define C_OPTION_INDENT 183 /* OPTION INDENT */ 2530 #define C_OPTION_LABELS 184 /* OPTION LABELS */ 2531 #define C_OPTION_LABELS_OFF 185 /* OPTION LABELS OFF */ 2532 #define C_OPTION_LABELS_ON 186 /* OPTION LABELS ON */ 2533 #define C_OPTION_PROMPT 187 /* OPTION PROMPT */ 2534 #define C_OPTION_PUNCT 188 /* OPTION PUNCT */ 2535 #define C_OPTION_PUNCT_AT 189 /* OPTION PUNCT AT */ 2536 #define C_OPTION_PUNCT_BYTE 190 /* OPTION PUNCT BYTE */ 2537 #define C_OPTION_PUNCT_COMMENT 191 /* OPTION PUNCT COMMENT */ 2538 #define C_OPTION_PUNCT_CURRENCY 192 /* OPTION PUNCT CURRENCY */ 2539 #define C_OPTION_PUNCT_DOUBLE 193 /* OPTION PUNCT DOUBLE */ 2540 #define C_OPTION_PUNCT_FILENUM 194 /* OPTION PUNCT FILENUM */ 2541 #define C_OPTION_PUNCT_IMAGE 195 /* OPTION PUNCT IMAGE */ 2542 #define C_OPTION_PUNCT_INPUT 196 /* OPTION PUNCT INPUT */ 2543 #define C_OPTION_PUNCT_INTEGER 197 /* OPTION PUNCT INTEGER */ 2544 #define C_OPTION_PUNCT_LONG 198 /* OPTION PUNCT LONG */ 2545 #define C_OPTION_PUNCT_LPAREN 199 /* OPTION PUNCT LPAREN */ 2546 #define C_OPTION_PUNCT_PRINT 200 /* OPTION PUNCT PRINT */ 2547 #define C_OPTION_PUNCT_QUOTE 201 /* OPTION PUNCT QUOTE */ 2548 #define C_OPTION_PUNCT_RPAREN 202 /* OPTION PUNCT RPAREN */ 2549 #define C_OPTION_PUNCT_SINGLE 203 /* OPTION PUNCT SINGLE */ 2550 #define C_OPTION_PUNCT_STATEMENT 204 /* OPTION PUNCT STATEMENT */ 2551 #define C_OPTION_PUNCT_STRING 205 /* OPTION PUNCT STRING */ 2552 #define C_OPTION_RECLEN 206 /* OPTION RECLEN */ 2553 #define C_OPTION_RENUM 207 /* OPTION RENUM */ 2554 #define C_OPTION_ROUND 208 /* OPTION ROUND */ 2555 #define C_OPTION_ROUND_BANK 209 /* OPTION ROUND BANK */ 2556 #define C_OPTION_ROUND_MATH 210 /* OPTION ROUND MATH */ 2557 #define C_OPTION_ROUND_TRUNCATE 211 /* OPTION ROUND TRUNCATE */ 2558 #define C_OPTION_SCALE 212 /* OPTION SCALE */ 2559 #define C_OPTION_SLEEP 213 /* OPTION SLEEP */ 2560 #define C_OPTION_STDERR 214 /* OPTION STDERR */ 2561 #define C_OPTION_STDIN 215 /* OPTION STDIN */ 2562 #define C_OPTION_STDOUT 216 /* OPTION STDOUT */ 2563 #define C_OPTION_STRICT 217 /* OPTION STRICT */ 2564 #define C_OPTION_STRICT_OFF 218 /* OPTION STRICT OFF */ 2565 #define C_OPTION_STRICT_ON 219 /* OPTION STRICT ON */ 2566 #define C_OPTION_TERMINAL 220 /* OPTION TERMINAL */ 2567 #define C_OPTION_TERMINAL_ADM 221 /* OPTION TERMINAL ADM */ 2568 #define C_OPTION_TERMINAL_ANSI 222 /* OPTION TERMINAL ANSI */ 2569 #define C_OPTION_TERMINAL_NONE 223 /* OPTION TERMINAL NONE */ 2570 #define C_OPTION_TIME 224 /* OPTION TIME */ 2571 #define C_OPTION_TRACE 225 /* OPTION TRACE */ 2572 #define C_OPTION_TRACE_OFF 226 /* OPTION TRACE OFF */ 2573 #define C_OPTION_TRACE_ON 227 /* OPTION TRACE ON */ 2574 #define C_OPTION_USING 228 /* OPTION USING */ 2575 #define C_OPTION_USING_ALL 229 /* OPTION USING ALL */ 2576 #define C_OPTION_USING_COMMA 230 /* OPTION USING COMMA */ 2577 #define C_OPTION_USING_DIGIT 231 /* OPTION USING DIGIT */ 2578 #define C_OPTION_USING_DOLLAR 232 /* OPTION USING DOLLAR */ 2579 #define C_OPTION_USING_EXRAD 233 /* OPTION USING EXRAD */ 2580 #define C_OPTION_USING_FILLER 234 /* OPTION USING FILLER */ 2581 #define C_OPTION_USING_FIRST 235 /* OPTION USING FIRST */ 2582 #define C_OPTION_USING_LENGTH 236 /* OPTION USING LENGTH */ 2583 #define C_OPTION_USING_LITERAL 237 /* OPTION USING LITERAL */ 2584 #define C_OPTION_USING_MINUS 238 /* OPTION USING MINUS */ 2585 #define C_OPTION_USING_PERIOD 239 /* OPTION USING PERIOD */ 2586 #define C_OPTION_USING_PLUS 240 /* OPTION USING PLUS */ 2587 #define C_OPTION_VERSION 241 /* OPTION VERSION */ 2588 #define C_OPTION_ZONE 242 /* OPTION ZONE */ 2589 #define C_PAUSE 243 /* PAUSE */ 2590 #define C_PDEL 244 /* PDEL */ 2591 #define C_POP 245 /* POP */ 2592 #define C_PRINT 246 /* PRINT */ 2593 #define C_PTP 247 /* PTP */ 2594 #define C_PTR 248 /* PTR */ 2595 #define C_PUT 249 /* PUT */ 2596 #define C_QUIT 250 /* QUIT */ 2597 #define C_READ 251 /* READ */ 2598 #define C_RECALL 252 /* RECALL */ 2599 #define C_REM 253 /* REM */ 2600 #define C_RENAME 254 /* RENAME */ 2601 #define C_RENUM 255 /* RENUM */ 2602 #define C_RENUMBER 256 /* RENUMBER */ 2603 #define C_REPEAT 257 /* REPEAT */ 2604 #define C_REPLACE 258 /* REPLACE */ 2605 #define C_RESET 259 /* RESET */ 2606 #define C_RESTORE 260 /* RESTORE */ 2607 #define C_RESUME 261 /* RESUME */ 2608 #define C_RETURN 262 /* RETURN */ 2609 #define C_RSET 263 /* RSET */ 2610 #define C_RUN 264 /* RUN */ 2611 #define C_RUNNH 265 /* RUNNH */ 2612 #define C_SAVE 266 /* SAVE */ 2613 #define C_SCRATCH 267 /* SCRATCH */ 2614 #define C_SELECT 268 /* SELECT */ 2615 #define C_SELECT_CASE 269 /* SELECT CASE */ 2616 #define C_STEP 270 /* STEP */ 2617 #define C_STOP 271 /* STOP */ 2618 #define C_STORE 272 /* STORE */ 2619 #define C_SUB 273 /* SUB */ 2620 #define C_SUB_END 274 /* SUB END */ 2621 #define C_SUB_EXIT 275 /* SUB EXIT */ 2622 #define C_SUBEND 276 /* SUBEND */ 2623 #define C_SUBEXIT 277 /* SUBEXIT */ 2624 #define C_SWAP 278 /* SWAP */ 2625 #define C_SYSTEM 279 /* SYSTEM */ 2626 #define C_TEXT 280 /* TEXT */ 2627 #define C_THEN 281 /* THEN */ 2628 #define C_TIMER 282 /* TIMER */ 2629 #define C_TIMER_OFF 283 /* TIMER OFF */ 2630 #define C_TIMER_ON 284 /* TIMER ON */ 2631 #define C_TIMER_STOP 285 /* TIMER STOP */ 2632 #define C_TLOAD 286 /* TLOAD */ 2633 #define C_TO 287 /* TO */ 2634 #define C_TRACE 288 /* TRACE */ 2635 #define C_TRACE_OFF 289 /* TRACE OFF */ 2636 #define C_TRACE_ON 290 /* TRACE ON */ 2637 #define C_TSAVE 291 /* TSAVE */ 2638 #define C_TTY 292 /* TTY */ 2639 #define C_TTY_IN 293 /* TTY IN */ 2640 #define C_TTY_OUT 294 /* TTY OUT */ 2641 #define C_UNTIL 295 /* UNTIL */ 2642 #define C_USE 296 /* USE */ 2643 #define C_VARS 297 /* VARS */ 2644 #define C_WEND 298 /* WEND */ 2645 #define C_WHILE 299 /* WHILE */ 2646 #define C_WRITE 300 /* WRITE */ 2647 2648 2649 /*------------------------------------------------------------- 2650 FUNCTIONS (FunctionID) 2651 -------------------------------------------------------------*/ 2652 2653 /* FUNCTIONS */ 2654 #define F_ABS_X_N 1 /* N = ABS( X ) */ 2655 #define F_ACOS_X_N 2 /* N = ACOS( X ) */ 2656 #define F_ACS_X_N 3 /* N = ACS( X ) */ 2657 #define F_ACSD_X_N 4 /* N = ACSD( X ) */ 2658 #define F_ACSG_X_N 5 /* N = ACSG( X ) */ 2659 #define F_ANGLE_X_Y_N 6 /* N = ANGLE( X, Y ) */ 2660 #define F_ARCCOS_X_N 7 /* N = ARCCOS( X ) */ 2661 #define F_ARCSIN_X_N 8 /* N = ARCSIN( X ) */ 2662 #define F_ARCTAN_X_N 9 /* N = ARCTAN( X ) */ 2663 #define F_ARGC_N 10 /* N = ARGC */ 2664 #define F_ARGT4_X_S 11 /* S$ = ARGT$( X ) */ 2665 #define F_ARGV_X_N 12 /* N = ARGV( X ) */ 2666 #define F_ARGV4_X_S 13 /* S$ = ARGV$( X ) */ 2667 #define F_ASC_A_N 14 /* N = ASC( A$ ) */ 2668 #define F_ASC_A_X_N 15 /* N = ASC( A$, X ) */ 2669 #define F_ASCII_A_N 16 /* N = ASCII( A$ ) */ 2670 #define F_ASIN_X_N 17 /* N = ASIN( X ) */ 2671 #define F_ASN_X_N 18 /* N = ASN( X ) */ 2672 #define F_ASND_X_N 19 /* N = ASND( X ) */ 2673 #define F_ASNG_X_N 20 /* N = ASNG( X ) */ 2674 #define F_ATAN_X_N 21 /* N = ATAN( X ) */ 2675 #define F_ATN_X_N 22 /* N = ATN( X ) */ 2676 #define F_ATND_X_N 23 /* N = ATND( X ) */ 2677 #define F_ATNG_X_N 24 /* N = ATNG( X ) */ 2678 #define F_BASE_N 25 /* N = BASE */ 2679 #define F_BIN4_X_S 26 /* S$ = BIN$( X ) */ 2680 #define F_BIN4_X_Y_S 27 /* S$ = BIN$( X, Y ) */ 2681 #define F_CATALOG_N 28 /* N = CATALOG */ 2682 #define F_CATALOG_A_N 29 /* N = CATALOG( A$ ) */ 2683 #define F_CCUR_X_N 30 /* N = CCUR( X ) */ 2684 #define F_CDBL_X_N 31 /* N = CDBL( X ) */ 2685 #define F_CEIL_X_N 32 /* N = CEIL( X ) */ 2686 #define F_CHAR_X_Y_S 33 /* S$ = CHAR( X, Y ) */ 2687 #define F_CHAR4_X_S 34 /* S$ = CHAR$( X ) */ 2688 #define F_CHDIR_A_N 35 /* N = CHDIR( A$ ) */ 2689 #define F_CHR_X_S 36 /* S$ = CHR( X ) */ 2690 #define F_CHR4_X_S 37 /* S$ = CHR$( X ) */ 2691 #define F_CIN_X_N 38 /* N = CIN( X ) */ 2692 #define F_CINT_X_N 39 /* N = CINT( X ) */ 2693 #define F_CLG_X_N 40 /* N = CLG( X ) */ 2694 #define F_CLK_X_N 41 /* N = CLK( X ) */ 2695 #define F_CLK_X_S 42 /* S$ = CLK( X ) */ 2696 #define F_CLK4_S 43 /* S$ = CLK$ */ 2697 #define F_CLNG_X_N 44 /* N = CLNG( X ) */ 2698 #define F_CLOG_X_N 45 /* N = CLOG( X ) */ 2699 #define F_CLOSE_N 46 /* N = CLOSE */ 2700 #define F_CLOSE_X_N 47 /* N = CLOSE( X ) */ 2701 #define F_CLS_N 48 /* N = CLS */ 2702 #define F_CNTRL_X_Y_N 49 /* N = CNTRL( X, Y ) */ 2703 #define F_CODE_A_N 50 /* N = CODE( A$ ) */ 2704 #define F_COLOR_X_Y_N 51 /* N = COLOR( X, Y ) */ 2705 #define F_COMMAND4_S 52 /* S$ = COMMAND$ */ 2706 #define F_COMMAND4_X_S 53 /* S$ = COMMAND$( X ) */ 2707 #define F_COS_X_N 54 /* N = COS( X ) */ 2708 #define F_COSD_X_N 55 /* N = COSD( X ) */ 2709 #define F_COSG_X_N 56 /* N = COSG( X ) */ 2710 #define F_COSH_X_N 57 /* N = COSH( X ) */ 2711 #define F_COT_X_N 58 /* N = COT( X ) */ 2712 #define F_COUNT_N 59 /* N = COUNT */ 2713 #define F_CSC_X_N 60 /* N = CSC( X ) */ 2714 #define F_CSH_X_N 61 /* N = CSH( X ) */ 2715 #define F_CSNG_X_N 62 /* N = CSNG( X ) */ 2716 #define F_CUR_X_Y_S 63 /* S$ = CUR( X, Y ) */ 2717 #define F_CVC_A_N 64 /* N = CVC( A$ ) */ 2718 #define F_CVD_A_N 65 /* N = CVD( A$ ) */ 2719 #define F_CVI_A_N 66 /* N = CVI( A$ ) */ 2720 #define F_CVL_A_N 67 /* N = CVL( A$ ) */ 2721 #define F_CVS_A_N 68 /* N = CVS( A$ ) */ 2722 #define F_DAT4_S 69 /* S$ = DAT$ */ 2723 #define F_DATE_N 70 /* N = DATE */ 2724 #define F_DATE4_S 71 /* S$ = DATE$ */ 2725 #define F_DATE4_X_S 72 /* S$ = DATE$( X ) */ 2726 #define F_DEG_N 73 /* N = DEG */ 2727 #define F_DEG_X_N 74 /* N = DEG( X ) */ 2728 #define F_DEGREE_N 75 /* N = DEGREE */ 2729 #define F_DEGREE_X_N 76 /* N = DEGREE( X ) */ 2730 #define F_DET_N 77 /* N = DET */ 2731 #define F_DIGITS_X_N 78 /* N = DIGITS( X ) */ 2732 #define F_DIGITS_X_Y_N 79 /* N = DIGITS( X, Y ) */ 2733 #define F_DIM_N 80 /* N = DIM( ... ) */ 2734 #define F_DPEEK_X_N 81 /* N = DPEEK( X ) */ 2735 #define F_DPOKE_X_Y_N 82 /* N = DPOKE( X, Y ) */ 2736 #define F_EDIT4_A_X_S 83 /* S$ = EDIT$( A$, X ) */ 2737 #define F_ENVIRON_A_N 84 /* N = ENVIRON( A$ ) */ 2738 #define F_ENVIRON4_A_S 85 /* S$ = ENVIRON$( A$ ) */ 2739 #define F_EOF_X_N 86 /* N = EOF( X ) */ 2740 #define F_EPS_X_N 87 /* N = EPS( X ) */ 2741 #define F_ERL_N 88 /* N = ERL */ 2742 #define F_ERR_N 89 /* N = ERR */ 2743 #define F_ERR4_S 90 /* S$ = ERR$ */ 2744 #define F_ERRL_N 91 /* N = ERRL */ 2745 #define F_ERRN_N 92 /* N = ERRN */ 2746 #define F_ERROR_X_N 93 /* N = ERROR( X ) */ 2747 #define F_ERROR_X_A_N 94 /* N = ERROR( X, A$ ) */ 2748 #define F_ERROR4_S 95 /* S$ = ERROR$ */ 2749 #define F_EXAM_X_N 96 /* N = EXAM( X ) */ 2750 #define F_EXEC_A_N 97 /* N = EXEC( A$ ) */ 2751 #define F_EXF_N 98 /* N = EXF( ... ) */ 2752 #define F_EXP_X_N 99 /* N = EXP( X ) */ 2753 #define F_FALSE_N 100 /* N = FALSE */ 2754 #define F_FETCH_X_N 101 /* N = FETCH( X ) */ 2755 #define F_FILEATTR_X_Y_N 102 /* N = FILEATTR( X, Y ) */ 2756 #define F_FILES_N 103 /* N = FILES */ 2757 #define F_FILES_A_N 104 /* N = FILES( A$ ) */ 2758 #define F_FILL_X_Y_N 105 /* N = FILL( X, Y ) */ 2759 #define F_FIX_X_N 106 /* N = FIX( X ) */ 2760 #define F_FLOAT_X_N 107 /* N = FLOAT( X ) */ 2761 #define F_FLOW_N 108 /* N = FLOW */ 2762 #define F_FP_X_N 109 /* N = FP( X ) */ 2763 #define F_FRAC_X_N 110 /* N = FRAC( X ) */ 2764 #define F_FRE_N 111 /* N = FRE */ 2765 #define F_FRE_A_N 112 /* N = FRE( A$ ) */ 2766 #define F_FRE_X_N 113 /* N = FRE( X ) */ 2767 #define F_FREE_N 114 /* N = FREE */ 2768 #define F_FREE_X_N 115 /* N = FREE( X ) */ 2769 #define F_FREE_A_N 116 /* N = FREE( A$ ) */ 2770 #define F_FREEFILE_N 117 /* N = FREEFILE */ 2771 #define F_GET_X_N 118 /* N = GET( X ) */ 2772 #define F_GET_X_Y_N 119 /* N = GET( X, Y ) */ 2773 #define F_GRAD_N 120 /* N = GRAD */ 2774 #define F_GRADIAN_N 121 /* N = GRADIAN */ 2775 #define F_HCS_X_N 122 /* N = HCS( X ) */ 2776 #define F_HEX_A_N 123 /* N = HEX( A$ ) */ 2777 #define F_HEX4_X_S 124 /* S$ = HEX$( X ) */ 2778 #define F_HEX4_X_Y_S 125 /* S$ = HEX$( X, Y ) */ 2779 #define F_HOME_N 126 /* N = HOME */ 2780 #define F_HSN_X_N 127 /* N = HSN( X ) */ 2781 #define F_HTN_X_N 128 /* N = HTN( X ) */ 2782 #define F_INCH4_S 129 /* S$ = INCH$ */ 2783 #define F_INDEX_A_B_N 130 /* N = INDEX( A$, B$ ) */ 2784 #define F_INITIALIZE_N 131 /* N = INITIALIZE */ 2785 #define F_INKEY4_S 132 /* S$ = INKEY$ */ 2786 #define F_INP_X_N 133 /* N = INP( X ) */ 2787 #define F_INPUT4_X_S 134 /* S$ = INPUT$( X ) */ 2788 #define F_INPUT4_X_Y_S 135 /* S$ = INPUT$( X, Y ) */ 2789 #define F_INSTR_A_B_N 136 /* N = INSTR( A$, B$ ) */ 2790 #define F_INSTR_A_B_X_N 137 /* N = INSTR( A$, B$, X ) */ 2791 #define F_INSTR_X_A_B_N 138 /* N = INSTR( X, A$, B$ ) */ 2792 #define F_INT_X_N 139 /* N = INT( X ) */ 2793 #define F_INT5_X_N 140 /* N = INT%( X ) */ 2794 #define F_IP_X_N 141 /* N = IP( X ) */ 2795 #define F_KEY_S 142 /* S$ = KEY */ 2796 #define F_KEY4_S 143 /* S$ = KEY$ */ 2797 #define F_KILL_A_N 144 /* N = KILL( A$ ) */ 2798 #define F_LBOUND_N 145 /* N = LBOUND( ... ) */ 2799 #define F_LCASE4_A_S 146 /* S$ = LCASE$( A$ ) */ 2800 #define F_LEFT_A_X_S 147 /* S$ = LEFT( A$, X ) */ 2801 #define F_LEFT4_A_X_S 148 /* S$ = LEFT$( A$, X ) */ 2802 #define F_LEN_A_N 149 /* N = LEN( A$ ) */ 2803 #define F_LGT_X_N 150 /* N = LGT( X ) */ 2804 #define F_LIN_X_S 151 /* S$ = LIN( X ) */ 2805 #define F_LN_X_N 152 /* N = LN( X ) */ 2806 #define F_LNO_X_N 153 /* N = LNO( X ) */ 2807 #define F_LOC_X_N 154 /* N = LOC( X ) */ 2808 #define F_LOCATE_X_Y_N 155 /* N = LOCATE( X, Y ) */ 2809 #define F_LOCK_X_N 156 /* N = LOCK( X ) */ 2810 #define F_LOF_X_N 157 /* N = LOF( X ) */ 2811 #define F_LOG_X_N 158 /* N = LOG( X ) */ 2812 #define F_LOG10_X_N 159 /* N = LOG10( X ) */ 2813 #define F_LOG2_X_N 160 /* N = LOG2( X ) */ 2814 #define F_LOGE_X_N 161 /* N = LOGE( X ) */ 2815 #define F_LOWER4_A_S 162 /* S$ = LOWER$( A$ ) */ 2816 #define F_LPOS_N 163 /* N = LPOS */ 2817 #define F_LTRIM4_A_S 164 /* S$ = LTRIM$( A$ ) */ 2818 #define F_LTW_X_N 165 /* N = LTW( X ) */ 2819 #define F_LWIDTH_X_N 166 /* N = LWIDTH( X ) */ 2820 #define F_MATCH_A_B_X_N 167 /* N = MATCH( A$, B$, X ) */ 2821 #define F_MAX_A_B_S 168 /* S$ = MAX( A$, B$ ) */ 2822 #define F_MAX_X_Y_N 169 /* N = MAX( X, Y ) */ 2823 #define F_MAXBYT_N 170 /* N = MAXBYT */ 2824 #define F_MAXCUR_N 171 /* N = MAXCUR */ 2825 #define F_MAXDBL_N 172 /* N = MAXDBL */ 2826 #define F_MAXDEV_N 173 /* N = MAXDEV */ 2827 #define F_MAXINT_N 174 /* N = MAXINT */ 2828 #define F_MAXLEN_N 175 /* N = MAXLEN */ 2829 #define F_MAXLEN_A_N 176 /* N = MAXLEN( A$ ) */ 2830 #define F_MAXLNG_N 177 /* N = MAXLNG */ 2831 #define F_MAXLVL_N 178 /* N = MAXLVL */ 2832 #define F_MAXNUM_N 179 /* N = MAXNUM */ 2833 #define F_MAXSNG_N 180 /* N = MAXSNG */ 2834 #define F_MEM_N 181 /* N = MEM */ 2835 #define F_MID_A_X_S 182 /* S$ = MID( A$, X ) */ 2836 #define F_MID_A_X_Y_S 183 /* S$ = MID( A$, X, Y ) */ 2837 #define F_MID4_A_X_S 184 /* S$ = MID$( A$, X ) */ 2838 #define F_MID4_A_X_Y_S 185 /* S$ = MID$( A$, X, Y ) */ 2839 #define F_MIN_X_Y_N 186 /* N = MIN( X, Y ) */ 2840 #define F_MIN_A_B_S 187 /* S$ = MIN( A$, B$ ) */ 2841 #define F_MINBYT_N 188 /* N = MINBYT */ 2842 #define F_MINCUR_N 189 /* N = MINCUR */ 2843 #define F_MINDBL_N 190 /* N = MINDBL */ 2844 #define F_MINDEV_N 191 /* N = MINDEV */ 2845 #define F_MININT_N 192 /* N = MININT */ 2846 #define F_MINLNG_N 193 /* N = MINLNG */ 2847 #define F_MINNUM_N 194 /* N = MINNUM */ 2848 #define F_MINSNG_N 195 /* N = MINSNG */ 2849 #define F_MKC4_X_S 196 /* S$ = MKC$( X ) */ 2850 #define F_MKD4_X_S 197 /* S$ = MKD$( X ) */ 2851 #define F_MKDIR_A_N 198 /* N = MKDIR( A$ ) */ 2852 #define F_MKI4_X_S 199 /* S$ = MKI$( X ) */ 2853 #define F_MKL4_X_S 200 /* S$ = MKL$( X ) */ 2854 #define F_MKS4_X_S 201 /* S$ = MKS$( X ) */ 2855 #define F_MOD_X_Y_N 202 /* N = MOD( X, Y ) */ 2856 #define F_NAME_A_B_N 203 /* N = NAME( A$, B$ ) */ 2857 #define F_NAME_N 204 /* N = NAME( ... ) */ 2858 #define F_NOFLOW_N 205 /* N = NOFLOW */ 2859 #define F_NOTRACE_N 206 /* N = NOTRACE */ 2860 #define F_NULL_X_N 207 /* N = NULL( X ) */ 2861 #define F_NUM_N 208 /* N = NUM */ 2862 #define F_NUM_A_N 209 /* N = NUM( A$ ) */ 2863 #define F_NUM4_X_S 210 /* S$ = NUM$( X ) */ 2864 #define F_OCT4_X_S 211 /* S$ = OCT$( X ) */ 2865 #define F_OCT4_X_Y_S 212 /* S$ = OCT$( X, Y ) */ 2866 #define F_OPEN_A_X_B_N 213 /* N = OPEN( A$, X, B$ ) */ 2867 #define F_OPEN_A_X_B_Y_N 214 /* N = OPEN( A$, X, B$, Y ) */ 2868 #define F_ORD_A_N 215 /* N = ORD( A$ ) */ 2869 #define F_OUT_X_Y_N 216 /* N = OUT( X, Y ) */ 2870 #define F_PAD_X_N 217 /* N = PAD( X ) */ 2871 #define F_PAUSE_X_N 218 /* N = PAUSE( X ) */ 2872 #define F_PDL_X_N 219 /* N = PDL( X ) */ 2873 #define F_PEEK_X_N 220 /* N = PEEK( X ) */ 2874 #define F_PI_N 221 /* N = PI */ 2875 #define F_PI_X_N 222 /* N = PI( X ) */ 2876 #define F_PIN_X_N 223 /* N = PIN( X ) */ 2877 #define F_POKE_X_Y_N 224 /* N = POKE( X, Y ) */ 2878 #define F_POS_N 225 /* N = POS */ 2879 #define F_POS_X_N 226 /* N = POS( X ) */ 2880 #define F_POS_A_B_N 227 /* N = POS( A$, B$ ) */ 2881 #define F_POS_A_B_X_N 228 /* N = POS( A$, B$, X ) */ 2882 #define F_PRECISION_X_N 229 /* N = PRECISION( X ) */ 2883 #define F_PTR_N 230 /* N = PTR( ... ) */ 2884 #define F_PUT_X_N 231 /* N = PUT( X ) */ 2885 #define F_PUT_X_Y_N 232 /* N = PUT( X, Y ) */ 2886 #define F_RAD_N 233 /* N = RAD */ 2887 #define F_RAD_X_N 234 /* N = RAD( X ) */ 2888 #define F_RADIAN_N 235 /* N = RADIAN */ 2889 #define F_RAN_N 236 /* N = RAN */ 2890 #define F_RAN_X_N 237 /* N = RAN( X ) */ 2891 #define F_RANDOM_N 238 /* N = RANDOM */ 2892 #define F_RANDOM_X_N 239 /* N = RANDOM( X ) */ 2893 #define F_RANDOMIZE_N 240 /* N = RANDOMIZE */ 2894 #define F_RANDOMIZE_X_N 241 /* N = RANDOMIZE( X ) */ 2895 #define F_REMAINDER_X_Y_N 242 /* N = REMAINDER( X, Y ) */ 2896 #define F_RENAME_A_B_N 243 /* N = RENAME( A$, B$ ) */ 2897 #define F_REPEAT4_X_A_S 244 /* S$ = REPEAT$( X, A$ ) */ 2898 #define F_REPEAT4_X_Y_S 245 /* S$ = REPEAT$( X, Y ) */ 2899 #define F_RESET_N 246 /* N = RESET */ 2900 #define F_RESIDUE_N 247 /* N = RESIDUE */ 2901 #define F_RIGHT_A_X_S 248 /* S$ = RIGHT( A$, X ) */ 2902 #define F_RIGHT4_A_X_S 249 /* S$ = RIGHT$( A$, X ) */ 2903 #define F_RMDIR_A_N 250 /* N = RMDIR( A$ ) */ 2904 #define F_RND_N 251 /* N = RND */ 2905 #define F_RND_X_N 252 /* N = RND( X ) */ 2906 #define F_ROUND_X_Y_N 253 /* N = ROUND( X, Y ) */ 2907 #define F_RTRIM4_A_S 254 /* S$ = RTRIM$( A$ ) */ 2908 #define F_SCALE_X_N 255 /* N = SCALE( X ) */ 2909 #define F_SEC_X_N 256 /* N = SEC( X ) */ 2910 #define F_SEEK_X_N 257 /* N = SEEK( X ) */ 2911 #define F_SEEK_X_Y_N 258 /* N = SEEK( X, Y ) */ 2912 #define F_SEG_X_N 259 /* N = SEG( X ) */ 2913 #define F_SEG_A_X_Y_S 260 /* S$ = SEG( A$, X, Y ) */ 2914 #define F_SEG4_A_X_Y_S 261 /* S$ = SEG$( A$, X, Y ) */ 2915 #define F_SGN_X_N 262 /* N = SGN( X ) */ 2916 #define F_SHELL_A_N 263 /* N = SHELL( A$ ) */ 2917 #define F_SIN_X_N 264 /* N = SIN( X ) */ 2918 #define F_SIND_X_N 265 /* N = SIND( X ) */ 2919 #define F_SING_X_N 266 /* N = SING( X ) */ 2920 #define F_SINH_X_N 267 /* N = SINH( X ) */ 2921 #define F_SIZE_A_N 268 /* N = SIZE( A$ ) */ 2922 #define F_SIZE_N 269 /* N = SIZE( ... ) */ 2923 #define F_SLEEP_X_N 270 /* N = SLEEP( X ) */ 2924 #define F_SNH_X_N 271 /* N = SNH( X ) */ 2925 #define F_SPA_X_S 272 /* S$ = SPA( X ) */ 2926 #define F_SPACE_X_S 273 /* S$ = SPACE( X ) */ 2927 #define F_SPACE4_X_S 274 /* S$ = SPACE$( X ) */ 2928 #define F_SPC_X_S 275 /* S$ = SPC( X ) */ 2929 #define F_SQR_X_N 276 /* N = SQR( X ) */ 2930 #define F_SQRT_X_N 277 /* N = SQRT( X ) */ 2931 #define F_STR_X_Y_S 278 /* S$ = STR( X, Y ) */ 2932 #define F_STR4_X_S 279 /* S$ = STR$( X ) */ 2933 #define F_STRING_X_Y_S 280 /* S$ = STRING( X, Y ) */ 2934 #define F_STRING4_X_A_S 281 /* S$ = STRING$( X, A$ ) */ 2935 #define F_STRING4_X_Y_S 282 /* S$ = STRING$( X, Y ) */ 2936 #define F_STRIP4_A_S 283 /* S$ = STRIP$( A$ ) */ 2937 #define F_STUFF_X_Y_N 284 /* N = STUFF( X, Y ) */ 2938 #define F_TAB_X_S 285 /* S$ = TAB( X ) */ 2939 #define F_TAN_X_N 286 /* N = TAN( X ) */ 2940 #define F_TAND_X_N 287 /* N = TAND( X ) */ 2941 #define F_TANG_X_N 288 /* N = TANG( X ) */ 2942 #define F_TANH_X_N 289 /* N = TANH( X ) */ 2943 #define F_TI_N 290 /* N = TI */ 2944 #define F_TI4_S 291 /* S$ = TI$ */ 2945 #define F_TIM_N 292 /* N = TIM */ 2946 #define F_TIM_X_N 293 /* N = TIM( X ) */ 2947 #define F_TIME_N 294 /* N = TIME */ 2948 #define F_TIME_X_N 295 /* N = TIME( X ) */ 2949 #define F_TIME4_S 296 /* S$ = TIME$ */ 2950 #define F_TIME4_X_S 297 /* S$ = TIME$( X ) */ 2951 #define F_TIMER_N 298 /* N = TIMER */ 2952 #define F_TOP_N 299 /* N = TOP */ 2953 #define F_TRACE_N 300 /* N = TRACE */ 2954 #define F_TRACE_X_N 301 /* N = TRACE( X ) */ 2955 #define F_TRIM4_A_S 302 /* S$ = TRIM$( A$ ) */ 2956 #define F_TROFF_N 303 /* N = TROFF */ 2957 #define F_TRON_N 304 /* N = TRON */ 2958 #define F_TRUE_N 305 /* N = TRUE */ 2959 #define F_TRUNCATE_X_Y_N 306 /* N = TRUNCATE( X, Y ) */ 2960 #define F_UBOUND_N 307 /* N = UBOUND( ... ) */ 2961 #define F_UCASE4_A_S 308 /* S$ = UCASE$( A$ ) */ 2962 #define F_UNLOCK_X_N 309 /* N = UNLOCK( X ) */ 2963 #define F_UNSAVE_A_N 310 /* N = UNSAVE( A$ ) */ 2964 #define F_UPPER4_A_S 311 /* S$ = UPPER$( A$ ) */ 2965 #define F_USR_N 312 /* N = USR( ... ) */ 2966 #define F_USR0_N 313 /* N = USR0( ... ) */ 2967 #define F_USR1_N 314 /* N = USR1( ... ) */ 2968 #define F_USR2_N 315 /* N = USR2( ... ) */ 2969 #define F_USR3_N 316 /* N = USR3( ... ) */ 2970 #define F_USR4_N 317 /* N = USR4( ... ) */ 2971 #define F_USR5_N 318 /* N = USR5( ... ) */ 2972 #define F_USR6_N 319 /* N = USR6( ... ) */ 2973 #define F_USR7_N 320 /* N = USR7( ... ) */ 2974 #define F_USR8_N 321 /* N = USR8( ... ) */ 2975 #define F_USR9_N 322 /* N = USR9( ... ) */ 2976 #define F_UUF_N 323 /* N = UUF( ... ) */ 2977 #define F_VAL_A_N 324 /* N = VAL( A$ ) */ 2978 #define F_VARPTR_N 325 /* N = VARPTR( ... ) */ 2979 #define F_VTAB_X_N 326 /* N = VTAB( X ) */ 2980 #define F_WAIT_X_N 327 /* N = WAIT( X ) */ 2981 #define F_WAIT_X_Y_N 328 /* N = WAIT( X, Y ) */ 2982 #define F_WAIT_X_Y_Z_N 329 /* N = WAIT( X, Y, Z ) */ 2983 #define F_WIDTH_X_N 330 /* N = WIDTH( X ) */ 2984 #define F_WIDTH_X_Y_N 331 /* N = WIDTH( X, Y ) */ 2985 #define F_ZONE_X_N 332 /* N = ZONE( X ) */ 2986 #define F_ZONE_X_Y_N 333 /* N = ZONE( X, Y ) */ 2987 2988 /*------------------------------------------------------------- 2989 WARNINGS 2990 -------------------------------------------------------------*/ 2991 #define WARN_CLEAR bwx_Error( 0, NULL ) 2992 #define WARN_NEXT_WITHOUT_FOR bwx_Error( 1, NULL ) 2993 #define WARN_SYNTAX_ERROR bwx_Error( 2, NULL ) 2994 #define WARN_RETURN_WITHOUT_GOSUB bwx_Error( 3, NULL ) 2995 #define WARN_OUT_OF_DATA bwx_Error( 4, NULL ) 2996 #define WARN_ILLEGAL_FUNCTION_CALL bwx_Error( 5, NULL ) 2997 #define WARN_OVERFLOW bwx_Error( 6, NULL ) 2998 #define WARN_OUT_OF_MEMORY bwx_Error( 7, NULL ) 2999 #define WARN_UNDEFINED_LINE bwx_Error( 8, NULL ) 3000 #define WARN_SUBSCRIPT_OUT_OF_RANGE bwx_Error( 9, NULL ) 3001 #define WARN_REDIMENSION_ARRAY bwx_Error( 10, NULL ) 3002 #define WARN_DIVISION_BY_ZERO bwx_Error( 11, NULL ) 3003 #define WARN_ILLEGAL_DIRECT bwx_Error( 12, NULL ) 3004 #define WARN_TYPE_MISMATCH bwx_Error( 13, NULL ) 3005 #define WARN_OUT_OF_STRING_SPACE bwx_Error( 14, NULL ) 3006 #define WARN_STRING_TOO_LONG bwx_Error( 15, NULL ) 3007 #define WARN_STRING_FORMULA_TOO_COMPLEX bwx_Error( 16, NULL ) 3008 #define WARN_CANT_CONTINUE bwx_Error( 17, NULL ) 3009 #define WARN_UNDEFINED_USER_FUNCTION bwx_Error( 18, NULL ) 3010 #define WARN_NO_RESUME bwx_Error( 19, NULL ) 3011 #define WARN_RESUME_WITHOUT_ERROR bwx_Error( 20, NULL ) 3012 #define WARN_UNPRINTABLE_ERROR bwx_Error( 21, NULL ) 3013 #define WARN_MISSING_OPERAND bwx_Error( 22, NULL ) 3014 #define WARN_LINE_BUFFER_OVERFLOW bwx_Error( 23, NULL ) 3015 #define WARN_FOR_WITHOUT_NEXT bwx_Error( 26, NULL ) 3016 #define WARN_BAD_DATA bwx_Error( 27, NULL ) /* NEW in bwBASIC 3.20 */ 3017 #define WARN_UNASSIGNED_28 bwx_Error( 28, NULL ) 3018 #define WARN_WHILE_WITHOUT_WEND bwx_Error( 29, NULL ) 3019 #define WARN_WEND_WITHOUT_WHILE bwx_Error( 30, NULL ) 3020 #define WARN_EXIT_FUNCTION_WITHOUT_FUNCTION bwx_Error( 31, NULL ) 3021 #define WARN_END_FUNCTION_WITHOUT_FUNCTION bwx_Error( 32, NULL ) 3022 #define WARN_EXIT_SUB_WITHOUT_SUB bwx_Error( 33, NULL ) 3023 #define WARN_END_SUB_WITHOUT_SUB bwx_Error( 34, NULL ) 3024 #define WARN_EXIT_FOR_WITHOUT_FOR bwx_Error( 35, NULL ) 3025 #define WARN_FIELD_OVERFLOW bwx_Error( 50, NULL ) 3026 #define WARN_INTERNAL_ERROR bwx_Error( 51, NULL ) 3027 #define WARN_BAD_FILE_NUMBER bwx_Error( 52, NULL ) 3028 #define WARN_FILE_NOT_FOUND bwx_Error( 53, NULL ) 3029 #define WARN_BAD_FILE_MODE bwx_Error( 54, NULL ) 3030 #define WARN_FILE_ALREADY_OPEN bwx_Error( 55, NULL ) 3031 #define WARN_UNASSIGNED_56 bwx_Error( 56, NULL ) 3032 #define WARN_DISK_IO_ERROR bwx_Error( 57, NULL ) 3033 #define WARN_FILE_ALREADY_EXISTS bwx_Error( 58, NULL ) 3034 #define WARN_UNASSIGNED_59 bwx_Error( 59, NULL ) 3035 #define WARN_UNASSIGNED_60 bwx_Error( 60, NULL ) 3036 #define WARN_DISK_FULL bwx_Error( 61, NULL ) 3037 #define WARN_INPUT_PAST_END bwx_Error( 62, NULL ) 3038 #define WARN_BAD_RECORD_NUMBER bwx_Error( 63, NULL ) 3039 #define WARN_BAD_FILE_NAME bwx_Error( 64, NULL ) 3040 #define WARN_UNASSIGNED_65 bwx_Error( 65, NULL ) 3041 #define WARN_DIRECT_STATEMENT_IN_FILE bwx_Error( 66, NULL ) 3042 #define WARN_TOO_MANY_FILES bwx_Error( 67, NULL ) 3043 #define WARN_UNASSIGNED_68 bwx_Error( 68, NULL ) 3044 #define WARN_VARIABLE_NOT_DECLARED bwx_Error( 70, NULL ) 3045 #define WARN_ADVANCED_FEATURE bwx_Error( 73, NULL ) 3046 3047 3048 3049 3050 /* EOF */ 3051