1 | /* $Id: options.h,v 1.13 2000-12-11 06:22:14 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_MIXED, /* fPE */ \
|
---|
58 | INFOLEVEL_QUIET, /* ulInfoLevel */ \
|
---|
59 | FALSE, /* fElf */ \
|
---|
60 | TRUE, /* fUNIXScript */ \
|
---|
61 | TRUE, /* fREXXScript */ \
|
---|
62 | TRUE, /* fJava */ \
|
---|
63 | FALSE, /* fNoLoader */ \
|
---|
64 | TRUE, /* fDllFixes */ \
|
---|
65 | CB_SWP_INIT, /* cbSwpHeapInit */ \
|
---|
66 | CB_SWP_MAX, /* cbSwpHeapMax */ \
|
---|
67 | CB_RES_INIT, /* cbResHeapInit */ \
|
---|
68 | CB_RES_MAX} /* cbResHeapMax */
|
---|
69 |
|
---|
70 | #define isAnyLoaderEnabled() (!options.fNoLoader && \
|
---|
71 | (isPELoaderEnabled() || isELFEnabled() || isUNIXScriptEnabled() || isREXXScriptEnabled() || isJAVAEnabled()))
|
---|
72 | #define isPELoaderEnabled() (options.fPE != FLAGS_PE_NOT)
|
---|
73 | #define isPELoaderDisabled() (options.fPE == FLAGS_PE_NOT)
|
---|
74 | #define isPe2LxLoaderEnabled() (options.fPE == FLAGS_PE_PE2LX)
|
---|
75 | #define isMixedPeLoaderEnabled() (options.fPE == FLAGS_PE_MIXED)
|
---|
76 |
|
---|
77 | #define isELFDisabled() (!options.fElf)
|
---|
78 | #define isELFEnabled() (options.fElf)
|
---|
79 | #define isUNIXScriptDisabled() (!options.fUNIXScript)
|
---|
80 | #define isUNIXScriptEnabled() (options.fUNIXScript)
|
---|
81 | #define isREXXScriptDisabled() (!options.fREXXScript)
|
---|
82 | #define isREXXScriptEnabled() (options.fREXXScript)
|
---|
83 | #define isJAVADisabled() (!options.fJava)
|
---|
84 | #define isJAVAEnabled() (options.fJava)
|
---|
85 |
|
---|
86 | #define isSMPKernel() (options.fKernel & KF_SMP)
|
---|
87 | #define isUNIKernel() (!(options.fKernel & KF_SMP))
|
---|
88 |
|
---|
89 | #define isDllFixesEnabled() (options.fDllFixes)
|
---|
90 | #define isDllFixesDisabled() (!options.fDllFixes)
|
---|
91 |
|
---|
92 | /* INC */
|
---|
93 |
|
---|
94 | /*******************************************************************************
|
---|
95 | * Structures and Typedefs *
|
---|
96 | *******************************************************************************/
|
---|
97 | /** Option struct */
|
---|
98 | #pragma pack(4)
|
---|
99 | struct options
|
---|
100 | {
|
---|
101 | /** @cat misc */
|
---|
102 | ULONG fQuiet; /* Quiet initialization. */
|
---|
103 |
|
---|
104 | /** @cat logging options */
|
---|
105 | USHORT usCom; /* Output port no. */
|
---|
106 | USHORT fLogging; /* Logging. */
|
---|
107 |
|
---|
108 | /** @cat kernel selection */
|
---|
109 | ULONG fKernel; /* Smp or uni kernel. */
|
---|
110 | ULONG ulBuild; /* Kernel build. */
|
---|
111 | USHORT usVerMajor; /* OS/2 major ver - 20 */
|
---|
112 | USHORT usVerMinor; /* OS/2 minor ver - 30,40 */
|
---|
113 |
|
---|
114 | /** @cat Options affecting the generated LX executables */
|
---|
115 | ULONG fPE; /* Flags set the type of conversion. */
|
---|
116 | ULONG ulInfoLevel; /* Pe2Lx InfoLevel. */
|
---|
117 |
|
---|
118 | /** @cat Options affecting the generated ELF executables */
|
---|
119 | ULONG fElf; /* Elf flags. */
|
---|
120 |
|
---|
121 | /** @cat Options affecting the UNIX script executables */
|
---|
122 | ULONG fUNIXScript; /* UNIX script flags. */
|
---|
123 |
|
---|
124 | /** @cat Options affecting the REXX script executables */
|
---|
125 | ULONG fREXXScript; /* REXX script flags. */
|
---|
126 |
|
---|
127 | /** @cat Options affecting the JAVA executables */
|
---|
128 | ULONG fJava; /* Java flags. */
|
---|
129 |
|
---|
130 | /** @cat Options affecting the executables */
|
---|
131 | ULONG fNoLoader; /* No loader stuff. !FIXME! We should import / functions even if this flag is set!!! */
|
---|
132 |
|
---|
133 | /** @cat Options affecting the behaviour changes in the OS/2 loader */
|
---|
134 | ULONG fDllFixes; /* Enables the long DLL name and non .DLL extention fixes. */
|
---|
135 |
|
---|
136 | /** @cat Options affecting the heap. */
|
---|
137 | ULONG cbSwpHeapInit; /* Initial heapsize. */
|
---|
138 | ULONG cbSwpHeapMax; /* Maximum heapsize. */
|
---|
139 | ULONG cbResHeapInit; /* Initial residentheapsize. */
|
---|
140 | ULONG cbResHeapMax; /* Maxiumem residentheapsize. */
|
---|
141 | };
|
---|
142 | #pragma pack()
|
---|
143 |
|
---|
144 | /*******************************************************************************
|
---|
145 | * Global Variables *
|
---|
146 | *******************************************************************************/
|
---|
147 | /* NOINC */
|
---|
148 | extern struct options DATA16_GLOBAL options; /* defined in d16globals.c */
|
---|
149 | #if defined(__IBMC__) || defined(__IBMCPP__)
|
---|
150 | #pragma map( options , "_options" )
|
---|
151 | #endif
|
---|
152 | /* INC */
|
---|
153 |
|
---|
154 | /* NOINC */
|
---|
155 | #endif
|
---|
156 | /* INC */
|
---|
157 |
|
---|