10 /* CP/M file attributes */
15 /* F5-F8 are banned in CP/M 2 & 3, F7 is used by ZSDOS */
16 #define CPM_ATTR_RO 256 /* Read-only */
17 #define CPM_ATTR_SYS 512 /* System */
18 #define CPM_ATTR_ARCV 1024 /* Archive */
19 #define CPM_ATTR_PWDEL 2048 /* Password required to delete */
20 #define CPM_ATTR_PWWRITE 4096 /* Password required to write */
21 #define CPM_ATTR_PWREAD 8192 /* Password required to read */
23 typedef int cpm_attr_t;
34 struct cpmSuperBlock *sb;
49 char name[2+8+1+3+1]; /* 00foobarxy.zzy\0 */
62 /* Note: CPMFS_HI_USER should be split for systems with user numbers
63 * up to 31 and CP/M 3, which uses them, but for password entries and
66 #define CPMFS_HI_USER (0x1<<0) /* has user numbers up to 31 */
67 #define CPMFS_CPM3_DATES (0x1<<1) /* has CP/M+ style time stamps */
68 #define CPMFS_CPM3_OTHER (0x1<<2) /* has passwords and disc label */
69 #define CPMFS_DS_DATES (0x1<<3) /* has datestamper timestamps */
70 #define CPMFS_EXACT_SIZE (0x1<<4) /* has reverse exact file size */
72 #define CPMFS_DR22 (CPMFS_HI_USER)
73 #define CPMFS_P2DOS (CPMFS_CPM3_DATES|CPMFS_HI_USER)
74 #define CPMFS_DR3 (CPMFS_CPM3_DATES|CPMFS_CPM3_OTHER|CPMFS_HI_USER)
75 #define CPMFS_ISX (CPMFS_EXACT_SIZE)
76 #define CPMFS_ZSYS (CPMFS_HI_USER)
89 struct dsEntry create;
90 struct dsEntry access;
91 struct dsEntry modify;
112 int extents; /* logical extents per physical extent */
114 char libdskGeometry[256];
116 struct PhysDirectoryEntry *dir;
124 struct cpmInode *root;
142 extern char const cmd[];
143 extern char const *boo;
145 int match(char const *a, char const *pattern);
146 void cpmglob(int opti, int argc, char * const argv[], struct cpmInode *root, int *gargc, char ***gargv);
147 void cpmglobfree(char **dirent, int entries);
149 int cpmReadSuper(struct cpmSuperBlock *drive, struct cpmInode *root, const char *format, int uppercase);
150 int cpmNamei(const struct cpmInode *dir, const char *filename, struct cpmInode *i);
151 void cpmStatFS(const struct cpmInode *ino, struct cpmStatFS *buf);
152 int cpmUnlink(const struct cpmInode *dir, const char *fname);
153 int cpmRename(const struct cpmInode *dir, const char *old, const char *newname);
154 int cpmOpendir(struct cpmInode *dir, struct cpmFile *dirp);
155 int cpmReaddir(struct cpmFile *dir, struct cpmDirent *ent);
156 void cpmStat(const struct cpmInode *ino, struct cpmStat *buf);
157 int cpmAttrGet(struct cpmInode *ino, cpm_attr_t *attrib);
158 int cpmAttrSet(struct cpmInode *ino, cpm_attr_t attrib);
159 int cpmChmod(struct cpmInode *ino, mode_t mode);
160 int cpmOpen(struct cpmInode *ino, struct cpmFile *file, mode_t mode);
161 ssize_t cpmRead(struct cpmFile *file, char *buf, size_t count);
162 ssize_t cpmWrite(struct cpmFile *file, const char *buf, size_t count);
163 int cpmClose(struct cpmFile *file);
164 int cpmCreat(struct cpmInode *dir, const char *fname, struct cpmInode *ino, mode_t mode);
165 void cpmUtime(struct cpmInode *ino, struct utimbuf *times);
166 int cpmSync(struct cpmSuperBlock *sb);
167 int cpmUmount(struct cpmSuperBlock *sb);
168 int cpmCheckDs(struct cpmSuperBlock *sb);