Minor fixes to comments.
[AROS.git] / rom / filesys / fat / fat_protos.h
blobc39080e5bc52b16c70e007026ed4faf60f79535e
1 /*
2 * fat.handler - FAT12/16/32 filesystem handler
4 * Copyright © 2006 Marek Szyprowski
5 * Copyright © 2007-2011 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 GetVolumeIdentity(struct FSSuper *sb, struct VolumeIdentity *volume);
23 void CountFreeClusters(struct FSSuper *sb);
24 void AllocCluster(struct FSSuper *sb, ULONG cluster);
25 void FreeCluster(struct FSSuper *sb, ULONG cluster);
27 /* disk.c */
28 void ProcessDiskChange (void);
29 void DoDiskInsert();
30 BOOL AttemptDestroyVolume(struct FSSuper *sb);
31 void DoDiskRemove();
32 void SendVolumePacket(struct DosList *vol, ULONG action);
34 LONG InitDiskHandler(struct FileSysStartupMsg *fssm);
35 void CleanupDiskHandler(void);
36 void UpdateDisk(void);
37 void Probe_64bit_support(void);
38 ULONG AccessDisk(BOOL do_write, ULONG num, ULONG nblocks, ULONG block_size, UBYTE *data);
40 /* info.c */
41 void FillDiskInfo (struct InfoData *id);
43 /* packet.c */
44 void ProcessPackets(void);
45 void ReplyPacket(struct DosPacket *pkt);
47 /* direntry.c */
48 LONG InitDirHandle(struct FSSuper *sb, ULONG cluster, struct DirHandle *dh, BOOL reuse);
49 LONG ReleaseDirHandle(struct DirHandle *dh);
51 LONG GetDirEntry(struct DirHandle *dh, ULONG index, struct DirEntry *de);
52 LONG GetNextDirEntry(struct DirHandle *dh, struct DirEntry *de);
53 LONG GetDirEntryByCluster(struct DirHandle *dh, ULONG cluster,
54 struct DirEntry *de);
56 LONG GetDirEntryByName(struct DirHandle *dh, STRPTR name, ULONG namelen, struct DirEntry *de);
57 LONG GetDirEntryByPath(struct DirHandle *dh, STRPTR path, ULONG pathlen, struct DirEntry *de);
59 LONG GetParentDir(struct DirHandle *dh, struct DirEntry *de);
61 LONG UpdateDirEntry(struct DirEntry *de);
63 LONG AllocDirEntry(struct DirHandle *dh, ULONG gap, struct DirEntry *de);
64 LONG CreateDirEntry(struct DirHandle *dh, STRPTR name, ULONG namelen, UBYTE attr, ULONG cluster, struct DirEntry *de);
65 LONG DeleteDirEntry(struct DirEntry *de);
67 LONG FillFIB(struct ExtFileLock *fl, struct FileInfoBlock *fib);
69 /* names.c */
70 LONG GetDirEntryShortName(struct DirEntry *de, STRPTR name, ULONG *len);
71 LONG GetDirEntryLongName(struct DirEntry *de, STRPTR name, ULONG *len);
72 LONG SetDirEntryName(struct DirEntry *de, STRPTR name, ULONG len);
73 ULONG NumLongNameEntries(STRPTR name, ULONG len);
75 /* fat.c */
76 void ConvertFATDate(UWORD date, UWORD time, struct DateStamp *ds);
77 void ConvertAROSDate(struct DateStamp *ds, UWORD *date, UWORD *time);
78 LONG SetVolumeName(struct FSSuper *sb, UBYTE *name);
79 LONG FindFreeCluster(struct FSSuper *sb, ULONG *rcluster);
81 /* file.c */
82 LONG ReadFileChunk(struct IOHandle *ioh, ULONG file_pos, ULONG nwant, UBYTE *data, ULONG *nread);
83 LONG WriteFileChunk(struct IOHandle *ioh, ULONG file_pos, ULONG nwant, UBYTE *data, ULONG *nwritten);
85 /* ops.c */
86 LONG OpLockFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, LONG access, struct ExtFileLock **filelock);
87 void OpUnlockFile(struct ExtFileLock *lock);
88 LONG OpCopyLock(struct ExtFileLock *lock, struct ExtFileLock **copy);
89 LONG OpLockParent(struct ExtFileLock *lock, struct ExtFileLock **parent);
90 LONG OpOpenFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, LONG action, struct ExtFileLock **filelock);
91 LONG OpDeleteFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen);
92 LONG OpRenameFile(struct ExtFileLock *sdirlock, UBYTE *sname, ULONG snamelen, struct ExtFileLock *ddirlock, UBYTE *dname, ULONG dnamelen);
93 LONG OpCreateDir(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, struct ExtFileLock **newdirlock);
94 LONG OpRead(struct ExtFileLock *lock, UBYTE *data, ULONG want, ULONG *read);
95 LONG OpWrite(struct ExtFileLock *lock, UBYTE *data, ULONG want, ULONG *written);
96 LONG OpSetFileSize(struct ExtFileLock *lock, LONG offset, LONG mode, LONG *newsize);
97 LONG OpSetProtect(struct ExtFileLock *lock, UBYTE *name, ULONG namelen, ULONG prot);
98 LONG OpSetDate(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, struct DateStamp *ds);
99 LONG OpAddNotify(struct NotifyRequest *nr);
100 LONG OpRemoveNotify(struct NotifyRequest *nr);
102 /* lock.c */
103 LONG TestLock(struct ExtFileLock *fl);
104 LONG LockFileByName(struct ExtFileLock *fl, UBYTE *name, LONG namelen, LONG access, struct ExtFileLock **lock);
105 LONG LockFile(ULONG cluster, ULONG entry, LONG access, struct ExtFileLock **lock);
106 LONG LockRoot(LONG access, struct ExtFileLock **lock);
107 LONG CopyLock(struct ExtFileLock *fl, struct ExtFileLock **lock);
108 void FreeLock(struct ExtFileLock *fl);
110 /* notify.c */
111 void SendNotify(struct NotifyRequest *nr);
112 void SendNotifyByLock(struct FSSuper *sb, struct GlobalLock *gl);
113 void SendNotifyByDirEntry(struct FSSuper *sb, struct DirEntry *de);
114 void ProcessNotify(void);
116 /* timer.c */
117 LONG InitTimer(void);
118 void CleanupTimer(void);
119 void RestartTimer(void);
120 void HandleTimer(void);
122 #endif