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