home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / src / h / config.h next >
C/C++ Source or Header  |  2002-01-18  |  13KB  |  630 lines

  1. /*
  2.  * Icon configuration.
  3.  */
  4.  
  5. /*
  6.  * System-specific definitions are in define.h, which is loaded first.
  7.  */
  8.  
  9. /*
  10.  *  A number of symbols are defined here.  Some are specific to individual
  11.  *  to operating systems.  Examples are:
  12.  *
  13.  *    MSDOS        MS-DOS for PCs
  14.  *    UNIX        any UNIX system; also set for BeOS
  15.  *    VMS        VMS for the VAX
  16.  *
  17.  *  These are defined to be 1 or 0 depending on which operating system
  18.  *  the installation is being done under.  They are all defined and only
  19.  *  one is defined to be 1.  (They are used in the form #if VAX || MSDOS.)
  20.  *
  21.  *  There also are definitions of symbols for specific computers and
  22.  *  versions of operating systems.  These include:
  23.  *
  24.  *    MICROSOFT    code specific to the Microsoft C compiler for MS-DOS
  25.  *
  26.  *  Other definitions may occur for different configurations. These include:
  27.  *
  28.  *    DeBug        debugging code
  29.  *    MultiThread    support for multiple programs under the interpreter
  30.  */
  31.  
  32. /*
  33.  * If COMPILER is not defined, code for the interpreter is compiled.
  34.  */
  35.  
  36. #ifndef COMPILER
  37.    #define COMPILER 0
  38. #endif
  39.  
  40. /*
  41.  * The following definitions insure that all the symbols for operating
  42.  * systems that are not relevant are defined to be 0 -- so that they
  43.  * can be used in logical expressions in #if directives.
  44.  */
  45.  
  46. #ifndef PORT
  47.    #define PORT 0
  48. #endif                    /* PORT */
  49.  
  50. #ifndef AMIGA
  51.    #define AMIGA 0
  52. #endif                    /* AMIGA */
  53.  
  54. #ifndef ARM
  55.    #define ARM 0
  56. #endif                    /* ARM */
  57.  
  58. #ifndef MACINTOSH
  59.    #define MACINTOSH 0
  60. #endif                    /* MACINTOSH */
  61.  
  62. #ifndef MSDOS
  63.    #define MSDOS 0
  64. #endif                    /* MSDOS */
  65.  
  66. #ifndef SCCX_MX
  67.    #define SCCX_MX 0
  68. #endif                    /* SCCX_MX */
  69.  
  70. #ifndef OS2
  71.    #define OS2 0
  72. #endif                    /* OS2 */
  73.  
  74. #ifndef OS2_32
  75.    #define OS2_32 0
  76. #endif                    /* OS32 */
  77.  
  78. #ifndef UNIX
  79.    #define UNIX 0
  80. #endif                    /* UNIX */
  81.  
  82. #ifndef VMS
  83.    #define VMS 0
  84. #endif                    /* VMS */
  85.  
  86. /*
  87.  * The following definitions serve to cast common conditionals is
  88.  *  a positive way, while allowing defaults for the cases that
  89.  *  occur most frequently.  That is, if co-expressions are not supported,
  90.  *  NoCoexpr is defined in define.h, but if they are supported, no
  91.  *  definition is needed in define.h; nonetheless subsequent conditionals
  92.  *  can be cast as #ifdef Coexpr.
  93.  */
  94.  
  95. #ifndef NoCoexpr
  96.    #undef Coexpr
  97.    #define Coexpr
  98. #endif                    /* NoCoexpr */
  99.  
  100. #ifdef NoCoexpr
  101.    #undef MultiThread
  102.    #undef EventMon
  103.    #undef Eve
  104. #endif                    /* NoCoexpr */
  105.  
  106. #if COMPILER
  107.    #undef Eve
  108.    #undef MultiThread
  109.    #undef EventMon
  110. #endif                    /* COMPILER */
  111.  
  112. #ifdef Eve
  113.    #undef EventMon
  114.    #undef MultiThread
  115.    #define EventMon
  116.    #define MultiThread
  117. #endif                    /* Eve */
  118.  
  119. #ifndef NoStrInvoke
  120.    #undef StrInvoke
  121.    #define StrInvoke
  122. #endif                    /* NoStrInvoke */
  123.  
  124. #ifndef NoLargeInts
  125.    #undef LargeInts
  126.    #define LargeInts
  127. #endif                    /* NoLargeInts */
  128.  
  129. #ifdef EventMon
  130.    #undef MultiThread
  131.    #define MultiThread
  132. #endif                    /* EventMon */
  133.  
  134. #ifndef NoExternalFunctions
  135.    #undef ExternalFunctions
  136.    #define ExternalFunctions
  137. #endif                    /* NoExternalFunctions */
  138.  
  139. /*
  140.  * Names for standard environment variables.
  141.  * The standard names are used unless they are overridden.
  142.  */
  143.  
  144. #ifndef NOERRBUF
  145.    #define NOERRBUF "NOERRBUF"
  146. #endif
  147.  
  148. #ifndef TRACE
  149.    #define TRACE "TRACE"
  150. #endif
  151.  
  152. #ifndef COEXPSIZE
  153.    #define COEXPSIZE "COEXPSIZE"
  154. #endif
  155.  
  156. #ifndef STRSIZE
  157.    #define STRSIZE "STRSIZE"
  158. #endif
  159.  
  160. #ifndef HEAPSIZE
  161.    #define HEAPSIZE "HEAPSIZE"
  162. #endif
  163.  
  164. #ifndef BLOCKSIZE
  165.    #define BLOCKSIZE "BLOCKSIZE"
  166. #endif
  167.  
  168. #ifndef BLKSIZE
  169.    #define BLKSIZE "BLKSIZE"
  170. #endif
  171.  
  172. #ifndef MSTKSIZE
  173.    #define MSTKSIZE "MSTKSIZE"
  174. #endif
  175.  
  176. #ifndef QLSIZE
  177.    #define QLSIZE "QLSIZE"
  178. #endif
  179.  
  180. #ifndef ICONCORE
  181.    #define ICONCORE "ICONCORE"
  182. #endif
  183.  
  184. #ifndef IPATH
  185.    #define IPATH "IPATH"
  186. #endif
  187.  
  188. /*
  189.  * Graphics definitions.
  190.  */
  191.  
  192. #ifdef MSWindows
  193.    #undef Graphics
  194.    #define Graphics 1
  195.    #ifndef NTConsole
  196.       #define ConsoleWindow 1
  197.    #endif                /* NTConsole */
  198. #endif                    /* MSWindows */
  199.  
  200. #ifdef MacGraph
  201.    #undef Graphics
  202.    #define Graphics 1
  203. #endif                    /* MacGraph */
  204.  
  205. #ifdef PresentationManager
  206.    #define Graphics 1
  207.    #define ConsoleWindow 1
  208. #endif                    /* PresentationManager */
  209.  
  210. #ifdef Graphics
  211.    #ifndef NoXpmFormat
  212.       #if UNIX
  213.          #undef HaveXpmFormat
  214.          #define HaveXpmFormat
  215.       #endif                /* UNIX */
  216.    #endif                /* NoXpmFormat */
  217.  
  218.    #ifndef MSWindows
  219.       #ifndef PresentationManager
  220.          #ifndef MacGraph
  221.             #undef XWindows
  222.             #define XWindows 1
  223.          #endif                /* MacGraph */
  224.       #endif                /* PresentationManager */
  225.    #endif                /* MSWindows */
  226.  
  227.    #undef LineCodes
  228.    #define LineCodes
  229.  
  230.    #undef Polling
  231.    #define Polling
  232.  
  233.    #ifndef NoIconify
  234.       #define Iconify
  235.    #endif                /* NoIconify */
  236.  
  237.    #ifndef ICONC_XLIB
  238.       #define ICONC_XLIB "-L/usr/X11R6/lib -lX11"
  239.    #endif                /* ICONC_XLIB */
  240.  
  241.    #ifdef ConsoleWindow
  242.       /*
  243.        * knock out fprintf and putc; these are here so that consoles may be used
  244.        * in icont and rtt, not just iconx
  245.        */
  246.       #undef fprintf
  247.       #define fprintf Consolefprintf
  248.       #undef putc
  249.       #define putc Consoleputc
  250.       #undef fflush
  251.       #define fflush Consolefflush
  252.       #undef printf
  253.       #define printf Consoleprintf
  254.       #undef exit
  255.       #define exit c_exit
  256.    #endif                /* Console Window */
  257.  
  258. #endif                    /* Graphics */
  259.  
  260. /*
  261.  * Data sizes and alignment.
  262.  */
  263.  
  264. #define WordSize sizeof(word)
  265.  
  266. #ifndef StackAlign
  267.    #define StackAlign 8
  268. #endif                    /* StackAlign */
  269.  
  270. /*
  271.  * Other defaults.
  272.  */
  273.  
  274. #ifdef DeBug
  275.    #undef DeBugTrans
  276.    #undef DeBugLinker
  277.    #undef DeBugIconx
  278.    #define DeBugTrans
  279.    #define DeBugLinker
  280.    #define DeBugIconx
  281. #endif                    /* DeBug */
  282.  
  283. #ifndef MaxHdr
  284.    #define MaxHdr 4096
  285. #endif                    /* MaxHdr */
  286.  
  287. #ifndef MaxPath
  288.    #define MaxPath 200
  289. #endif                    /* MaxPath */
  290.  
  291. #ifndef SourceSuffix
  292.    #define SourceSuffix ".icn"
  293. #endif                    /* SourceSuffix */
  294.  
  295. /*
  296.  * Representations of directories. LocalDir is the "current working directory".
  297.  *  SourceDir is where the source file is.
  298.  */
  299.  
  300. #define LocalDir ""
  301. #define SourceDir (char *)NULL
  302.  
  303. #ifndef TargetDir
  304.    #define TargetDir LocalDir
  305. #endif                    /* TargetDir */
  306.  
  307. /*
  308.  * Features enabled by default under certain systems
  309.  */
  310.  
  311. #ifndef Pipes
  312.    #if ARM || OS2 || UNIX || VMS
  313.       #define Pipes
  314.    #endif                /* ARM || OS2 || UNIX || VMS */
  315. #endif                    /* Pipes */
  316.  
  317. #ifndef KeyboardFncs
  318.    #if UNIX
  319.       #ifndef NoKeyboardFncs
  320.          #define KeyboardFncs
  321.       #endif                /* NoKeyboardFncs */
  322.    #endif                /* UNIX */
  323. #endif                    /* KeyboardFncs */
  324.  
  325. #ifndef ReadDirectory
  326.    #if UNIX
  327.       #define ReadDirectory
  328.    #endif                /* UNIX*/
  329. #endif                    /* ReadDirectory */
  330.  
  331. #ifndef SysOpt
  332.    #if UNIX
  333.       #define SysOpt
  334.    #endif                /* UNIX*/
  335. #endif                    /* SysOpt */
  336.  
  337. /*
  338.  *  The following definitions assume ANSI C.
  339.  */
  340. #define Cat(x,y) x##y
  341. #define Lit(x) #x
  342. #define Bell '\a'
  343.  
  344. /*
  345.  * Customize output if not pre-defined.
  346.  */
  347.  
  348. #ifndef TraceOut
  349.    #define TraceOut(s) fprintf(stderr,s)
  350. #endif                    /* TraceOut */
  351.  
  352. #ifndef WriteBinary
  353.    #define WriteBinary "wb"
  354. #endif                    /* WriteBinary */
  355.  
  356. #ifndef ReadBinary
  357.    #define ReadBinary "rb"
  358. #endif                    /* ReadBinary */
  359.  
  360. #ifndef ReadWriteBinary
  361.    #define ReadWriteBinary "wb+"
  362. #endif                    /* ReadWriteBinary */
  363.  
  364. #ifndef ReadEndBinary
  365.    #define ReadEndBinary "r+b"
  366. #endif                    /* ReadEndBinary */
  367.  
  368. #ifndef WriteText
  369.    #define WriteText "w"
  370. #endif                    /* WriteText */
  371.  
  372. #ifndef ReadText
  373.    #define ReadText "r"
  374. #endif                    /* ReadText */
  375.  
  376. /*
  377.  * The following code is operating-system dependent [@config.01].
  378.  *  Any configuration stuff that has to be done at this point.
  379.  */
  380.  
  381. #if PORT
  382.    /* Probably nothing is needed. */
  383. Deliberate Syntax Error
  384. #endif                    /* PORT */
  385.  
  386. #if VMS
  387.    #define ExecSuffix ".exe"
  388.    #define ObjSuffix ".obj"
  389.    #define LibSuffix ".olb"
  390. #endif                    /* VMS */
  391.  
  392. #if AMIGA || ARM || MACINTOSH
  393. #endif                    /* AMIGA || ARM || ... */
  394.  
  395. #if MSDOS || OS2
  396.  
  397.    /*
  398.     *  Define compiler-specific symbols to be zero if not already
  399.     *  defined.
  400.     */
  401.  
  402.    #ifndef MICROSOFT
  403.       #define MICROSOFT 0
  404.    #endif                /* MICROSOFT */
  405.  
  406.    #ifndef CSET2
  407.       #define CSET2 0
  408.    #endif                /* CSet/2 */
  409.  
  410.    #ifndef CSET2V2
  411.       #define CSET2V2 0
  412.    #endif                /* CSet/2 version 2 */
  413.  
  414.    #ifndef TURBO
  415.       #define TURBO 0
  416.    #endif                /* TURBO */
  417.  
  418.    #ifndef HIGHC_386
  419.       #define HIGHC_386 0
  420.    #endif                /* HIGHC_386 */
  421.  
  422.    #ifndef INTEL_386
  423.       #define INTEL_386 0
  424.    #endif                /* INTEL_386 */
  425.  
  426.    #ifndef WATCOM
  427.       #define WATCOM 0
  428.    #endif                /* WATCOM */
  429.  
  430.    #ifndef ZTC_386
  431.       #define ZTC_386 0
  432.    #endif                /* ZTC_386 */
  433.  
  434.    #ifndef NT
  435.       #define NT 0
  436.    #endif                /* NT */
  437.  
  438.    #ifndef BORLAND_286
  439.       #define BORLAND_286 0
  440.    #endif                /* BORLAND_286 (16-bit protected mode)*/
  441.  
  442.    #ifndef BORLAND_386
  443.       #define BORLAND_386 0
  444.    #endif                /* BORLAND_386 (32-bit protected mode)*/
  445.  
  446.    #if HIGHC_386
  447.       /*
  448.        * MetaWare's HighC 386 macro putc doesn't handle putc('\n') correctly -
  449.        * sometimes a CR is not written out before the LF.  So, redefine
  450.        * macro putc to actually issue an fputc.
  451.        */
  452.       #undef putc
  453.       #define putc(c,f) fputc(c,f)
  454.    #endif                /* HIGHC_386 */
  455. #endif                    /* MSDOS || OS2 */
  456.  
  457. #if MACINTOSH
  458.    #if LSC
  459.       /*
  460.        * LightSpeed C requires that #define tokens appear after prototypes
  461.        */
  462.       #define malloc mlalloc
  463.    #endif                /* LSC */
  464. #endif                    /* MACINTOSH */
  465.  
  466. #if MACINTOSH && MPW
  467.    #ifndef NoHeader
  468.       #undef Header
  469.       #define Header
  470.    #endif                /* NoHeader */
  471. #endif                    /* MACINTOSH && MPW */
  472.  
  473. #ifndef NoWildCards
  474.    #if NT || BORLAND_286 || BORLAND_386 || MICROSOFT || SCCX_MX
  475.       #define WildCards 1
  476.    #else                /* NT || ... */
  477.       #define WildCards 0
  478.    #endif                /* NT || ... */
  479. #else                    /* NoWildCards */
  480.    #define WildCards 0
  481. #endif                    /* NoWildCards */
  482.  
  483. /*
  484.  * End of operating-system specific code.
  485.  */
  486.  
  487. #ifndef DiffPtrs
  488.    #define DiffPtrs(p1,p2) (word)((p1)-(p2))
  489. #endif                    /* DiffPtrs */
  490.  
  491. #ifndef AllocReg
  492.    #define AllocReg(n) malloc(n)
  493. #endif                    /* AllocReg */
  494.  
  495. #define MaxFileName 256
  496.  
  497. #ifndef RttSuffix
  498.    #define RttSuffix ".r"
  499. #endif                    /* RttSuffix */
  500.  
  501. #ifndef DBSuffix
  502.    #define DBSuffix ".db"
  503. #endif                    /* DBSuffix */
  504.  
  505. #ifndef PPInit
  506.    #define PPInit ""
  507. #endif                    /* PPInit */
  508.  
  509. #ifndef PPDirectives
  510.    #define PPDirectives {"passthru", PpKeep},
  511. #endif                    /* PPDirectives */
  512.  
  513. #ifndef EventMon
  514.    #if IntBits == 16
  515.       #define NoSrcColumnInfo
  516.    #endif                /* IntBits == 16 */
  517. #endif                    /* EventMon */
  518.  
  519. #ifndef NoSrcColumnInfo
  520.    #define SrcColumnInfo
  521. #endif                    /* NoSrcColumnInfo */
  522.  
  523. #ifndef ExecSuffix
  524.    #define ExecSuffix ""
  525. #endif                    /* ExecSuffix */
  526.  
  527. #ifndef CSuffix
  528.    #define CSuffix ".c"
  529. #endif                    /* CSuffix */
  530.  
  531. #ifndef HSuffix
  532.    #define HSuffix ".h"
  533. #endif                    /* HSuffix */
  534.  
  535. #ifndef ObjSuffix
  536.    #define ObjSuffix ".o"
  537. #endif                    /* ObjSuffix */
  538.  
  539. #ifndef LibSuffix
  540.    #define LibSuffix ".a"
  541. #endif                    /* LibSuffix */
  542.  
  543. #ifndef CComp
  544.    #define CComp "cc"
  545. #endif                    /* CComp */
  546.  
  547. #ifndef COpts
  548.    #define COpts ""
  549. #endif                    /* COpts */
  550.  
  551. /*
  552.  * Note, size of the hash table is a power of 2:
  553.  */
  554. #define IHSize 128
  555. #define IHasher(x)    (((unsigned int)(unsigned long)(x))&(IHSize-1))
  556.  
  557. #if COMPILER
  558.  
  559.    /*
  560.     * Code for the compiler.
  561.     */
  562.    #undef MultiThread        /* no way -- interpreter only */
  563.    #undef EventMon        /* presently not supported in the compiler */
  564.    #undef ExecImages        /* interpreter only */
  565.  
  566. #else                    /* COMPILER */
  567.  
  568.    /*
  569.     * Code for the interpreter.
  570.     */
  571.    #ifndef IcodeSuffix
  572.       #define IcodeSuffix ""
  573.    #endif                /* IcodeSuffix */
  574.  
  575.    #ifndef IcodeASuffix
  576.       #define IcodeASuffix ""
  577.    #endif                /* IcodeASuffix */
  578.  
  579.    #ifndef U1Suffix
  580.       #define U1Suffix ".u1"
  581.    #endif                /* U1Suffix */
  582.  
  583.    #ifndef U2Suffix
  584.       #define U2Suffix ".u2"
  585.    #endif                /* U2Suffix */
  586.  
  587.    #ifndef USuffix
  588.       #define USuffix ".u"
  589.    #endif                /* USuffix */
  590.  
  591. #endif                    /* COMPILER */
  592.  
  593. #if UNIX
  594.    #undef Header
  595.    #define Header
  596.    #undef ShellHeader
  597.    #define ShellHeader
  598. #endif                    /* UNIX */
  599.  
  600. #if (MSDOS || OS2) && !NT
  601.    #undef DirectExecution
  602.    #define DirectExecution
  603. #endif                    /* (MSDOS || OS2) && !NT */
  604.  
  605. #ifdef Header
  606.    #undef DirectExecution
  607.    #define DirectExecution
  608. #endif                    /* Header */
  609.  
  610. /*
  611.  *  Vsizeof is for use with variable-sized (i.e., indefinite)
  612.  *   structures containing an array of descriptors declared of size 1
  613.  *   to avoid compiler warnings associated with 0-sized arrays.
  614.  */
  615.  
  616. #define Vsizeof(s)    (sizeof(s) - sizeof(struct descrip))
  617.  
  618. /*
  619.  * Other sizeof macros:
  620.  *
  621.  *  Wsizeof(x)    -- Size of x in words.
  622.  *  Vwsizeof(x) -- Size of x in words, minus the size of a descriptor.    Used
  623.  *   when structures have a potentially null list of descriptors
  624.  *   at their end.
  625.  */
  626.  
  627. #define Wsizeof(x)    ((sizeof(x) + sizeof(word) - 1) / sizeof(word))
  628. #define Vwsizeof(x) \
  629.    ((sizeof(x) - sizeof(struct descrip) + sizeof(word) - 1) / sizeof(word))
  630.