aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt/grt-errors.adb
diff options
context:
space:
mode:
authorBrian Drummond <brian@shapes.demon.co.uk>2017-10-04 19:05:36 +0100
committerTristan Gingold <tgingold@free.fr>2017-10-05 06:15:25 +0200
commitffd9fe10d40a133786358828cfab361377b9e8de (patch)
tree7e74087448bc579f922a3b6dfc995c0fc807c8d4 /src/grt/grt-errors.adb
parent6a465e007f8cd5be01137e2981c5a4864b46cd5b (diff)
downloadghdl-ffd9fe10d40a133786358828cfab361377b9e8de.tar.gz
ghdl-ffd9fe10d40a133786358828cfab361377b9e8de.tar.bz2
ghdl-ffd9fe10d40a133786358828cfab361377b9e8de.zip
Make error stream available for additional reporting : see issue #26
Diffstat (limited to 'src/grt/grt-errors.adb')
-rw-r--r--src/grt/grt-errors.adb25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/grt/grt-errors.adb b/src/grt/grt-errors.adb
index 28ee85963..e9e2f54ad 100644
--- a/src/grt/grt-errors.adb
+++ b/src/grt/grt-errors.adb
@@ -30,12 +30,17 @@ with Grt.Backtraces;
package body Grt.Errors is
-- Output stream to send error messages
- Out_Stream : FILEs;
+ Error_Stream : FILEs;
- procedure Set_Out_Stream (Stream : Grt.Stdio.FILEs) is
+ procedure Set_Error_Stream (Stream : Grt.Stdio.FILEs) is
begin
- Out_Stream := Stream;
- end Set_Out_Stream;
+ Error_Stream := Stream;
+ end Set_Error_Stream;
+
+ function Get_Error_Stream return Grt.Stdio.FILEs is
+ begin
+ return Error_Stream;
+ end Get_Error_Stream;
-- Called in case of premature exit.
-- CODE is 0 for success, 1 for failure.
@@ -82,27 +87,27 @@ package body Grt.Errors is
procedure Put_Err (Str : String) is
begin
- Put (Out_Stream, Str);
+ Put (Error_Stream, Str);
end Put_Err;
procedure Put_Err (C : Character) is
begin
- Put (Out_Stream, C);
+ Put (Error_Stream, C);
end Put_Err;
procedure Put_Err (Str : Ghdl_C_String) is
begin
- Put (Out_Stream, Str);
+ Put (Error_Stream, Str);
end Put_Err;
procedure Put_Err (N : Integer) is
begin
- Put_I32 (Out_Stream, Ghdl_I32 (N));
+ Put_I32 (Error_Stream, Ghdl_I32 (N));
end Put_Err;
procedure Newline_Err is
begin
- New_Line (Out_Stream);
+ New_Line (Error_Stream);
end Newline_Err;
-- procedure Put_Err (Str : Ghdl_Str_Len_Type)
@@ -141,7 +146,7 @@ package body Grt.Errors is
procedure Report_Now_C is
begin
- Put_Time (Out_Stream, Grt.Types.Current_Time);
+ Put_Time (Error_Stream, Grt.Types.Current_Time);
end Report_Now_C;
procedure Report_E (Str : String) is