DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦60432c622⟧ TextFile

    Length: 2321 (0x911)
    Types: TextFile
    Names: »B«

Derivation

└─⟦afbc8121e⟧ Bits:30000532 8mm tape, Rational 1000, MC68020_OS2000 7_2_2
    └─ ⟦77aa8350c⟧ »DATA« 
        └─⟦f794ecd1d⟧ 
            └─⟦4c85d69e2⟧ 
                └─⟦this⟧ 

TextFile

separate (Os_Dependent_Io)
package body Form_Handling is

    type Option_List is array (Option) of Boolean;
    pragma Pack (Option_List);

    Empty_Options : constant Option_List :=
       (Non_Sharable => False, Sharable => False);

    function Is_Delimiter (C : Character) return Boolean is
    begin
        return C = ' ' or else C = ',' or else C = ';';
    end Is_Delimiter;

    function Parse (Form : String) return Option_List is
        Options : Option_List      := Empty_Options;
        Last    : constant Natural := Form'Last;
        Start   : Natural          := Form'First;
        Finish  : Natural;
    begin  
        while Start <= Last loop
            while Start <= Last and then Is_Delimiter (Form (Start)) loop
                Start := Start + 1;
            end loop;

            Finish := Start + 1;

            while Finish <= Last and then not Is_Delimiter (Form (Finish)) loop
                Finish := Finish + 1;  
            end loop;

            Finish := Finish - 1;

            if Finish <= Last then
                declare
                    Value : Option;
                begin
                    Value           := Option'Value (Form (Start .. Finish));
                    Options (Value) := True;
                exception
                    when Constraint_Error =>
                        null;
                end;

            end if;

            Start := Finish + 1;
        end loop;

        return Options;
    end Parse;

    function Sharable (Form : String; Mode : Dio.File_Mode) return Boolean is
        Options : Option_List := Parse (Form);
    begin
        if Options (Non_Sharable) then
            return False;
        elsif Options (Sharable) then
            return True;
        else
            case Mode is
                when Dio.Closed | Dio.In_File =>
                    return True;
                when Dio.Inout_File | Dio.Out_File =>
                    return False;
            end case;
        end if;
    end Sharable;

    function Default_Image (Form : String; Mode_Bits : Natural) return String is
    begin
        if Mode_Bits >= Os2000_Io.Single_User then
            return Option'Image (Non_Sharable);
        else
            return Option'Image (Sharable);
        end if;
    end Default_Image;

end Form_Handling;