| 1 | /* $Id: options.h,v 1.15 2001-01-08 18:05:26 bird Exp $
|
|---|
| 2 | *
|
|---|
| 3 | * Options.
|
|---|
| 4 | *
|
|---|
| 5 | * Copyright (c) 1998-1999 knut st. osmundsen
|
|---|
| 6 | *
|
|---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | /* NOINC */
|
|---|
| 12 | #ifndef _options_h_
|
|---|
| 13 | #define _options_h_
|
|---|
| 14 | /* INC */
|
|---|
| 15 |
|
|---|
| 16 | /*******************************************************************************
|
|---|
| 17 | * Defined Constants And Macros *
|
|---|
| 18 | *******************************************************************************/
|
|---|
| 19 | /* fKernel */
|
|---|
| 20 | #define KF_UNI 0x0000
|
|---|
| 21 | #define KF_SMP 0x0001
|
|---|
| 22 | #define KF_W4 0x0002
|
|---|
| 23 | #define KF_DEBUG 0x1000
|
|---|
| 24 | #define KF_HAS_DEBUGTYPE 0x2000
|
|---|
| 25 | #define KF_ALLSTRICT 0x3000
|
|---|
| 26 | #define KF_HALFSTRICT 0x7000
|
|---|
| 27 |
|
|---|
| 28 | /* fPE */
|
|---|
| 29 | #define FLAGS_PE_NOT 0x00000000UL
|
|---|
| 30 | #define FLAGS_PE_PE2LX 0x00000001UL
|
|---|
| 31 | #define FLAGS_PE_PE 0x00000002UL
|
|---|
| 32 | #define FLAGS_PE_MIXED 0x00000003UL
|
|---|
| 33 |
|
|---|
| 34 | /* ulInfoLevel */
|
|---|
| 35 | #define INFOLEVEL_QUIET 0x00000000UL
|
|---|
| 36 | #define INFOLEVEL_ERROR 0x00000001UL
|
|---|
| 37 | #define INFOLEVEL_WARNING 0x00000002UL
|
|---|
| 38 | #define INFOLEVEL_INFO 0x00000003UL
|
|---|
| 39 | #define INFOLEVEL_INFOALL 0x00000004UL
|
|---|
| 40 |
|
|---|
| 41 | /* default heapsizes */
|
|---|
| 42 | #define CB_SWP_INIT ((unsigned long)1024*512) /* 512KB */
|
|---|
| 43 | #define CB_SWP_MAX ((unsigned long)1024*1024*16) /* 16MB */
|
|---|
| 44 | #define CB_RES_INIT ((unsigned long)1024*256) /* 256KB */
|
|---|
| 45 | #define CB_RES_MAX ((unsigned long)1024*1024*10) /* 10MB */
|
|---|
| 46 |
|
|---|
| 47 | /* NOINC */
|
|---|
| 48 | /* default assignments */
|
|---|
| 49 | #define DEFAULT_OPTION_ASSIGMENTS \
|
|---|
| 50 | {FALSE, /* fQuiet */ \
|
|---|
| 51 | OUTPUT_COM2, /* usCom */ \
|
|---|
| 52 | FALSE, /* fLogging */ \
|
|---|
| 53 | KF_UNI, /* fKernel */ \
|
|---|
| 54 | ~0UL, /* ulBuild */ \
|
|---|
| 55 | (unsigned short)~0, /* usVerMajor */ \
|
|---|
| 56 | (unsigned short)~0, /* usVerMinor */ \
|
|---|
| 57 | FLAGS_PE_PE, /* fPE */ \
|
|---|
| 58 | INFOLEVEL_QUIET, /* ulInfoLevel */ \
|
|---|
| 59 | FALSE, /* fElf */ \
|
|---|
| 60 | TRUE, /* fUNIXScript */ \
|
|---|
| 61 | TRUE, /* fREXXScript */ \
|
|---|
| 62 | TRUE, /* fJava */ \
|
|---|
| 63 | FALSE, /* fNoLoader */ \
|
|---|
| 64 | TRUE, /* fDllFixes */ \
|
|---|
| 65 | TRUE, /* fExeFixes */ \
|
|---|
| 66 | CB_SWP_INIT, /* cbSwpHeapInit */ \
|
|---|
| 67 | CB_SWP_MAX, /* cbSwpHeapMax */ \
|
|---|
| 68 | CB_RES_INIT, /* cbResHeapInit */ \
|
|---|
| 69 | CB_RES_MAX} /* cbResHeapMax */
|
|---|
| 70 |
|
|---|
| 71 | #define isAnyLoaderEnabled() (!options.fNoLoader && \
|
|---|
| 72 | (isPELoaderEnabled() || isELFEnabled() || isUNIXScriptEnabled() || isREXXScriptEnabled() || isJAVAEnabled()))
|
|---|
| 73 | #define isPELoaderEnabled() (options.fPE != FLAGS_PE_NOT)
|
|---|
| 74 | #define isPELoaderDisabled() (options.fPE == FLAGS_PE_NOT)
|
|---|
| 75 | #define isPe2LxLoaderEnabled() (options.fPE == FLAGS_PE_PE2LX)
|
|---|
| 76 | #define isMixedPeLoaderEnabled() (options.fPE == FLAGS_PE_MIXED)
|
|---|
| 77 |
|
|---|
| 78 | #define isELFDisabled() (!options.fElf)
|
|---|
| 79 | #define isELFEnabled() (options.fElf)
|
|---|
| 80 | #define isUNIXScriptDisabled() (!options.fUNIXScript)
|
|---|
| 81 | #define isUNIXScriptEnabled() (options.fUNIXScript)
|
|---|
| 82 | #define isREXXScriptDisabled() (!options.fREXXScript)
|
|---|
| 83 | #define isREXXScriptEnabled() (options.fREXXScript)
|
|---|
| 84 | #define isJAVADisabled() (!options.fJava)
|
|---|
| 85 | #define isJAVAEnabled() (options.fJava)
|
|---|
| 86 |
|
|---|
| 87 | #define isSMPKernel() (options.fKernel & KF_SMP)
|
|---|
| 88 | #define isUNIKernel() (!(options.fKernel & KF_SMP))
|
|---|
| 89 |
|
|---|
| 90 | #define isDllFixesEnabled() (options.fDllFixes)
|
|---|
| 91 | #define isDllFixesDisabled() (!options.fDllFixes)
|
|---|
| 92 |
|
|---|
| 93 | #define isExeFixesEnabled() (options.fExeFixes)
|
|---|
| 94 | #define isExeFixesDisabled() (!options.fExeFixes)
|
|---|
| 95 |
|
|---|
| 96 | /* INC */
|
|---|
| 97 |
|
|---|
| 98 | /*******************************************************************************
|
|---|
| 99 | * Structures and Typedefs *
|
|---|
| 100 | *******************************************************************************/
|
|---|
| 101 | /** Option struct */
|
|---|
| 102 | #pragma pack(4)
|
|---|
| 103 | struct options
|
|---|
| 104 | {
|
|---|
| 105 | /** @cat misc */
|
|---|
| 106 | ULONG fQuiet; /* Quiet initialization. */
|
|---|
| 107 |
|
|---|
| 108 | /** @cat logging options */
|
|---|
| 109 | USHORT usCom; /* Output port no. */
|
|---|
| 110 | USHORT fLogging; /* Logging. */
|
|---|
| 111 |
|
|---|
| 112 | /** @cat kernel selection */
|
|---|
| 113 | ULONG fKernel; /* Smp or uni kernel. */
|
|---|
| 114 | ULONG ulBuild; /* Kernel build. */
|
|---|
| 115 | USHORT usVerMajor; /* OS/2 major ver - 20 */
|
|---|
| 116 | USHORT usVerMinor; /* OS/2 minor ver - 30,40 */
|
|---|
| 117 |
|
|---|
| 118 | /** @cat Options affecting the generated LX executables */
|
|---|
| 119 | ULONG fPE; /* Flags set the type of conversion. */
|
|---|
| 120 | ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */
|
|---|
| 121 |
|
|---|
| 122 | /** @cat Options affecting the generated ELF executables */
|
|---|
| 123 | ULONG fElf; /* Elf flags. */
|
|---|
| 124 |
|
|---|
| 125 | /** @cat Options affecting the UNIX script executables */
|
|---|
| 126 | ULONG fUNIXScript; /* UNIX script flags. */
|
|---|
| 127 |
|
|---|
| 128 | /** @cat Options affecting the REXX script executables */
|
|---|
| 129 | ULONG fREXXScript; /* REXX script flags. */
|
|---|
| 130 |
|
|---|
| 131 | /** @cat Options affecting the JAVA executables */
|
|---|
| 132 | ULONG fJava; /* Java flags. */
|
|---|
| 133 |
|
|---|
| 134 | /** @cat Options affecting the executables */
|
|---|
| 135 | ULONG fNoLoader; /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
|
|---|
| 136 |
|
|---|
| 137 | /** @cat Options affecting the behaviour changes in the OS/2 loader */
|
|---|
| 138 | ULONG fDllFixes; /* Enables the long DLL name and non .DLL extention fixes. */
|
|---|
| 139 | ULONG fExeFixes; /* Enables EXE files to export entry points. */
|
|---|
| 140 |
|
|---|
| 141 | /** @cat Options affecting the heap. */
|
|---|
| 142 | ULONG cbSwpHeapInit; /* Initial heapsize. */
|
|---|
| 143 | ULONG cbSwpHeapMax; /* Maximum heapsize. */
|
|---|
| 144 | ULONG cbResHeapInit; /* Initial residentheapsize. */
|
|---|
| 145 | ULONG cbResHeapMax; /* Maxiumem residentheapsize. */
|
|---|
| 146 | };
|
|---|
| 147 | #pragma pack()
|
|---|
| 148 |
|
|---|
| 149 | /*******************************************************************************
|
|---|
| 150 | * Global Variables *
|
|---|
| 151 | *******************************************************************************/
|
|---|
| 152 | /* NOINC */
|
|---|
| 153 | extern struct options DATA16_GLOBAL options; /* defined in d16globals.c */
|
|---|
| 154 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
|---|
| 155 | #pragma map( options , "_options" )
|
|---|
| 156 | #endif
|
|---|
| 157 | /* INC */
|
|---|
| 158 |
|
|---|
| 159 | /* NOINC */
|
|---|
| 160 | #endif
|
|---|
| 161 | /* INC */
|
|---|
| 162 |
|
|---|