-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
device.h
44 lines (37 loc) · 1.28 KB
/
device.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
#ifndef DEVICE_H
#define DEVICE_H
#include "ff.h"
#ifdef _WIN32
/* The type of device the file system is on: */
#define CPMDRV_FILE 0 /* Regular file or Unix block device */
#define CPMDRV_WIN95 1 /* Windows 95 floppy drive accessed via VWIN32 */
#define CPMDRV_WINNT 2 /* Windows NT floppy drive accessed via CreateFile */
#endif
struct Device
{
int opened;
int secLength;
int tracks;
int sectrk;
off_t offset;
#if HAVE_LIBDSK_H
DSK_PDRIVER dev;
DSK_GEOMETRY geom;
#endif
#if HAVE_WINDOWS_H
int drvtype;
HANDLE hdisk;
#endif
// FIL fd;
};
extern FIL fild ;
void Device_f_sync(void);
const char *Device_share_open(struct Device *self, const char *deviceOpts);
const char *Device_f_open(struct Device *self, const char *filename, int mode, const char *deviceOpts);
const char *Device_open(struct Device *self, const char *filename, int mode, const char *deviceOpts);
const char *Device_setGeometry(struct Device *self, int secLength, int sectrk, int tracks, off_t offset, const char *libdskGeometry);
const char *Device_close(struct Device *self);
const char *Device_f_close(struct Device *self);
const char *Device_readSector(struct Device *self, int track, int sector, char *buf);
const char *Device_writeSector(struct Device *self, int track, int sector, const char *buf);
#endif