4 libbasetype struct IntDosBase
5 libbasetypeextern struct DosLibrary
7 options noexpunge, noresident
12 #include <dos/dosextens.h>
13 #include <dos/filehandler.h>
14 #include <dos/record.h>
15 #include <dos/rdargs.h>
16 #include <dos/dosasl.h>
18 #include <dos/notify.h>
19 #include <dos/datetime.h>
20 #include <dos/dostags.h>
21 #include <dos/exall.h>
22 #include <aros/preprocessor/variadic/cast2iptr.hpp>
24 #define AllocDosObjectTagList(...) AllocDosObject(__VA_ARGS__)
25 #define CreateNewProcTagList(...) CreateNewProc(__VA_ARGS__)
26 #define NewLoadSegTagList(...) NewLoadSeg(__VA_ARGS__)
27 #define System(...) SystemTagList(__VA_ARGS__)
29 /* Prototypes for stubs in amiga.lib */
33 APTR AllocDosObjectTags (ULONG type, Tag tag1, ...) __stackparm;
34 struct Process * CreateNewProcTags (Tag tag1, ...) __stackparm;
35 BPTR NewLoadSegTags (STRPTR file, Tag tag1, ...) __stackparm;
36 LONG SystemTags (STRPTR command, Tag tag1, ...) __stackparm;
40 #if !defined(NO_INLINE_STDARG) && defined(__GNUC__)
41 #define FWritef(fh, format, ...) \
43 IPTR __args[] = { AROS_PP_VARIADIC_CAST2IPTR(__VA_ARGS__) }; \
44 VFWritef((fh), (format), __args); \
47 #define FPrintf(fh, format, ...) \
49 IPTR __args[] = { AROS_PP_VARIADIC_CAST2IPTR(__VA_ARGS__) }; \
50 VFPrintf((fh), (format), __args); \
53 #define Printf(format, ...) \
55 IPTR __args[] = { AROS_PP_VARIADIC_CAST2IPTR(__VA_ARGS__) }; \
56 VFPrintf(Output(), (format), __args); \
63 #include <dos/dosextens.h>
65 #include "dos_intern.h"
69 struct DosLibrary *OpenLib(ULONG version) (D0)
74 BPTR Open(CONST_STRPTR name, LONG accessMode) (D1,D2)
75 BOOL Close(BPTR file) (D1)
76 LONG Read(BPTR file, APTR buffer, LONG length) (D1, D2, D3)
77 LONG Write(BPTR file, CONST_APTR buffer, LONG length) (D1, D2, D3)
80 LONG Seek(BPTR file, LONG position, LONG mode) (D1,D2,D3)
81 BOOL DeleteFile(CONST_STRPTR name) (D1)
82 LONG Rename(CONST_STRPTR oldName, CONST_STRPTR newName) (D1,D2)
83 BPTR Lock(CONST_STRPTR name, LONG accessMode) (D1,D2)
84 BOOL UnLock(BPTR lock) (D1)
85 BPTR DupLock(BPTR lock) (D1)
86 LONG Examine(BPTR lock, struct FileInfoBlock* fib) (D1,D2)
87 LONG ExNext(BPTR lock, struct FileInfoBlock* fileInfoBlock) (D1,D2)
88 LONG Info(BPTR lock, struct InfoData* parameterBlock) (D1,D2)
89 BPTR CreateDir(CONST_STRPTR name) (D1)
90 BPTR CurrentDir(BPTR lock) (D1)
92 struct MsgPort* CreateProc(CONST_STRPTR name, LONG pri, BPTR segList, LONG stackSize) (D1,D2,D3,D4)
93 void Exit(LONG returnCode) (D1)
94 BPTR LoadSeg(CONST_STRPTR name) (D1)
95 BOOL UnLoadSeg(BPTR seglist) (D1)
96 .skip 1 # AmigaOS 2.1 private: ClearVec(bVector, upb) (D1,D2)
97 .skip 1 # AmigaOS 2.1 private: NoReqLoadSeg(bFileName) (D1)
98 struct MsgPort *DeviceProc(CONST_STRPTR name) (D1)
99 LONG SetComment(CONST_STRPTR name, CONST_STRPTR comment) (D1,D2)
100 LONG SetProtection(CONST_STRPTR name, ULONG protect) (D1,D2)
101 struct DateStamp *DateStamp(struct DateStamp *date) (D1)
102 void Delay(ULONG timeout) (D1)
103 LONG WaitForChar(BPTR file, LONG timeout) (D1,D2)
104 BPTR ParentDir(BPTR lock) (D1)
105 LONG IsInteractive(BPTR file) (D1)
106 BOOL Execute(CONST_STRPTR string, BPTR input, BPTR output) (D1,D2,D3)
108 APTR AllocDosObject(ULONG type, struct TagItem *tags) (D1,D2)
109 void FreeDosObject(ULONG type, APTR ptr) (D1,D2)
110 SIPTR DoPkt(struct MsgPort* port, LONG action, SIPTR arg1, SIPTR arg2, SIPTR arg3, SIPTR arg4, SIPTR arg5) (D1,D2,D3,D4,D5,D6,D7)
111 void SendPkt(struct DosPacket *dp, struct MsgPort *port, struct MsgPort *replyport) (D1,D2,D3)
112 struct DosPacket *WaitPkt() ()
113 void ReplyPkt(struct DosPacket *dp, SIPTR res1, LONG res2) (D1,D2,D3)
114 void AbortPkt(struct MsgPort *port, struct DosPacket *pkt) (D1,D2)
115 BOOL LockRecord(BPTR fh, ULONG offset, ULONG length, ULONG mode, ULONG timeout) (D1,D2,D3,D4,D5)
116 BOOL LockRecords(struct RecordLock *recArray, ULONG timeout) (D1,D2)
117 BOOL UnLockRecord(BPTR fh, ULONG offset, ULONG length) (D1,D2,D3)
118 BOOL UnLockRecords(struct RecordLock * recArray) (D1)
119 BPTR SelectInput(BPTR fh) (D1)
120 BPTR SelectOutput(BPTR fh) (D1)
121 LONG FGetC(BPTR file) (D1)
122 LONG FPutC(BPTR file, LONG character) (D1,D2)
123 LONG UnGetC(BPTR file, LONG character) (D1,D2)
124 LONG FRead(BPTR fh, APTR block, ULONG blocklen, ULONG number) (D1,D2,D3,D4)
125 LONG FWrite(BPTR fh, CONST_APTR block, ULONG blocklen, ULONG numblocks) (D1,D2,D3,D4)
126 STRPTR FGets(BPTR fh, STRPTR buf, ULONG buflen) (D1,D2,D3)
127 LONG FPuts(BPTR file, CONST_STRPTR string) (D1,D2)
128 LONG VFWritef(BPTR fh, CONST_STRPTR fmt, const IPTR *argarray) (D1,D2,D3)
129 LONG VFPrintf(BPTR file, CONST_STRPTR format, const IPTR *argarray) (D1,D2,D3)
130 LONG Flush(BPTR file) (D1)
131 LONG SetVBuf(BPTR file, STRPTR buff, LONG type, LONG size) (D1,D2,D3,D4)
132 BPTR DupLockFromFH(BPTR lock) (D1)
133 BPTR OpenFromLock(BPTR lock) (D1)
134 BPTR ParentOfFH(BPTR fh) (D1)
135 BOOL ExamineFH(BPTR fh, struct FileInfoBlock* fib) (D1,D2)
136 BOOL SetFileDate(CONST_STRPTR name, const struct DateStamp *date) (D1,D2)
137 BOOL NameFromLock(BPTR lock, STRPTR buffer, LONG length) (D1,D2,D3)
138 BOOL NameFromFH(BPTR fh, STRPTR buffer, LONG length) (D1,D2,D3)
139 LONG SplitName(CONST_STRPTR name, ULONG separator, STRPTR buf, LONG oldpos, LONG size) (D1,D2,D3,D4,D5)
140 LONG SameLock(BPTR lock1, BPTR lock2) (D1,D2)
141 LONG SetMode(BPTR fh, LONG mode) (D1,D2)
142 BOOL ExAll(BPTR lock, struct ExAllData *buffer, LONG size, LONG data, struct ExAllControl *control) (D1,D2,D3,D4,D5)
143 LONG ReadLink(struct MsgPort *port, BPTR lock, CONST_STRPTR path, STRPTR buffer, ULONG size) (D1,D2,D3,D4,D5)
144 LONG MakeLink(CONST_STRPTR name, SIPTR dest, LONG soft) (D1,D2,D3)
145 BOOL ChangeMode(ULONG type, BPTR object, ULONG newmode) (D1,D2,D3)
146 LONG SetFileSize(BPTR file, LONG offset, LONG mode) (D1,D2,D3)
147 SIPTR SetIoErr(SIPTR result) (D1)
148 BOOL Fault(LONG code, CONST_STRPTR header, STRPTR buffer, LONG len) (D1,D2,D3,D4)
149 BOOL PrintFault(LONG code, CONST_STRPTR header) (D1,D2)
150 BOOL ErrorReport(LONG code, LONG type, IPTR arg1, struct MsgPort *device) (D1,D2,D3,D4)
151 LONG DisplayError(CONST_STRPTR formatStr, ULONG flags, APTR args) (A0,D0,A1)
152 struct CommandLineInterface *Cli() ()
153 struct Process *CreateNewProc(const struct TagItem *tags) (D1)
154 LONG RunCommand(BPTR segList, ULONG stacksize, STRPTR argptr, ULONG argsize) (D1,D2,D3,D4)
155 struct MsgPort *GetConsoleTask() ()
156 struct MsgPort *SetConsoleTask(struct MsgPort *handler) (D1)
157 struct MsgPort *GetFileSysTask() ()
158 struct MsgPort *SetFileSysTask(struct MsgPort *task) (D1)
159 STRPTR GetArgStr() ()
160 STRPTR SetArgStr(CONST_STRPTR string) (D1)
161 struct Process *FindCliProc(ULONG num) (D1)
163 BOOL SetCurrentDirName(CONST_STRPTR name) (D1)
164 BOOL GetCurrentDirName(STRPTR buf, LONG len) (D1,D2)
165 BOOL SetProgramName(CONST_STRPTR name) (D1)
166 BOOL GetProgramName(STRPTR buf, LONG len) (D1,D2)
167 BOOL SetPrompt(CONST_STRPTR name) (D1)
168 BOOL GetPrompt(STRPTR buf, LONG len) (D1,D2)
169 BPTR SetProgramDir(BPTR lock) (D1)
170 BPTR GetProgramDir() ()
171 LONG SystemTagList(CONST_STRPTR command, const struct TagItem *tags) (D1,D2)
172 LONG AssignLock(CONST_STRPTR name, BPTR lock) (D1,D2)
173 BOOL AssignLate(CONST_STRPTR name, CONST_STRPTR path) (D1,D2)
174 BOOL AssignPath(CONST_STRPTR name, CONST_STRPTR path) (D1,D2)
175 BOOL AssignAdd(CONST_STRPTR name, BPTR lock) (D1,D2)
176 LONG RemAssignList(CONST_STRPTR name, BPTR lock) (D1,D2)
177 struct DevProc *GetDeviceProc(CONST_STRPTR name, struct DevProc *dp) (D1,D2)
178 void FreeDeviceProc(struct DevProc *dp) (D1)
179 struct DosList *LockDosList(ULONG flags) (D1)
180 void UnLockDosList(ULONG flags) (D1)
181 struct DosList *AttemptLockDosList(ULONG flags) (D1)
182 LONG RemDosEntry(struct DosList *dlist) (D1)
183 LONG AddDosEntry(struct DosList *dlist) (D1)
184 struct DosList *FindDosEntry(struct DosList *dlist, CONST_STRPTR name, ULONG flags) (D1,D2,D3)
185 struct DosList *NextDosEntry(struct DosList *dlist, ULONG flags) (D1,D2)
186 struct DosList * MakeDosEntry(CONST_STRPTR name, LONG type) (D1,D2)
187 void FreeDosEntry(struct DosList *dlist) (D1)
188 BOOL IsFileSystem(CONST_STRPTR devicename) (D1)
189 BOOL Format(CONST_STRPTR devicename, CONST_STRPTR volumename, ULONG dostype) (D1,D2,D3)
190 LONG Relabel(CONST_STRPTR drive, CONST_STRPTR newname) (D1,D2)
191 LONG Inhibit(CONST_STRPTR name, LONG onoff) (D1,D2)
192 BOOL AddBuffers(CONST_STRPTR devicename, LONG numbuffers) (D1,D2)
193 LONG CompareDates(const struct DateStamp *date1, const struct DateStamp *date2) (D1,D2)
194 BOOL DateToStr(struct DateTime *datetime) (D1)
195 BOOL StrToDate(struct DateTime *datetime) (D1)
196 BPTR InternalLoadSeg(BPTR fh, BPTR table, LONG_FUNC *functionarray, LONG *stack) (D0,A0,A1,A2)
197 BOOL InternalUnLoadSeg(BPTR seglist, VOID_FUNC freefunc) (D1,A1)
198 BPTR NewLoadSeg(CONST_STRPTR file, const struct TagItem *tags) (D1,D2)
199 BOOL AddSegment(CONST_STRPTR name, BPTR seg, LONG type) (D1,D2,D3)
200 struct Segment *FindSegment(CONST_STRPTR name, struct Segment *seg, BOOL system) (D1,D2,D3)
201 LONG RemSegment(struct Segment *seg) (D1)
202 LONG CheckSignal(LONG mask) (D1)
203 struct RDArgs *ReadArgs(CONST_STRPTR templ, IPTR *array, struct RDArgs *rdargs) (D1,D2,D3)
204 LONG FindArg(CONST_STRPTR templ, CONST_STRPTR keyword) (D1,D2)
205 LONG ReadItem(STRPTR buffer, LONG maxchars, struct CSource *input) (D1,D2,D3)
206 LONG StrToLong(CONST_STRPTR string, LONG *value) (D1,D2)
207 LONG MatchFirst(CONST_STRPTR pat, struct AnchorPath *AP) (D1,D2)
208 LONG MatchNext(struct AnchorPath *AP) (D1)
209 void MatchEnd(struct AnchorPath *AP) (D1)
210 LONG ParsePattern(CONST_STRPTR Source, STRPTR Dest, LONG DestLength) (D1,D2,D3)
211 BOOL MatchPattern(CONST_STRPTR pat, CONST_STRPTR str) (D1,D2)
212 .skip 1 # DosNameFromAnchor
213 void FreeArgs(struct RDArgs *args) (D1)
216 STRPTR FilePart(CONST_STRPTR path) (D1)
217 STRPTR PathPart(CONST_STRPTR path) (D1)
218 BOOL AddPart(STRPTR dirname, CONST_STRPTR filename, ULONG size) (D1,D2,D3)
219 BOOL StartNotify(struct NotifyRequest *notify) (D1)
220 void EndNotify(struct NotifyRequest *notify) (D1)
221 BOOL SetVar(CONST_STRPTR name, CONST_STRPTR buffer, LONG size, LONG flags) (D1,D2,D3,D4)
222 LONG GetVar(CONST_STRPTR name, STRPTR buffer, LONG size, LONG flags) (D1,D2,D3,D4)
223 LONG DeleteVar(CONST_STRPTR name, ULONG flags) (D1,D2)
224 struct LocalVar *FindVar(CONST_STRPTR name, ULONG type) (D1,D2)
225 IPTR CliInit(struct DosPacket *dp) (A0)
226 IPTR CliInitNewcli(struct DosPacket *dp) (A0)
227 IPTR CliInitRun(struct DosPacket *dp) (A0)
228 LONG WriteChars(CONST_STRPTR buf, ULONG buflen) (D1,D2)
229 LONG PutStr(CONST_STRPTR string) (D1)
230 LONG VPrintf(CONST_STRPTR format, IPTR *argarray) (D1,D2)
232 .version 37 # Actually, version 36.147, but let's be on the safe side
233 LONG ParsePatternNoCase(CONST_STRPTR Source, STRPTR Dest, LONG DestLength) (D1,D2,D3)
234 BOOL MatchPatternNoCase(CONST_STRPTR pat, CONST_STRPTR str) (D1,D2)
235 STRPTR DosGetString(LONG stringNum) (D1)
237 BOOL SameDevice(BPTR lock1, BPTR lock2) (D1,D2)
239 void ExAllEnd(BPTR lock, struct ExAllData *buffer, LONG size, LONG data, struct ExAllControl *control) (D1,D2,D3,D4,D5)
240 BOOL SetOwner(CONST_STRPTR name, ULONG owner_info) (D1,D2)
242 .skip 1 # MorphOS v50: LONG AddSegmentTagList(struct TagItem *tags) (A0)
243 .skip 1 # MorphOS v50: struct Segment *FindSegmentTagList(struct TagItem *tags) (A0)
244 LONG ScanVars(struct Hook * hook, ULONG flags, APTR userdata) (D1,D2,D3)
245 # The following entries are reserved for MorphOS v51 compatibility:
255 # QUAD Seek64(BPTR file, QUAD pos, LONG mode) (base,sysv)
256 # QUAD SetFileSize64(BPTR fh, QUAD pos, LONG mode) (base,sysv)
257 # LONG LockRecord64(BPTR fh, UQUAD offset, UQUAD length, ULONG mode, ULONG timeout) (base,sysv)
258 # LONG LockRecords64(struct RecordLock64 *recArray, ULONG timeout) (base,sysv)
259 # LONG UnLockRecord64(BPTR fh, UQUAD offset, UQUAD length) (base,sysv)
260 # LONG UnLockRecords64(struct RecordLock64 *recArray) (base,sysv)
263 # LONG NewReadLink( struct MsgPort *port, BPTR lock, CONST_STRPTR path, UBYTE *buffer, LONG buffer_size) (base,sysv)
264 # LONG GetFileSysAttr(CONST_STRPTR devicename, LONG attr, APTR storage, LONG storage_size) (base,sysv)
265 # LONG GetSegListAttr(BPTR seglist, LONG attr, APTR storage, LONG storage_size) (base,sysv)
266 # LONG SetDosObjectAttr(ULONG type, APTR ptr, struct TagItem *tags) (base,sysv)
267 # LONG GetDosObjectAttr(ULONG type, APTR ptr, struct TagItem *tags) (base,sysv)
268 # LONG Examine64(BPTR lock, struct FileInfoBlock *fib, struct TagItem *tags) (base,sysv)
269 # LONG ExNext64(BPTR lock, struct FileInfoBlock *fib, struct TagItem *tags) (base,sysv)
270 # LONG ExamineFH64(BPTR file, struct FileInfoBlock *fib, struct TagItem *tags) (base,sysv)