dosdetect.o \
drives.o \
filedes.o \
- fileerr.o \
filename.o \
get_ostype.o \
gotoxy.o \
.export _close
.import closedirect, freebuffer
- .import errnoexit, oserrexit
.import return0
+ .include "errno.inc"
.include "filedes.inc"
_close:
; Return success
jmp return0
- ; Return errno
-errno: jmp errnoexit
+ ; Set __errno
+errno: jmp __directerrno
- ; Return oserror
-oserr: jmp oserrexit
+ ; Set __oserror
+oserr: jmp __mappederrno
+++ /dev/null
-;
-; Oliver Schmidt, 15.01.2004
-;
-; Error handling for ProDOS 8 file I/O
-;
-
- .export errnoexit, oserrexit
-
- .include "errno.inc"
-
-errnoexit:
- jsr __seterrno ; Returns with A = 0
-
-oserrexit:
- sta __oserror
- lda #$FF
- tax
- rts
.destructor closeallfiles, 17
.import pushname, popname
- .import errnoexit, oserrexit
.import iobuf_alloc, iobuf_free
.import addysp, incsp4, incaxy, pushax, popax
; Cleanup stack
errno: jsr incsp4 ; Preserves A
- ; Return errno
- jmp errnoexit
+ ; Set __errno
+ jmp __directerrno
; Save fdtab slot
found: tya
jsr freebuffer
pla ; Restore oserror code
- ; Return oserror
- jmp oserrexit
+ ; Set __oserror
+ jmp __mappederrno
open: ldy tmp2 ; Restore fdtab slot
.constructor initprompt
.export _read
.import rwprolog, rwcommon
- .import errnoexit
.import RDKEY, COUT
.include "zeropage.inc"
; Load errno code
einval: lda #EINVAL
- ; Return errno
-errno: jmp errnoexit
+ ; Set __errno
+errno: jmp __directerrno
;
.export _rootdir
- .import popax, oserrexit
+ .import popax
.include "zeropage.inc"
.include "errno.inc"
tax
rts
- ; Return oserror
-oserr: jmp oserrexit
+ ; Set __oserror
+oserr: jmp __mappederrno
;
.export rwprolog, rwcommon, rwepilog
- .import oserrexit
.import popax
.include "zeropage.inc"
+ .include "errno.inc"
.include "fcntl.inc"
.include "mli.inc"
.include "filedes.inc"
ldx mliparam + MLI::RW::TRANS_COUNT+1
rts
- ; Return oserror
-oserr: jmp oserrexit
+ ; Set __oserror
+oserr: jmp __mappederrno
.export _write
.import rwprolog, rwcommon, rwepilog
- .import errnoexit, oserrexit
.import COUT
.include "zeropage.inc"
; Load errno code
einval: lda #EINVAL
- ; Return errno
-errno: jmp errnoexit
+ ; Set __errno
+errno: jmp __directerrno
- ; Return oserror
-oserr: jmp oserrexit
+ ; Set __oserror
+oserr: jmp __mappederrno
dosdetect.o \
drives.o \
filedes.o \
- fileerr.o \
filename.o \
get_ostype.o \
gotoxy.o \