home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / watcoapi.zip / incl32 / os2def.h < prev    next >
C/C++ Source or Header  |  2002-09-30  |  2KB  |  96 lines

  1. /*
  2.     OS/2 typedefs and constants for 32-bit development.
  3. */
  4.  
  5.  
  6. #ifndef NULL
  7. #define NULL  0
  8. #endif
  9.  
  10. #ifndef TRUE
  11. #define TRUE  1
  12. #endif
  13.  
  14. #ifndef FALSE
  15. #define FALSE 0
  16. #endif
  17.  
  18. #define FAR
  19. #define NEAR
  20.  
  21. #define FIELDOFFSET(type, field)   ((SHORT)&(((type *)0)->field))
  22.  
  23. #define MAKEULONG(l, h)  ((ULONG)(((USHORT)(l)) | ((ULONG)((USHORT)(h))) << 16))
  24. #define MAKELONG(l, h)   ((LONG)MAKEULONG(l, h))
  25. #define MAKEUSHORT(l, h) (((USHORT)(l)) | ((USHORT)(h)) << 8)
  26. #define MAKESHORT(l, h)  ((SHORT)MAKEUSHORT(l, h))
  27.  
  28. #define LOBYTE(w)   LOUCHAR(w)
  29. #define HIBYTE(w)   HIUCHAR(w)
  30. #define LOUCHAR(w)  ((UCHAR)(w))
  31. #define HIUCHAR(w)  ((UCHAR)(((USHORT)(w) >> 8) & 0xff))
  32. #define LOUSHORT(l) ((USHORT)((ULONG)l))
  33. #define HIUSHORT(l) ((USHORT)(((ULONG)(l) >> 16) & 0xffff))
  34.  
  35. #define NULLHANDLE  ((LHANDLE)0)
  36.  
  37. #define APIENTRY16 _Far16 _Pascal
  38. #define PASCAL16   _Far16 _Pascal
  39.  
  40. #define EXPENTRY  _System
  41. #define APIENTRY  _System
  42.  
  43. #define CHAR     char
  44. #define SHORT    short
  45. #define LONG     long
  46. #define INT      int
  47. #define VOID     void
  48.  
  49. typedef unsigned long   APIRET;
  50. typedef unsigned short  APIRET16;
  51.  
  52. typedef unsigned char   UCHAR,  *PUCHAR;
  53. typedef char            BYTE,   *PBYTE;
  54. typedef unsigned short  USHORT, *PUSHORT;
  55. typedef unsigned int    UINT,   *PUINT;
  56. typedef unsigned long   ULONG,  *PULONG;
  57.  
  58. typedef unsigned short  SHANDLE;
  59. typedef unsigned long   LHANDLE;
  60.  
  61. typedef char *PSZ;
  62. typedef char *PCH;
  63. typedef const char *PCSZ;
  64.  
  65. typedef unsigned long BOOL, *PBOOL;
  66. typedef unsigned LONG BOOL32, *PBOOL32;
  67.  
  68. typedef CHAR     *PCHAR;
  69. typedef SHORT    *PSHORT;
  70. typedef INT      *PINT;
  71. typedef LONG     *PLONG;
  72.  
  73. typedef VOID     *PVOID;
  74. typedef PVOID    *PPVOID;
  75.  
  76. typedef int (APIENTRY _PFN)();
  77. typedef _PFN  *PFN;
  78.  
  79. typedef USHORT  SEL, *PSEL;
  80.  
  81. typedef LHANDLE HFILE, *PHFILE;
  82. typedef LHANDLE HMODULE, *PHMODULE;
  83. typedef LHANDLE PID, *PPID;
  84. typedef LHANDLE TID, *PTID;
  85. typedef ULONG   HEV,  *PHEV;
  86. typedef ULONG   HMTX, *PHMTX;
  87. typedef ULONG   HMUX, *PHMUX;
  88. typedef VOID    *HSEM;
  89. typedef HSEM    *PHSEM;
  90. typedef USHORT  SGID;
  91.  
  92. typedef struct _QWORD {
  93.     ULONG   ulLo;
  94.     ULONG   ulHi;
  95. } QWORD, *PQWORD;
  96.