Debian Codegraph @

progs/arm_db.ads

raw
1 package ARM_Database is
2
3 --
4 -- Ada reference manual formatter (ARM_Form).
5 --
6 -- This package contains the database to store items for non-normative
7 -- appendixes.
8 --
9 -- ---------------------------------------
10 -- Copyright 2000, 2004, 2005, 2006, 2011
11 -- AXE Consultants. All rights reserved.
12 -- P.O. Box 1512, Madison WI 53701
13 -- E-Mail: [email protected]
14 --
15 -- ARM_Form is free software: you can redistribute it and/or modify
16 -- it under the terms of the GNU General Public License version 3
17 -- as published by the Free Software Foundation.
18 --
19 -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS"
20 -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY,
21 -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL.
22 -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL,
23 -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES,
24 -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
25 -- DAMAGES.
26 --
27 -- A copy of the GNU General Public License is available in the file
28 -- gpl-3-0.txt in the standard distribution of the ARM_Form tool.
29 -- Otherwise, see <http://www.gnu.org/licenses/>.
30 --
31 -- If the GPLv3 license is not satisfactory for your needs, a commercial
32 -- use license is available for this tool. Contact Randy at AXE Consultants
33 -- for more information.
34 --
35 -- ---------------------------------------
36 --
37 -- Edit History:
38 --
39 -- 5/16/00 - RLB - Created package.
40 -- 8/10/00 - RLB - Added Normal_Indexed_List to fix glossary problems.
41 -- 8/28/00 - RLB - Added revision info to database.
42 -- 10/28/04 - RLB - Added Inserted_Normal_Number change kind.
43 -- 11/02/04 - RLB - Added Deleted_Inserted_Number change kind.
44 -- 12/06/04 - RLB - Added Revised_Inserted_Number change kind.
45 -- 1/19/05 - RLB - Added Added_Version.
46 -- 2/15/06 - RLB - Added Deleted_No_Delete_Message and
47 -- Deleted_Inserted_Number_No_Delete_Message change kinds.
48 -- 10/18/06 - RLB - Added No_Deleted_Paragraph_Messages to Report.
49 -- 10/18/11 - RLB - Changed to GPLv3 license.
50 -- 10/20/11 - RLB - Added Initial_Version parameter.
51
52 type Database_Type is tagged limited private;
53
54 type Paragraph_Change_Kind_Type is (None, Inserted, Inserted_Normal_Number,
55 Deleted, Deleted_Inserted_Number,
56 Deleted_No_Delete_Message,
57 Deleted_Inserted_Number_No_Delete_Message,
58 Revised, Revised_Inserted_Number);
59
60 Not_Valid_Error : exception;
61
62 procedure Create (Database_Object : in out Database_Type);
63 -- Initialize a database object.
64
65 procedure Destroy (Database_Object : in out Database_Type);
66 -- Destroy a database object, freeing any resources used.
67
68 procedure Insert (Database_Object : in out Database_Type;
69 Sort_Key : in String;
70 Hang_Item : in String;
71 Text : in String;
72 Change_Kind : in Paragraph_Change_Kind_Type := ARM_Database.None;
73 Version : in Character := '0';
74 Initial_Version : in Character := '0');
75 -- Insert an item into the database object.
76 -- Sort_Key is the string on which this item will be sorted (if it
77 -- is sorted). Hang_Item is the item which hangs out for the item
78 -- in the report (if any). Text is the text for the item; the text
79 -- may include formatting codes. Change_Kind and Version are the
80 -- revision status for this item. Initial_Version is the version of
81 -- the initial text for this item.
82
83 type Format_Type is
84 (Normal_List, Normal_Indexed_List, Bullet_List, Hanging_List);
85
86 generic
87 with procedure Format_Text (Text : in String;
88 Text_Name : in String);
89 procedure Report (Database_Object : in out Database_Type;
90 In_Format : in Format_Type;
91 Sorted : in Boolean;
92 Added_Version : Character := '0';
93 No_Deleted_Paragraph_Messages : in Boolean := False);
94 -- Output the items with the appropriate format to the
95 -- "Format_Text" routine. "Format_Text" allows all commands
96 -- for the full formatter. (Text_Name is an identifying name
97 -- for error messages). This is an added list for Added_Version
98 -- ('0' meaning it is not added); in that case, use normal numbers
99 -- for items with a version less than or equal to Added_Version.
100 -- (This is intended to be used to output the items to
101 -- appropriate Format and Output objects; but we can't do that
102 -- directly because that would make this unit recursive with
103 -- ARM_Format.
104 -- No paragraphs will be have deleted paragraph messages if
105 -- No_Deleted_Paragraph_Messages is True.
106 private
107
108 type Item;
109 type Item_List is access all Item;
110 type Database_Type is tagged limited record
111 Is_Valid : Boolean := False;
112 List : Item_List;
113 Item_Count : Natural;
114 end record;
115
116 end ARM_Database;
117
118