home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / BBEdit / MacBob 1.0ß2 / Source / MacBob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-07  |  1.7 KB  |  93 lines  |  [TEXT/KAHL]

  1. /***
  2.   *
  3.   *    MacBob.h
  4.   *    Copyright © 1995 by Christopher E. Hyde.  All rights reserved.
  5.   *
  6.   ***/
  7.  
  8. #include "CStream.h"
  9.  
  10. enum {        // About Box dialog items
  11.     kAboutLine = 8
  12. };
  13.  
  14. enum {
  15.     kPrefsResType    =    'MBob'
  16. };
  17.  
  18.     // Resource IDs
  19. enum {
  20.     rBase = 1000,
  21.  
  22.         // Dialogs
  23.     rOptionsDlog = rBase, rAboutDlog, rStopAlertDlog,
  24.  
  25.         // STR#s
  26.     rErrorStrings = rBase, rTokenNames,
  27.  
  28.         // ICONs
  29.     rHelpIconOff = rBase, rHelpIconOn
  30. };
  31.  
  32.     // Error Messages / return values
  33. enum {
  34.     kSuccess = 0,
  35.     errBBEditVersionNotHighEnough,
  36.     errWrongWindowKind,
  37.     errUserInterrupt,
  38.     errBalloonHelpNotAvailable,
  39.     errWindowContentsNil,
  40.     errNotEnoughMemory,
  41.     errNoMainFunction,
  42.     errTooMuchRecursion,
  43.     errUnknown,
  44.     errPrintedMessage            // Don’t show an alert
  45. };
  46.  
  47.     // Constants
  48.  
  49. enum {        // Option dialog items
  50.     kRun = 1, kCancel, kAbout,
  51.     kBalloonHelp, kLine,
  52.  
  53.     kFirstOption, kFirstOptionMinus1 = kFirstOption - 1,
  54.  
  55.         // Compiler options
  56.     kExtensions, kVCompile, kDumpCode,
  57.  
  58.         // Runtime options
  59.     kBufferStdErr, kVExec, kTraceExec,
  60.     kPatchCode, kDebug,
  61.  
  62.     kLastOptionPlus1,
  63.     kNumOptions = kLastOptionPlus1 - kFirstOption
  64. };
  65.  
  66.     // Data structures
  67.  
  68. struct TPrefs {
  69. /*
  70.     Extensions        Enable MacBob extensions
  71.     VCompile            Print messages during compile (verbose)
  72.     DumpCode            Display decoded functions
  73.     BufferStdErr        Buffer characters written to stdout
  74.     VExec            Print messages during execution (verbose)
  75.     TraceExec            Control tracing of program execution
  76.     PatchCode            Patch the Interpret() function
  77.     Debug            Development debugging
  78. */
  79.     bool    fOption[kNumOptions];
  80. };
  81.  
  82. #define    _Opt(n)    (gPrefs.fOption[n - kFirstOption])
  83. #define    Opt(n)    _Opt(k##n)
  84.  
  85.     // Global Variables
  86.  
  87. extern TPrefs             gPrefs;
  88. extern CIStream         gInput;
  89. extern COStream        gOutput;
  90.  
  91. // MacBob.cp
  92. extern void*    Calloc        (UInt32 count, UInt32 size);
  93.