5 Copyright (C) 2001-2008 Neil Cafferkey
7 This file is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Lesser General Public License as
9 published by the Free Software Foundation; either version 2.1 of the
10 License, or (at your option) any later version.
12 This file is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this file; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston,
29 #include <dos/dosextens.h>
30 #include <dos/filehandler.h>
31 #include <dos/notify.h>
32 #include <dos/exall.h>
33 #include <exec/memory.h>
34 #include <exec/initializers.h>
35 #include <utility/utility.h>
37 #include <proto/exec.h>
38 #include <proto/dos.h>
39 #include <proto/alib.h>
40 #include <proto/locale.h>
41 #include <proto/utility.h>
54 #ifndef MEM_BLOCKSHIFT
55 #define MEM_BLOCKSHIFT ((sizeof(APTR) == 8) ? 4 : 3)
58 #define MIN(A, B) (((A) < (B))? (A): (B))
59 #define MEMBLOCKS(A) ((((A) - 1) >> (MEM_BLOCKSHIFT)) + 1)
62 (((BYTE *)(A)) - (UPINT)&((struct Object *)NULL)->hard_link))
63 #define DOSBOOL(A) ((A)? DOSTRUE: DOSFALSE)
64 #define FIXLOCK(handler, lock)\
65 ((lock != NULL)? (lock): (handler)->root_dir->lock)
67 #define MAX_NAME_SIZE (sizeof(((struct FileInfoBlock *)NULL)->fib_FileName))
68 #define MIN_BLOCK_SIZE 64
69 #define MAX_BLOCK_SIZE 0x8000
70 #define CLEAR_PUDDLE_SIZE (8 * 1024)
71 #define CLEAR_PUDDLE_THRESH (4 * 1024)
72 #define MUDDY_PUDDLE_SIZE (16 * 1024)
73 #define MUDDY_PUDDLE_THRESH (8 * 1024)
74 #define PUBLIC_PUDDLE_SIZE (4 * 1024)
75 #define PUBLIC_PUDDLE_THRESH (2 * 1024)
76 #define DOS_VERSION 39
77 #define UTILITY_VERSION 37
78 #define LOCALE_VERSION 38
84 UWORD length
; /* number of data bytes */
93 struct MinList openings
;
100 UWORD end_length
; /* number of valid bytes in last data block */
101 struct MinList elements
;
102 UPINT length
; /* logical length in bytes for a file */
103 UPINT block_count
; /* number of memory blocks */
105 struct Object
*parent
;
106 struct DateStamp date
;
109 struct MinNode hard_link
;
110 struct MinList notifications
;
111 struct Block start_block
; /* a zero-length block */
113 #define soft_link_target comment
129 struct NotifyRequest
*request
;
136 struct Object
*next_object
;
142 struct Object
*root_dir
;
143 struct DosList
*volume
;
144 struct MsgPort
*proc_port
;
145 struct MsgPort
*notify_port
;
148 struct Locale
*locale
;
149 ULONG min_block_size
;
150 ULONG max_block_size
;
152 struct MinList notifications
;
153 struct MinList examinations
;
160 struct DosLibrary
*DOSBase
;
161 struct UtilityBase
*UtilityBase
;
162 struct LocaleBase
*LocaleBase
;
165 /* FIXME: Remove these #define xxxBase hacks
166 Do not use this in new code !
168 #define LocaleBase (handler->LocaleBase)
169 #define UtilityBase (handler->UtilityBase)
170 #define DOSBase (handler->DOSBase)