2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
5 Desc: Internal types and stuff for dos
11 #include <aros/system.h>
14 #include <dos/dosextens.h>
15 #include <dos/filesystem.h>
16 #include <dos/dosasl.h>
17 #include <utility/tagitem.h>
19 #include "dos_dosdoio.h"
24 #define TimerBase (DOSBase->dl_TimerBase)
26 /* Needed for close() */
28 AROS_LC0(BPTR, expunge, struct DosLibrary *, DOSBase, 3, Dos)
30 #define RDAF_ALLOCATED_BY_READARGS (1L << 31)
46 extern struct EString EString
[];
52 #define IOBUFSIZE 4096
59 struct DosLibrary
*DOSBase
;
63 (((struct FileHandle *)BADDR(f))->fh_Flags&FHF_WRITE&& \
64 ((struct FileHandle *)BADDR(f))->fh_Pos<((struct FileHandle *)BADDR(f))->fh_End? \
65 *((struct FileHandle *)BADDR(f))->fh_Pos++=c,0:FPutC(f,c))
67 void InitIOFS(struct IOFileSys
*iofs
, ULONG type
,
68 struct DosLibrary
*DOSBase
);
70 STRPTR
StripVolume(STRPTR name
);
72 LONG
DoIOFS(struct IOFileSys
*iofs
, struct DevProc
*dvp
, STRPTR name
, struct DosLibrary
*DOSBase
);
74 struct DosPacket
*internal_WaitPkt(struct MsgPort
*msgPort
,
75 struct DosLibrary
*DOSBase
);
77 BOOL
RunHandler(struct DeviceNode
*deviceNode
, struct DosLibrary
*DOSBase
);
79 /* Cli dependent SetProgramName() for use in CreateNewProc() */
80 BOOL
internal_SetProgramName(struct CommandLineInterface
*cli
, STRPTR name
,
81 struct DosLibrary
*DOSBase
);
84 /* Pattern matching function used by MatchPattern() and MatchPatternNoCase() */
85 BOOL
patternMatch(STRPTR pat
, STRPTR str
, BOOL useCase
,
86 struct DosLibrary
*DOSBase
);
88 /* Pattern parsing function used by ParsePattern() and ParsePatternNoCase() */
89 LONG
patternParse(STRPTR Source
, STRPTR Dest
, LONG DestLength
, BOOL useCase
,
90 struct DosLibrary
*DOSBase
);
95 struct FileHandle
*fh
,
98 struct DosLibrary
*DOSBase
100 LONG
InternalFlush( struct FileHandle
*fh
, struct DosLibrary
*DOSBase
);
105 struct AChain
*Match_AllocAChain(LONG extrasize
, struct DosLibrary
*DOSBase
);
106 void Match_FreeAChain(struct AChain
*ac
, struct DosLibrary
*DOSBase
);
107 LONG
Match_BuildAChainList(STRPTR pattern
, struct AnchorPath
*ap
,
108 struct AChain
**retac
, struct DosLibrary
*DOSBase
);
109 LONG
Match_MakeResult(struct AnchorPath
*ap
, struct DosLibrary
*DOSBase
);
111 void addprocesstoroot(struct Process
* , struct DosLibrary
*);
112 void removefromrootnode(struct Process
*, struct DosLibrary
*);
116 UBYTE type
; /* 0: Split 1: MP_NOT */
117 STRPTR pat
; /* Pointer into pattern */
118 STRPTR str
; /* Pointer into string */
123 struct markerarray
*next
;
124 struct markerarray
*prev
;
125 struct marker marker
[128];
128 #define PUSH(t,p,s) \
132 if(macur->next==NULL) \
134 macur->next=AllocMem(sizeof(struct markerarray),MEMF_ANY); \
135 if(macur->next==NULL) \
136 ERROR(ERROR_NO_FREE_STORE); \
137 macur->next->prev=macur; \
142 macur->marker[macnt].type=(t); \
143 macur->marker[macnt].pat=(p); \
144 macur->marker[macnt].str=(s); \
158 (t)=macur->marker[macnt].type; \
159 (p)=macur->marker[macnt].pat; \
160 (s)=macur->marker[macnt].str; \
163 #define MP_ESCAPE 0x81 /* Before characters in [0x81;0x8a] */
164 #define MP_MULT 0x82 /* _#(_a) */
165 #define MP_MULT_END 0x83 /* #(a_)_ */
166 #define MP_NOT 0x84 /* _~(_a) */
167 #define MP_NOT_END 0x85 /* ~(a_)_ */
168 #define MP_OR 0x86 /* _(_a|b) */
169 #define MP_OR_NEXT 0x87 /* (a_|_b) */
170 #define MP_OR_END 0x88 /* (a|b_)_ */
171 #define MP_SINGLE 0x89 /* ? */
172 #define MP_ALL 0x8a /* #? or * */
173 #define MP_SET 0x8b /* _[_ad-g] */
174 #define MP_NOT_SET 0x8c /* _[~_ad-g] */
175 #define MP_DASH 0x8d /* [ad_-g_] */
176 #define MP_SET_END 0x8e /* [ad-g_]_ */
178 /* Whether MatchFirst/MatchNext/MatchEnd in case of the base
179 AChain should just take the currentdir lock pointer, or
180 make a real duplicate with DupLock() */
182 #define MATCHFUNCS_NO_DUPLOCK 0
184 /* DosGetString additional codes (printf style parametrized) */
186 #define STRING_DISK_NOT_VALIDATED -4000
187 #define STRING_DISK_WRITE_PROTECTED -4001
188 #define STRING_DEVICE_NOT_MOUNTED_INSERT -4002
189 #define STRING_DEVICE_NOT_MOUNTED_REPLACE -4003
190 #define STRING_DEVICE_NOT_MOUNTED_REPLACE_TARGET -4004
191 #define STRING_DISK_FULL -4005
192 #define STRING_NOT_A_DOS_DISK -4006
193 #define STRING_NO_DISK -4007
194 #define STRING_ABORT_BUSY -4008
195 #define STRING_ABORT_DISK_ERROR -4009
197 #define STRING_RETRY -5000
198 #define STRING_CANCEL -5001
199 #define STRING_REQUESTTITLE -5002
201 #include <dos_commanderrors.h>
203 /* Force attempts to use DosLibrary->dl_Errors to fail. This is used by
204 locale.library's replacement function for DosGetString() to peek
205 the pointer of the catalog to use */
207 #define dl_Errors do_not_use_is_reserved_for_locale_dosgetstring_replacement
209 #define __is_task(task) (((struct Task *)task)->tc_Node.ln_Type == NT_TASK)
210 #define __is_process(task) (((struct Task *)task)->tc_Node.ln_Type == NT_PROCESS)
224 IPTR start_address
; // start address of loaded executable segment
225 struct MinList seginfos
;
228 struct InternalExAllControl
230 struct ExAllControl eac
;
231 /* Used for ExAll emulation. If non null, it means
232 ExAll emulation is being performed. */
233 struct FileInfoBlock
*fib
;
237 typedef struct FileHandle
* FileHandlePtr
;
239 void vbuf_free(FileHandlePtr fh
);
241 IPTR
vbuf_alloc(FileHandlePtr fh
, ULONG size
, struct DosLibrary
*DOSBase
);
243 LONG
FWriteChars(BPTR file
, CONST UBYTE
* buffer
, ULONG length
, struct DosLibrary
*DOSBase
);
245 #endif /* DOS_INTERN_H */