File: build.adb

package info (click to toggle)
libaws 2.2dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,624 kB
  • ctags: 1,173
  • sloc: ada: 61,829; ansic: 6,483; makefile: 1,282; xml: 196; sh: 119; java: 112; python: 66; sed: 40
file content (152 lines) | stat: -rw-r--r-- 6,172 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
------------------------------------------------------------------------------
--                              Ada Web Server                              --
--                                                                          --
--                         Copyright (C) 2000-2006                          --
--                                 AdaCore                                  --
--                                                                          --
--  This library is free software; you can redistribute it and/or modify    --
--  it under the terms of the GNU General Public License as published by    --
--  the Free Software Foundation; either version 2 of the License, or (at   --
--  your option) any later version.                                         --
--                                                                          --
--  This library is distributed in the hope that it will be useful, but     --
--  WITHOUT 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       --
--  along with this library; if not, write to the Free Software Foundation, --
--  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.          --
--                                                                          --
------------------------------------------------------------------------------

with Ada.Text_IO;
with Ada.Strings.Fixed;

with AWS.Utils;
with AWS.Default;
with SOAP;

with Templates_Parser;

procedure Build is

   use Ada;
   use AWS;
   use AWS.Utils;
   use Templates_Parser;

   File : Text_IO.File_Type;

   function Image (D : in Duration) return String;
   --  D string representation

   -----------
   -- Image --
   -----------

   function Image (D : in Duration) return String is
      D_S : constant String   := Duration'Image (D);
      I   : constant Positive := Strings.Fixed.Index (D_S, ".");
   begin
      return D_S (D_S'First + 1 .. I + 1);
   end Image;

   --  If a tag is added into this table make sure to update gen_doc.sed.tmplt

   T : Translate_Table
     := (Assoc ("AWS_VERSION", AWS.Version),
         Assoc ("SOAP_VERSION", SOAP.Version),
         Assoc ("MAX_CONNECT", Image (Default.Max_Connection)),
         Assoc ("KEEP_ALIVE_LIMIT",
                Image (Default.Free_Slots_Keep_Alive_Limit)),
         Assoc ("QUEUE_SIZE", Default.Accept_Queue_Size),
         Assoc ("SERVER_NAME", Default.Server_Name),
         Assoc ("SERVER_PORT", Image (Default.Server_Port)),
         Assoc ("HOTPLUG_PORT", Image (Default.Hotplug_Port)),
         Assoc ("LOG_FILE_DIR", Default.Log_File_Directory),
         Assoc ("LOG_SPLIT_MODE", Default.Log_Split_Mode),
         Assoc ("ERROR_LOG_SPLIT_MODE", Default.Error_Log_Split_Mode),
         Assoc ("DIRECTORY_BROWSER_PAGE", Default.Directory_Browser_Page),
         Assoc ("UPLOAD_DIR", Default.Upload_Directory),
         Assoc ("LINE_STACK_SIZE", Default.Line_Stack_Size),
         Assoc ("CHECK_URL_VALIDITY", Default.Check_URL_Validity),
         Assoc ("DEFAULT_CERTIFICATE", Default.Certificate),
         Assoc ("DEFAULT_KEY", Default.Key),
         Assoc ("SECURITY_MODE", Default.Security_Mode),
         Assoc ("EXCHANGE_CERTIFICATE", Default.Exchange_Certificate),
         Assoc ("CASE_SENSITIVE_PARAMETERS",
                Default.Case_Sensitive_Parameters),
         Assoc ("ADMIN_URI", Default.Admin_URI),
         Assoc ("CT_WAIT_FOR_CLIENT",
                Image (Default.Cleaner_Wait_For_Client_Timeout)),
         Assoc ("CT_CLIENT_HEADER",
                Image (Default.Cleaner_Client_Header_Timeout)),
         Assoc ("CT_CLIENT_DATA",
                Image (Default.Cleaner_Client_Data_Timeout)),
         Assoc ("CT_SERVER_RESPONSE",
                Image (Default.Cleaner_Server_Response_Timeout)),
         Assoc ("FT_WAIT_FOR_CLIENT",
                Image (Default.Force_Wait_For_Client_Timeout)),
         Assoc ("FT_CLIENT_HEADER",
                Image (Default.Force_Client_Header_Timeout)),
         Assoc ("FT_CLIENT_DATA",
                Image (Default.Force_Client_Data_Timeout)),
         Assoc ("FT_SERVER_RESPONSE",
                Image (Default.Force_Server_Response_Timeout)),
         Assoc ("SEND_TIMEOUT",
                Image (Default.Send_Timeout)),
         Assoc ("RECEIVE_TIMEOUT",
                Image (Default.Receive_Timeout)),
         Assoc ("LOGO_IMAGE",
                Default.Logo_Image),
         Assoc ("DOWN_IMAGE",
                Default.Down_Image),
         Assoc ("UP_IMAGE",
                Default.Up_Image),
         Assoc ("STATUS_PAGE",
                Default.Status_Page),
         Assoc ("SESSION_LIFETIME",
                Image (Default.Session_Lifetime)),
         Assoc ("SESSION_CLEANUP_INTERVAL",
                Image (Default.Session_Cleanup_Interval)),
         Assoc ("TRANSIENT_LIFETIME",
                Image (Default.Transient_Lifetime)),
         Assoc ("TRANSIENT_CLEANUP_INTERVAL",
                Image (Default.Transient_Cleanup_Interval)),
         Assoc ("WWW_ROOT", Default.WWW_Root)
        );

begin
   --  Generates the documentation

   Text_IO.Put_Line
     (Parse ("aws.texi.tmplt", T, Keep_Unknown_Tags => True));

   --  Generates a script that can be used to create the documentation from
   --  the document template.

   Text_IO.Create (File, Text_IO.Out_File, "gen_doc.sed");

   declare
      use Strings.Fixed;
      Script : String :=
        Parse ("gen_doc.sed.tmplt", T, Keep_Unknown_Tags => True);
      I      : Natural;
   begin
      loop
         I := Index (Script, "x_");
         exit when I = 0;
         Replace_Slice (Script, I, I + 1, "@_");
      end loop;

      loop
         I := Index (Script, "_x");
         exit when I = 0;
         Replace_Slice (Script, I, I + 1, "_@");
      end loop;

      Text_IO.Put_Line (File, Script);
   end;
   Text_IO.Close (File);
end Build;