(in-package "AFFI")
(declare-library-base :DOSBASE "dos.library")
(format t "~&;; Warning: Please complete the prototypes for ~S manually!~%" "dos.library")

(defconstant BPTR 4)

(defflibfun 'OPEN 'DOSBASE -30 #x32 BPTR 'string -4)
(defflibfun 'CLOSE 'DOSBASE -36 #x2 0 BPTR)
(defflibfun 'READ 'DOSBASE -42 #x432 -4 BPTR :io -4)
(defflibfun 'WRITE 'DOSBASE -48 #x432 -4 BPTR :io 4) ; :io avoids copying
(defflibfun 'INPUT 'DOSBASE -54 #x0 BPTR)
(defflibfun 'OUTPUT 'DOSBASE -60 #x0 BPTR)
(defflibfun 'SEEK 'DOSBASE -66 #x432 -4 BPTR -4 -4)
(defflibfun 'DELETEFILE 'DOSBASE -72 #x2 0 'string)
(defflibfun 'RENAME 'DOSBASE -78 #x32 0 'string 'string)
(defflibfun 'LOCK 'DOSBASE -84 #x32 BPTR 'string -4)
(defflibfun 'UNLOCK 'DOSBASE -90 #x2 () BPTR)
(defflibfun 'DUPLOCK 'DOSBASE -96 #x2 BPTR BPTR)
(defflibfun 'EXAMINE 'DOSBASE -102 #x32 0 BPTR :io)
(defflibfun 'EXNEXT 'DOSBASE -108 #x32 0 BPTR :io)
(defflibfun 'INFO 'DOSBASE -114 #x32 0 BPTR :io)
(defflibfun 'CREATEDIR 'DOSBASE -120 #x2 BPTR 'string)
(defflibfun 'CURRENTDIR 'DOSBASE -126 #x2 BPTR BPTR)
(defflibfun 'IOERR 'DOSBASE -132 #x0 -4)
(defflibfun 'CREATEPROC 'DOSBASE -138 #x5432 :external 'string -1 BPTR 4)
;;(defflibfun 'EXIT 'DOSBASE -144 #x2 () -4)
(defflibfun 'LOADSEG 'DOSBASE -150 #x2 BPTR 'string)
(defflibfun 'UNLOADSEG 'DOSBASE -156 #x2 -2 BPTR)
(defflibfun 'DEVICEPROC 'DOSBASE -174 #x2 :external 'string)
(defflibfun 'SETCOMMENT 'DOSBASE -180 #x32 0 'string 'string)
(defflibfun 'SETPROTECTION 'DOSBASE -186 #x32 0 'string 4)
(defflibfun 'DATESTAMP 'DOSBASE -192 #x2 '* '*)
(defflibfun 'DELAY 'DOSBASE -198 #x2 () 4)
(defflibfun 'WAITFORCHAR 'DOSBASE -204 #x32 0 BPTR 4)
(defflibfun 'PARENTDIR 'DOSBASE -210 #x2 BPTR BPTR)
(defflibfun 'ISINTERACTIVE 'DOSBASE -216 #x2 0 BPTR)
(defflibfun 'EXECUTE 'DOSBASE -222 #x432 0 'string BPTR BPTR)
(defflibfun 'ALLOCDOSOBJECT 'DOSBASE -228 #x32 '* 4 '*)
(defflibfun 'FREEDOSOBJECT 'DOSBASE -234 #x32 () 4 :external)
(defflibfun 'DOPKT 'DOSBASE -240 #x8765432 -4 '* -4 -4 -4 -4 -4 -4)
(defflibfun 'SENDPKT 'DOSBASE -246 #x432 '* '* '* '*)
(defflibfun 'WAITPKT 'DOSBASE -252 #x0 '*)
(defflibfun 'REPLYPKT 'DOSBASE -258 #x432 '* '* '* '*)
(defflibfun 'ABORTPKT 'DOSBASE -264 #x32 '* '* '*)
(defflibfun 'LOCKRECORD 'DOSBASE -270 #x65432 '* '* '* '* '* '*)
(defflibfun 'LOCKRECORDS 'DOSBASE -276 #x32 '* '* '*)
(defflibfun 'UNLOCKRECORD 'DOSBASE -282 #x432 '* '* '* '*)
(defflibfun 'UNLOCKRECORDS 'DOSBASE -288 #x2 '* '*)
(defflibfun 'SELECTINPUT 'DOSBASE -294 #x2 BPTR BPTR)
(defflibfun 'SELECTOUTPUT 'DOSBASE -300 #x2 BPTR BPTR)
(defflibfun 'FGETC 'DOSBASE -306 #x2 -2 BPTR)
(defflibfun 'FPUTC 'DOSBASE -312 #x32 -2 BPTR -4)
(defflibfun 'UNGETC 'DOSBASE -318 #x32 -4 BPTR -4)
(defflibfun 'FREAD 'DOSBASE -324 #x5432 '* '* '* '* '*)
(defflibfun 'FWRITE 'DOSBASE -330 #x5432 4 BPTR :io 4 4)
(defflibfun 'FGETS 'DOSBASE -336 #x432 '* BPTR :io 4)
(defflibfun 'FPUTS 'DOSBASE -342 #x32 -4 BPTR 'string)
(defflibfun 'VFWRITEF 'DOSBASE -348 #x432 () BPTR 'string '*)
(defflibfun 'VFPRINTF 'DOSBASE -354 #x432 -4 BPTR 'string '*)
(defflibfun 'FLUSH 'DOSBASE -360 #x2 0 BPTR)
(defflibfun 'SETVBUF 'DOSBASE -366 #x5432 -4 BPTR :external -4 -4)
(defflibfun 'DUPLOCKFROMFH 'DOSBASE -372 #x2 '* '*)
(defflibfun 'OPENFROMLOCK 'DOSBASE -378 #x2 BPTR BPTR)
(defflibfun 'PARENTOFFH 'DOSBASE -384 #x2 BPTR BPTR)
(defflibfun 'EXAMINEFH 'DOSBASE -390 #x32 0 BPTR :io)
(defflibfun 'SETFILEDATE 'DOSBASE -396 #x32 0 'string '*)
(defflibfun 'NAMEFROMLOCK 'DOSBASE -402 #x432 0 BPTR :io 4)
(defflibfun 'NAMEFROMFH 'DOSBASE -408 #x432 0 BPTR :io 4)
(defflibfun 'SPLITNAME 'DOSBASE -414 #x65432 '* '* '* '* '* '*)
(defflibfun 'SAMELOCK 'DOSBASE -420 #x32 -4 BPTR BPTR)
(defflibfun 'SETMODE 'DOSBASE -426 #x32 0 BPTR -4)
(defflibfun 'EXALL 'DOSBASE -432 #x65432 0 BPTR 'string 4 -4 '*)
(defflibfun 'READLINK 'DOSBASE -438 #x65432 0 :external BPTR 'string :io 4)
(defflibfun 'MAKELINK 'DOSBASE -444 #x432 0 'string '* -4)
(defflibfun 'CHANGEMODE 'DOSBASE -450 #x432 0 4 BPTR -4)
(defflibfun 'SETFILESIZE 'DOSBASE -456 #x432 -4 BPTR -4 -4)
(defflibfun 'SETIOERR 'DOSBASE -462 #x2 -4 -4)
(defflibfun 'FAULT 'DOSBASE -468 #x5432 -4 -4 'string :io 4)
(defflibfun 'PRINTFAULT 'DOSBASE -474 #x32 -4 -4 'string)
(defflibfun 'ERRORREPORT 'DOSBASE -480 #x5432 '* '* '* '* '*)
(defflibfun 'CLI 'DOSBASE -492 #x0 '*)
(defflibfun 'CREATENEWPROC 'DOSBASE -498 #x2 :external '*)
(defflibfun 'RUNCOMMAND 'DOSBASE -504 #x5432 '* '* '* '* '*)
(defflibfun 'GETCONSOLETASK 'DOSBASE -510 #x0 :external)
(defflibfun 'SETCONSOLETASK 'DOSBASE -516 #x2 :external :external)
(defflibfun 'GETFILESYSTASK 'DOSBASE -522 #x0 :external)
(defflibfun 'SETFILESYSTASK 'DOSBASE -528 #x2 :external :external)
(defflibfun 'GETARGSTR 'DOSBASE -534 #x0 'string)
(defflibfun 'SETARGSTR 'DOSBASE -540 #x2 '* '*)
(defflibfun 'FINDCLIPROC 'DOSBASE -546 #x2 :external 4)
(defflibfun 'MAXCLI 'DOSBASE -552 #x0 '*)
(defflibfun 'SETCURRENTDIRNAME 'DOSBASE -558 #x2 '* '*)
(defflibfun 'GETCURRENTDIRNAME 'DOSBASE -564 #x32 0 :io 4)
(defflibfun 'SETPROGRAMNAME 'DOSBASE -570 #x2 '* '*)
(defflibfun 'GETPROGRAMNAME 'DOSBASE -576 #x32 -2 :io 4)
(defflibfun 'SETPROMPT 'DOSBASE -582 #x2 '* '*)
(defflibfun 'GETPROMPT 'DOSBASE -588 #x32 -2 :io 4)
(defflibfun 'SETPROGRAMDIR 'DOSBASE -594 #x2 '* '*)
(defflibfun 'GETPROGRAMDIR 'DOSBASE -600 #x0 BPTR)
(defflibfun 'SYSTEMTAGLIST 'DOSBASE -606 #x32 -4 'string '*)
(defflibfun 'ASSIGNLOCK 'DOSBASE -612 #x32 '* '* '*)
(defflibfun 'ASSIGNLATE 'DOSBASE -618 #x32 '* '* '*)
(defflibfun 'ASSIGNPATH 'DOSBASE -624 #x32 '* '* '*)
(defflibfun 'ASSIGNADD 'DOSBASE -630 #x32 '* '* '*)
(defflibfun 'REMASSIGNLIST 'DOSBASE -636 #x32 '* '* '*)
(defflibfun 'GETDEVICEPROC 'DOSBASE -642 #x32 :external 'string :external)
(defflibfun 'FREEDEVICEPROC 'DOSBASE -648 #x2 () :external)
;(defflibfun 'LOCKDOSLIST 'DOSBASE -654 #x2 '* '*)
;(defflibfun 'UNLOCKDOSLIST 'DOSBASE -660 #x2 '* '*)
(defflibfun 'ATTEMPTLOCKDOSLIST 'DOSBASE -666 #x2 '* '*)
(defflibfun 'REMDOSENTRY 'DOSBASE -672 #x2 '* '*)
(defflibfun 'ADDDOSENTRY 'DOSBASE -678 #x2 '* '*)
(defflibfun 'FINDDOSENTRY 'DOSBASE -684 #x432 '* '* '* '*)
(defflibfun 'NEXTDOSENTRY 'DOSBASE -690 #x32 '* '* '*)
(defflibfun 'MAKEDOSENTRY 'DOSBASE -696 #x32 '* '* '*)
(defflibfun 'FREEDOSENTRY 'DOSBASE -702 #x2 '* '*)
(defflibfun 'ISFILESYSTEM 'DOSBASE -708 #x2 0 'string)
(defflibfun 'FORMAT 'DOSBASE -714 #x432 '* '* '* '*)
(defflibfun 'RELABEL 'DOSBASE -720 #x32 '* '* '*)
;(defflibfun 'INHIBIT 'DOSBASE -726 #x32 '* '* '*)
(defflibfun 'ADDBUFFERS 'DOSBASE -732 #x32 -4 'string -4)
(defflibfun 'COMPAREDATES 'DOSBASE -738 #x32 '* '* '*)
(defflibfun 'DATETOSTR 'DOSBASE -744 #x2 0 '*)
(defflibfun 'STRTODATE 'DOSBASE -750 #x2 0 '*)
(defflibfun 'INTERNALLOADSEG 'DOSBASE -756 #xBA91 '* '* '* '* '*)
(defflibfun 'INTERNALUNLOADSEG 'DOSBASE -762 #xA2 '* '* '*)
(defflibfun 'NEWLOADSEG 'DOSBASE -768 #x32 BPTR 'string '*)
(defflibfun 'ADDSEGMENT 'DOSBASE -774 #x432 '* '* '* '*)
(defflibfun 'FINDSEGMENT 'DOSBASE -780 #x432 '* '* '* '*)
(defflibfun 'REMSEGMENT 'DOSBASE -786 #x2 '* '*)
(defflibfun 'CHECKSIGNAL 'DOSBASE -792 #x2 4 4)
(defflibfun 'READARGS 'DOSBASE -798 #x432 '* '* '* '*)
(defflibfun 'FINDARG 'DOSBASE -804 #x32 -4 'string 'string)
(defflibfun 'READITEM 'DOSBASE -810 #x432 '* '* '* '*)
(defflibfun 'STRTOLONG 'DOSBASE -816 #x32 -4 'string '*)
(defflibfun 'MATCHFIRST 'DOSBASE -822 #x32 -4 'string '*)
(defflibfun 'MATCHNEXT 'DOSBASE -828 #x2 -4 '*)
(defflibfun 'MATCHEND 'DOSBASE -834 #x2 () '*)
(defflibfun 'PARSEPATTERN 'DOSBASE -840 #x432 -4 'string :io 4)
(defflibfun 'MATCHPATTERN 'DOSBASE -846 #x32 -2 :io 'string) ; do not copy
(defflibfun 'FREEARGS 'DOSBASE -858 #x2 '* '*)
(defflibfun 'FILEPART 'DOSBASE -870 #x2 '* '*) ;dangerous: returns pointer into string
(defflibfun 'PATHPART 'DOSBASE -876 #x2 '* '*) ;dangerous: returns pointer into string
(defflibfun 'ADDPART 'DOSBASE -882 #x432 0 :io 'string 4)
(defflibfun 'STARTNOTIFY 'DOSBASE -888 #x2 '* '*)
(defflibfun 'ENDNOTIFY 'DOSBASE -894 #x2 '* '*)
(defflibfun 'SETVAR 'DOSBASE -900 #x5432 -2 'string 'string -4 4)
(defflibfun 'GETVAR 'DOSBASE -906 #x5432 -4 'string 'string -4 4)
(defflibfun 'DELETEVAR 'DOSBASE -912 #x32 0 'string 4)
(defflibfun 'FINDVAR 'DOSBASE -918 #x32 :external 'string 4)
(defflibfun 'CLIINITNEWCLI 'DOSBASE -930 #x9 4 :external)
(defflibfun 'CLIINITRUN 'DOSBASE -936 #x9 4 :external)
(defflibfun 'WRITECHARS 'DOSBASE -942 #x32 -4 :io 4)
(defflibfun 'PUTSTR 'DOSBASE -948 #x2 0 'string)
(defflibfun 'VPRINTF 'DOSBASE -954 #x32 -4 'string '*)
(defflibfun 'PARSEPATTERNNOCASE 'DOSBASE -966 #x432 -4 'string :io 4)
(defflibfun 'MATCHPATTERNNOCASE 'DOSBASE -972 #x32 -2 :io 'string) ; do not copy
(defflibfun 'SAMEDEVICE 'DOSBASE -984 #x32 -2 BPTR BPTR) ;only bits 0-15
(defflibfun 'EXALLEND 'DOSBASE -990 #x65432 '* '* '* '* '* '*)
(defflibfun 'SETOWNER 'DOSBASE -996 #x32 '* '* '*)

(provide "dos.library")
