home *** CD-ROM | disk | FTP | other *** search
- /***
- *
- * MacBob.h
- * Copyright © 1995 by Christopher E. Hyde. All rights reserved.
- *
- ***/
-
- #include "CStream.h"
-
- enum { // About Box dialog items
- kAboutLine = 8
- };
-
- enum {
- kPrefsResType = 'MBob'
- };
-
- // Resource IDs
- enum {
- rBase = 1000,
-
- // Dialogs
- rOptionsDlog = rBase, rAboutDlog, rStopAlertDlog,
-
- // STR#s
- rErrorStrings = rBase, rTokenNames,
-
- // ICONs
- rHelpIconOff = rBase, rHelpIconOn
- };
-
- // Error Messages / return values
- enum {
- kSuccess = 0,
- errBBEditVersionNotHighEnough,
- errWrongWindowKind,
- errUserInterrupt,
- errBalloonHelpNotAvailable,
- errWindowContentsNil,
- errNotEnoughMemory,
- errNoMainFunction,
- errTooMuchRecursion,
- errUnknown,
- errPrintedMessage // Don’t show an alert
- };
-
- // Constants
-
- enum { // Option dialog items
- kRun = 1, kCancel, kAbout,
- kBalloonHelp, kLine,
-
- kFirstOption, kFirstOptionMinus1 = kFirstOption - 1,
-
- // Compiler options
- kExtensions, kVCompile, kDumpCode,
-
- // Runtime options
- kBufferStdErr, kVExec, kTraceExec,
- kPatchCode, kDebug,
-
- kLastOptionPlus1,
- kNumOptions = kLastOptionPlus1 - kFirstOption
- };
-
- // Data structures
-
- struct TPrefs {
- /*
- Extensions Enable MacBob extensions
- VCompile Print messages during compile (verbose)
- DumpCode Display decoded functions
- BufferStdErr Buffer characters written to stdout
- VExec Print messages during execution (verbose)
- TraceExec Control tracing of program execution
- PatchCode Patch the Interpret() function
- Debug Development debugging
- */
- bool fOption[kNumOptions];
- };
-
- #define _Opt(n) (gPrefs.fOption[n - kFirstOption])
- #define Opt(n) _Opt(k##n)
-
- // Global Variables
-
- extern TPrefs gPrefs;
- extern CIStream gInput;
- extern COStream gOutput;
-
- // MacBob.cp
- extern void* Calloc (UInt32 count, UInt32 size);
-