DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦c1bb879e1⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Unbounded_String, pragma Module_Name 4 3983, pragma Subsystem Tools, seg_02851c

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



generic
    Default_Maximum_Length : Natural := 20;
package Unbounded_String is
    pragma Subsystem (Tools, Private_Part => Open);
    pragma Module_Name (4, 3983);

    -------------------------------------------------------------------------------
    --  Managed Pointer Sequential Unbounded Strings:
    --  Restrictions and assumptions
    -- 1.   Storage management is performed
    -- 2.   Extending a string in a way that requires a new allocation allows
    --      space for expansion.
    -- 3.   CANNOT be used by multiple tasks unless user provides serialization
    -- 4.   := is reference copy, use copy to assign contents
    -- 5.   Uninitialized or Freed objects are true null's and changes to one
    --      of the referents will not be reflected in the other;
    -- 6.   Use Free prior to assignment to prevent garbage
    -- 7.   = is object identity, compare Images for value equality
    -------------------------------------------------------------------------------


    subtype String_Length   is Natural;
    type    Variable_String is private;

    -- release storage associated with a string
    procedure Free (V : in out Variable_String);

    -- Get information about current length or contents of a string
    function Length  (Source : Variable_String) return String_Length;
    function Char_At (Source : Variable_String; At_Pos : Positive)
                     return Character;

    function Extract (Source    : Variable_String;
                      Start_Pos : Positive;
                      End_Pos   : Natural) return String;

    function Image (V : Variable_String) return String;
    function Value (S : String)          return Variable_String;

    -- Image (Target) := Image (Source);
    procedure Copy (Target : in out Variable_String; Source : Variable_String);
    procedure Copy (Target : in out Variable_String; Source : String);
    procedure Copy (Target : in out Variable_String; Source : Character);

    -- Target := Source; Source := ""; with appropriate storage management
    procedure Move (Target : in out Variable_String;
                    Source : in out Variable_String);

    -- Target := Target & Source;
    procedure Append (Target : in out Variable_String;
                      Source :        Variable_String);

    procedure Append (Target : in out Variable_String; Source : String);

    procedure Append (Target : in out Variable_String; Source : Character);

    procedure Append (Target : in out Variable_String;
                      Source :        Character;
                      Count  :        String_Length);

    -- Target := Target (1..At_Pos-1) & Source & Target (At_Pos..Target'Length)
    procedure Insert (Target : in out Variable_String;
                      At_Pos :        Positive;
                      Source :        Variable_String);

    procedure Insert (Target : in out Variable_String;
                      At_Pos :        Positive;
                      Source :        String);

    procedure Insert (Target : in out Variable_String;
                      At_Pos :        Positive;
                      Source :        Character);

    procedure Insert (Target : in out Variable_String;
                      At_Pos :        Positive;
                      Source :        Character;
                      Count  :        String_Length);

    -- Target (At_Pos .. At_Pos + Count -1) := "";
    procedure Delete (Target : in out Variable_String;
                      At_Pos :        Positive;
                      Count  :        String_Length := 1);

    -- Target (At_Pos .. At_Pos + Source'Length - 1) := Source;
    procedure Replace (Target : in out Variable_String;
                       At_Pos :        Positive;
                       Source :        Character);

    procedure Replace (Target : in out Variable_String;
                       At_Pos :        Positive;
                       Source :        Character;
                       Count  :        String_Length);

    procedure Replace (Target : in out Variable_String;
                       At_Pos :        Positive;
                       Source :        String);

    procedure Replace (Target : in out Variable_String;
                       At_Pos :        Positive;
                       Source :        Variable_String);

    -- Target'Length := New_Length;
    -- Target (Target'Length .. New_Length) := Fill_With;
    procedure Set_Length (Target     : in out Variable_String;
                          New_Length :        String_Length;
                          Fill_With  :        Character := ' ');


    -- Determine if a Variable_String is null; different from = ""
    function Is_Nil (V : Variable_String) return Boolean;

    -- Return a null Variable_String.  Note that assignment of Nil may
    -- create garbage; see procedure Free above.
    function Nil return Variable_String;

private
    type Pointer is access String;

    type    Real_String;
    type    Variable_String is access Real_String;
    subtype String_Bound    is Integer range -1 .. Integer'Last;

    type Real_String is
        record
            Length    : String_Bound;
            Contents  : Pointer;
            Next_Free : Variable_String;
        end record;

    Null_String : Pointer := new String (1 .. 0);

    Free_List_Item : constant String_Bound := -1;

    Free_List : Real_String :=
       Real_String'(Free_List_Item, Null_String,
                    new Real_String'(Free_List_Item, Null_String, null));
end Unbounded_String;

E3 Meta Data

    nblk1=7
    nid=0
    hdr6=e
        [0x00] rec0=14 rec1=00 rec2=01 rec3=088
        [0x01] rec0=18 rec1=00 rec2=02 rec3=076
        [0x02] rec0=00 rec1=00 rec2=07 rec3=01c
        [0x03] rec0=18 rec1=00 rec2=03 rec3=048
        [0x04] rec0=18 rec1=00 rec2=04 rec3=010
        [0x05] rec0=17 rec1=00 rec2=05 rec3=032
        [0x06] rec0=18 rec1=00 rec2=06 rec3=000
    tail 0x21520fd7083c17502ca64 0x42a00088462065003