1
0

disk.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #pragma src "/sys/src/libdisk"
  2. #pragma lib "libdisk.a"
  3. #include <diskcmd.h>
  4. /* SCSI interface */
  5. typedef struct Scsi Scsi;
  6. struct Scsi {
  7. QLock;
  8. char* inquire;
  9. int rawfd;
  10. int nchange;
  11. ulong changetime;
  12. };
  13. enum {
  14. Sread = 0,
  15. Swrite,
  16. Snone,
  17. };
  18. char* scsierror(int, int);
  19. int scsicmd(Scsi*, uchar*, int, void*, int, int);
  20. int scsi(Scsi*, uchar*, int, void*, int, int);
  21. Scsi* openscsi(char*);
  22. void closescsi(Scsi*);
  23. int scsiready(Scsi*);
  24. extern int scsiverbose;
  25. /* disk partition interface */
  26. typedef struct Disk Disk;
  27. struct Disk {
  28. char *prefix;
  29. char *part;
  30. int fd;
  31. int wfd;
  32. int ctlfd;
  33. int rdonly;
  34. int type;
  35. vlong secs;
  36. vlong secsize;
  37. vlong size;
  38. vlong offset; /* within larger disk, perhaps */
  39. int width; /* of disk size in bytes as decimal string */
  40. int c;
  41. int h;
  42. int s;
  43. int chssrc;
  44. };
  45. Disk* opendisk(char*, int, int);
  46. enum {
  47. Tfile = 0,
  48. Tsd,
  49. Tfloppy,
  50. Gpart = 0, /* partition info source */
  51. Gdisk,
  52. Gguess,
  53. };
  54. /* proto file parsing */
  55. typedef void Protoenum(char *new, char *old, Dir *d, void *a);
  56. typedef void Protowarn(char *msg, void *a);
  57. int rdproto(char*, char*, Protoenum*, Protowarn*, void*);