2 ; Ullrich von Bassewitz, 31.05.1998
4 ; Several small file stream functions
7 .export _clearerr, _feof, _ferror, _fileno, _fflush
15 ; Get the FILE* parameter, check if the file is open. Returns zero in A
16 ; and zero flag set in case of an error.
22 lda (ptr1),y ; get f->f_flags
23 and #_FOPEN ; file open?
28 ; void clearerr (FILE* f);
35 and #<~(_FEOF | _FERROR)
46 beq @L1 ; Return 0 on error
54 ; int ferror (FILE* f);
59 beq @L1 ; Return 0 on error
67 ; int fileno (FILE* f);
78 ; If the file is not valid, fileno must set errno and return -1
88 ; int __fastcall__ fflush (FILE* f);