mirror of
https://github.com/cc65/cc65.git
synced 2025-01-24 20:30:08 +00:00
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
@ -9,8 +9,9 @@
|
||||
|
||||
; Struct _FILE
|
||||
.struct _FILE
|
||||
f_fd .byte
|
||||
f_flags .byte
|
||||
f_fd .byte
|
||||
f_flags .byte
|
||||
f_pushback .byte
|
||||
.endstruct
|
||||
|
||||
; Flags field
|
||||
@ -23,3 +24,4 @@ _FPUSHBACK = $08
|
||||
; File table
|
||||
.global __filetab
|
||||
|
||||
|
||||
|
@ -18,12 +18,13 @@
|
||||
|
||||
/* Definition of struct _FILE */
|
||||
struct _FILE {
|
||||
char f_fd;
|
||||
char f_flags;
|
||||
char f_fd;
|
||||
char f_flags;
|
||||
unsigned char f_pushback;
|
||||
};
|
||||
|
||||
/* File table. Beware: FOPEN_MAX is hardcoded in the ASM files! */
|
||||
extern FILE _filetab [FOPEN_MAX];
|
||||
extern FILE _filetab[FOPEN_MAX];
|
||||
|
||||
/* Flags field */
|
||||
#define _FCLOSED 0x00
|
||||
|
@ -16,11 +16,11 @@
|
||||
.data
|
||||
|
||||
__filetab:
|
||||
.byte 0, _FOPEN ; stdin
|
||||
.byte 1, _FOPEN ; stdout
|
||||
.byte 2, _FOPEN ; stderr
|
||||
.byte 0, _FOPEN, 0 ; stdin
|
||||
.byte 1, _FOPEN, 0 ; stdout
|
||||
.byte 2, _FOPEN, 0 ; stderr
|
||||
.repeat FOPEN_MAX - 3
|
||||
.byte 0, _FCLOSED ; free slot
|
||||
.byte 0, _FCLOSED, 0 ; free slot
|
||||
.endrepeat
|
||||
|
||||
|
||||
|
@ -68,7 +68,7 @@ _ferror:
|
||||
_fileno:
|
||||
jsr getf
|
||||
; bcs err
|
||||
dey
|
||||
ldy #_FILE::f_fd
|
||||
lda (ptr1),y
|
||||
ldx #0
|
||||
rts
|
||||
|
Loading…
x
Reference in New Issue
Block a user