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

⟦21f787494⟧ Ada Source

    Length: 14336 (0x3800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Document, pragma Module_Name 4 3581, pragma Segmented_Heap Element, pragma Segmented_Heap Element_List_Item_Pointer, pragma Subsystem Design_Facility, seg_028ad6

Derivation

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

E3 Source Code



with Directory_Tools;
with Errors;
with Heap_Strings;
with System;

package Document is
    package Object renames Directory_Tools.Object;

    type Element is private;
    Nil_Element : constant Element;
    function Is_Nil (An_Element : Element) return Boolean;

    type Classes is (Postscript, Lineprinter, Document_Db, Markup, Unknown);

    subtype Devices is Classes range Postscript .. Lineprinter;

    type    Paragraph_Mark_Kinds is (Title, Number, None);
    subtype Paragraph_Mark       is String;

    type Element_States is (Nil, Unresolved, Unmarked, Valid);

    -- An element resolves to a particular library object and can
    --   mark a particular paragraph in that object.
    --
    -- The state of an element reflects this info :
    --
    --    ELEMENT_STATE  Reason for being in the state
    --    -------------  -----------------------------------
    --         NIL       Uninitialized or set to NIL_ELEMENT.
    --     UNRESOLVED    RESOLVE of ELEMENT failed, no object exists,
    --                     access violation or lock error.
    --      UNMARKED     RESOLVE worked but no mark was set or
    --                     mark did not exist in the object.
    --       MARKED      RESOLVE worked and paragraph mark was found.

    function State_Of (The_Element : Element) return Element_States;

    function Last_Status_Of (The_Element : Element) return Errors.Condition;
    -- NIL, MARKED and UNMARKED with no mark set return ERRORS.OK.


    procedure Resolve (An_Element  : in out Element;
                       To_Pathname :        String;
                       Class       :        Classes := Unknown;  
                       Status      : in out Errors.Condition);

    procedure Resolve (An_Element : in out Element;
                       To_Handle  :        Object.Handle;
                       Class      :        Classes := Unknown;
                       Status     : in out Errors.Condition);


    function Handle_Of (The_Element : Element) return Object.Handle;
    -- Returns a nil handle if the element is NIL or UNRESOLVED.

    function Pathname_Of (The_Element : Element) return String;
    -- Returns a null string if the element is NIL.

    function Class_Of (The_Element : Element) return Classes;
    -- Returns Unknown if the element is NIL or UNRESOLVED.


    procedure Set_Mark (Of_Element : in out Element;
                        With_Paragraph_Mark_Kind : Paragraph_Mark_Kinds := None;
                        With_Paragraph_Mark_Image : String := "";
                        Status : in out Errors.Condition);

    function Mark_Of (An_Element : Element;  
                      Which      : Paragraph_Mark_Kinds) return String;



    -----------------------------------------------------------
    -- ELEMENTs are not 'safe' objects. To save them in
    --  permanent objects (like files), they must be converted to
    --  ELEMENT_PERMANENT_REPRESENTATIONs.
    --
    -- ELEMENT_PERMANENT_REPRESENTATIONs of elements in any
    --  ELEMENT_STATE can be made. If, after conversion from
    --  PERMANENT_REPRESENTATION back to ELEMENT, a previously
    --  UNRESOLVED or UNMARKED element can now be resolved or
    --  who's set mark now exists, the element state is changed
    --  and queries (like HANDLE_OF) may return different results.
    --  Similarly, if the object or mark has disappeared while
    --  the element was permanently stored, a previously MARKED
    --  or RESOLVED element may be restored as UNRESOLVED or UNMARKED.
    -----------------------------------------------------------

    type Element_Permanent_Representation is new String;

    function Convert (An_Element : Element;  
                      Within     : String := "<SUBSYSTEM>")
                     return Element_Permanent_Representation;
    -- The WITHIN parameter specifies how fully qualified the
    -- representation is (or should be resolved). When converting from
    -- an element to a permanent representation, the values can be :
    --   <FULL>         - The element's fully qualified resolution is
    --                    returned.
    --   <SUBSYSTEM>    - The resolution of the element is subsystem
    --                    relative. Subsystem name and spec or load origin
    --                    is preserved.
    --   <VIEW>         - The resolution of the element is view relative.
    --                    No origin information is preserved.
    --
    -- Storage for <SUBSYSTEM> or <VIEW> representation are less than
    -- <FULL> but some origin information is lost.
    --

    procedure Convert (An_Element_Rep :        Element_Permanent_Representation;
                       Result         : out    Element;
                       Status         : in out Errors.Condition;
                       Within         :        String := "<DEFAULT>");
    -- When converting from a permanent representation to an element,
    -- an attempt is made to fill in any missing information in the
    -- permanent representation from the WITHIN parameter. So, in all
    -- cases, if the permanent representation was FULLy resolved the
    -- WITHIN parameter is ignored, otherwise :
    --   <DEFAULT>      - For <SUBSYSTEM>, the view selected by
    --                    the current activity for the stored subsystem is
    --                    used as the origin. The spec or load origin of the
    --                    representation is used to pick the specific view.
    --                    For <VIEW>, the current view context is used as
    --                    the origin.
    --   subsystem name - For <SUBSYSTEM>, same as <DEFAULT>.
    --                    For <VIEW>, the view selected by the current
    --                    activity for the specified subsystem is used.
    --                    The subsystem name can be followed by "'SPEC" or
    --                    "'LOAD" to force use of the spec view or load
    --                    view from the activity. (Defaults to Spec View)
    --   view name      - For <SUBSYSTEM>, if the subsystem containing the
    --                    specified view matches the representation's
    --                    subsystem, the specified view is used.
    --                    If no match, same as <DEFAULT>.
    --                    For <VIEW> the specified view is used.


    function Unique_Id (For_Element : Element) return Long_Integer;
    -- Generates a unique number for any element.
    -- Useful for building maps for elements.



    -------------------
    -- LIST operations
    -------------------

    type Element_List is private;
    Nil_List : constant Element_List;

    -- Assignment on a LIST  * * DOES NOT CAUSE A COPY TO BE MADE! * *
    -- Use COPY to do that.

    procedure Copy (From_List : Element_List; To_List : in out Element_List);

    procedure Add (An_Element : Element; To_List : in out Element_List);


    procedure Reset (A_List : in out Element_List);

    function Value (In_List : Element_List) return Element;

    procedure Next (In_List : in out Element_List);

    function Done (With_List : Element_List) return Boolean;


    -- These two operations return information relating to the cause/nature
    -- of the condition which caused FAILED to be raised.

    Failed : exception;

    function Diagnosis return String;
    function Status    return Errors.Condition;


    ---------------
    -- UTILITIES
    ---------------

    -------------------------------------------------
    -- Operations to bring up a window on an Element
    -------------------------------------------------
    procedure Definition (On_Element        :        Element;
                          In_Place          :        Boolean := False;
                          Edit              :        Boolean := False;
                          Library_Item_Only :        Boolean := False;
                          Status            : in out Errors.Condition);
    -- The LIBRARY_ITEM_ONLY parameter specifies if definition for
    --  UNMARKED elements is to bring up a window on the contents of
    --  the element or a Library OE window of the library containing
    --  the element with the element name highlighted.


    -- Hide these ...
    procedure Convert (An_Element_Rep :        Element_Permanent_Representation;
                       Result         : out    Element;
                       Status         : in out Errors.Condition;
                       Within         :        String := "<DEFAULT>";
                       Use_Heap       :        System.Segment);

    procedure Field_Copy (From_List :        Element_List;
                          To_List   : in out Element_List);
    -- If a data type contains a LIST and that data type is stored
    --   in a segmented heap and a selector on that pointed-to object
    --   returns a LIST, use this to get the LIST out.
    --   It will un-normalize the internal segmented heap pointers.

    function Debug_Image (Of_Element      : Element;
                          Level           : Natural;
                          Prefix          : String;
                          Expand_Pointers : Boolean) return String;

    function Debug_Image (Of_List         : Element_List;
                          Level           : Natural;
                          Prefix          : String;
                          Expand_Pointers : Boolean) return String;


    pragma Subsystem (Design_Facility, Closed);
    pragma Module_Name (4, 3581);
    pragma Bias_Key (27);

private

    type Element_Item;
    type Element is access Element_Item;
    pragma Segmented_Heap (Element);

    Nil_Element : constant Element := null;

    type Element_List_Item;
    type Element_List_Item_Pointer is access Element_List_Item;
    pragma Segmented_Heap (Element_List_Item_Pointer);


    type Element_List_Item is
        record
            An_Element : Element;
            Next       : Element_List_Item_Pointer;
        end record;

    type Element_List is
        record
            Root    : Element_List_Item_Pointer;
            Current : Element_List_Item_Pointer;
        end record;

    Nil_List : constant Element_List := (null, null);
end Document;

E3 Meta Data

    nblk1=d
    nid=0
    hdr6=1a
        [0x00] rec0=1f rec1=00 rec2=01 rec3=022
        [0x01] rec0=00 rec1=00 rec2=0d rec3=012
        [0x02] rec0=14 rec1=00 rec2=02 rec3=06e
        [0x03] rec0=1a rec1=00 rec2=03 rec3=01a
        [0x04] rec0=13 rec1=00 rec2=04 rec3=01c
        [0x05] rec0=12 rec1=00 rec2=05 rec3=028
        [0x06] rec0=0e rec1=00 rec2=06 rec3=094
        [0x07] rec0=1a rec1=00 rec2=07 rec3=094
        [0x08] rec0=20 rec1=00 rec2=08 rec3=056
        [0x09] rec0=00 rec1=00 rec2=0c rec3=006
        [0x0a] rec0=13 rec1=00 rec2=09 rec3=008
        [0x0b] rec0=1c rec1=00 rec2=0a rec3=024
        [0x0c] rec0=12 rec1=00 rec2=0b rec3=000
    tail 0x2172258d283c2474e8395 0x42a00088462065003