2 * fat-handler - FAT12/16/32 filesystem handler
4 * Copyright © 2006 Marek Szyprowski
5 * Copyright © 2007-2015 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.
13 #ifndef FAT_HANDLER_PROTO_H
14 #define FAT_HANDLER_PROTO_H
17 void ProcessDiskChange (struct Globals
*glob
);
18 void DoDiskInsert(struct Globals
*glob
);
19 BOOL
AttemptDestroyVolume(struct FSSuper
*sb
);
20 void DoDiskRemove(struct Globals
*glob
);
21 void SendVolumePacket(struct DosList
*vol
, ULONG action
,
22 struct Globals
*glob
);
23 LONG
InitDiskHandler(struct Globals
*glob
);
24 void CleanupDiskHandler(struct Globals
*glob
);
25 void UpdateDisk(struct Globals
*glob
);
26 void Probe_64bit_support(struct Globals
*glob
);
27 void FillDiskInfo(struct InfoData
*id
, struct Globals
*glob
);
30 void ProcessPackets(struct Globals
*glob
);
31 void ReplyPacket(struct DosPacket
*pkt
, struct ExecBase
*sysbase
);
34 void InitDir(struct FSSuper
*sb
, ULONG cluster
, struct DirEntry
*de
);
35 LONG
InitDirHandle(struct FSSuper
*sb
, ULONG cluster
, struct DirHandle
*dh
,
37 LONG
ReleaseDirHandle(struct DirHandle
*dh
);
38 LONG
GetDirEntry(struct DirHandle
*dh
, ULONG index
, struct DirEntry
*de
);
39 LONG
GetNextDirEntry(struct DirHandle
*dh
, struct DirEntry
*de
);
40 LONG
GetDirEntryByCluster(struct DirHandle
*dh
, ULONG cluster
,
42 LONG
GetDirEntryByName(struct DirHandle
*dh
, STRPTR name
, ULONG namelen
,
44 LONG
GetDirEntryByPath(struct DirHandle
*dh
, STRPTR path
, ULONG pathlen
,
46 LONG
GetParentDir(struct DirHandle
*dh
, struct DirEntry
*de
);
47 LONG
UpdateDirEntry(struct DirEntry
*de
);
48 LONG
AllocDirEntry(struct DirHandle
*dh
, ULONG gap
, struct DirEntry
*de
);
49 LONG
CreateDirEntry(struct DirHandle
*dh
, STRPTR name
, ULONG namelen
,
50 UBYTE attr
, ULONG cluster
, struct DirEntry
*de
);
51 void FillDirEntry(struct DirEntry
*de
, UBYTE attr
, ULONG cluster
);
52 LONG
DeleteDirEntry(struct DirEntry
*de
);
53 LONG
FillFIB(struct ExtFileLock
*fl
, struct FileInfoBlock
*fib
,
54 struct Globals
*glob
);
57 LONG
GetDirEntryShortName(struct DirEntry
*de
, STRPTR name
, ULONG
*len
);
58 LONG
GetDirEntryLongName(struct DirEntry
*de
, STRPTR name
, ULONG
*len
);
59 LONG
SetDirEntryName(struct DirEntry
*de
, STRPTR name
, ULONG len
);
60 ULONG
NumLongNameEntries(STRPTR name
, ULONG len
);
63 LONG
ReadFATSuper(struct FSSuper
*s
);
64 void FreeFATSuper(struct FSSuper
*s
);
65 LONG
FormatFATVolume(const UBYTE
*name
, UWORD len
, struct Globals
*glob
);
66 LONG
CompareFATSuper(struct FSSuper
*s1
, struct FSSuper
*s2
);
68 void CountFreeClusters(struct FSSuper
*sb
);
69 void AllocCluster(struct FSSuper
*sb
, ULONG cluster
);
70 void FreeCluster(struct FSSuper
*sb
, ULONG cluster
);
72 void ConvertFATDate(UWORD date
, UWORD time
, struct DateStamp
*ds
,
73 struct Globals
*glob
);
74 void ConvertSysDate(ULONG secs
, UWORD
*date
, UWORD
*time
,
75 struct Globals
*glob
);
76 void ConvertDOSDate(struct DateStamp
*ds
, UWORD
*date
, UWORD
*time
,
77 struct Globals
*glob
);
78 LONG
SetVolumeName(struct FSSuper
*sb
, UBYTE
*name
, UWORD len
);
79 LONG
FindFreeCluster(struct FSSuper
*sb
, ULONG
*rcluster
);
82 LONG
ReadFileChunk(struct IOHandle
*ioh
, ULONG file_pos
, ULONG nwant
,
83 UBYTE
*data
, ULONG
*nread
);
84 LONG
WriteFileChunk(struct IOHandle
*ioh
, ULONG file_pos
, ULONG nwant
,
85 UBYTE
*data
, ULONG
*nwritten
);
88 LONG
OpLockFile(struct ExtFileLock
*dirlock
, UBYTE
*name
, ULONG namelen
,
89 LONG access
, struct ExtFileLock
**filelock
, struct Globals
*glob
);
90 void OpUnlockFile(struct ExtFileLock
*lock
, struct Globals
*glob
);
91 LONG
OpCopyLock(struct ExtFileLock
*lock
, struct ExtFileLock
**copy
,
92 struct Globals
*glob
);
93 LONG
OpLockParent(struct ExtFileLock
*lock
, struct ExtFileLock
**parent
,
94 struct Globals
*glob
);
95 LONG
OpOpenFile(struct ExtFileLock
*dirlock
, UBYTE
*name
, ULONG namelen
,
96 LONG action
, struct ExtFileLock
**filelock
, struct Globals
*glob
);
97 LONG
OpDeleteFile(struct ExtFileLock
*dirlock
, UBYTE
*name
, ULONG namelen
,
98 struct Globals
*glob
);
99 LONG
OpRenameFile(struct ExtFileLock
*sdirlock
, UBYTE
*sname
, ULONG snamelen
,
100 struct ExtFileLock
*ddirlock
, UBYTE
*dname
, ULONG dnamelen
,
101 struct Globals
*glob
);
102 LONG
OpCreateDir(struct ExtFileLock
*dirlock
, UBYTE
*name
, ULONG namelen
,
103 struct ExtFileLock
**newdirlock
, struct Globals
*glob
);
104 LONG
OpRead(struct ExtFileLock
*lock
, UBYTE
*data
, ULONG want
, ULONG
*read
,
105 struct Globals
*glob
);
106 LONG
OpWrite(struct ExtFileLock
*lock
, UBYTE
*data
, ULONG want
,
107 ULONG
*written
, struct Globals
*glob
);
108 LONG
OpSetFileSize(struct ExtFileLock
*lock
, LONG offset
, LONG mode
,
109 LONG
*newsize
, struct Globals
*glob
);
110 LONG
OpSetProtect(struct ExtFileLock
*lock
, UBYTE
*name
, ULONG namelen
,
111 ULONG prot
, struct Globals
*glob
);
112 LONG
OpSetDate(struct ExtFileLock
*dirlock
, UBYTE
*name
, ULONG namelen
,
113 struct DateStamp
*ds
, struct Globals
*glob
);
114 LONG
OpAddNotify(struct NotifyRequest
*nr
, struct Globals
*glob
);
115 LONG
OpRemoveNotify(struct NotifyRequest
*nr
, struct Globals
*glob
);
118 LONG
TestLock(struct ExtFileLock
*fl
, struct Globals
*glob
);
119 LONG
LockFileByName(struct ExtFileLock
*fl
, UBYTE
*name
, LONG namelen
,
120 LONG access
, struct ExtFileLock
**lock
, struct Globals
*glob
);
121 LONG
LockFile(ULONG cluster
, ULONG entry
, LONG access
,
122 struct ExtFileLock
**lock
, struct Globals
*glob
);
123 LONG
LockRoot(LONG access
, struct ExtFileLock
**lock
, struct Globals
*glob
);
124 LONG
CopyLock(struct ExtFileLock
*fl
, struct ExtFileLock
**lock
,
125 struct Globals
*glob
);
126 void FreeLock(struct ExtFileLock
*fl
, struct Globals
*glob
);
129 void SendNotify(struct NotifyRequest
*nr
, struct Globals
*glob
);
130 void SendNotifyByLock(struct FSSuper
*sb
, struct GlobalLock
*gl
);
131 void SendNotifyByDirEntry(struct FSSuper
*sb
, struct DirEntry
*de
);
132 void ProcessNotify(struct Globals
*glob
);
135 LONG
InitTimer(struct Globals
*glob
);
136 void CleanupTimer(struct Globals
*glob
);
137 void RestartTimer(struct Globals
*glob
);
138 void HandleTimer(struct Globals
*glob
);