summaryrefslogtreecommitdiffstats
path: root/private/os2/ldr/basedef.h
blob: 15de3ae406262411b2f56f4af118a7e73e5dcf18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
/*static char *SCCSID = "@(#)basedef.h	6.1 90/11/15";*/
/***	BASEDEF.H
 *
 *	SCCSID = @(#)basedef.h	  13.11	90/07/10
 *
 *	Basic constants and types
 *	Copyright (c) 1988,1989 Microsoft Corporation
 *
 *
 *	MODIFICATION HISTORY
 *	    10/10/88  JTP    Created.
 *	    10/11/88  JTP    Added more base types.
 *
 *	To control what is included use the following:
 *
 *	    INCL_TYPES	     basic typedefs
 */


/*** Basic constants
 */

//c-begin
#include <os2std.h>
//c-end

//masm-begin
//NULL	equ	0
//TRUE	equ    -1
//FALSE	equ	0
//masm-end

#define CTRUE	1

#define KSIZE	1024

#ifdef	INCL_PAGE
#define PAGESIZE 4096
#endif


/*** Basic data types
 */

//c-begin
#define CDECL	_cdecl
#define PASCAL	_pascal
#define VOID	void
#define CONST	const
#define VOLATILE volatile

#ifdef	M_I386
#define FAR	_near			// p  (32-bit pointer)
#define NEAR	_near			// np (near pointer)
#define FAR32	_far			// fp (48-bit pointer, restricted)
#else
#define FAR	_far
#define NEAR	_near
#endif
//c-end

//masm-begin
//DefType VOID
//masm-end

#define CENTRY CDECL FAR		// to declare misc. C-based interfaces
#define PRIVENTRY PASCAL FAR		// to declare private routines
#define EXPENTRY PASCAL FAR		// to declare exported routines
#define API32ENTRY PASCAL FAR		// to declare exported API routines
#define DYNENTRY PASCAL FAR _export	// to declare exported dynlink routines

#ifdef	INCL_TYPES

typedef int INT;			// i
typedef unsigned int UINT;		// u
typedef INT BOOL;			// f

typedef unsigned char BYTE;		// b
typedef unsigned short WORD;		// w
typedef unsigned long DWORD;		// dw

typedef char CHAR;			// ch
typedef unsigned char UCHAR;		// uch
typedef short SHORT;			// s
typedef unsigned short USHORT;		// us
typedef long LONG;			// l
typedef unsigned long ULONG;		// ul

typedef UCHAR BBOOL;			// bf
typedef USHORT SBOOL;			// sf
typedef ULONG LBOOL;			// lf

typedef ULONG FLAGS;			// fl
typedef ULONG PORT;			// port


/*** Basic pointer types
 */
typedef VOID FAR *PVOID;		// p
typedef VOID NEAR *NPVOID;		// np


/*** Basic pointer-to-basic-data types
 */
typedef INT FAR *PINT;			// pi
typedef INT NEAR *NPINT;		// npi

typedef UINT FAR *PUINT;		// pu
typedef UINT NEAR *NPUINT;		// npu

typedef BYTE FAR *PBYTE;		// pb
typedef BYTE NEAR *NPBYTE;		// npb

typedef WORD FAR *PWORD;		// pw
typedef WORD NEAR *NPWORD;		// npw

typedef DWORD FAR *PDWORD;		// pdw
typedef DWORD NEAR *NPDWORD;		// npdw

typedef CHAR FAR *PCHAR;		// pch
typedef CHAR NEAR *NPCHAR;		// npch

typedef SHORT FAR *PSHORT;		// ps
typedef SHORT NEAR *NPSHORT;		// nps

typedef LONG FAR *PLONG;		// pl
typedef LONG NEAR *NPLONG;		// npl

typedef UCHAR FAR *PUCHAR;		// puch
typedef UCHAR NEAR *NPUCHAR;		// npuch

typedef USHORT FAR *PUSHORT;		// pus
typedef USHORT NEAR *NPUSHORT;		// npus

typedef ULONG FAR *PULONG;		// pul
typedef ULONG NEAR *NPULONG;		// npul

typedef BOOL FAR *PBOOL;		// pf
typedef BOOL NEAR *NPBOOL;		// npf

typedef BBOOL FAR *PBBOOL;		// pbf
typedef BBOOL NEAR *NPBBOOL;		// npbf

typedef SBOOL FAR *PSBOOL;		// psf
typedef SBOOL NEAR *NPSBOOL;		// npsf

typedef LBOOL FAR *PLBOOL;		// plf
typedef LBOOL NEAR *NPLBOOL;		// nplf

typedef FLAGS FAR *PFLAGS;		// pfl
typedef FLAGS NEAR *NPFLAGS;		// npfl

typedef PVOID FAR *PPVOID;		// pp
typedef PVOID NEAR *NPPVOID;		// npp


/*** Other common types (and their pointers)
 */
typedef BYTE BUF[];			// buf
typedef BUF FAR *PBUF;			// pbuf

typedef CHAR NAM[8];			// nam
typedef CHAR SZ[];			// sz
typedef CHAR FAR *PSZ;			// psz
typedef CHAR NEAR *NPSZ;		// npsz
typedef CHAR SZZ[];			// szz
typedef CHAR FAR *PSZZ; 		// pszz
typedef CHAR NEAR *NPSZZ;		// npszz

typedef USHORT SEL;			// sel
typedef SEL FAR *PSEL;			// psel
typedef SEL NEAR *NPSEL;		// npsel

typedef USHORT SOFFSET;			// soff
typedef ULONG OFFSET;			// off

typedef ULONG PPHYS;			// pphys

typedef (PASCAL FAR *PFN)();		// pfn
typedef (PASCAL NEAR *NPFN)();		// npfn
typedef (PASCAL FAR32 *FPFN)(); 	// fpfn
typedef (PASCAL FAR32 *FPVOID)();	// fp (the only kind of FPVOID allowed)

typedef PFN FAR *PPFN;			// ppfn
typedef PFN NEAR *NPPFN;		// nppfn
typedef FPFN FAR *PFPFN;		// pfpfn
typedef FPFN NEAR *NPFPFN;		// npfpfn

typedef USHORT SHANDLE;			// sh
typedef PVOID  HANDLE;			// h

typedef struct _POINTL	{		// ptl
    LONG  x;
    LONG  y;
} POINTL;
typedef POINTL FAR *PPOINTL;

typedef struct _RECTL { 		// rcl
    LONG  xLeft;
    LONG  yBottom;
    LONG  xRight;
    LONG  yTop;
} RECTL;
typedef RECTL FAR *PRECTL;

typedef struct _RGB {			// rgb
    BYTE bBlue;
    BYTE bGreen;
    BYTE bRed;
} RGB;
typedef RGB FAR *PRGB;


/*** OS/2-specific types
 */
typedef ULONG ERRCODE;			// errc
typedef ULONG RETCODE;			// rc
typedef USHORT SRETCODE;		// src

typedef USHORT PID;			// pid
typedef USHORT SGID;			// sgid
typedef USHORT TID;			// tid

typedef struct _RESULTCODES {		// rsc
    USHORT codeTerminate;
    USHORT codeResult;
} RESULTCODES;
typedef RESULTCODES FAR *PRESULTCODES;

typedef SHANDLE HFILE;			// shf
typedef HFILE FAR *PHFILE;		// pshf

#endif	// INCL_TYPES