pgrl.h
Go to the documentation of this file.
1 
23 #ifndef _GRL_H_
24 #define _GRL_H_ 1
25 
29 #ifndef NULL
30 #define NULL 0
31 #endif
32 
33 #define NEAR near
34 #define LONG long
35 #define VOID void
36 #define PASCAL pascal
37 
38 typedef unsigned char BYTE;
39 typedef unsigned int UINT;
40 typedef short int SINT;
41 typedef short int SHORT;
42 typedef unsigned short int USHORT;
43 typedef int BOOL;
44 
45 typedef unsigned int WORD;
46 typedef unsigned long DWORD;
47 
48 typedef const char far *LPCSTR;
49 typedef const char *PCSTR;
50 typedef char *PSTR;
51 typedef char near *NPSTR;
52 typedef char far *LPSTR;
53 typedef BYTE near *PBYTE;
54 typedef BYTE far *LPBYTE;
55 typedef int near *PINT;
56 typedef int far *LPINT;
57 typedef WORD near *PWORD;
58 typedef WORD far *LPWORD;
59 typedef long near *PLONG;
60 typedef long far *LPLONG;
61 typedef DWORD near *PDWORD;
62 typedef DWORD far *LPDWORD;
63 typedef void far *LPVOID;
64 
65 typedef UINT WPARAM;
66 typedef LONG LPARAM;
67 typedef LONG LRESULT;
68 
69 #define MAKELONG(a, b) ((LONG)(((WORD)(a)) | (((DWORD)((WORD)(b))) << 16)))
70 #define LOWORD(l) ((WORD)(l))
71 #define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
72 #define LOBYTE(w) ((BYTE)(w))
73 #define HIBYTE(w) ((BYTE)((WORD)(w) >> 8))
74 #define MAKELPARAM(low, high) ((LPARAM)MAKELONG(low, high))
75 #define MAKELRESULT(low, high) ((LRESULT)MAKELONG(low, high))
76 #define MAKELP(sel, off) ((void FAR*)MAKELONG((off), (sel)))
77 #define SELECTOROF(lp) HIWORD(lp)
78 #define OFFSETOF(lp) LOWORD(lp)
79 #define FIELDOFFSET(type, field) ((int)(&((type NEAR*)1)->field)-1)
80 
81 #define bitset(var,bitno) ((var) |= 1 << (bitno))
82 #define bitclr(var,bitno) ((var) &= ~(1 << (bitno)))
83 #define bittst(var,bitno) ((var)&(1<<(bitno)))
84 
85 #define ENABLE 1
86 #define DISABLE 0
87 #define HIGH 1
88 #define LOW 0
89 #define HENABLE 1
90 #define LDISABLE 0
91 #define LENABLE 0
92 #define HDISABLE 1
93 #define ON 1
94 #define OFF 0
95 
96 #ifndef TRUE
97  #define TRUE 1
98  #define FALSE 0
99 #endif
100 
101 #define HPULSE 1
102 #define LPULSE 0
103 #define CLEAR 0
104 #define SET 1
105 #define DIR_OUT 0
106 #define DIR_IN 1
107 
108 #ifndef SLEEP
109  #define SLEEP() asm(" sleep")
110 #endif
111 
112 
113 #endif // _GRL_H_
114 /* ***************************************************************[ENDL]**** */
115 
short int SHORT
Definition: pgrl.h:41
UINT WPARAM
Definition: pgrl.h:65
DWORD far * LPDWORD
Definition: pgrl.h:62
WORD near * PWORD
Definition: pgrl.h:57
unsigned short int USHORT
Definition: pgrl.h:42
int BOOL
Definition: pgrl.h:43
char * PSTR
Definition: pgrl.h:50
const char * PCSTR
Definition: pgrl.h:49
LONG LPARAM
Definition: pgrl.h:66
BYTE far * LPBYTE
Definition: pgrl.h:54
BYTE near * PBYTE
Definition: pgrl.h:53
short int SINT
Definition: pgrl.h:40
char far * LPSTR
Definition: pgrl.h:52
long near * PLONG
Definition: pgrl.h:59
const char far * LPCSTR
Definition: pgrl.h:48
DWORD near * PDWORD
Definition: pgrl.h:61
WORD far * LPWORD
Definition: pgrl.h:58
int far * LPINT
Definition: pgrl.h:56
int near * PINT
Definition: pgrl.h:55
char near * NPSTR
Definition: pgrl.h:51
#define LONG
Definition: pgrl.h:34
unsigned long DWORD
Definition: pgrl.h:46
unsigned char BYTE
Definition: pgrl.h:38
unsigned int WORD
Definition: pgrl.h:45
long far * LPLONG
Definition: pgrl.h:60
void far * LPVOID
Definition: pgrl.h:63
unsigned int UINT
Definition: pgrl.h:39
LONG LRESULT
Definition: pgrl.h:67