|
|
1.1 root 1: /*static char *SCCSID = "@(#)os2def.h 13.17 90/03/12";*/
2: /***************************************************************************\
3: *
4: * Module Name: OS2DEF.H
5: *
6: * OS/2 Common Definitions file
7: *
8: * Copyright (c) 1987 IBM Corporation
9: * Copyright (c) 1987 Microsoft Corporation
10: *
11: \***************************************************************************/
12:
13: #define OS2DEF_INCLUDED
14:
15: #ifndef OS2_INCLUDED
16: #if !(defined(INCL_32) || defined(INCL_16))
17: #ifdef M_I386
18: #define INCL_32
19: #else /* not M_I386 */
20: #define INCL_16
21: #endif /* M_I386 */
22: #endif /* INCL_32 || INCL_16 */
23: #endif /* OS2_INCLUDED */
24:
25: #ifdef INCL_32 /* This #ifdef brackets the rest of this entire */
26: /* file. It is used to include either the */
27: /* 32-bit or 16-bit base definitions. No */
28: /* definitions (other than 16/32-bit */
29: /* determination) must be placed above this. */
30:
31: /* XLATOFF */
32:
33: #ifdef INCL_16
34: #error message ("Using 32 bit definitions when compiling 16 bit code")
35: #endif /* INCL_16 */
36:
37: #define PASCAL /* nothing */
38: #define FAR /* nothing */
39: #define NEAR /* nothing */
40: #define EXPENTRY _syscall
41: #define APIENTRY _syscall
42: #define APIRET ULONG
43:
44: #define VOID void
45: /* XLATON */
46:
47: #include <os2std.h>
48:
49: typedef unsigned long SHANDLE;
50:
51: typedef VOID FAR *LHANDLE;
52:
53: /* XLATOFF */
54: #define CHAR char /* ch */
55: #define SHORT short /* s */
56: #define LONG long /* l */
57: #ifndef INCL_SAADEFS
58: #define INT int /* i */
59: #endif /* !INCL_SAADEFS */
60: /* XLATON */
61:
62: typedef unsigned char UCHAR; /* uch */
63: typedef unsigned short USHORT; /* us */
64: typedef unsigned long ULONG; /* ul */
65: #ifndef INCL_SAADEFS
66: typedef unsigned int UINT; /* ui */
67: #endif /* !INCL_SAADEFS */
68:
69: typedef unsigned char BYTE; /* b */
70:
71: typedef unsigned char FAR *PSZ;
72: typedef unsigned char NEAR *NPSZ;
73:
74: typedef unsigned char FAR *PCH;
75: typedef unsigned char NEAR *NPCH;
76:
77: typedef int (PASCAL FAR *PFN)();
78: typedef int (PASCAL NEAR *NPFN)();
79:
80: typedef BYTE FAR *PBYTE;
81: typedef BYTE NEAR *NPBYTE;
82:
83: typedef CHAR FAR *PCHAR;
84: typedef SHORT FAR *PSHORT;
85: typedef LONG FAR *PLONG;
86: #ifndef INCL_SAADEFS
87: typedef INT FAR *PINT;
88: #endif /* !INCL_SAADEFS */
89:
90: typedef UCHAR FAR *PUCHAR;
91: typedef USHORT FAR *PUSHORT;
92: typedef ULONG FAR *PULONG;
93: #ifndef INCL_SAADEFS
94: typedef UINT FAR *PUINT;
95: #endif /* !INCL_SAADEFS */
96:
97: typedef VOID FAR *PVOID;
98: typedef PVOID FAR *PPVOID;
99:
100: typedef unsigned short BOOL; /* f */
101: typedef BOOL FAR *PBOOL;
102:
103: typedef unsigned long BOOL32; /* f32 */
104: typedef BOOL32 FAR *PBOOL32;
105:
106:
107: #ifndef INCL_SAADEFS
108: typedef unsigned short SEL; /* sel */
109: typedef SEL FAR *PSEL;
110:
111: /*** Useful Helper Macros */
112:
113: /* Create untyped far pointer from selector and offset */
114: #define MAKEP(sel, off) ((PVOID)MAKEULONG(off, sel))
115:
116: /* Extract selector or offset from far pointer */
117: #define SELECTOROF(p) (((PUSHORT)&(p))[1])
118: #define OFFSETOF(p) (((PUSHORT)&(p))[0])
119: #endif /* !INCL_SAADEFS */
120:
121:
122:
123:
124: /* Cast any variable to an instance of the specified type. */
125: #define MAKETYPE(v, type) (*((type FAR *)&v))
126:
127: /* Calculate the byte offset of a field in a structure of type type. */
128: #define FIELDOFFSET(type, field) ((SHORT)&(((type *)0)->field))
129:
130: /* Combine l & h to form a 32 bit quantity. */
131: #define MAKEULONG(l, h) ((ULONG)(((USHORT)(l)) | ((ULONG)((USHORT)(h))) << 16))
132: #define MAKELONG(l, h) ((LONG)MAKEULONG(l, h))
133:
134: /* Combine l & h to form a 16 bit quantity. */
135: #define MAKEUSHORT(l, h) (((USHORT)(l)) | ((USHORT)(h)) << 8)
136: #define MAKESHORT(l, h) ((SHORT)MAKEUSHORT(l, h))
137:
138: /* Extract high and low order parts of 16 and 32 bit quantity */
139: #define LOBYTE(w) LOUCHAR(w)
140: #define HIBYTE(w) HIUCHAR(w)
141: #define LOUCHAR(w) ((UCHAR)(w))
142: #define HIUCHAR(w) ((UCHAR)(((USHORT)(w) >> 8) & 0xff))
143: #define LOUSHORT(l) ((USHORT)(l))
144: #define HIUSHORT(l) ((USHORT)(((ULONG)(l) >> 16) & 0xffff))
145:
146: /*** Common Error definitions ****/
147:
148: typedef ULONG ERRORID; /* errid */
149: typedef ERRORID FAR *PERRORID;
150:
151: /* Combine severity and error code to produce ERRORID */
152: #define MAKEERRORID(sev, error) (ERRORID)(MAKEULONG((error), (sev)))
153: /* Extract error number from an errorid */
154: #define ERRORIDERROR(errid) (LOUSHORT(errid))
155: /* Extract severity from an errorid */
156: #define ERRORIDSEV(errid) (HIUSHORT(errid))
157:
158: /* Severity codes */
159: #define SEVERITY_NOERROR 0x0000
160: #define SEVERITY_WARNING 0x0004
161: #define SEVERITY_ERROR 0x0008
162: #define SEVERITY_SEVERE 0x000C
163: #define SEVERITY_UNRECOVERABLE 0x0010
164:
165: /* Base component error values */
166:
167: #define WINERR_BASE 0x1000 /* Window Manager */
168: #define GPIERR_BASE 0x2000 /* Graphics Presentation Interface */
169: #define DEVERR_BASE 0x3000 /* Device Manager */
170: #define SPLERR_BASE 0x4000 /* Spooler */
171:
172: /*** Common types used across components */
173:
174: /*** Common DOS types */
175:
176: typedef SHANDLE HMODULE; /* hmod */
177: typedef SHANDLE PID; /* pid */
178: typedef SHANDLE TID; /* tid */
179: #ifndef INCL_SAADEFS
180: typedef USHORT SGID; /* sgid */
181: #endif /* !INCL_SAADEFS */
182:
183: typedef HMODULE FAR *PHMODULE;
184: typedef PID FAR *PPID;
185: typedef TID FAR *PTID;
186:
187: #ifndef INCL_SAADEFS
188: typedef VOID FAR *HSEM; /* hsem */
189: typedef HSEM FAR *PHSEM;
190: #endif /* !INCL_SAADEFS */
191:
192: /*** Common SUP types */
193:
194: typedef LHANDLE HAB; /* hab */
195: typedef HAB FAR *PHAB;
196:
197: /*** Common GPI/DEV types */
198:
199: typedef LHANDLE HPS; /* hps */
200: typedef HPS FAR *PHPS;
201:
202: typedef LHANDLE HDC; /* hdc */
203: typedef HDC FAR *PHDC;
204:
205: typedef LHANDLE HRGN; /* hrgn */
206: typedef HRGN FAR *PHRGN;
207:
208: typedef LHANDLE HBITMAP; /* hbm */
209: typedef HBITMAP FAR *PHBITMAP;
210:
211: typedef LHANDLE HMF; /* hmf */
212: typedef HMF FAR *PHMF;
213:
214: typedef LHANDLE HPAL; /* hpal */
215: typedef HPAL FAR *PHPAL;
216:
217: typedef LONG COLOR; /* clr */
218: typedef COLOR FAR *PCOLOR;
219:
220: typedef struct _POINTL { /* ptl */
221: LONG x;
222: LONG y;
223: } POINTL;
224: typedef POINTL FAR *PPOINTL;
225: typedef POINTL NEAR *NPPOINTL;
226:
227: typedef struct _POINTS { /* pts */
228: SHORT x;
229: SHORT y;
230: } POINTS;
231: typedef POINTS FAR *PPOINTS;
232:
233: typedef struct _RECTL { /* rcl */
234: LONG xLeft;
235: LONG yBottom;
236: LONG xRight;
237: LONG yTop;
238: } RECTL;
239: typedef RECTL FAR *PRECTL;
240: typedef RECTL NEAR *NPRECTL;
241:
242: typedef CHAR STR8[8]; /* str8 */
243: typedef STR8 FAR *PSTR8;
244:
245: /* FDATE and FTIME definitions moved to bsedos.h */
246: /* FILEFINDBUF definitions moved to bsedos.h */
247:
248: /*** common DEV/SPL types */
249:
250: /* structure for Device Driver data */
251:
252: typedef struct _DRIVDATA { /* driv */
253: LONG cb;
254: LONG lVersion;
255: CHAR szDeviceName[32];
256: CHAR abGeneralData[1];
257: } DRIVDATA;
258: typedef DRIVDATA FAR *PDRIVDATA;
259:
260: /* array indices for array parameter for DevOpenDC, SplQmOpen or SplQpOpen */
261:
262: #define ADDRESS 0
263: #ifndef INCL_SAADEFS
264: #define DRIVER_NAME 1
265: #define DRIVER_DATA 2
266: #define DATA_TYPE 3
267: #define COMMENT 4
268: #define PROC_NAME 5
269: #define PROC_PARAMS 6
270: #define SPL_PARAMS 7
271: #define NETWORK_PARAMS 8
272:
273: /* structure definition as an alternative of the array parameter */
274:
275: typedef struct _DEVOPENSTRUC { /* dop */
276: PSZ pszLogAddress;
277: PSZ pszDriverName;
278: PDRIVDATA pdriv;
279: PSZ pszDataType;
280: PSZ pszComment;
281: PSZ pszQueueProcName;
282: PSZ pszQueueProcParams;
283: PSZ pszSpoolerParams;
284: PSZ pszNetworkParams;
285: } DEVOPENSTRUC;
286: typedef DEVOPENSTRUC FAR *PDEVOPENSTRUC;
287: #endif /* !INCL_SAADEFS */
288:
289: /*** common AVIO/GPI types */
290:
291: /* values of fsSelection field of FATTRS structure */
292: #define FATTR_SEL_ITALIC 0x0001
293: #define FATTR_SEL_UNDERSCORE 0x0002
294: #define FATTR_SEL_OUTLINE 0x0008
295: #define FATTR_SEL_STRIKEOUT 0x0010
296: #define FATTR_SEL_BOLD 0x0020
297:
298: /* values of fsType field of FATTRS structure */
299: #define FATTR_TYPE_KERNING 0x0004
300: #define FATTR_TYPE_MBCS 0x0008
301: #define FATTR_TYPE_DBCS 0x0010
302: #define FATTR_TYPE_ANTIALIASED 0x0020
303:
304: /* values of fsFontUse field of FATTRS structure */
305: #define FATTR_FONTUSE_NOMIX 0x0002
306: #define FATTR_FONTUSE_OUTLINE 0x0004
307: #define FATTR_FONTUSE_TRANSFORMABLE 0x0008
308: /* size for fields in the font structures */
309:
310: #define FACESIZE 32
311:
312: /* font struct for Vio/GpiCreateLogFont */
313:
314: typedef struct _FATTRS { /* fat */
315: USHORT usRecordLength;
316: USHORT fsSelection;
317: LONG lMatch;
318: CHAR szFacename[FACESIZE];
319: USHORT idRegistry;
320: USHORT usCodePage;
321: LONG lMaxBaselineExt;
322: LONG lAveCharWidth;
323: USHORT fsType;
324: USHORT fsFontUse;
325: } FATTRS;
326: typedef FATTRS FAR *PFATTRS;
327:
328: /* values of fsType field of FONTMETRICS structure */
329: #define FM_TYPE_FIXED 0x0001
330: #define FM_TYPE_LICENSED 0x0002
331: #define FM_TYPE_KERNING 0x0004
332: #define FM_TYPE_DBCS 0x0010
333: #define FM_TYPE_MBCS 0x0018
334: #define FM_TYPE_64K 0x8000
335:
336: /* values of fsDefn field of FONTMETRICS structure */
337: #define FM_DEFN_OUTLINE 0x0001
338: #define FM_DEFN_GENERIC 0x8000
339:
340: /* values of fsSelection field of FONTMETRICS structure */
341: #define FM_SEL_ITALIC 0x0001
342: #define FM_SEL_UNDERSCORE 0x0002
343: #define FM_SEL_NEGATIVE 0x0004
344: #define FM_SEL_OUTLINE 0x0008 /* Hollow Outline Font */
345: #define FM_SEL_STRIKEOUT 0x0010
346: #define FM_SEL_BOLD 0x0020
347:
348: /* values of fsCapabilities field of FONTMETRICS structure */
349: #define FM_CAP_NOMIX 0x0001
350:
351: /* font metrics returned by GpiQueryFonts and others */
352:
353: typedef struct _FONTMETRICS { /* fm */
354: CHAR szFamilyname[FACESIZE];
355: CHAR szFacename[FACESIZE];
356: USHORT idRegistry;
357: USHORT usCodePage;
358: LONG lEmHeight;
359: LONG lXHeight;
360: LONG lMaxAscender;
361: LONG lMaxDescender;
362: LONG lLowerCaseAscent;
363: LONG lLowerCaseDescent;
364: LONG lInternalLeading;
365: LONG lExternalLeading;
366: LONG lAveCharWidth;
367: LONG lMaxCharInc;
368: LONG lEmInc;
369: LONG lMaxBaselineExt;
370: SHORT sCharSlope;
371: SHORT sInlineDir;
372: SHORT sCharRot;
373: USHORT usWeightClass;
374: USHORT usWidthClass;
375: SHORT sXDeviceRes;
376: SHORT sYDeviceRes;
377: SHORT sFirstChar;
378: SHORT sLastChar;
379: SHORT sDefaultChar;
380: SHORT sBreakChar;
381: SHORT sNominalPointSize;
382: SHORT sMinimumPointSize;
383: SHORT sMaximumPointSize;
384: USHORT fsType;
385: USHORT fsDefn;
386: USHORT fsSelection;
387: USHORT fsCapabilities;
388: LONG lSubscriptXSize;
389: LONG lSubscriptYSize;
390: LONG lSubscriptXOffset;
391: LONG lSubscriptYOffset;
392: LONG lSuperscriptXSize;
393: LONG lSuperscriptYSize;
394: LONG lSuperscriptXOffset;
395: LONG lSuperscriptYOffset;
396: LONG lUnderscoreSize;
397: LONG lUnderscorePosition;
398: LONG lStrikeoutSize;
399: LONG lStrikeoutPosition;
400: SHORT sKerningPairs;
401: SHORT sFamilyClass;
402: LONG lMatch;
403: } FONTMETRICS;
404: typedef FONTMETRICS FAR *PFONTMETRICS;
405:
406: /*** Common WIN types */
407:
408: typedef LHANDLE HWND; /* hwnd */
409: typedef HWND FAR *PHWND;
410:
411: typedef struct _WRECT { /* wrc */
412: SHORT xLeft;
413: SHORT dummy1;
414: SHORT yBottom;
415: SHORT dummy2;
416: SHORT xRight;
417: SHORT dummy3;
418: SHORT yTop;
419: SHORT dummy4;
420: } WRECT;
421: typedef WRECT FAR *PWRECT;
422: typedef WRECT NEAR *NPWRECT;
423:
424: typedef struct _WPOINT { /* wpt */
425: SHORT x;
426: SHORT dummy1;
427: SHORT y;
428: SHORT dummy2;
429: } WPOINT;
430: typedef WPOINT FAR *PWPOINT;
431: typedef WPOINT NEAR *NPWPOINT;
432:
433: /* The following #else/#endif corresponds to a #if near the top of this */
434: /* file. The next three lines include the 16-bit version of this file, */
435: /* hence these lines MUST be the last lines in this include file. */
436: #else /* not INCL_32 */
437:
438: #ifdef INCL_16
439: #include <os2def16.h>
440: #endif /* INCL_16 */
441:
442: #endif /* INCL_32 */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.