aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-files_operations.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/synth/synth-files_operations.adb')
-rw-r--r--src/synth/synth-files_operations.adb27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/synth/synth-files_operations.adb b/src/synth/synth-files_operations.adb
index 3fa075468..29c70d98d 100644
--- a/src/synth/synth-files_operations.adb
+++ b/src/synth/synth-files_operations.adb
@@ -174,12 +174,11 @@ package body Synth.Files_Operations is
end Endfile;
-- Declaration
- -- procedure FILE_OPEN (file F : FT:
+ -- procedure FILE_OPEN (file F : FT;
-- External_Name : String;
-- Open_Kind : File_Open_Kind);
- procedure Synth_File_Open (Syn_Inst : Synth_Instance_Acc;
- Imp : Node;
- Loc : Node)
+ procedure Synth_File_Open
+ (Syn_Inst : Synth_Instance_Acc; Imp : Node; Loc : Node)
is
Inters : constant Node := Get_Interface_Declaration_Chain (Imp);
F : constant File_Index := Get_Value (Syn_Inst, Inters).File;
@@ -215,6 +214,26 @@ package body Synth.Files_Operations is
end if;
end Synth_File_Open;
+ -- Declaration
+ -- procedure FILE_CLOSE (file F : FT);
+ procedure Synth_File_Close
+ (Syn_Inst : Synth_Instance_Acc; Imp : Node; Loc : Node)
+ is
+ Inters : constant Node := Get_Interface_Declaration_Chain (Imp);
+ F : constant File_Index := Get_Value (Syn_Inst, Inters).File;
+ Status : Op_Status;
+ begin
+ if Get_Text_File_Flag (Get_Type (Inters)) then
+ Ghdl_Text_File_Close (F, Status);
+ else
+ Ghdl_File_Close (F, Status);
+ end if;
+
+ if Status /= Op_Ok then
+ File_Error (Loc, Status);
+ end if;
+ end Synth_File_Close;
+
-- Declaration:
-- procedure untruncated_text_read --!V87
-- (file f : text; str : out string; len : out natural); --!V87