Added pushback char to struct FILE
git-svn-id: svn://svn.cc65.org/cc65/trunk@3028 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
51d536da7a
commit
d2351bba49
4 changed files with 13 additions and 10 deletions
|
@ -11,6 +11,7 @@
|
||||||
.struct _FILE
|
.struct _FILE
|
||||||
f_fd .byte
|
f_fd .byte
|
||||||
f_flags .byte
|
f_flags .byte
|
||||||
|
f_pushback .byte
|
||||||
.endstruct
|
.endstruct
|
||||||
|
|
||||||
; Flags field
|
; Flags field
|
||||||
|
@ -23,3 +24,4 @@ _FPUSHBACK = $08
|
||||||
; File table
|
; File table
|
||||||
.global __filetab
|
.global __filetab
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
struct _FILE {
|
struct _FILE {
|
||||||
char f_fd;
|
char f_fd;
|
||||||
char f_flags;
|
char f_flags;
|
||||||
|
unsigned char f_pushback;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* File table. Beware: FOPEN_MAX is hardcoded in the ASM files! */
|
/* File table. Beware: FOPEN_MAX is hardcoded in the ASM files! */
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
.data
|
.data
|
||||||
|
|
||||||
__filetab:
|
__filetab:
|
||||||
.byte 0, _FOPEN ; stdin
|
.byte 0, _FOPEN, 0 ; stdin
|
||||||
.byte 1, _FOPEN ; stdout
|
.byte 1, _FOPEN, 0 ; stdout
|
||||||
.byte 2, _FOPEN ; stderr
|
.byte 2, _FOPEN, 0 ; stderr
|
||||||
.repeat FOPEN_MAX - 3
|
.repeat FOPEN_MAX - 3
|
||||||
.byte 0, _FCLOSED ; free slot
|
.byte 0, _FCLOSED, 0 ; free slot
|
||||||
.endrepeat
|
.endrepeat
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ _ferror:
|
||||||
_fileno:
|
_fileno:
|
||||||
jsr getf
|
jsr getf
|
||||||
; bcs err
|
; bcs err
|
||||||
dey
|
ldy #_FILE::f_fd
|
||||||
lda (ptr1),y
|
lda (ptr1),y
|
||||||
ldx #0
|
ldx #0
|
||||||
rts
|
rts
|
||||||
|
|
Loading…
Add table
Reference in a new issue