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.
 
 
 
 
 
 

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