aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/g-cgideb.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/g-cgideb.adb')
-rw-r--r--gcc/ada/g-cgideb.adb80
1 files changed, 27 insertions, 53 deletions
diff --git a/gcc/ada/g-cgideb.adb b/gcc/ada/g-cgideb.adb
index 023f21f09c0..4c353d86569 100644
--- a/gcc/ada/g-cgideb.adb
+++ b/gcc/ada/g-cgideb.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2000-2001 Ada Core Technologies, Inc. --
+-- Copyright (C) 2000-2005, AdaCore --
-- --
-- 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- --
@@ -37,13 +37,11 @@ package body GNAT.CGI.Debug is
use Ada.Strings.Unbounded;
- --
- -- Define the abstract type which act as a template for all debug IO mode.
+ -- Define the abstract type which act as a template for all debug IO modes.
-- To create a new IO mode you must:
-- 1. create a new package spec
-- 2. create a new type derived from IO.Format
-- 3. implement all the abstract rountines in IO
- --
package IO is
@@ -54,51 +52,39 @@ package body GNAT.CGI.Debug is
function Variable
(Mode : Format;
Name : String;
- Value : String)
- return String
- is abstract;
- -- Returns variable Name and its associated value.
-
- function New_Line
- (Mode : Format)
- return String
- is abstract;
+ Value : String) return String is abstract;
+ -- Returns variable Name and its associated value
+
+ function New_Line (Mode : Format) return String is abstract;
-- Returns a new line such as this concatenated between two strings
-- will display the strings on two lines.
- function Title
- (Mode : Format;
- Str : String)
- return String
- is abstract;
+ function Title (Mode : Format; Str : String) return String is abstract;
-- Returns Str as a Title. A title must be alone and centered on a
-- line. Next output will be on the following line.
function Header
(Mode : Format;
- Str : String)
- return String
- is abstract;
+ Str : String) return String is abstract;
-- Returns Str as an Header. An header must be alone on its line. Next
-- output will be on the following line.
end IO;
- --
- -- IO for HTML mode
- --
+ ----------------------
+ -- IO for HTML Mode --
+ ----------------------
package HTML_IO is
- -- see IO for comments about these routines.
+ -- See IO for comments about these routines
type Format is new IO.Format with null record;
function Variable
(IO : Format;
Name : String;
- Value : String)
- return String;
+ Value : String) return String;
function New_Line (IO : in Format) return String;
@@ -108,9 +94,9 @@ package body GNAT.CGI.Debug is
end HTML_IO;
- --
- -- IO for plain text mode
- --
+ ----------------------------
+ -- IO for Plain Text Mode --
+ ----------------------------
package Text_IO is
@@ -121,8 +107,7 @@ package body GNAT.CGI.Debug is
function Variable
(IO : Format;
Name : String;
- Value : String)
- return String;
+ Value : String) return String;
function New_Line (IO : in Format) return String;
@@ -188,10 +173,10 @@ package body GNAT.CGI.Debug is
NL : constant String := (1 => ASCII.LF);
function Bold (S : in String) return String;
- -- Returns S as an HTML bold string.
+ -- Returns S as an HTML bold string
function Italic (S : in String) return String;
- -- Returns S as an HTML italic string.
+ -- Returns S as an HTML italic string
----------
-- Bold --
@@ -207,8 +192,7 @@ package body GNAT.CGI.Debug is
------------
function Header (IO : in Format; Str : in String) return String is
- pragma Warnings (Off, IO);
-
+ pragma Unreferenced (IO);
begin
return "<h2>" & Str & "</h2>" & NL;
end Header;
@@ -227,8 +211,7 @@ package body GNAT.CGI.Debug is
--------------
function New_Line (IO : in Format) return String is
- pragma Warnings (Off, IO);
-
+ pragma Unreferenced (IO);
begin
return "<br>" & NL;
end New_Line;
@@ -238,8 +221,7 @@ package body GNAT.CGI.Debug is
-----------
function Title (IO : in Format; Str : in String) return String is
- pragma Warnings (Off, IO);
-
+ pragma Unreferenced (IO);
begin
return "<p align=center><font size=+2>" & Str & "</font></p>" & NL;
end Title;
@@ -251,11 +233,9 @@ package body GNAT.CGI.Debug is
function Variable
(IO : Format;
Name : String;
- Value : String)
- return String
+ Value : String) return String
is
- pragma Warnings (Off, IO);
-
+ pragma Unreferenced (IO);
begin
return Bold (Name) & " = " & Italic (Value);
end Variable;
@@ -282,8 +262,7 @@ package body GNAT.CGI.Debug is
--------------
function New_Line (IO : in Format) return String is
- pragma Warnings (Off, IO);
-
+ pragma Unreferenced (IO);
begin
return String'(1 => ASCII.LF);
end New_Line;
@@ -295,7 +274,6 @@ package body GNAT.CGI.Debug is
function Title (IO : in Format; Str : in String) return String is
Spaces : constant Natural := (80 - Str'Length) / 2;
Indent : constant String (1 .. Spaces) := (others => ' ');
-
begin
return Indent & Str & New_Line (IO);
end Title;
@@ -307,11 +285,9 @@ package body GNAT.CGI.Debug is
function Variable
(IO : Format;
Name : String;
- Value : String)
- return String
+ Value : String) return String
is
- pragma Warnings (Off, IO);
-
+ pragma Unreferenced (IO);
begin
return " " & Name & " = " & Value;
end Variable;
@@ -324,7 +300,6 @@ package body GNAT.CGI.Debug is
function HTML_Output return String is
HTML : HTML_IO.Format;
-
begin
return IO.Output (Mode => HTML);
end HTML_Output;
@@ -335,7 +310,6 @@ package body GNAT.CGI.Debug is
function Text_Output return String is
Text : Text_IO.Format;
-
begin
return IO.Output (Mode => Text);
end Text_Output;