home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / BASEDEF.H < prev    next >
C/C++ Source or Header  |  1997-04-10  |  6KB  |  229 lines

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