fs.h 653 B

123456789101112131415161718192021222324252627282930313233343536
  1. typedef struct File File;
  2. typedef struct Fs Fs;
  3. #include "dosfs.h"
  4. #include "kfs.h"
  5. struct File{
  6. union{
  7. Dosfile dos;
  8. Kfsfile kfs;
  9. int walked;
  10. };
  11. Fs *fs;
  12. char *path;
  13. };
  14. struct Fs{
  15. union {
  16. Dos dos;
  17. Kfs kfs;
  18. };
  19. int dev; /* device id */
  20. long (*diskread)(Fs*, void*, long); /* disk read routine */
  21. vlong (*diskseek)(Fs*, vlong); /* disk seek routine */
  22. long (*read)(File*, void*, long);
  23. int (*walk)(File*, char*);
  24. File root;
  25. };
  26. extern int chatty;
  27. extern int dotini(Fs*);
  28. extern int fswalk(Fs*, char*, File*);
  29. extern int fsread(File*, void*, long);
  30. extern int fsboot(Fs*, char*, Boot*);
  31. #define BADPTR(x) ((ulong)x < 0x80000000)