11 #define FILE_ATTRIBUTE_READONLY 0x1
12 #define FILE_ATTRIBUTE_HIDDEN 0x2
13 #define FILE_ATTRIBUTE_SYSTEM 0x4
14 #define FILE_ATTRIBUTE_DIRECTORY 0x10
15 #define FILE_ATTRIBUTE_ARCHIVE 0x20
16 #define FILE_ATTRIBUTE_NORMAL 0x80
24 #define LGOP_INVERT_OR 6
25 #define LGOP_INVERT_AND 7
26 #define LGOP_INVERT_XOR 8
28 #define LGOP_SUBTRACT 10
29 #define LGOP_MULTIPLY 11
31 #define getred(pgc) (((pgc)>>16)&0xFF)
32 #define getgreen(pgc) (((pgc)>>8)&0xFF)
33 #define getblue(pgc) ((pgc)&0xFF)
34 #define mkcolor(r,g,b) (((r)<<16)|((g)<<8)|(b))
36 typedef struct ThreadState
40 unsigned long MsbTime
;
41 unsigned long LsbTime
;
50 #if (sizeof(int) == 2)
55 short int __stdcall
RdosSwapShort(short int val
);
56 long __stdcall
RdosSwapLong(long val
);
58 void __stdcall
RdosSetTextMode();
59 int __stdcall
RdosSetVideoMode(int *BitsPerPixel
, int *xres
, int *yres
, int *linesize
, void **buffer
);
60 void __stdcall
RdosSetClipRect(int handle
, int xmin
, int ymin
, int xmax
, int ymax
);
61 void __stdcall
RdosClearClipRect(int handle
);
62 void __stdcall
RdosSetDrawColor(int handle
, int color
);
63 void __stdcall
RdosSetLGOP(int handle
, int lgop
);
64 void __stdcall
RdosSetHollowStyle(int handle
);
65 void __stdcall
RdosSetFilledStyle(int handle
);
66 int __stdcall
RdosOpenFont(int height
);
67 void __stdcall
RdosCloseFont(int font
);
68 void __stdcall
RdosGetStringMetrics(int font
, const char *str
, int *width
, int *height
);
69 void __stdcall
RdosSetFont(int handle
, int font
);
70 int __stdcall
RdosGetPixel(int handle
, int x
, int y
);
71 void __stdcall
RdosSetPixel(int handle
, int x
, int y
);
72 void __stdcall
RdosBlit(int SrcHandle
, int DestHandle
, int width
, int height
,
73 int SrcX
, int SrcY
, int DestX
, int DestY
);
74 void __stdcall
RdosDrawMask(int handle
, void *mask
, int RowSize
, int width
, int height
,
75 int SrcX
, int SrcY
, int DestX
, int DestY
);
76 void __stdcall
RdosDrawLine(int handle
, int x1
, int y1
, int x2
, int y2
);
77 void __stdcall
RdosDrawString(int handle
, int x
, int y
, const char *str
);
78 void __stdcall
RdosDrawRect(int handle
, int x
, int y
, int width
, int height
);
79 void __stdcall
RdosDrawEllipse(int handle
, int x
, int y
, int width
, int height
);
80 int __stdcall
RdosCreateBitmap(int BitsPerPixel
, int width
, int height
);
81 int __stdcall
RdosDuplicateBitmapHandle(int handle
);
82 void __stdcall
RdosCloseBitmap(int handle
);
83 int __stdcall
RdosCreateStringBitmap(int font
, const char *str
);
84 void __stdcall
RdosGetBitmapInfo(int handle
, int *BitPerPixel
, int *width
, int *height
,
85 int *linesize
, void **buffer
);
87 int __stdcall
RdosCreateSprite(int DestHandle
, int BitmapHandle
, int MaskHandle
, int lgop
);
88 void __stdcall
RdosCloseSprite(int handle
);
89 void __stdcall
RdosShowSprite(int handle
);
90 void __stdcall
RdosHideSprite(int handle
);
91 void __stdcall
RdosMoveSprite(int handle
, int x
, int y
);
93 void __stdcall
RdosSetForeColor(int color
);
94 void __stdcall
RdosSetBackColor(int color
);
95 int __stdcall
RdosGetMemSize(void *ptr
);
96 void *__stdcall
RdosAllocateMem(int Size
);
97 void __stdcall
RdosFreeMem(void *ptr
);
98 int __stdcall
RdosAppDebug();
100 int __stdcall
RdosOpenCom(int ID
, long BaudRate
, char Parity
, char DataBits
, char StopBits
, int SendBufSize
, int RecBufSize
);
101 void __stdcall
RdosCloseCom(int Handle
);
102 void __stdcall
RdosFlushCom(int Handle
);
103 char __stdcall
RdosReadCom(int Handle
);
104 int __stdcall
RdosWriteCom(int Handle
, char Val
);
105 void __stdcall
RdosEnableCts(int Handle
);
106 void __stdcall
RdosDisableCts(int Handle
);
107 void __stdcall
RdosEnableAutoRts(int Handle
);
108 void __stdcall
RdosDisableAutoRts(int Handle
);
109 void __stdcall
RdosSetDtr(int Handle
);
110 void __stdcall
RdosResetDtr(int Handle
);
111 void __stdcall
RdosSetRts(int Handle
);
112 void __stdcall
RdosResetRts(int Handle
);
113 int __stdcall
RdosGetReceiveBufferSpace(int Handle
);
114 int __stdcall
RdosGetSendBufferSpace(int Handle
);
115 void __stdcall
RdosWaitForSendCompletedCom(int Handle
);
117 int __stdcall
RdosOpenFile(const char *FileName
, char Access
);
118 int __stdcall
RdosCreateFile(const char *FileName
, int Attrib
);
119 void __stdcall
RdosCloseFile(int Handle
);
120 int __stdcall
RdosIsDevice(int Handle
);
121 int __stdcall
RdosDuplFile(int Handle
);
122 long __stdcall
RdosGetFileSize(int Handle
);
123 void __stdcall
RdosSetFileSize(int Handle
, long Size
);
124 long __stdcall
RdosGetFilePos(int Handle
);
125 void __stdcall
RdosSetFilePos(int Handle
, long Pos
);
126 int __stdcall
RdosReadFile(int Handle
, void *Buf
, int Size
);
127 int __stdcall
RdosWriteFile(int Handle
, const void *Buf
, int Size
);
128 void __stdcall
RdosGetFileTime(int Handle
, unsigned long *MsbTime
, unsigned long *LsbTime
);
129 void __stdcall
RdosSetFileTime(int Handle
, unsigned long MsbTime
, unsigned long LsbTime
);
131 int __stdcall
RdosCreateMapping(int Size
);
132 int __stdcall
RdosCreateNamedMapping(const char *Name
, int Size
);
133 int __stdcall
RdosCreateNamedFileMapping(const char *Name
, int Size
, int FileHandle
);
134 int __stdcall
RdosOpenNamedMapping(const char *Name
);
135 void __stdcall
RdosSyncMapping(int Handle
);
136 void __stdcall
RdosCloseMapping(int Handle
);
137 void __stdcall
RdosMapView(int Handle
, int Offset
, void *Base
, int Size
);
138 void __stdcall
RdosUnmapView(int Handle
);
140 int __stdcall
RdosSetCurDrive(int Drive
);
141 int __stdcall
RdosGetCurDrive();
142 int __stdcall
RdosSetCurDir(const char *PathName
);
143 int __stdcall
RdosGetCurDir(int Drive
, char *PathName
);
144 int __stdcall
RdosMakeDir(const char *PathName
);
145 int __stdcall
RdosRemoveDir(const char *PathName
);
146 int __stdcall
RdosRenameFile(const char *ToName
, const char *FromName
);
147 int __stdcall
RdosDeleteFile(const char *PathName
);
148 int __stdcall
RdosGetFileAttribute(const char *PathName
, int *Attribute
);
149 int __stdcall
RdosSetFileAttribute(const char *PathName
, int Attribute
);
150 int __stdcall
RdosOpenDir(const char *PathName
);
151 void __stdcall
RdosCloseDir(int Handle
);
152 int __stdcall
RdosReadDir(int Handle
, int EntryNr
, int MaxNameSize
, char *PathName
, long *FileSize
, int *Attribute
, unsigned long *MsbTime
, unsigned long *LsbTime
);
154 int __stdcall
RdosGetThreadState(int ThreadNr
, ThreadState
*State
);
155 int __stdcall
RdosSuspendThread(int ThreadNr
);
157 void __stdcall
RdosCpuReset();
158 void __stdcall
RdosGetVersion(int *Major
, int *Minor
, int *Release
);
159 void __stdcall
RdosCreateThread(void (*Start
)(void *Param
), const char *Name
, void *Param
, int StackSize
);
160 void __stdcall
RdosTerminateThread();
161 int __stdcall
RdosGetThreadHandle();
162 int __stdcall
RdosExec(const char *prog
, const char *param
);
163 int __stdcall
RdosSpawn(const char *prog
, const char *param
, const char *startdir
);
164 void __stdcall
RdosWaitMilli(int ms
);
165 void __stdcall
RdosGetTics(unsigned long *msb
, unsigned long *lsb
);
166 void __stdcall
RdosTicsToRecord(unsigned long msb
, unsigned long lsb
, int *year
, int *month
, int *day
, int *hour
, int *min
, int *sec
, int *milli
);
167 void __stdcall
RdosRecordToTics(unsigned long *msb
, unsigned long *lsb
, int year
, int month
, int day
, int hour
, int min
, int sec
, int milli
);
168 int __stdcall
RdosDayOfWeek(int year
, int month
, int day
);
169 void __stdcall
RdosGetSysTime(int *year
, int *month
, int *day
, int *hour
, int *min
, int *sec
, int *milli
);
170 void __stdcall
RdosGetTime(int *year
, int *month
, int *day
, int *hour
, int *min
, int *sec
, int *milli
);
171 void __stdcall
RdosSetTime(int year
, int month
, int day
, int hour
, int min
, int sec
, int milli
);
172 void __stdcall
RdosAddTics(unsigned long *msb
, unsigned long *lsb
, long tics
);
173 void __stdcall
RdosAddMilli(unsigned long *msb
, unsigned long *lsb
, long ms
);
174 void __stdcall
RdosAddSec(unsigned long *msb
, unsigned long *lsb
, long sec
);
175 void __stdcall
RdosAddMin(unsigned long *msb
, unsigned long *lsb
, long min
);
176 void __stdcall
RdosAddHour(unsigned long *msb
, unsigned long *lsb
, long hour
);
177 void __stdcall
RdosAddDay(unsigned long *msb
, unsigned long *lsb
, long day
);
178 int __stdcall
RdosSyncTime(long IP
);
180 void __stdcall
RdosDecodeMsbTics(unsigned long msb
, int *days
, int *hours
);
181 void __stdcall
RdosDecodeLsbTics(unsigned long lsb
, int *min
, int *sec
, int *milli
, int *micro
);
183 int __stdcall
RdosCreateSection();
184 void __stdcall
RdosDeleteSection(int Handle
);
185 void __stdcall
RdosEnterSection(int Handle
);
186 void __stdcall
RdosLeaveSection(int Handle
);
188 int __stdcall
RdosCreateWait();
189 void __stdcall
RdosCloseWait(int Handle
);
190 void * __stdcall
RdosCheckWait(int Handle
);
191 void * __stdcall
RdosWaitForever(int Handle
);
192 void * __stdcall
RdosWaitTimeout(int Handle
, int MillSec
);
193 void __stdcall
RdosStopWait(int Handle
);
194 void __stdcall
RdosRemoveWait(int Handle
, void *ID
);
195 void __stdcall
RdosAddWaitForKeyboard(int Handle
, void *ID
);
196 void __stdcall
RdosAddWaitForMouse(int Handle
, void *ID
);
197 void __stdcall
RdosAddWaitForCom(int Handle
, int ComHandle
, void *ID
);
198 void __stdcall
RdosAddWaitForAdc(int Handle
, int AdcHandle
, void *ID
);
200 int __stdcall
RdosCreateSignal();
201 void __stdcall
RdosResetSignal(int Handle
);
202 int __stdcall
RdosIsSignalled(int Handle
);
203 void __stdcall
RdosSetSignal(int Handle
);
204 void __stdcall
RdosFreeSignal(int Handle
);
205 void __stdcall
RdosAddWaitForSignal(int Handle
, int SignalHandle
, void *ID
);
207 long __stdcall
RdosGetIp();
208 int __stdcall
RdosNameToIp(const char *HostName
);
209 int __stdcall
RdosIpToName(int Ip
, char *HostName
, int MaxSize
);
211 int __stdcall
RdosCreateTcpListen(int Port
, int MaxConnections
, int BufferSize
);
212 int __stdcall
RdosGetTcpListen(int Handle
);
213 void __stdcall
RdosCloseTcpListen(int Handle
);
214 void __stdcall
RdosAddWaitForTcpListen(int Handle
, int ConHandle
, void *ID
);
216 int __stdcall
RdosOpenTcpConnection(int RemoteIp
, int LocalPort
, int RemotePort
, int Timeout
, int BufferSize
);
217 int __stdcall
RdosWaitForTcpConnection(int Handle
, long Timeout
);
218 void __stdcall
RdosAddWaitForTcpConnection(int Handle
, int ConHandle
, void *ID
);
219 void __stdcall
RdosCloseTcpConnection(int Handle
);
220 void __stdcall
RdosDeleteTcpConnection(int Handle
);
221 void __stdcall
RdosAbortTcpConnection(int Handle
);
222 void __stdcall
RdosPushTcpConnection(int Handle
);
223 int __stdcall
RdosIsTcpConnectionClosed(int Handle
);
224 long __stdcall
RdosGetRemoteTcpConnectionIP(int Handle
);
225 int __stdcall
RdosGetRemoteTcpConnectionPort(int Handle
);
226 int __stdcall
RdosGetLocalTcpConnectionPort(int Handle
);
227 int __stdcall
RdosReadTcpConnection(int Handle
, void *Buf
, int Size
);
228 int __stdcall
RdosWriteTcpConnection(int Handle
, const void *Buf
, int Size
);
229 int __stdcall
RdosPollTcpConnection(int Handle
);
231 int __stdcall
RdosGetLocalMailslot(const char *Name
);
232 int __stdcall
RdosGetRemoteMailslot(long Ip
, const char *Name
);
233 void __stdcall
RdosFreeMailslot(int Handle
);
234 int __stdcall
RdosSendMailslot(int Handle
, const void *Msg
, int Size
, void *ReplyBuf
, int MaxReplySize
);
236 void __stdcall
RdosDefineMailslot(const char *Name
, int MaxSize
);
237 int __stdcall
RdosReceiveMailslot(void *Msg
);
238 void __stdcall
RdosReplyMailslot(const void *Msg
, int Size
);
240 void __stdcall
RdosSetFocus(char FocusKey
);
241 char __stdcall
RdosGetFocus();
243 void __stdcall
RdosClearKeyboard();
244 int __stdcall
RdosPollKeyboard();
245 int __stdcall
RdosReadKeyboard();
246 int __stdcall
RdosGetKeyboardState();
247 int __stdcall
RdosPutKeyboard(int KeyCode
, int VirtualKey
, int ScanCode
);
248 int __stdcall
RdosPeekKeyEvent(int *ExtKey
, int *KeyState
, int *VirtualKey
, int *ScanCode
);
249 int __stdcall
RdosReadKeyEvent(int *ExtKey
, int *KeyState
, int *VirtualKey
, int *ScanCode
);
251 void __stdcall
RdosHideMouse();
252 void __stdcall
RdosShowMouse();
253 void __stdcall
RdosGetMousePosition(int *x
, int *y
);
254 void __stdcall
RdosSetMousePosition(int x
, int y
);
255 void __stdcall
RdosSetMouseWindow(int StartX
, int StartY
, int EndX
, int EndY
);
256 void __stdcall
RdosSetMouseMickey(int x
, int y
);
257 int __stdcall
RdosGetLeftButton();
258 int __stdcall
RdosGetRightButton();
259 void __stdcall
RdosGetLeftButtonPressPosition(int *x
, int *y
);
260 void __stdcall
RdosGetRightButtonPressPosition(int *x
, int *y
);
261 void __stdcall
RdosGetLeftButtonReleasePosition(int *x
, int *y
);
262 void __stdcall
RdosGetRightButtonReleasePosition(int *x
, int *y
);
264 void __stdcall
RdosGetCursorPosition(int *Row
, int *Col
);
265 void __stdcall
RdosSetCursorPosition(int Row
, int Col
);
266 void __stdcall
RdosWriteChar(char ch
);
267 void __stdcall
RdosWriteSizeString(const char *Buf
, int Size
);
268 void __stdcall
RdosWriteString(const char *Buf
);
269 int __stdcall
RdosReadLine(char *Buf
, int MaxSize
);
271 int __stdcall
RdosPing(long Node
, long Timeout
);
273 int __stdcall
RdosGetIdeDisc(int UnitNr
);
274 int __stdcall
RdosGetFloppyDisc(int UnitNr
);
276 int __stdcall
RdosSetDiscInfo(int DiscNr
, int SectorSize
, long Sectors
, int BiosSectorsPerCyl
, int BiosHeads
);
277 int __stdcall
RdosGetDiscInfo(int DiscNr
, int *SectorSize
, long *Sectors
, int *BiosSectorsPerCyl
, int *BiosHeads
);
278 int __stdcall
RdosReadDisc(int DiscNr
, long Sector
, char *Buf
, int Size
);
279 int __stdcall
RdosWriteDisc(int DiscNr
, long Sector
, const char *Buf
, int Size
);
281 void __stdcall
RdosGetRdfsInfo(void *CryptTab
, void *KeyTab
, void *ExtentSizeTab
);
282 void __stdcall
RdosDemandLoadDrive(int DriveNr
);
283 int __stdcall
RdosFormatDrive(int DiscNr
, long StartSector
, int Size
, const char *FsName
);
285 int __stdcall
RdosAllocateFixedDrive(int DriveNr
);
286 int __stdcall
RdosAllocateStaticDrive();
287 int __stdcall
RdosAllocateDynamicDrive();
289 int __stdcall
RdosGetDriveInfo(int DriveNr
, long *FreeUnits
, int *BytesPerUnit
, long *TotalUnits
);
290 int __stdcall
RdosGetDriveDiscParam(int DriveNr
, int *DiscNr
, long *StartSector
, long *TotalSectors
);
292 int __stdcall
RdosCreateFileDrive(int Drive
, long Size
, const char *FsName
, const char *FileName
);
293 int __stdcall
RdosOpenFileDrive(int Drive
, const char *FileName
);
295 int __stdcall
RdosGetModuleHandle();
296 const char * __stdcall
RdosGetExeName();
297 int __stdcall
RdosLoadDll(const char *Name
);
298 void __stdcall
RdosFreeDll(int handle
);
299 int __stdcall
RdosReadResource(int handle
, int ID
, char *Buf
, int Size
);
300 int __stdcall
RdosReadBinaryResource(int handle
, int ID
, char *Buf
, int Size
);
302 int __stdcall
RdosOpenAdc(int channel
);
303 void __stdcall
RdosCloseAdc(int handle
);
304 void __stdcall
RdosDefineAdcTime(int handle
, unsigned long msg
, unsigned long lsb
);
305 long __stdcall
RdosReadAdc(int handle
);
307 int __stdcall
RdosReadSerialLines(int device
, int *val
);
308 int __stdcall
RdosToggleSerialLine(int device
, int line
);
309 int __stdcall
RdosReadSerialVal(int device
, int line
, int *val
);
310 int __stdcall
RdosWriteSerialVal(int device
, int line
, int val
);
311 int __stdcall
RdosReadSerialRaw(int device
, int line
, int *val
);
312 int __stdcall
RdosWriteSerialRaw(int device
, int line
, int val
);
314 int __stdcall
RdosOpenSysEnv();
315 int __stdcall
RdosOpenProcessEnv();
316 void __stdcall
RdosCloseEnv(int handle
);
317 void __stdcall
RdosAddEnvVar(int handle
, const char *var
, const char *value
);
318 void __stdcall
RdosDeleteEnvVar(int handle
, const char *var
);
319 int __stdcall
RdosFindEnvVar(int handle
, const char *var
, char *value
);
320 void __stdcall
RdosGetEnvData(int handle
, char *buf
);
321 void __stdcall
RdosSetEnvData(int handle
, const char *buf
);
323 int __stdcall
RdosOpenSysIni();
324 void __stdcall
RdosCloseIni(int handle
);
325 int __stdcall
RdosGotoIniSection(int handle
, const char *name
);
326 int __stdcall
RdosRemoveIniSection(int handle
);
327 int __stdcall
RdosReadIni(int handle
, const char *var
, char *str
, int maxsize
);
328 int __stdcall
RdosWriteIni(int handle
, const char *var
, const char *str
);
329 int __stdcall
RdosDeleteIni(int handle
, const char *var
);
331 void __stdcall
RdosEnableStatusLED();
332 void __stdcall
RdosDisableStatusLED();
334 void __stdcall
RdosStartWatchdog(int timeout
);
335 void __stdcall
RdosKickWatchdog();