diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2025-07-01 18:21:15 +0100 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2025-07-01 18:21:15 +0100 |
commit | 15670d4477ce219c017bd52417a6074b981fb197 (patch) | |
tree | 104593aed086b69b355d7f8918c492959608c5b2 | |
parent | 8deef83915f9e0fb14f278c68527c95085461c41 (diff) | |
download | gcc-15670d4477ce219c017bd52417a6074b981fb197.zip gcc-15670d4477ce219c017bd52417a6074b981fb197.tar.gz gcc-15670d4477ce219c017bd52417a6074b981fb197.tar.bz2 |
PR modula2/120912: Request for a procedure to obtain a file from an IOChan
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>
-rw-r--r-- | gcc/m2/gm2-libs-iso/IOChanUtils.def | 8 | ||||
-rw-r--r-- | gcc/m2/gm2-libs-iso/IOChanUtils.mod | 12 |
2 files changed, 19 insertions, 1 deletions
diff --git a/gcc/m2/gm2-libs-iso/IOChanUtils.def b/gcc/m2/gm2-libs-iso/IOChanUtils.def index e38f83a..3a8a0c6 100644 --- a/gcc/m2/gm2-libs-iso/IOChanUtils.def +++ b/gcc/m2/gm2-libs-iso/IOChanUtils.def @@ -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. diff --git a/gcc/m2/gm2-libs-iso/IOChanUtils.mod b/gcc/m2/gm2-libs-iso/IOChanUtils.mod index 5cbb2a9..168fe0d 100644 --- a/gcc/m2/gm2-libs-iso/IOChanUtils.mod +++ b/gcc/m2/gm2-libs-iso/IOChanUtils.mod @@ -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. |