home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / CMDS / mtools_3.6.src.lzh / MTOOLS_3.6 / fsP.h < prev    next >
Text File  |  1997-11-12  |  1KB  |  68 lines

  1. #ifndef MTOOLS_FSP_H
  2. #define MTOOLS_FSP_H
  3.  
  4. #include "stream.h"
  5. #include "msdos.h"
  6. #include "fs.h"
  7.  
  8.  
  9. typedef struct FatMap_t {
  10.     unsigned char *data;
  11.     int dirty;
  12.     int valid;
  13. } FatMap_t;
  14.  
  15.  
  16. typedef struct Fs_t {
  17.     Class_t *Class;
  18.     int refs;
  19.     Stream_t *Next;
  20.     Stream_t *Buffer;
  21.     
  22.     int serialized;
  23.     unsigned long serial_number;
  24.     int cluster_size;
  25.     unsigned int sector_size;
  26.     int fat_error;
  27.  
  28.     unsigned int (*fat_decode)(struct Fs_t *This, unsigned int num);
  29.     int (*fat_encode)(struct Fs_t *This, unsigned int num,
  30.               unsigned int code);
  31.  
  32.     Stream_t *Direct;
  33.     int fat_dirty;
  34.     unsigned int fat_start;
  35.     unsigned int fat_len;
  36.  
  37.     int num_fat;
  38.     unsigned int end_fat;
  39.     unsigned int last_fat;
  40.     int fat_bits;
  41.     FatMap_t *FatMap;
  42.  
  43.     int dir_start;
  44.     int dir_len;
  45.     int clus_start;
  46.  
  47.     int num_clus;
  48.     char drive; /* for error messages */
  49.  
  50.     /* fat 32 */
  51.     unsigned int primaryFat;
  52.     unsigned int writeAllFats;
  53.     unsigned int rootCluster;
  54.     InfoSector_t *infoSector;
  55.     int infoSectorLoc;
  56. } Fs_t;
  57.  
  58. void set_fat12(Fs_t *Fs);
  59. void set_fat16(Fs_t *Fs);
  60. void set_fat32(Fs_t *Fs);
  61. unsigned int get_next_free_cluster(Fs_t *Fs, unsigned int last);
  62. int fat_read(Fs_t *This, struct bootsector *boot, int fat_bits,
  63.          unsigned int tot_sectors, int nodups);
  64. void fat_write(Fs_t *This);
  65. int zero_fat(Fs_t *Fs, int media_descriptor);
  66. extern Class_t FsClass;
  67. #endif
  68.