aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/output.ads
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/output.ads')
-rw-r--r--gcc/ada/output.ads63
1 files changed, 37 insertions, 26 deletions
diff --git a/gcc/ada/output.ads b/gcc/ada/output.ads
index bc61989..a660529 100644
--- a/gcc/ada/output.ads
+++ b/gcc/ada/output.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- $Revision: 1.28 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
@@ -42,41 +42,47 @@ with Types; use Types;
package Output is
pragma Elaborate_Body (Output);
- -------------------------
- -- Line Buffer Control --
- -------------------------
-
- -- Note: the following buffer and column position are maintained by
- -- the subprograms defined in this package, and are not normally
- -- directly modified or accessed by a client. However, a client is
- -- permitted to modify these values, using the knowledge that only
- -- Write_Eol actually generates any output.
-
- Buffer_Max : constant := 8192;
- Buffer : String (1 .. Buffer_Max + 1);
- -- Buffer used to build output line. We do line buffering because it
- -- is needed for the support of the debug-generated-code option (-gnatD).
- -- Historically it was first added because on VMS, line buffering is
- -- needed with certain file formats. So in any case line buffering must
- -- be retained for this purpose, even if other reasons disappear. Note
- -- any attempt to write more output to a line than can fit in the buffer
- -- will be silently ignored.
-
- Column : Pos range 1 .. Buffer'Length + 1 := 1;
- -- Column about to be written.
+ type Output_Proc is access procedure (S : String);
+ -- This type is used for the Set_Special_Output procedure. If this
+ -- procedure is called, then instead of lines being written to
+ -- standard error or standard output, a call is made to the given
+ -- procedure for each line, passing the line with an end of line
+ -- character (which is a single ASCII.LF character, even in systems
+ -- which normally use CR/LF or some other sequence for line end).
-----------------
-- Subprograms --
-----------------
+ procedure Set_Special_Output (P : Output_Proc);
+ -- Sets subsequent output to call procedure P. If P is null, then
+ -- the call cancels the effect of a previous call, reverting the
+ -- output to standard error or standard output depending on the
+ -- mode at the time of previous call. Any exception generated by
+ -- by calls to P is simply propagated to the caller of the routine
+ -- causing the write operation.
+
+ procedure Cancel_Special_Output;
+ -- Cancels the effect of a call to Set_Special_Output, if any.
+ -- The output is then directed to standard error or standard output
+ -- depending on the last call to Set_Standard_Error or Set_Standard_Output.
+ -- It is never an error to call Cancel_Special_Output. It has the same
+ -- effect as calling Set_Special_Output (null).
+
procedure Set_Standard_Error;
-- Sets subsequent output to appear on the standard error file (whatever
- -- that might mean for the host operating system, if anything).
+ -- that might mean for the host operating system, if anything) when
+ -- no special output is in effect. When a special output is in effect,
+ -- the output will appear on standard error only after special output
+ -- has been cancelled.
procedure Set_Standard_Output;
-- Sets subsequent output to appear on the standard output file (whatever
- -- that might mean for the host operating system, if anything). This is
- -- the default mode before any call to either of the Set procedures.
+ -- that might mean for the host operating system, if anything) when
+ -- no special output is in effect. When a special output is in effect,
+ -- the output will appear on standard output only after special output
+ -- has been cancelled. Output to standard output is the default mode
+ -- before any call to either of the Set procedures.
procedure Write_Char (C : Character);
-- Write one character to the standard output file. Note that the
@@ -102,6 +108,11 @@ pragma Elaborate_Body (Output);
procedure Write_Line (S : String);
-- Equivalent to Write_Str (S) followed by Write_Eol;
+ function Column return Nat;
+ pragma Inline (Column);
+ -- Returns the number of the column about to be written (e.g. a value
+ -- of 1 means the current line is empty).
+
--------------------------
-- Debugging Procedures --
--------------------------