CVS difference for arm/progs/arm_cont.adb

Differences between 1.18 and version 1.19
Log of other versions for file arm/progs/arm_cont.adb

--- arm/progs/arm_cont.adb	2012/09/01 05:13:36	1.18
+++ arm/progs/arm_cont.adb	2022/02/04 04:29:03	1.19
@@ -10,7 +10,7 @@
     -- references.
     --
     -- ---------------------------------------
-    -- Copyright 2000, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012
+    -- Copyright 2000, 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012, 2022
     --   AXE Consultants. All rights reserved.
     -- P.O. Box 1512, Madison WI  53701
     -- E-Mail: randy@rrsoftware.com
@@ -56,6 +56,7 @@
     -- 10/19/11 - RLB - Added Parent_Clause from Stephen Leake's version.
     -- 10/25/11 - RLB - Added version to Old name strings.
     --  8/30/12 - RLB - Added traps if we're reading Section = UNKNOWN.
+    --  1/28/22 - RLB - Added Note_Info to better support ISO 2004 notes.
 
     function "<" (Left, Right : Clause_Number_Type) return Boolean is
 	-- True if Left comes before Right in the collating order.
@@ -110,6 +111,7 @@
 	Level : Level_Type;
 	Clause_Number : Clause_Number_Type;
         Version : ARM_Contents.Change_Version_Type := '0';
+        Note_Info : Note_Info_Type := No_Notes;
     end record;
 
     Title_List : array (1 .. 900) of Title_Record;
@@ -151,7 +153,8 @@
 	     Search_Title => Ada.Characters.Handling.To_Lower (Title),
 	     Level => Level,
 	     Clause_Number => Clause_Number,
-             Version => Version);
+             Version => Version,
+             Note_Info => No_Notes);
 --Ada.Text_IO.Put_Line ("  Add " & Title &
 -- " Index=" & Natural'Image(Last_Title) & " Level=" & Level_Type'Image(Level));
 --Ada.Text_IO.Put_Line ("    Section" & Section_Number_Type'Image(Clause_Number.Section) &
@@ -187,7 +190,8 @@
 	     Search_Title => Ada.Characters.Handling.To_Lower (Old_Title),
 	     Level => Level,
 	     Clause_Number => Clause_Number,
-             Version => Version);
+             Version => Version,
+             Note_Info => No_Notes);
 --Ada.Text_IO.Put_Line ("  Add_Old " & Old_Title &
 -- " Index=" & Natural'Image(Last_Old_Title) & " Level=" & Level_Type'Image(Level));
 --Ada.Text_IO.Put_Line ("    Section" & Section_Number_Type'Image(Section_Number) &
@@ -665,5 +669,45 @@
 	    end if;
 	end loop;
     end For_Each;
+
+
+    function Lookup_Note_Info (Level : in Level_Type;
+		               Clause_Number : in Clause_Number_Type) return Note_Info_Type is
+	-- Given the level and clause numbers, return the note information.
+	-- Raises Not_Found_Error if not found.
+    begin
+	if Clause_Number.Section = UNKNOWN then
+	    raise Bad_Clause_Error with "unknown section number";
+	-- else not unknown
+	end if;
+	for I in 1 .. Last_Title loop
+	    if Title_List(I).Level = Level and then
+	       Title_List(I).Clause_Number = Clause_Number then
+		return Title_List(I).Note_Info;
+	    end if;
+	end loop;
+	raise Not_Found_Error;
+    end Lookup_Note_Info;
+    
+    
+    procedure Update_Note_Info (Level : in Level_Type;
+		                Clause_Number : in Clause_Number_Type;
+                                New_Note_Info : in Note_Info_Type) is
+	-- Given the level and clause numbers, update the note information to
+        -- the provided value. Raises Not_Found_Error if not found.
+    begin
+	if Clause_Number.Section = UNKNOWN then
+	    raise Bad_Clause_Error with "unknown section number";
+	-- else not unknown
+	end if;
+	for I in 1 .. Last_Title loop
+	    if Title_List(I).Level = Level and then
+	       Title_List(I).Clause_Number = Clause_Number then
+		Title_List(I).Note_Info := New_Note_Info;
+                return;
+	    end if;
+	end loop;
+	raise Not_Found_Error;
+    end Update_Note_Info;
 
 end ARM_Contents;

Questions? Ask the ACAA Technical Agent