r26531@plastic: rob | 2007-05-19 23:49:19 +1000
[tangerine.git] / workbench / fs / fat / fat_protos.h
blob5e98c2a7304ad8b940efc2e8fe78c9e566144202
1 /*
2 * fat.handler - FAT12/16/32 filesystem handler
4 * Copyright © 2006 Marek Szyprowski
5 * Copyright © 2007 The AROS Development Team
7 * This program is free software; you can redistribute it and/or modify it
8 * under the same terms as AROS itself.
10 * $Id$
13 #ifndef FAT_HANDLER_PROTO_H
14 #define FAT_HANDLER_PROTO_H
16 /* fat */
17 LONG ReadFATSuper (struct FSSuper *s);
18 void FreeFATSuper(struct FSSuper *s);
19 LONG CompareFATSuper(struct FSSuper *s1, struct FSSuper *s2);
21 LONG GetVolumeInfo(struct FSSuper *sb, struct VolumeInfo *volume);
23 void CountFreeClusters(struct FSSuper *sb);
25 /* diskchange */
26 void ProcessDiskChange (void);
27 void DoDiskInsert();
28 void DoDiskRemove();
29 void SendVolumePacket(struct DosList *vol, ULONG action);
31 /* diskio */
32 LONG InitDiskHandler (struct FileSysStartupMsg *fssm, ULONG *ressigbit);
33 void CleanupDiskHandler(ULONG diskchgsig_bit);
35 /* info.c */
36 void FillDiskInfo (struct InfoData *id);
38 /* packet.c */
39 void ProcessPackets(void);
41 /* new definitions as we refactor the code */
43 /* direntry.c */
44 LONG InitDirHandle(struct FSSuper *sb, ULONG cluster, struct DirHandle *dh);
45 LONG ReleaseDirHandle(struct DirHandle *dh);
47 LONG GetDirEntry(struct DirHandle *dh, ULONG index, struct DirEntry *de);
48 LONG GetNextDirEntry(struct DirHandle *dh, struct DirEntry *de);
50 LONG GetDirEntryByName(struct DirHandle *dh, STRPTR name, ULONG namelen, struct DirEntry *de);
51 LONG GetDirEntryByPath(struct DirHandle *dh, STRPTR path, ULONG pathlen, struct DirEntry *de);
53 LONG GetParentDir(struct DirHandle *dh, struct DirEntry *de);
55 LONG UpdateDirEntry(struct DirEntry *de);
57 LONG CreateDirEntry(struct DirHandle *dh, STRPTR name, ULONG namelen, UBYTE attr, ULONG cluster, struct DirEntry *de);
58 LONG DeleteDirEntry(struct DirEntry *de);
60 LONG FillFIB(struct ExtFileLock *fl, struct FileInfoBlock *fib);
62 /* names.c */
63 LONG GetDirEntryShortName(struct DirEntry *de, STRPTR name, ULONG *len);
64 LONG GetDirEntryLongName(struct DirEntry *de, STRPTR name, ULONG *len);
65 LONG SetDirEntryName(struct DirEntry *de, STRPTR name, ULONG len);
66 ULONG NumLongNameEntries(STRPTR name, ULONG len);
68 /* fat.c */
69 void ConvertFATDate(UWORD date, UWORD time, struct DateStamp *ds);
70 void ConvertAROSDate(struct DateStamp ds, UWORD *date, UWORD *time);
71 LONG SetVolumeName(struct FSSuper *sb, UBYTE *name);
72 LONG FindFreeCluster(struct FSSuper *sb, ULONG *rcluster);
74 /* file.c */
75 LONG ReadFileChunk(struct IOHandle *ioh, ULONG file_pos, ULONG nwant, UBYTE *data, ULONG *nread);
76 LONG WriteFileChunk(struct IOHandle *ioh, ULONG file_pos, ULONG nwant, UBYTE *data, ULONG *nwritten);
78 /* ops.c */
79 LONG OpLockFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, LONG access, struct ExtFileLock **filelock);
80 void OpUnlockFile(struct ExtFileLock *lock);
81 LONG OpCopyLock(struct ExtFileLock *lock, struct ExtFileLock **copy);
82 LONG OpLockParent(struct ExtFileLock *lock, struct ExtFileLock **parent);
83 LONG OpOpenFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, LONG action, struct ExtFileLock **filelock);
84 LONG OpDeleteFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen);
85 LONG OpRenameFile(struct ExtFileLock *sdirlock, UBYTE *sname, ULONG snamelen, struct ExtFileLock *ddirlock, UBYTE *dname, ULONG dnamelen);
86 LONG OpCreateDir(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, struct ExtFileLock **newdirlock);
87 LONG OpRead(struct ExtFileLock *lock, UBYTE *data, ULONG want, ULONG *read);
88 LONG OpWrite(struct ExtFileLock *lock, UBYTE *data, ULONG want, ULONG *written);
89 LONG OpSetFileSize(struct ExtFileLock *lock, LONG offset, LONG mode, LONG *newsize);
90 LONG OpSetProtect(struct ExtFileLock *lock, UBYTE *name, ULONG namelen, ULONG prot);
91 LONG OpAddNotify(struct NotifyRequest *nr);
92 LONG OpRemoveNotify(struct NotifyRequest *nr);
94 /* lock.c */
95 LONG TestLock(struct ExtFileLock *fl);
96 LONG LockFileByName(struct ExtFileLock *fl, UBYTE *name, LONG namelen, LONG access, struct ExtFileLock **lock);
97 LONG LockFile(ULONG cluster, ULONG entry, LONG access, struct ExtFileLock **lock);
98 LONG LockRoot(LONG access, struct ExtFileLock **lock);
99 LONG CopyLock(struct ExtFileLock *fl, struct ExtFileLock **lock);
100 void FreeLock(struct ExtFileLock *fl);
102 /* notify.c */
103 void SendNotify(struct NotifyRequest *nr);
104 void SendNotifyByLock(struct FSSuper *sb, struct GlobalLock *gl);
105 void SendNotifyByDirEntry(struct FSSuper *sb, struct DirEntry *de);
106 void ProcessNotify(void);
108 #endif