ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

3069 lines
134 KiB

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