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