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