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

⟦7b32f387a⟧ Ada Source

    Length: 3072 (0xc00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Unix_Status_Buffer, seg_0509ac

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 Unchecked_Conversion;
with V_I_Bits;

package body Unix_Status_Buffer is

    function To_Short_Int is new Unchecked_Conversion
                                    (Source => Unix_Status_Buffer.Mode_Rec,
                                     Target => Short_Integer);

    function To_Int is new Unchecked_Conversion
                              (Source => Unix_Status_Buffer.Mode_Rec,
                               Target => Integer);


    function To_Permission (M : Mode_Rec) return File_Names.Permission is
        Int : Integer;
        Mask : Integer := 1;
        Perm : File_Names.Permission := (others => File_Names.Deny_Right);
    begin
        if Mode_Rec'Size = 2 * System.Storage_Unit then
            Int := Integer (To_Short_Int (M));
        else
            Int := To_Int (M);
        end if;
        for Right in File_Names.World_Execute_R ..
                        File_Names.Execute_As_User_R loop
            if V_I_Bits.Bit_And (Int, Mask) /= 0 then
                Perm (Right) := File_Names.Allow_Right;
            end if;
            Mask := 2 * Mask;
        end loop;
        return Perm;
    end To_Permission;


    function To_Permission_Int (P : File_Names.Permission)
                               return Permission_Integer is
        Int_P, Mask : Permission_Integer;
    begin
        Int_P := 0;
        Mask := 1;
        for Right in File_Names.World_Execute_R ..
                        File_Names.Execute_As_User_R loop
            if P (Right) = File_Names.Allow_Right then
                Int_P := V_I_Bits.Bit_Or (Int_P, Mask);
            end if;
            Mask := 2 * Mask;
        end loop;
        return Int_P;
    end To_Permission_Int;


    function Is_Directory (Stat_Buf : Status_Buffer) return Boolean is
    begin
        return Stat_Buf.Mode.S_Ifmt = S_Ifdir;
    end Is_Directory;

end Unix_Status_Buffer;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=1c rec1=00 rec2=01 rec3=046
        [0x01] rec0=20 rec1=00 rec2=02 rec3=000
    tail 0x217580416878e7995e6ff 0x42a00088462060003