home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / BASEDEF.H next >
C/C++ Source or Header  |  1995-04-14  |  6KB  |  245 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /*static char *SCCSID = "@(#)basedef.h    6.1 90/11/15";*/
  14. /***    BASEDEF.H
  15.  *
  16.  *    SCCSID = @(#)basedef.h      13.11    90/07/10
  17.  *
  18.  *    Basic constants and types
  19.  *
  20.  *
  21.  *    MODIFICATION HISTORY
  22.  *        10/10/88  JTP    Created.
  23.  *        10/11/88  JTP    Added more base types.
  24.  *
  25.  *    To control what is included use the following:
  26.  *
  27.  *        INCL_TYPES         basic typedefs
  28.  */
  29.  
  30.  
  31. /*** Basic constants
  32.  */
  33.  
  34. //c-begin
  35. #include <os2std.h>
  36. //c-end
  37.  
  38. //masm-begin
  39. //NULL    equ    0
  40. //TRUE    equ    -1
  41. //FALSE    equ    0
  42. //masm-end
  43.  
  44. #define CTRUE    1
  45.  
  46. #define KSIZE    1024
  47.  
  48. #ifdef    INCL_PAGE
  49. #define PAGESIZE 4096
  50. #endif
  51.  
  52.  
  53. /*** Basic data types
  54.  */
  55.  
  56. //c-begin
  57. #define CDECL    _cdecl
  58. #define PASCAL    _pascal
  59. #define VOID    void
  60. #define CONST    const
  61. #define VOLATILE volatile
  62.  
  63. #ifdef    M_I386
  64. #define FAR    _near            // p  (32-bit pointer)
  65. #define NEAR    _near            // np (near pointer)
  66. #define FAR32    _far            // fp (48-bit pointer, restricted)
  67. #else
  68. #define FAR    _far
  69. #define NEAR    _near
  70. #endif
  71. //c-end
  72.  
  73. //masm-begin
  74. //DefType VOID
  75. //masm-end
  76.  
  77. #define CENTRY CDECL FAR        // to declare misc. C-based interfaces
  78. #define PRIVENTRY PASCAL FAR        // to declare private routines
  79. #define EXPENTRY PASCAL FAR        // to declare exported routines
  80. #define API32ENTRY PASCAL FAR        // to declare exported API routines
  81. #define DYNENTRY PASCAL FAR _export    // to declare exported dynlink routines
  82.  
  83. #ifdef    INCL_TYPES
  84.  
  85. typedef int INT;            // i
  86. typedef unsigned int UINT;        // u
  87. typedef INT BOOL;            // f
  88.  
  89. typedef unsigned char BYTE;        // b
  90. typedef unsigned short WORD;        // w
  91. typedef unsigned long DWORD;        // dw
  92.  
  93. typedef char CHAR;            // ch
  94. typedef unsigned char UCHAR;        // uch
  95. typedef short SHORT;            // s
  96. typedef unsigned short USHORT;        // us
  97. typedef long LONG;            // l
  98. typedef unsigned long ULONG;        // ul
  99.  
  100. typedef UCHAR BBOOL;            // bf
  101. typedef USHORT SBOOL;            // sf
  102. typedef ULONG LBOOL;            // lf
  103.  
  104. typedef ULONG FLAGS;            // fl
  105. typedef ULONG PORT;            // port
  106.  
  107.  
  108. /*** Basic pointer types
  109.  */
  110. typedef VOID FAR *PVOID;        // p
  111. typedef VOID NEAR *NPVOID;        // np
  112.  
  113.  
  114. /*** Basic pointer-to-basic-data types
  115.  */
  116. typedef INT FAR *PINT;            // pi
  117. typedef INT NEAR *NPINT;        // npi
  118.  
  119. typedef UINT FAR *PUINT;        // pu
  120. typedef UINT NEAR *NPUINT;        // npu
  121.  
  122. typedef BYTE FAR *PBYTE;        // pb
  123. typedef BYTE NEAR *NPBYTE;        // npb
  124.  
  125. typedef WORD FAR *PWORD;        // pw
  126. typedef WORD NEAR *NPWORD;        // npw
  127.  
  128. typedef DWORD FAR *PDWORD;        // pdw
  129. typedef DWORD NEAR *NPDWORD;        // npdw
  130.  
  131. typedef CHAR FAR *PCHAR;        // pch
  132. typedef CHAR NEAR *NPCHAR;        // npch
  133.  
  134. typedef SHORT FAR *PSHORT;        // ps
  135. typedef SHORT NEAR *NPSHORT;        // nps
  136.  
  137. typedef LONG FAR *PLONG;        // pl
  138. typedef LONG NEAR *NPLONG;        // npl
  139.  
  140. typedef UCHAR FAR *PUCHAR;        // puch
  141. typedef UCHAR NEAR *NPUCHAR;        // npuch
  142.  
  143. typedef USHORT FAR *PUSHORT;        // pus
  144. typedef USHORT NEAR *NPUSHORT;        // npus
  145.  
  146. typedef ULONG FAR *PULONG;        // pul
  147. typedef ULONG NEAR *NPULONG;        // npul
  148.  
  149. typedef BOOL FAR *PBOOL;        // pf
  150. typedef BOOL NEAR *NPBOOL;        // npf
  151.  
  152. typedef BBOOL FAR *PBBOOL;        // pbf
  153. typedef BBOOL NEAR *NPBBOOL;        // npbf
  154.  
  155. typedef SBOOL FAR *PSBOOL;        // psf
  156. typedef SBOOL NEAR *NPSBOOL;        // npsf
  157.  
  158. typedef LBOOL FAR *PLBOOL;        // plf
  159. typedef LBOOL NEAR *NPLBOOL;        // nplf
  160.  
  161. typedef FLAGS FAR *PFLAGS;        // pfl
  162. typedef FLAGS NEAR *NPFLAGS;        // npfl
  163.  
  164. typedef PVOID FAR *PPVOID;        // pp
  165. typedef PVOID NEAR *NPPVOID;        // npp
  166.  
  167.  
  168. /*** Other common types (and their pointers)
  169.  */
  170. typedef BYTE BUF[];            // buf
  171. typedef BUF FAR *PBUF;            // pbuf
  172.  
  173. typedef CHAR NAM[8];            // nam
  174. typedef CHAR SZ[];            // sz
  175. typedef CHAR FAR *PSZ;            // psz
  176. typedef CHAR NEAR *NPSZ;        // npsz
  177. typedef CHAR SZZ[];            // szz
  178. typedef CHAR FAR *PSZZ;         // pszz
  179. typedef CHAR NEAR *NPSZZ;        // npszz
  180.  
  181. typedef USHORT SEL;            // sel
  182. typedef SEL FAR *PSEL;            // psel
  183. typedef SEL NEAR *NPSEL;        // npsel
  184.  
  185. typedef USHORT SOFFSET;            // soff
  186. typedef ULONG OFFSET;            // off
  187.  
  188. typedef ULONG PPHYS;            // pphys
  189.  
  190. typedef (PASCAL FAR *PFN)();        // pfn
  191. typedef (PASCAL NEAR *NPFN)();        // npfn
  192. typedef (PASCAL FAR32 *FPFN)();     // fpfn
  193. typedef (PASCAL FAR32 *FPVOID)();    // fp (the only kind of FPVOID allowed)
  194.  
  195. typedef PFN FAR *PPFN;            // ppfn
  196. typedef PFN NEAR *NPPFN;        // nppfn
  197. typedef FPFN FAR *PFPFN;        // pfpfn
  198. typedef FPFN NEAR *NPFPFN;        // npfpfn
  199.  
  200. typedef USHORT SHANDLE;            // sh
  201. typedef PVOID  HANDLE;            // h
  202.  
  203. typedef struct _POINTL    {        // ptl
  204.     LONG  x;
  205.     LONG  y;
  206. } POINTL;
  207. typedef POINTL FAR *PPOINTL;
  208.  
  209. typedef struct _RECTL {         // rcl
  210.     LONG  xLeft;
  211.     LONG  yBottom;
  212.     LONG  xRight;
  213.     LONG  yTop;
  214. } RECTL;
  215. typedef RECTL FAR *PRECTL;
  216.  
  217. typedef struct _RGB {            // rgb
  218.     BYTE bBlue;
  219.     BYTE bGreen;
  220.     BYTE bRed;
  221. } RGB;
  222. typedef RGB FAR *PRGB;
  223.  
  224.  
  225. /*** OS/2-specific types
  226.  */
  227. typedef ULONG ERRCODE;            // errc
  228. typedef ULONG RETCODE;            // rc
  229. typedef USHORT SRETCODE;        // src
  230.  
  231. typedef USHORT PID;            // pid
  232. typedef USHORT SGID;            // sgid
  233. typedef USHORT TID;            // tid
  234.  
  235. typedef struct _RESULTCODES {        // rsc
  236.     USHORT codeTerminate;
  237.     USHORT codeResult;
  238. } RESULTCODES;
  239. typedef RESULTCODES FAR *PRESULTCODES;
  240.  
  241. typedef SHANDLE HFILE;            // shf
  242. typedef HFILE FAR *PHFILE;        // pshf
  243.  
  244. #endif    // INCL_TYPES
  245.