Rev 7666 | Rev 7701 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7666 | Rev 7700 | ||
---|---|---|---|
1 | #ifndef ___PORT_H___ |
1 | #ifndef ___PORT_H___ |
2 | #define ___PORT_H___ |
2 | #define ___PORT_H___ |
3 | 3 | ||
4 | #ifdef __cplusplus |
4 | #ifdef __cplusplus |
5 | extern "C" { |
5 | extern "C" { |
6 | #endif |
6 | #endif |
7 | 7 | ||
8 | #define _BORLAND_DOS_REGS |
8 | #define _BORLAND_DOS_REGS |
9 | 9 | ||
10 | struct DWORDREGS { |
10 | struct DWORDREGS { |
11 | unsigned long edi; |
11 | unsigned long edi; |
12 | unsigned long esi; |
12 | unsigned long esi; |
13 | unsigned long ebp; |
13 | unsigned long ebp; |
14 | unsigned long cflag; |
14 | unsigned long cflag; |
15 | unsigned long ebx; |
15 | unsigned long ebx; |
16 | unsigned long edx; |
16 | unsigned long edx; |
17 | unsigned long ecx; |
17 | unsigned long ecx; |
18 | unsigned long eax; |
18 | unsigned long eax; |
19 | unsigned short eflags; |
19 | unsigned short eflags; |
20 | }; |
20 | }; |
21 | struct DWORDREGS_W { |
21 | struct DWORDREGS_W { |
22 | unsigned long di; |
22 | unsigned long di; |
23 | unsigned long si; |
23 | unsigned long si; |
24 | unsigned long bp; |
24 | unsigned long bp; |
25 | unsigned long cflag; |
25 | unsigned long cflag; |
26 | unsigned long bx; |
26 | unsigned long bx; |
27 | unsigned long dx; unsigned long cx; |
27 | unsigned long dx; unsigned long cx; |
28 | unsigned long ax; |
28 | unsigned long ax; |
29 | unsigned short flags; |
29 | unsigned short flags; |
30 | }; |
30 | }; |
31 | 31 | ||
32 | struct WORDREGS { |
32 | struct WORDREGS { |
33 | unsigned short di, _upper_di; |
33 | unsigned short di, _upper_di; |
34 | unsigned short si, _upper_si; |
34 | unsigned short si, _upper_si; |
35 | unsigned short bp, _upper_bp; |
35 | unsigned short bp, _upper_bp; |
36 | unsigned short cflag, _upper_cflag; |
36 | unsigned short cflag, _upper_cflag; |
37 | unsigned short bx, _upper_bx; |
37 | unsigned short bx, _upper_bx; |
38 | unsigned short dx, _upper_dx; |
38 | unsigned short dx, _upper_dx; |
39 | unsigned short cx, _upper_cx; |
39 | unsigned short cx, _upper_cx; |
40 | unsigned short ax, _upper_ax; |
40 | unsigned short ax, _upper_ax; |
41 | unsigned short flags; |
41 | unsigned short flags; |
42 | }; |
42 | }; |
43 | 43 | ||
44 | struct BYTEREGS { |
44 | struct BYTEREGS { |
45 | unsigned short di, _upper_di; |
45 | unsigned short di, _upper_di; |
46 | unsigned short si, _upper_si; |
46 | unsigned short si, _upper_si; |
47 | unsigned short bp, _upper_bp; |
47 | unsigned short bp, _upper_bp; |
48 | unsigned long cflag; |
48 | unsigned long cflag; |
49 | unsigned char bl; |
49 | unsigned char bl; |
50 | unsigned char bh; |
50 | unsigned char bh; |
51 | unsigned short _upper_bx; |
51 | unsigned short _upper_bx; |
52 | unsigned char dl; |
52 | unsigned char dl; |
53 | unsigned char dh; |
53 | unsigned char dh; |
54 | unsigned short _upper_dx; |
54 | unsigned short _upper_dx; |
55 | unsigned char cl; |
55 | unsigned char cl; |
56 | unsigned char ch; |
56 | unsigned char ch; |
57 | unsigned short _upper_cx; |
57 | unsigned short _upper_cx; |
58 | unsigned char al; |
58 | unsigned char al; |
59 | unsigned char ah; |
59 | unsigned char ah; |
60 | unsigned short _upper_ax; |
60 | unsigned short _upper_ax; |
61 | unsigned short flags; |
61 | unsigned short flags; |
62 | }; |
62 | }; |
63 | 63 | ||
64 | union REGS { |
64 | union REGS { |
65 | struct DWORDREGS d; |
65 | struct DWORDREGS d; |
66 | #ifdef _NAIVE_DOS_REGS |
66 | #ifdef _NAIVE_DOS_REGS |
67 | struct WORDREGS x; |
67 | struct WORDREGS x; |
68 | #else |
68 | #else |
69 | #ifdef _BORLAND_DOS_REGS |
69 | #ifdef _BORLAND_DOS_REGS |
70 | struct DWORDREGS x; |
70 | struct DWORDREGS x; |
71 | #else |
71 | #else |
72 | struct DWORDREGS_W x; |
72 | struct DWORDREGS_W x; |
73 | #endif |
73 | #endif |
74 | #endif |
74 | #endif |
75 | struct WORDREGS w; |
75 | struct WORDREGS w; |
76 | struct BYTEREGS h; |
76 | struct BYTEREGS h; |
77 | }; |
77 | }; |
78 | 78 | ||
79 | 79 | ||
80 | long getfilelen(int); |
80 | long getfilelen(int); |
81 | 81 | ||
82 | #ifndef _WIN32_ |
82 | #ifndef _WIN32_ |
83 | #define CP_ACP 0 |
83 | #define CP_ACP 0 |
84 | #define MB_PRECOMPOSED 1 |
84 | #define MB_PRECOMPOSED 1 |
85 | #define OemToChar OemToCharA |
85 | #define OemToChar OemToCharA |
86 | #define CharToOem CharToOemA |
86 | #define CharToOem CharToOemA |
87 | 87 | ||
88 | 88 | ||
89 | bool OemToCharA(char*, char*); |
89 | bool OemToCharA(char*, char*); |
90 | bool CharToOemA(char*, char*); |
90 | bool CharToOemA(char*, char*); |
91 | int MultiByteToWideChar(unsigned int,unsigned int,char*,int,wchar_t *,int); |
91 | int MultiByteToWideChar(unsigned int,unsigned int,char*,int,wchar_t *,int); |
92 | - | ||
93 | #else |
- | |
94 | - | ||
95 | int stricmp(const char*, const char*); |
- | |
96 | int strnicmp(const char*, const char*, int); |
- | |
97 | 92 | ||
98 | #endif |
93 | #endif |
99 | 94 | ||
100 | char* strupr(char* s); |
95 | char* strupr(char* s); |
101 | char* strlwr(char* s); |
96 | char* strlwr(char* s); |
- | 97 | int stricmp(const char*, const char*); |
|
- | 98 | int strnicmp(const char*, const char*, int); |
|
102 | 99 | ||
103 | #ifdef _PORT_CPP_ |
100 | #ifdef _PORT_CPP_ |
104 | 101 | ||
105 | long lseek (int, long, int); |
102 | long lseek (int, long, int); |
106 | char tolower(char c); |
103 | char tolower(char c); |
107 | char toupper(char c); |
104 | char toupper(char c); |
108 | 105 | ||
109 | char * getcwd (char *buffer, int size); |
106 | char * getcwd (char *buffer, int size); |
110 | int stat (const char*, struct _stat*); |
107 | int stat (const char*, struct _stat*); |
111 | 108 | ||
112 | void exit(int); |
109 | void exit(int); |
113 | 110 | ||
114 | void* malloc(int); |
111 | void* malloc(int); |
115 | #endif //_PORT_CPP_ |
112 | #endif //_PORT_CPP_ |
116 | 113 | ||
117 | #ifdef __cplusplus |
114 | #ifdef __cplusplus |
118 | } |
115 | } |
119 | #endif |
116 | #endif |
120 | 117 | ||
121 | 118 | ||
122 | #endif // ___PORT_H___ |
119 | #endif // ___PORT_H___ |