-
Notifications
You must be signed in to change notification settings - Fork 2
/
COMMON.H
52 lines (45 loc) · 1.41 KB
/
COMMON.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// common.h
//
// common definitions
#ifndef common_h
#define common_h
// basic type definitions.
typedef unsigned char byte;
typedef unsigned short int word;
typedef unsigned long dword;
typedef char * string;
// basic class for lptr's - pointers comprised of a segment and offset.
// the intention is that addresses are well defined within Borg. So comparison
// operators exist in a well defined way. Addresses are not converted to 32 bit
// equivalents or whatever for this.
class lptr //Pointer Struct 32-bit.
{ public:
word segm; //segment
dword offs; //offset
public:
lptr(){};
lptr(word seg,dword off);
~lptr(){};
void assign(word seg,dword off);
bool between(const lptr& lwb,const lptr& upb);
bool operator==(const lptr& loc2);
bool operator<=(const lptr& loc2);
bool operator>=(const lptr& loc2);
bool operator<(const lptr& loc2);
bool operator>(const lptr& loc2);
bool operator!=(const lptr& loc2);
lptr operator+(dword offs2);
lptr& operator++(int x);
lptr& operator+=(dword offs2);
lptr operator-(dword offs2);
dword operator-(lptr& loc2);
};
// predefined null pointer.
extern const lptr nlptr;
// basic support functions
void cleanstring(char *str);
void CenterWindow(HWND hdwnd);
void demangle(char **nme);
void getfiletoload(char *fname);
void getfiletosave(char *fname);
#endif