2 Copyright © 1995-2008, 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 CONST_STRPTR
StripVolume(CONST_STRPTR name
);
72 LONG
DoIOFS(struct IOFileSys
*iofs
, struct DevProc
*dvp
, CONST_STRPTR name
,
73 struct DosLibrary
*DOSBase
);
75 void IOFS_SendPkt(struct DosPacket
*dp
, struct MsgPort
*replyport
, struct DosLibrary
*DOSBase
);
77 struct DosPacket
*internal_WaitPkt(struct MsgPort
*msgPort
,
78 struct DosLibrary
*DOSBase
);
80 BOOL
RunHandler(struct DeviceNode
*deviceNode
, struct DosLibrary
*DOSBase
);
82 /* Cli dependent SetProgramName() for use in CreateNewProc() */
83 BOOL
internal_SetProgramName(struct CommandLineInterface
*cli
,
84 CONST_STRPTR name
, struct DosLibrary
*DOSBase
);
87 /* Pattern matching function used by MatchPattern() and MatchPatternNoCase() */
88 BOOL
patternMatch(CONST_STRPTR pat
, CONST_STRPTR str
, BOOL useCase
,
89 struct DosLibrary
*DOSBase
);
91 /* Pattern parsing function used by ParsePattern() and ParsePatternNoCase() */
92 LONG
patternParse(CONST_STRPTR Source
, STRPTR Dest
, LONG DestLength
,
93 BOOL useCase
, struct DosLibrary
*DOSBase
);
98 struct FileHandle
*fh
,
101 struct DosLibrary
*DOSBase
103 LONG
InternalFlush( struct FileHandle
*fh
, struct DosLibrary
*DOSBase
);
108 struct AChain
*Match_AllocAChain(LONG extrasize
, struct DosLibrary
*DOSBase
);
109 void Match_FreeAChain(struct AChain
*ac
, struct DosLibrary
*DOSBase
);
110 LONG
Match_BuildAChainList(CONST_STRPTR pattern
, struct AnchorPath
*ap
,
111 struct AChain
**retac
, struct DosLibrary
*DOSBase
);
112 LONG
Match_MakeResult(struct AnchorPath
*ap
, struct DosLibrary
*DOSBase
);
114 void addprocesstoroot(struct Process
* , struct DosLibrary
*);
115 void removefromrootnode(struct Process
*, struct DosLibrary
*);
119 UBYTE type
; /* 0: Split 1: MP_NOT */
120 CONST_STRPTR pat
; /* Pointer into pattern */
121 CONST_STRPTR str
; /* Pointer into string */
126 struct markerarray
*next
;
127 struct markerarray
*prev
;
128 struct marker marker
[128];
131 #define PUSH(t,p,s) \
135 if(macur->next==NULL) \
137 macur->next=AllocMem(sizeof(struct markerarray),MEMF_ANY); \
138 if(macur->next==NULL) \
139 ERROR(ERROR_NO_FREE_STORE); \
140 macur->next->prev=macur; \
145 macur->marker[macnt].type=(t); \
146 macur->marker[macnt].pat=(p); \
147 macur->marker[macnt].str=(s); \
161 (t)=macur->marker[macnt].type; \
162 (p)=macur->marker[macnt].pat; \
163 (s)=macur->marker[macnt].str; \
166 #define MP_ESCAPE 0x81 /* Before characters in [0x81;0x8a] */
167 #define MP_MULT 0x82 /* _#(_a) */
168 #define MP_MULT_END 0x83 /* #(a_)_ */
169 #define MP_NOT 0x84 /* _~(_a) */
170 #define MP_NOT_END 0x85 /* ~(a_)_ */
171 #define MP_OR 0x86 /* _(_a|b) */
172 #define MP_OR_NEXT 0x87 /* (a_|_b) */
173 #define MP_OR_END 0x88 /* (a|b_)_ */
174 #define MP_SINGLE 0x89 /* ? */
175 #define MP_ALL 0x8a /* #? or * */
176 #define MP_SET 0x8b /* _[_ad-g] */
177 #define MP_NOT_SET 0x8c /* _[~_ad-g] */
178 #define MP_DASH 0x8d /* [ad_-g_] */
179 #define MP_SET_END 0x8e /* [ad-g_]_ */
181 /* Whether MatchFirst/MatchNext/MatchEnd in case of the base
182 AChain should just take the currentdir lock pointer, or
183 make a real duplicate with DupLock() */
185 #define MATCHFUNCS_NO_DUPLOCK 0
187 /* DosGetString additional codes (printf style parametrized) */
189 #define STRING_DISK_NOT_VALIDATED -4000
190 #define STRING_DISK_WRITE_PROTECTED -4001
191 #define STRING_DEVICE_NOT_MOUNTED_INSERT -4002
192 #define STRING_DEVICE_NOT_MOUNTED_REPLACE -4003
193 #define STRING_DEVICE_NOT_MOUNTED_REPLACE_TARGET -4004
194 #define STRING_DISK_FULL -4005
195 #define STRING_NOT_A_DOS_DISK -4006
196 #define STRING_NO_DISK -4007
197 #define STRING_ABORT_BUSY -4008
198 #define STRING_ABORT_DISK_ERROR -4009
200 #define STRING_RETRY -5000
201 #define STRING_CANCEL -5001
202 #define STRING_REQUESTTITLE -5002
204 #include "dos_commanderrors.h"
206 /* Force attempts to use DosLibrary->dl_Errors to fail. This is used by
207 locale.library's replacement function for DosGetString() to peek
208 the pointer of the catalog to use */
210 #define dl_Errors do_not_use_is_reserved_for_locale_dosgetstring_replacement
212 #define __is_task(task) (((struct Task *)task)->tc_Node.ln_Type == NT_TASK)
213 #define __is_process(task) (((struct Task *)task)->tc_Node.ln_Type == NT_PROCESS)
227 IPTR start_address
; // start address of loaded executable segment
228 struct MinList seginfos
;
231 struct InternalExAllControl
233 struct ExAllControl eac
;
234 /* Used for ExAll emulation. If non null, it means
235 ExAll emulation is being performed. */
236 struct FileInfoBlock
*fib
;
240 typedef struct FileHandle
* FileHandlePtr
;
242 void vbuf_free(FileHandlePtr fh
);
244 APTR
vbuf_alloc(FileHandlePtr fh
, ULONG size
, struct DosLibrary
*DOSBase
);
246 LONG
FWriteChars(BPTR file
, CONST UBYTE
* buffer
, ULONG length
, struct DosLibrary
*DOSBase
);
248 #endif /* DOS_INTERN_H */