home *** CD-ROM | disk | FTP | other *** search
- /*
- ** M S - D O S d i s k e t t e f i l e s y s t e m
- */
-
- /* Default (implicitly assumed) sector size */
- #define SECTORSIZE 512
-
- /*
- ** FAT entries are based at 2, since the first two entries in
- ** the FAT table are reserved for the ancient media descriptor byte
- */
- #define CLUSTER_TO_SECTOR(cluster) (((cluster)-2)*sectors_per_cluster + \
- file_area)
-
- /* Some basically stdio.h constants that we define just in case */
- #ifndef NULL
- #define NULL ((void *)0)
- #endif
- #ifndef EOF
- #define EOF (-1)
- #endif
-
- /* Debugger's aid macro */
- #ifdef DEBUG
- #define Db(x) x
- #else
- #define Db(x)
- #endif
-
- /* Directory data entry format */
- typedef struct {
- unsigned char filename[11],attribute;
- char reserved[10];
- unsigned int time,date;
- unsigned int cluster;
- unsigned long int filesize;
- } directory;
-
- #define ATTR_READONLY 0x01
- #define ATTR_HIDDEN 0x02
- #define ATTR_SYSTEM 0x04
- #define ATTR_VOLABEL 0x08
- #define ATTR_DIRECTORY 0x10
- #define ATTR_ARCHIVE 0x20
- #define ATTR_UNUSED1 0x40
- #define ATTR_UNUSED2 0x80
-
- #define ATTR_SPECIAL 0x1E
-
- /* Function call prototypes */
- void disk_open();
- directory *find_dir(char *filename);
-
- int file_open(directory *dir_item);
- int file_getc();
-
- directory *file_create(char *filename);
- int file_putc(directory *dir_item,int character);
- void file_close(directory *dir_item);
-
- void disk_clear(int disktype);
-