]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR modula2/120912: Request for a procedure to obtain a file from an IOChan
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 1 Jul 2025 17:21:15 +0000 (18:21 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 1 Jul 2025 17:21:15 +0000 (18:21 +0100)
This patch introduces the procedure GetFile into the supplementary
ISO style library IOChanUtils.

gcc/m2/ChangeLog:

PR modula2/120912
* gm2-libs-iso/IOChanUtils.def (GetFile): New procedure function.
* gm2-libs-iso/IOChanUtils.mod (GetFile): New procedure function.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-libs-iso/IOChanUtils.def
gcc/m2/gm2-libs-iso/IOChanUtils.mod

index e38f83a3483415ceaa82082f80a365a181cb1552..3a8a0c61e7aaa9446ce1b3e0f3de478453cf09fc 100644 (file)
@@ -11,6 +11,7 @@ DEFINITION MODULE IOChanUtils ;
 *)
 
 FROM DynamicStrings IMPORT String ;
+FROM FIO IMPORT File ;
 
 IMPORT IOChan ;
 
@@ -24,4 +25,11 @@ IMPORT IOChan ;
 PROCEDURE GetFileName (c: IOChan.ChanId) : String ;
 
 
+(*
+   GetFile - returns the FIO.File associated with ChanId c.
+*)
+
+PROCEDURE GetFile (c: IOChan.ChanId) : File ;
+
+
 END IOChanUtils.
index 5cbb2a96192fd338098d9d2e710f68be48f2599f..168fe0dda9c7879d4006e097792ffe913da9ab21 100644 (file)
@@ -11,8 +11,18 @@ IMPORT IOChan, SFIO, RTio ;
 
 PROCEDURE GetFileName (c: IOChan.ChanId) : String ;
 BEGIN
-   RETURN SFIO.GetFileName (RTio.GetFile (c))
+   RETURN SFIO.GetFileName (GetFile (c))
 END GetFileName ;
 
 
+(*
+   GetFile - returns the FIO.File associated with ChanId c.
+*)
+
+PROCEDURE GetFile (c: IOChan.ChanId) : File ;
+BEGIN
+   RETURN RTio.GetFile (c)
+END GetFile ;
+
+
 END IOChanUtils.