-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
+-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
--- Boston, MA 02110-1301, USA. --
+-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
--- As a special exception, if other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
+-- As a special exception under Section 7 of GPL version 3, you are granted --
+-- additional permissions described in the GCC Runtime Library Exception, --
+-- version 3.1, as published by the Free Software Foundation. --
+-- --
+-- You should have received a copy of the GNU General Public License and --
+-- a copy of the GCC Runtime Library Exception along with this program; --
+-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
+-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- It is never an error to call Cancel_Special_Output. It has the same
-- effect as calling Set_Special_Output (null).
+ procedure Ignore_Output (S : String);
+ -- Does nothing. To disable output, pass Ignore_Output'Access to
+ -- Set_Special_Output.
+
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) when
-- has been cancelled. Output to standard output is the default mode
-- before any call to either of the Set procedures.
+ procedure Indent;
+ -- Increases the current indentation level. Whenever a line is written
+ -- (triggered by Eol), an appropriate amount of whitespace is added to the
+ -- beginning of the line, wrapping around if it gets too long.
+
+ procedure Outdent;
+ -- Decreases the current indentation level
+
procedure Write_Char (C : Character);
- -- Write one character to the standard output file. Note that the
- -- character should not be LF or CR (use Write_Eol for end of line)
+ -- Write one character to the standard output file. If the character is LF,
+ -- this is equivalent to Write_Eol.
procedure Write_Erase_Char (C : Character);
-- If last character in buffer matches C, erase it, otherwise no effect
-- e.g. CR/LF for DOS, or LF for Unix) to the standard output file.
-- This routine also empties the line buffer, actually writing it
-- to the file. Note that Write_Eol is the only routine that causes
- -- any actual output to be written.
+ -- any actual output to be written. Trailing spaces are removed.
+
+ procedure Write_Eol_Keep_Blanks;
+ -- Similar as Write_Eol, except that trailing spaces are not removed
procedure Write_Int (Val : Int);
-- Write an integer value with no leading blanks or zeroes. Negative
procedure Restore_Output_Buffer (S : Saved_Output_Buffer);
-- Restore previously saved output buffer. The value in S is not affected
- -- so it is legtimate to restore a buffer more than once.
+ -- so it is legitimate to restore a buffer more than once.
--------------------------
-- Debugging Procedures --
-- subprograms defined in this package, and cannot be directly modified or
-- accessed by a client.
- Buffer : String (1 .. Buffer_Max + 1);
+ Buffer : String (1 .. Buffer_Max + 1) := (others => '*');
for Buffer'Alignment use 4;
-- Buffer used to build output line. We do line buffering because it
-- is needed for the support of the debug-generated-code option (-gnatD).
-- Column about to be written
type Saved_Output_Buffer is record
- Buffer : String (1 .. Buffer_Max + 1);
- Next_Col : Positive;
+ Buffer : String (1 .. Buffer_Max + 1);
+ Next_Col : Positive;
+ Cur_Indentation : Natural;
end record;
end Output;