|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 3604 (0xe14)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
with Log;
with Text_Io;
with Profile;
with Directory_Tools;
with String_Utilities;
with List_Generic;
package body Mvs_Name_Package is
package Naming renames Directory_Tools.Naming;
subtype Names is String (1 .. 5);
package Name_Manager is new List_Generic (Names);
Name_List : Name_Manager.List;
Name : Name_Manager.Iterator;
function Get_Mvs_Name (Ada_Unit_Name : String) return String is
Mvs_Name : String (1 .. 8) := "00000000";
Part : String (1 .. 5);
Position : Natural;
Second_Position : Natural;
Version : Natural;
Simple_Name_Length : Natural;
function Find_Underscore (Ada_Unit_Name : String) return Natural is
Position : Natural := 0;
begin
for I in Ada_Unit_Name'First .. Ada_Unit_Name'Last loop
if Ada_Unit_Name (I) = '_' then
Position := I;
exit;
end if;
end loop;
return Position;
end Find_Underscore;
procedure Output_Result (Mvs_Name : String) is
begin
Log.Put_Line (Ada_Unit_Name & " =====> " & Mvs_Name);
end Output_Result;
begin
Simple_Name_Length := Naming.Simple_Name (Ada_Unit_Name)'Length;
Get_Simple_Name:
declare
Simple_Name :
String (1 .. Simple_Name_Length) :=
Naming.Simple_Name (Ada_Unit_Name);
begin
Position := Find_Underscore (Simple_Name);
if Position = 0 then
Mvs_Name (1 .. Simple_Name_Length) :=
Simple_Name (1 .. Simple_Name_Length);
else
Mvs_Name (1 .. 2) := Simple_Name (1 .. 2);
Second_Position :=
Find_Underscore
(Simple_Name (Position + 1 .. Simple_Name_Length));
if Second_Position = 0 then
Mvs_Name (3 .. 4) :=
Simple_Name (Position + 1 .. Position + 2);
else
Mvs_Name (3 .. 4) :=
Simple_Name (Position + 1) &
Simple_Name (Second_Position + 1);
end if;
end if;
end Get_Simple_Name;
Version := Integer'Value (Naming.Version_Attribute (Ada_Unit_Name));
if Version < 10 then
Mvs_Name (7) := Integer'Image (Version) (2);
elsif Version < 100 then
Mvs_Name (6 .. 7) := Integer'Image (Version) (2 .. 3);
else
Mvs_Name (5 .. 7) := Integer'Image (Version) (2 .. 4);
end if;
if String_Utilities.Upper_Case (Naming.Part_Attribute (Ada_Unit_Name)) =
"'BODY" then
Mvs_Name (8) := 'B';
else
Mvs_Name (8) := 'S';
end if;
Name_Manager.Init (Name, Name_List);
while not Name_Manager.Done (Name) loop
if Name_Manager.Value (Name) = Mvs_Name (1 .. 4) & Mvs_Name (8) then
Mvs_Name (4) := Character'Succ (Mvs_Name (4));
end if;
Name_Manager.Next (Name);
end loop;
Name_List :=
Name_Manager.Make (Mvs_Name (1 .. 4) & Mvs_Name (8), Name_List);
Output_Result (Mvs_Name);
return Mvs_Name;
end Get_Mvs_Name;
end Mvs_Name_Package;