with Profile;
with Tape_Tools;

package Tape_Utils is
    Tape_Error : exception;

    subtype Device is Tape_Tools.Logical_Device;

    type Io_Mode is (To_Tape, From_Tape);

    subtype Format is String;
    R1000 : constant Format := "R1000";
    Vax_Vms : constant Format := "Vax/VMS";

    function Obtain (Mode : Io_Mode;
                     Format : String;
                     Volume : String := "";
                     To_Operator : String := "Thank you";
                     Record_Format : Tape_Tools.Record_Format :=
                        Tape_Tools.Fixed_Length;
                     Record_Length : Natural := 80;
                     Block_Length : Natural := 2000;
                     Response : Profile.Response_Profile := Profile.Get)
                    return Device;
    procedure Release (Tape : Device;
                       Response : Profile.Response_Profile := Profile.Get);

    function Status (Tape : Device) return String renames Tape_Tools.Status;
    function End_Of_Tape (Tape : Device) return Boolean
        renames Tape_Tools.End_Of_Tape;

    procedure Write (Tape : in out Device;
                     Host_Name, Tape_Name : String;
                     Record_Format : Tape_Tools.Record_Format :=
                        Tape_Tools.Fixed_Length;
                     Record_Length : Natural := 80;
                     Response : Profile.Response_Profile := Profile.Get);
    procedure Read (Tape : in out Device;
                    Host_Name : String := "";
                    Response : Profile.Response_Profile := Profile.Get);

    procedure Create (Tape : in out Device; Tape_Name : String);
    procedure Open (Tape : in out Device; Tape_Name : out String);
    procedure Put_Line (Tape : Device; Line : String);
    procedure Get_Line (Tape : Device; Line : out String; Length : out Natural)
        renames Tape_Tools.Get_Line;
    procedure Close (Tape : Device) renames Tape_Tools.Close;
end Tape_Utils;