-;
+;
; Ullrich von Bassewitz, 31.05.1998
;
; Several small file stream functions
.import __errno
.importzp ptr1
+ .include "_file.inc"
+
;
; Get the FILE* parameter, check if the file is open
;
getf: sta ptr1
stx ptr1+1
- ldy #1
- lda (ptr1),y ; get f->f_flags
- and #$01 ; file open?
- beq @L1 ; jump if no
- clc ; ok
+ ldy #_FILE_f_flags
+ lda (ptr1),y ; get f->f_flags
+ and #_FOPEN ; file open?
+ beq @L1 ; jump if no
+ clc ; ok
rts
@L1: sec
rts
jsr getf
bcs err
lda (ptr1),y
- and #$F9
+ and #<~(_FEOF | _FERROR)
sta (ptr1),y
err: rts
jsr getf
; bcs err
lda (ptr1),y
- and #$02
+ and #_FEOF
ldx #0
rts
jsr getf
; bcs err
lda (ptr1),y
- and #$04
+ and #_FERROR
ldx #0
rts