1 (* RTgen.def provide a generic device interface used by ISO.
3 Copyright (C) 2008-2023 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
6 This file is part of GNU Modula-2.
8 GNU Modula-2 is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 GNU Modula-2 is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 Under Section 7 of GPL version 3, you are granted additional
19 permissions described in the GCC Runtime Library Exception, version
20 3.1, as published by the Free Software Foundation.
22 You should have received a copy of the GNU General Public License and
23 a copy of the GCC Runtime Library Exception along with this program;
24 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
25 <http://www.gnu.org/licenses/>. *)
27 DEFINITION MODULE RTgen ;
33 Date : Mon Sep 22 18:15:35 2008
35 Description: provides a generic device interface between
36 ISO channels and the underlying PIM style
40 FROM RTgenif IMPORT GenDevIF ;
41 FROM IOLink IMPORT DeviceId, DeviceTablePtr;
42 FROM IOConsts IMPORT ReadResults ;
43 FROM SYSTEM IMPORT ADDRESS ;
48 DeviceType = (seqfile, streamfile, programargs, stdchans, term, socket, rndfile) ;
52 InitChanDev - initialize and return a ChanDev.
55 PROCEDURE InitChanDev (t: DeviceType; d: DeviceId; g: GenDevIF) : ChanDev ;
59 KillChanDev - deallocates, g.
62 PROCEDURE KillChanDev (g: GenDevIF) : GenDevIF ;
66 RaiseEOFinLook - returns TRUE if the Look procedure
67 should raise an exception if it
71 PROCEDURE RaiseEOFinLook (g: ChanDev) : BOOLEAN ;
75 RaiseEOFinSkip - returns TRUE if the Skip procedure
76 should raise an exception if it
80 PROCEDURE RaiseEOFinSkip (g: ChanDev) : BOOLEAN ;
83 PROCEDURE doLook (g: ChanDev;
88 PROCEDURE doSkip (g: ChanDev;
91 PROCEDURE doSkipLook (g: ChanDev;
96 PROCEDURE doWriteLn (g: ChanDev;
99 PROCEDURE doReadText (g: ChanDev;
103 VAR charsRead: CARDINAL) ;
105 PROCEDURE doWriteText (g: ChanDev;
108 charsToWrite: CARDINAL) ;
110 PROCEDURE doReadLocs (g: ChanDev;
114 VAR locsRead: CARDINAL) ;
116 PROCEDURE doWriteLocs (g: ChanDev;
119 locsToWrite: CARDINAL) ;
122 checkErrno - checks a number of errno conditions and raises
123 appropriate ISO exceptions if they occur.
126 PROCEDURE checkErrno (g: ChanDev; d: DeviceTablePtr) ;