Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git] / workbench / fs / fat / fat_protos.h
blob9f916a77798c7c557e08afbdfa24d1f1feb0a788
1 /*
2 * fat.handler - FAT12/16/32 filesystem handler
4 * Copyright © 2006 Marek Szyprowski
5 * Copyright © 2007-2008 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);
34 void UpdateDisk(void);
35 void Probe_64bit_support(void);
36 ULONG AccessDisk(BOOL do_write, ULONG num, ULONG nblocks, ULONG block_size, UBYTE *data);
38 /* info.c */
39 void FillDiskInfo (struct InfoData *id);
41 /* packet.c */
42 void ProcessPackets(void);
44 /* new definitions as we refactor the code */
46 /* direntry.c */
47 LONG InitDirHandle(struct FSSuper *sb, ULONG cluster, struct DirHandle *dh, BOOL reuse);
48 LONG ReleaseDirHandle(struct DirHandle *dh);
50 LONG GetDirEntry(struct DirHandle *dh, ULONG index, struct DirEntry *de);
51 LONG GetNextDirEntry(struct DirHandle *dh, struct DirEntry *de);
53 LONG GetDirEntryByName(struct DirHandle *dh, STRPTR name, ULONG namelen, struct DirEntry *de);
54 LONG GetDirEntryByPath(struct DirHandle *dh, STRPTR path, ULONG pathlen, struct DirEntry *de);
56 LONG GetParentDir(struct DirHandle *dh, struct DirEntry *de);
58 LONG UpdateDirEntry(struct DirEntry *de);
60 LONG CreateDirEntry(struct DirHandle *dh, STRPTR name, ULONG namelen, UBYTE attr, ULONG cluster, struct DirEntry *de);
61 LONG DeleteDirEntry(struct DirEntry *de);
63 LONG FillFIB(struct ExtFileLock *fl, struct FileInfoBlock *fib);
65 /* names.c */
66 LONG GetDirEntryShortName(struct DirEntry *de, STRPTR name, ULONG *len);
67 LONG GetDirEntryLongName(struct DirEntry *de, STRPTR name, ULONG *len);
68 LONG SetDirEntryName(struct DirEntry *de, STRPTR name, ULONG len);
69 ULONG NumLongNameEntries(STRPTR name, ULONG len);
71 /* fat.c */
72 void ConvertFATDate(UWORD date, UWORD time, struct DateStamp *ds);
73 void ConvertAROSDate(struct DateStamp ds, UWORD *date, UWORD *time);
74 LONG SetVolumeName(struct FSSuper *sb, UBYTE *name);
75 LONG FindFreeCluster(struct FSSuper *sb, ULONG *rcluster);
77 /* file.c */
78 LONG ReadFileChunk(struct IOHandle *ioh, ULONG file_pos, ULONG nwant, UBYTE *data, ULONG *nread);
79 LONG WriteFileChunk(struct IOHandle *ioh, ULONG file_pos, ULONG nwant, UBYTE *data, ULONG *nwritten);
81 /* ops.c */
82 LONG OpLockFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, LONG access, struct ExtFileLock **filelock);
83 void OpUnlockFile(struct ExtFileLock *lock);
84 LONG OpCopyLock(struct ExtFileLock *lock, struct ExtFileLock **copy);
85 LONG OpLockParent(struct ExtFileLock *lock, struct ExtFileLock **parent);
86 LONG OpOpenFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, LONG action, struct ExtFileLock **filelock);
87 LONG OpDeleteFile(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen);
88 LONG OpRenameFile(struct ExtFileLock *sdirlock, UBYTE *sname, ULONG snamelen, struct ExtFileLock *ddirlock, UBYTE *dname, ULONG dnamelen);
89 LONG OpCreateDir(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, struct ExtFileLock **newdirlock);
90 LONG OpRead(struct ExtFileLock *lock, UBYTE *data, ULONG want, ULONG *read);
91 LONG OpWrite(struct ExtFileLock *lock, UBYTE *data, ULONG want, ULONG *written);
92 LONG OpSetFileSize(struct ExtFileLock *lock, LONG offset, LONG mode, LONG *newsize);
93 LONG OpSetProtect(struct ExtFileLock *lock, UBYTE *name, ULONG namelen, ULONG prot);
94 LONG OpSetDate(struct ExtFileLock *dirlock, UBYTE *name, ULONG namelen, struct DateStamp *ds);
95 LONG OpAddNotify(struct NotifyRequest *nr);
96 LONG OpRemoveNotify(struct NotifyRequest *nr);
98 /* lock.c */
99 LONG TestLock(struct ExtFileLock *fl);
100 LONG LockFileByName(struct ExtFileLock *fl, UBYTE *name, LONG namelen, LONG access, struct ExtFileLock **lock);
101 LONG LockFile(ULONG cluster, ULONG entry, LONG access, struct ExtFileLock **lock);
102 LONG LockRoot(LONG access, struct ExtFileLock **lock);
103 LONG CopyLock(struct ExtFileLock *fl, struct ExtFileLock **lock);
104 void FreeLock(struct ExtFileLock *fl);
106 /* notify.c */
107 void SendNotify(struct NotifyRequest *nr);
108 void SendNotifyByLock(struct FSSuper *sb, struct GlobalLock *gl);
109 void SendNotifyByDirEntry(struct FSSuper *sb, struct DirEntry *de);
110 void ProcessNotify(void);
112 #endif