Subversion Repositories Kolibri OS

Rev

Rev 7700 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7700 Rev 7701
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*); //Leency
-
 
96
int strnicmp(const char*, const char*, int); //Leency
92
 
97
 
93
#endif
98
#endif
94
 
99
 
95
char* strupr(char* s);
100
char* strupr(char* s);
96
char* strlwr(char* s);
101
char* strlwr(char* s);
97
int stricmp(const char*, const char*);
102
//int stricmp(const char*, const char*); //Leency
98
int strnicmp(const char*, const char*, int);
103
//int strnicmp(const char*, const char*, int); //Leency
99
 
104
 
100
#ifdef _PORT_CPP_
105
#ifdef _PORT_CPP_
101
 
106
 
102
long lseek (int, long, int);
107
long lseek (int, long, int);
103
char tolower(char c);
108
char tolower(char c);
104
char toupper(char c);
109
char toupper(char c);
105
 
110
 
106
char * getcwd (char *buffer, int size);
111
char * getcwd (char *buffer, int size);
107
int 	stat (const char*, struct _stat*);
112
int 	stat (const char*, struct _stat*);
108
 
113
 
109
void exit(int);
114
void exit(int);
110
 
115
 
111
void* malloc(int); 
116
void* malloc(int); 
112
#endif //_PORT_CPP_
117
#endif //_PORT_CPP_
113
 
118
 
114
#ifdef __cplusplus
119
#ifdef __cplusplus
115
}
120
}
116
#endif
121
#endif
117
 
122
 
118
 
123
 
119
#endif  // ___PORT_H___
124
#endif  // ___PORT_H___