From d2351bba49f217459d133d4d0f661dce269cb6ab Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 12 May 2004 13:16:36 +0000 Subject: [PATCH] Added pushback char to struct FILE git-svn-id: svn://svn.cc65.org/cc65/trunk@3028 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- asminc/_file.inc | 6 ++++-- libsrc/common/_file.h | 7 ++++--- libsrc/common/_file.s | 8 ++++---- libsrc/common/fmisc.s | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/asminc/_file.inc b/asminc/_file.inc index 916215bce..2f9938a3e 100644 --- a/asminc/_file.inc +++ b/asminc/_file.inc @@ -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 + diff --git a/libsrc/common/_file.h b/libsrc/common/_file.h index f1f9af306..8ee46ff2a 100644 --- a/libsrc/common/_file.h +++ b/libsrc/common/_file.h @@ -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 diff --git a/libsrc/common/_file.s b/libsrc/common/_file.s index b34a135aa..84686a062 100644 --- a/libsrc/common/_file.s +++ b/libsrc/common/_file.s @@ -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 diff --git a/libsrc/common/fmisc.s b/libsrc/common/fmisc.s index c9125939e..98ad7214c 100644 --- a/libsrc/common/fmisc.s +++ b/libsrc/common/fmisc.s @@ -68,7 +68,7 @@ _ferror: _fileno: jsr getf ; bcs err - dey + ldy #_FILE::f_fd lda (ptr1),y ldx #0 rts -- 2.39.5