gm2-libs-iso/RTfio
DEFINITION MODULE RTfio ;
(*
Description: provides default FIO based methods for the RTgenif
procedures. These will be used by StreamFile,
SeqFile, StdChans, TermFile and RndFile.
*)
FROM SYSTEM IMPORT ADDRESS ;
FROM IOLink IMPORT DeviceTablePtr;
FROM RTgenif IMPORT GenDevIF ;
(*
doreadchar - returns a CHAR from the file associated with, g.
*)
PROCEDURE doreadchar (g: GenDevIF; d: DeviceTablePtr) : CHAR ;
(*
dounreadchar - pushes a CHAR back onto the file associated
with, g.
*)
PROCEDURE dounreadchar (g: GenDevIF; d: DeviceTablePtr; ch: CHAR) : CHAR ;
(*
dogeterrno - returns the errno relating to the generic device.
*)
PROCEDURE dogeterrno (g: GenDevIF; d: DeviceTablePtr) : INTEGER ;
(*
dorbytes - reads upto, max, bytes setting, actual, and
returning FALSE if an error (not due to eof)
occurred.
*)
PROCEDURE dorbytes (g: GenDevIF;
d: DeviceTablePtr;
to: ADDRESS;
max: CARDINAL;
VAR actual: CARDINAL) : BOOLEAN ;
(*
dowbytes - writes up to, nBytes. It returns FALSE
if an error occurred and it sets actual
to the amount of data written.
*)
PROCEDURE dowbytes (g: GenDevIF;
d: DeviceTablePtr;
from: ADDRESS;
nBytes: CARDINAL;
VAR actual: CARDINAL) : BOOLEAN ;
(*
dowriteln - attempt to write an end of line marker to the
file and returns TRUE if successful.
*)
PROCEDURE dowriteln (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
(*
iseof - returns TRUE if end of file has been seen.
*)
PROCEDURE iseof (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
(*
iseoln - returns TRUE if end of line has been seen.
*)
PROCEDURE iseoln (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
(*
iserror - returns TRUE if an error was seen on the device.
Note that reaching EOF is not classified as an
error.
*)
PROCEDURE iserror (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
END RTfio.