home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / disk-man / mtools-3.000 / mtools-3 / mtools-3.0 / fsP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-03  |  977 b   |  49 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. #define NEEDED_FAT_SIZE(x) ((((x)->num_clus+2) * ((x)->fat_bits/4) -1 )/ 2 / (x)->sector_size + 1)
  9.  
  10. typedef struct Fs_t {
  11.     Class_t *Class;
  12.     int refs;
  13.     Stream_t *Next;
  14.     Stream_t *Buffer;
  15.     
  16.     int serialized;
  17.     unsigned long serial_number;
  18.     int cluster_size;
  19.     unsigned int sector_size;
  20.     int fat_error;
  21.  
  22.  
  23.     unsigned int (*fat_decode)(struct Fs_t *This, unsigned int num);
  24.     int (*fat_encode)(struct Fs_t *This, unsigned int num,
  25.               unsigned int code);
  26.  
  27.     Stream_t *Direct;
  28.     int fat_dirty;
  29.     int fat_start;
  30.     int fat_len;
  31.  
  32.     int num_fat;
  33.     int end_fat;
  34.     int last_fat;
  35.     int fat_bits;
  36.     unsigned char *fat_buf;
  37.  
  38.     int dir_start;
  39.     int dir_len;
  40.     int num_clus;
  41.     char drive; /* for error messages */
  42. } Fs_t;
  43.  
  44. unsigned int get_next_free_cluster(Fs_t *Fs, unsigned int last);
  45. int fat_read(Fs_t *This, struct bootsector *boot, int fat_bits);
  46. void fat_write(Fs_t *This);
  47. extern Class_t FsClass;
  48. #endif
  49.