+/* Please note: All functions in this file will set _oserror *and* return its
+** value. The only exception is dio_open, which will return NULL, but _oserror
+** will be set. All function will also set _oserror in case of successful
+** execution, effectively clearing it.
+*/
+
+
+
+/*****************************************************************************/
+/* Data */
+/*****************************************************************************/
+
+
+
+typedef struct __dhandle_t *dhandle_t;
+
+typedef struct {
+ unsigned char head;
+ unsigned track;
+ unsigned sector;
+} dio_phys_pos;
+
+
+
+/*****************************************************************************/
+/* Code */
+/*****************************************************************************/
+
+
+
+unsigned __fastcall__ dio_query_sectsize (dhandle_t handle);
+/* returns sector size */
+
+unsigned __fastcall__ dio_query_sectcount (dhandle_t handle);
+/* returns sector count */
+
+dhandle_t __fastcall__ dio_open (unsigned char device);
+/* open device for subsequent dio access */
+
+unsigned char __fastcall__ dio_close (dhandle_t handle);
+/* close device, returns oserror (0 for success) */
+
+unsigned char __fastcall__ dio_read (dhandle_t handle,
+ unsigned sect_num,
+ void *buffer);
+/* read sector <sect_num> from device <handle> to memory at <buffer> */
+/* the number of bytes transferred depends on the sector size */
+/* returns oserror (0 for success) */
+
+unsigned char __fastcall__ dio_write (dhandle_t handle,
+ unsigned sect_num,
+ const void *buffer);
+/* write memory at <buffer> to sector <sect_num> on device <handle>, no verify */
+/* the number of bytes transferred depends on the sector size */
+/* returns oserror (0 for success) */