home *** CD-ROM | disk | FTP | other *** search
- /*
- * KERMITS.C
- *
- * Contains: KermitSend()
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989-90 Greenleaf Software Inc. All Rights Reserved.
- *
- * MODIFICATIONS
- *
- */
-
- #include <stdio.h>
- #include <string.h>
- #include "gf.h"
- #include "asiports.h"
- #include "xfer.h"
- #include "_xfer.h"
-
- /*
- * int KermitSend( int port,
- * char *file_name_list,
- * void ( *message_routine )( char *message ),
- * void ( *idle_routine )( XFER *status_block ),
- * unsigned int abort_key )
- *
- *
- * ARGUMENTS
- *
- * int port: This is the com port where the transfer
- * will be performed. It should be open,
- * and set to eight bit mode.
- *
- * char *file_name_list: This is a pointer to a string containing
- * a list of file names. The file names
- * can be separated by spaces, commas,
- * or semicolons. KERMIT will do its
- * best to send them one at a time.
- *
- * void ( *message_routine )( char * ):A routine to print character messages
- * sent out by the drive. NULL for no
- * routine present.
- *
- * void ( *idle_routine )( XFER * ): An idle routine. It gets a parameter
- * block pointer, enabling it to print
- * out statistics. NULL for no routine.
- *
- * unsigned int abort_key: A user defined abort key. Control X
- * conventionally, but ESC is good too.
- *
- * DESCRIPTION
- *
- * This routine is the public user interface routine to perform a Kermit
- * file send. The public interface routines are responsible for
- * setting up the xfer status block, andpassing it to the driver routine.
- * The private driver for KermitSend is _KermitSned(). So all this
- * public routine does is assign appropriate values to the status block,
- * then call the private driver. Note that Kermit needs an eight bit channel
- * to operate properly. XON/XOFF flow control will still work in conjunction
- * with the kermit protocol, as will RTS/CTS flow control. Note that with
- * Kermit, this module can send from 0 to N files. The number of files
- * is totally in the hands of the routine that sets up the filename string
- * that is passed to this routine.
- *
- * SIDE EFFECTS
- *
- * File(s) may have been transfered.
- *
- * RETURNS
- *
- * This routine returns the xfer status word that was set up
- * by the driver routine. The interpretation of the return values
- * is described in the include file, "XFER.H", which also contains
- * their definitions.
- *
- *
- * AUTHOR
- * Mark Nelson 27-Sep-1989 20:57:40.92
- *
- * MODIFICATIONS
- *
- */
- int GF_CONV KermitSend( int port,
- char *file_name_list,
- void ( GF_CDECL *message_routine )( char *message ),
- void ( GF_CDECL *idle_routine )( XFER *status_block ),
- unsigned int abort_key )
- {
- XFER kermit;
-
- kermit.port = port;
- kermit.return_file_name = NULL;
- kermit.filename = file_name_list;
- kermit.message_routine = message_routine;
- kermit.idle_routine = idle_routine;
- kermit.abort_key = abort_key;
- kermit.transfer_type = XFER_TYPE_KERMIT;
- kermit.file_length = 0L;
- _KermitSend( &kermit );
- return( kermit.return_status );
- }
-
-