1 #ifndef _DISK_H_ 2 #define _DISK_H_ 1 3 #if defined(__cplusplus) 4 extern "C" { 5 #endif 6 7 8 AUTOLIB(disk) 9 10 #if 0 11 /* SCSI interface */ 12 typedef struct Scsi Scsi; 13 struct Scsi { 14 QLock lk; 15 char* inquire; 16 int rawfd; 17 int nchange; 18 ulong changetime; 19 }; 20 21 enum { 22 Sread = 0, 23 Swrite, 24 Snone, 25 }; 26 27 char* scsierror(int, int); 28 int scsicmd(Scsi*, uchar*, int, void*, int, int); 29 int scsi(Scsi*, uchar*, int, void*, int, int); 30 Scsi* openscsi(char*); 31 int scsiready(Scsi*); 32 33 extern int scsiverbose; 34 #endif 35 36 /* disk partition interface */ 37 typedef struct Disk Disk; 38 struct Disk { 39 char *prefix; 40 char *part; 41 int fd; 42 int wfd; 43 int ctlfd; 44 int rdonly; 45 int type; 46 47 vlong secs; 48 vlong secsize; 49 vlong size; 50 vlong offset; /* within larger disk, perhaps */ 51 int width; /* of disk size in bytes as decimal string */ 52 int c; 53 int h; 54 int s; 55 int chssrc; 56 }; 57 58 Disk* opendisk(char*, int, int); 59 60 enum { 61 Tfile = 0, 62 Tsd, 63 Tfloppy, 64 65 Gpart = 0, /* partition info source */ 66 Gdisk, 67 Gguess 68 }; 69 70 /* proto file parsing */ 71 typedef void Protoenum(char *new, char *old, Dir *d, void *a); 72 typedef void Protowarn(char *msg, void *a); 73 int rdproto(char*, char*, Protoenum*, Protowarn*, void*); 74 75 #if defined(__cplusplus) 76 } 77 #endif 78 #endif 79