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

⟦441ad987a⟧ Ada Source

    Length: 16384 (0x4000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Directory, seg_0269f2, seg_027c52, seg_027ced

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 Our_Generic_String;  
with Set_Generic;
with Calendar;  
package Directory is


    Already_Existent_Object_Error : exception;
    Non_Existent_Object_Error     : exception;
    System_Error                  : exception;


    type Object is private;

    -- Objects in the directory system are accessed via Directory.Object

    function Nil return Object;
    function Is_Nil (The_Object : Object) return Boolean;

    function Same_Object (Left, Right : Object) return Boolean;

    type Class_Enumeration is new Natural range 0 .. 63;

    Unknown_Class           : constant Class_Enumeration := 0;
    Directory_Class         : constant Class_Enumeration := 1;
    File_Class              : constant Class_Enumeration := 2;
    Link_Class              : constant Class_Enumeration := 3;
    Fifo_Class              : constant Class_Enumeration := 4;
    Socket_Class            : constant Class_Enumeration := 5;
    Character_Special_Class : constant Class_Enumeration := 6;
    Bloc_Special_Class      : constant Class_Enumeration := 7;
    Multiplex_File_Class    : constant Class_Enumeration := 8;

    function Class (The_Object : Object) return Class_Enumeration;
    function Equal (Class1, Class2 : Class_Enumeration) return Boolean;
    function Image (The_Class : Class_Enumeration) return String;
    function Value (S : String) return Class_Enumeration;


    type Iterator is private;

    procedure Next  (Iter : in out Iterator);
    function  Done  (Iter : Iterator) return Boolean;
    function  Value (Iter : Iterator) return Object;
    procedure Reset (Iter : in out Iterator);


--  to get the message associated with the UNIX errno varaible value

    function Get_Error_Message return String;


    package Naming is

        -- Provides mechanisms for manipulating and resolving names and for
        -- establishing a context for name resolution.

        subtype String_Name is String;

        -- Lexically and syntactically a Directory system string name.

        subtype Simple_String_Name is String;

        -- A single segment of a string name.

        subtype Context is Object;

        -- The Directory System Object that serves as the initial context
        -- for name resolution.  May be any Object.

        procedure Set_Default_Context (The_Context : Naming.String_Name);

        procedure Set_Default_Context (The_Context : Naming.Context);

        -- Establishes the default naming context for the job.

        function Default_Context return Naming.String_Name;
        function Default_Context return Naming.Context;

        -- Returns the default name resolution context for the job.


        function Absolute (The_Name : String_Name) return Boolean;

        -- return true if the_name is an absolute path name

        function Absolute_Name (The_Name : String_Name) return String_Name;

        -- return the corresponding absolute path name


        function Prefix (The_Name : String_Name) return String_Name;

        -- Removes the last segment from a selected name and returns
        -- the prefix.
        -- Prefix ("A/B/C") => "A/B"
        -- Prefix ("A") => ""


        function Simple_Name (The_Name : String_Name) return Simple_String_Name;

        -- Returns only the last segment of a selected name, without attributes
        -- Simple_name ("A/B/C") => "C"
        -- Simple_name ("A") => "A"


        function Simple_Name_Without_Extension
                    (The_Name : String_Name) return Simple_String_Name;


        function Head (The_Name : String_Name) return Simple_String_Name;

        -- Returns only the first segment of a selected name.
        -- Head ("A/B/C") => "A"
        -- Head ("A") => "A"
        -- Head ("/A") => "/"

        function Tail (The_Name : String_Name) return String_Name;

        -- Removes the first segment from a selected name and returns the tail.
        --      Tail ("A/B/C") => "B/C"
        -- Tail ("A") => ""

        function Extension (A_Name : String_Name) return String;

        -- Returns the Extension at the end of the given string name.
        -- If the simple name of the given string name has no attributes,
        -- the null string is returned.

        function Full_Name (The_Object : Object) return Naming.String_Name;

        -- Computes the fully qualified string name for the The_Object.

        function Simple_Name (The_Object : Object) return Simple_String_Name;

        -- Computes the simple name for the The_Object.

        function Simple_Name_Without_Extension
                    (The_Object : Object) return Simple_String_Name;

    end Naming;

    package Traversal is
        -- Provides operations for traversing the Directory System
        -- in a variety of ways.

        function Root return Object;

        -- Returns the (somewhat special) Object corresponding to the
        -- root of the universe.

        function Home return Object;

        -- returns the object corresponding to the home directory

        function Parent (The_Object : Object) return Object;

        -- Returns the parent Object for The_Object.

        function Child (The_Object : Object;
                        Child_Name : Naming.Simple_String_Name) return Object;

        -- Retrieve the named subobject.

        function Children (The_Object : Object;
                           Pattern    : Naming.Simple_String_Name := "*";
                           Class      : Class_Enumeration := Unknown_Class)
                          return Iterator;

        -- Initializes the iteration over the children that match the
        -- specified name pattern.
        -- If a class is provided, only children of that class are returned.

    end Traversal;

    package Statistics is

        subtype User is String;

        subtype Group is String;

        subtype Permission_Enumeration is Integer range 0 .. 7;

        None_Permission  : constant Permission_Enumeration := 0;
        X_Permission     : constant Permission_Enumeration := 1;
        W_Permission     : constant Permission_Enumeration := 2;
        W_X_Permission   : constant Permission_Enumeration := 3;
        R_Permission     : constant Permission_Enumeration := 4;
        R_X_Permission   : constant Permission_Enumeration := 5;
        R_W_Permission   : constant Permission_Enumeration := 6;
        R_W_X_Permission : constant Permission_Enumeration := 7;

        function Time_Of_Last_Update (The_Object : Object) return Calendar.Time;

        function Time_Of_Last_Read (The_Object : Object) return Calendar.Time;

        function Creator (The_Object : Object) return User;

        function Creator_Group (The_Object : Object) return Group;

        function Object_Size (The_Object : Object) return Integer;

        function Number_Of_Links (The_Object : Object) return Integer;

        function Owner_Permissions (The_Object : Object)
                                   return Permission_Enumeration;

        function Group_Permissions (The_Object : Object)
                                   return Permission_Enumeration;

        function Other_Permissions (The_Object : Object)
                                   return Permission_Enumeration;

        procedure Change_Owner_Permissions
                     (The_Object      : Object;
                      The_Permissions : Permission_Enumeration);

        procedure Change_Group_Permissions
                     (The_Object      : Object;
                      The_Permissions : Permission_Enumeration);

        procedure Change_Other_Permissions
                     (The_Object      : Object;
                      The_Permissions : Permission_Enumeration);

        function Image (The_Permissions : Permission_Enumeration) return String;

        function Value (S : in String) return Permission_Enumeration;

    end Statistics;


    package Any_Object is

        -- Operations to Create, Copy and Destroy Objects.

        procedure Open (The_Object : in out Object; Object_Name : String);

        procedure Create (The_Object               : in out Object;
                          Object_Name              :        String;
                          Object_Class             :        Class_Enumeration :=
                             Directory.Unknown_Class;
                          Object_Owner_Permissions :
                             Directory.Statistics.Permission_Enumeration      :=
                             Directory.Statistics.R_W_Permission;
                          Object_Group_Permissions :
                             Directory.Statistics.Permission_Enumeration      :=
                             Directory.Statistics.R_W_Permission;
                          Object_Other_Permissions :
                             Directory.Statistics.Permission_Enumeration      :=
                             Directory.Statistics.R_W_Permission);

        procedure Copy (Source           :        Object;  
                        Destination_Name : in     String;
                        Destination      : in out Object);

        procedure Rename (Source : in out Object; Destination_Name : in String);

        procedure Delete (The_Object : in out Object);


    end Any_Object;


private

    package Gs is new Our_Generic_String (Default_Maximal_Length => 256);

    type Object is
        record
            Name : Gs.Object := Gs.Undefined_Object;
        end record;

    package Object_Set is new Set_Generic (Element => Object);


    type Iterator is new Object_Set.Iterator;

end Directory;

E3 Meta Data

    nblk1=f
    nid=2
    hdr6=1c
        [0x00] rec0=1e rec1=00 rec2=01 rec3=046
        [0x01] rec0=1c rec1=00 rec2=0c rec3=048
        [0x02] rec0=04 rec1=00 rec2=0e rec3=04e
        [0x03] rec0=20 rec1=00 rec2=05 rec3=00a
        [0x04] rec0=1c rec1=00 rec2=09 rec3=034
        [0x05] rec0=1e rec1=00 rec2=0b rec3=01e
        [0x06] rec0=04 rec1=00 rec2=0a rec3=02c
        [0x07] rec0=1d rec1=00 rec2=0f rec3=03a
        [0x08] rec0=00 rec1=00 rec2=03 rec3=00a
        [0x09] rec0=15 rec1=00 rec2=04 rec3=082
        [0x0a] rec0=02 rec1=00 rec2=0d rec3=010
        [0x0b] rec0=1b rec1=00 rec2=07 rec3=064
        [0x0c] rec0=12 rec1=00 rec2=08 rec3=02c
        [0x0d] rec0=1b rec1=00 rec2=06 rec3=000
        [0x0e] rec0=03 rec1=00 rec2=02 rec3=000
    tail 0x2172126dc83ab4fa7f7d4 0x42a00088462062803
Free Block Chain:
  0x2: 0000  00 00 00 0f 80 0c 75 74 20 4e 61 6d 69 6e 67 2e  ┆      ut Naming.┆