with Kermit_Defs;

package Kermit is

    -- This package is used to copy files to or from another computer,
    -- using the Kermit protocol and an RS-232 or Telnet connection.
    -- See $.Documentation for more general information.

    Port : Kermit_Defs.Port_Number := Kermit_Defs.Current_Port;
    -- The default port via which to communicate.

    Options : Kermit_Defs.Options := Kermit_Defs.Default.Options;
    -- The default options for communication and copying files.

    procedure Send (Source : String := "";
                    Target : String := "";
                    Port : Kermit_Defs.Port_Number := Kermit.Port;
                    Options : Kermit_Defs.Options := Kermit.Options);
    -- Transmit files via the given Port, using the Kermit packet protocol.
    -- Source is the Rational pathname of the file(s) to send; wildcards
    -- are OK.  Target, if non-null, is the desired remote name of the
    -- file.  The default Target is to use the same name as the Source.

    procedure Receive (Target : String := "";
                       Port : Kermit_Defs.Port_Number := Kermit.Port;
                       Options : Kermit_Defs.Options := Kermit.Options);
    -- Receive files via the given Port, using the Kermit packet protocol.
    -- Target, if non-null, is the desired local (Rational) name of the file.
    -- The default Target is to use the name in the received file header.

    procedure Connect (Port : Kermit_Defs.Port_Number := Kermit.Port;
                       Terminal_Port : Kermit_Defs.Port_Number :=
                          Kermit_Defs.Current_Port;
                       Escape : Character := Ascii.Etx; -- control-C
                       Log : String := "";
                       Local_Echo : Boolean := False;
                       Options : Kermit_Defs.Physical_Options :=
                          Kermit.Options.Physical;
                       Terminal_Options : Kermit_Defs.Physical_Options :=
                          Kermit_Defs.Default.Options.Physical);
    -- Carry on an interactive dialog with a remote machine via
    -- the given Port.  Append a transcript to the named Log file.
    -- Terminal_Port is the port for local terminal communication:
    -- interaction continues until the Escape character is received
    -- on the Terminal_Port.  If Local_Echo = True, input from the
    -- Terminal_Port will be echoed as it is received.  Options and
    -- Terminal_Options may be used to configure Port and Terminal_Port.

    procedure Transmit (File_Name : String := "";
                        Port : Kermit_Defs.Port_Number := Kermit.Port;
                        Log_File : String := "";
                        Options : Kermit_Defs.Physical_Options :=
                           Kermit.Options.Physical);
    -- Transmit the contents of the specified file on the given Port,
    -- and append them to given Log_File.  The file is transmitted
    -- verbatim, without being packetized, and without error checking.
    -- Options may be used to configure the Port.

    procedure Call (To : String := "");
    -- Initiate a Telnet connection to the given host name.
    -- If the connection is successfully formed, bind it to
    -- a port, and assign the port number to Kermit.Port.

    procedure Clear (Port : Kermit_Defs.Port_Number := Kermit.Port);
    -- If the Port is an RS-232 port, hang up the phone.
    -- If it is a Telnet port, disconnect the Telnet connection.

end Kermit;