X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=cpmfs.h;h=2f519a1c628205d7aa10226f6e0944a85f7261d1;hb=edf600144998d1a1e09898548938cc11b95c10bc;hp=2393bc9903ff1be7b50517c6faa3e8b6b523b017;hpb=32087c67d53a8f8058b359388f23e2dbc9436d54;p=debian%2Fcpmtools diff --git a/cpmfs.h b/cpmfs.h index 2393bc9..2f519a1 100644 --- a/cpmfs.h +++ b/cpmfs.h @@ -3,6 +3,7 @@ #include #include +#include #ifdef _WIN32 #include @@ -99,9 +100,34 @@ struct cpmStat time_t ctime; }; +#define CPMFS_HI_USER (0x1<<0) /* has user numbers up to 31 */ +#define CPMFS_CPM3_DATES (0x1<<1) /* has CP/M+ style time stamps */ +#define CPMFS_CPM3_OTHER (0x1<<2) /* has passwords and disc label */ +#define CPMFS_DS_DATES (0x1<<3) /* has datestamper timestamps */ +#define CPMFS_EXACT_SIZE (0x1<<4) /* has exact file size */ + #define CPMFS_DR22 0 -#define CPMFS_P2DOS 1 -#define CPMFS_DR3 2 +#define CPMFS_P2DOS (CPMFS_CPM3_DATES|CPMFS_HI_USER) +#define CPMFS_DR3 (CPMFS_CPM3_DATES|CPMFS_CPM3_OTHER|CPMFS_HI_USER) +#define CPMFS_ISX (CPMFS_EXACT_SIZE) +#define CPMFS_ZSYS (CPMFS_HI_USER) + +struct dsEntry +{ + char year; + char month; + char day; + char hour; + char minute; +}; + +struct dsDate +{ + struct dsEntry create; + struct dsEntry access; + struct dsEntry modify; + char checksum; +}; struct cpmSuperBlock { @@ -114,7 +140,8 @@ struct cpmSuperBlock int maxdir; int skew; int boottrk; - int type; + off_t offset; + unsigned int type; int size; int extents; /* logical extents per physical extent */ struct PhysDirectoryEntry *dir; @@ -127,6 +154,9 @@ struct cpmSuperBlock char *passwd; size_t passwdLength; struct cpmInode *root; + int dirtyDirectory; + struct dsDate *ds; + int dirtyDs; }; struct cpmStatFS @@ -163,8 +193,10 @@ int cpmRead(struct cpmFile *file, char *buf, int count); int cpmWrite(struct cpmFile *file, const char *buf, int count); int cpmClose(struct cpmFile *file); int cpmCreat(struct cpmInode *dir, const char *fname, struct cpmInode *ino, mode_t mode); +void cpmUtime(struct cpmInode *ino, struct utimbuf *times); int cpmSync(struct cpmSuperBlock *sb); void cpmUmount(struct cpmSuperBlock *sb); +int cpmCheckDs(struct cpmSuperBlock *sb); #ifdef __cplusplus }