]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/gm2-libs-iso/RTfio.def
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / gm2-libs-iso / RTfio.def
CommitLineData
1eee94d3
GM
1(* RTfio.def provide default FIO based methods.
2
a945c346 3Copyright (C) 2008-2024 Free Software Foundation, Inc.
1eee94d3
GM
4Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
5
6This file is part of GNU Modula-2.
7
8GNU Modula-2 is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GNU Modula-2 is distributed in the hope that it will be useful, but
14WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16General Public License for more details.
17
18Under Section 7 of GPL version 3, you are granted additional
19permissions described in the GCC Runtime Library Exception, version
203.1, as published by the Free Software Foundation.
21
22You should have received a copy of the GNU General Public License and
23a copy of the GCC Runtime Library Exception along with this program;
24see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25<http://www.gnu.org/licenses/>. *)
26
27DEFINITION MODULE RTfio ;
28
29(*
30 Title : RTfio
31 Author : Gaius Mulley
32 System : GNU Modula-2
33 Date : Wed Sep 24 11:54:58 2008
34 Revision : $Version$
35 Description: provides default FIO based methods for the RTgenif
36 procedures. These will be used by StreamFile,
37 SeqFile, StdChans, TermFile and RndFile.
38*)
39
40FROM SYSTEM IMPORT ADDRESS ;
41FROM IOLink IMPORT DeviceTablePtr;
42FROM RTgenif IMPORT GenDevIF ;
43
44
45(*
46 doreadchar - returns a CHAR from the file associated with, g.
47*)
48
49PROCEDURE doreadchar (g: GenDevIF; d: DeviceTablePtr) : CHAR ;
50
51
52(*
53 dounreadchar - pushes a CHAR back onto the file associated
54 with, g.
55*)
56
57PROCEDURE dounreadchar (g: GenDevIF; d: DeviceTablePtr; ch: CHAR) : CHAR ;
58
59
60(*
61 dogeterrno - returns the errno relating to the generic device.
62*)
63
64PROCEDURE dogeterrno (g: GenDevIF; d: DeviceTablePtr) : INTEGER ;
65
66
67(*
68 dorbytes - reads upto, max, bytes setting, actual, and
69 returning FALSE if an error (not due to eof)
70 occurred.
71*)
72
73PROCEDURE dorbytes (g: GenDevIF;
74 d: DeviceTablePtr;
75 to: ADDRESS;
76 max: CARDINAL;
77 VAR actual: CARDINAL) : BOOLEAN ;
78
79(*
80 dowbytes - writes up to, nBytes. It returns FALSE
81 if an error occurred and it sets actual
82 to the amount of data written.
83*)
84
85PROCEDURE dowbytes (g: GenDevIF;
86 d: DeviceTablePtr;
87 from: ADDRESS;
88 nBytes: CARDINAL;
89 VAR actual: CARDINAL) : BOOLEAN ;
90
91
92(*
93 dowriteln - attempt to write an end of line marker to the
94 file and returns TRUE if successful.
95*)
96
97PROCEDURE dowriteln (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
98
99
100(*
101 iseof - returns TRUE if end of file has been seen.
102*)
103
104PROCEDURE iseof (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
105
106
107(*
108 iseoln - returns TRUE if end of line has been seen.
109*)
110
111PROCEDURE iseoln (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
112
113
114(*
115 iserror - returns TRUE if an error was seen on the device.
116 Note that reaching EOF is not classified as an
117 error.
118*)
119
120PROCEDURE iserror (g: GenDevIF; d: DeviceTablePtr) : BOOLEAN ;
121
122
123END RTfio.