home *** CD-ROM | disk | FTP | other *** search
- /*
- * YMGS.C
- *
- * Contains: YmodemGSend()
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989-90 Greenleaf Software Inc. All Rights Reserved.
- *
- */
-
- #include <stdio.h>
- #include "gf.h"
- #include "asiports.h"
- #include "xfer.h"
- #include "_xfer.h"
-
-
- /*
- *
- * int YmodemGSend( int port,
- * char *file_name_list,
- * void ( *message_routine )( char * ),
- * void ( *idle_routine )( XFER * ),
- * unsigned int abort_key )
- *
- * ARGUMENTS
- *
- * int port: The port can be any opened COM port.
- * Take note of the fact that XMODEM file
- * transfers must have a totally transparent
- * eight bit connection. This means that
- * The port must be opened with eight bits,
- * and XON/XOFF handshaking must be turned
- * off. In addition, the buffer sizes
- * should be large enough to accomodate the
- * largest XMODEM buffer, which is about
- * 1030 bytes.
- *
- * 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. The driver will do its
- * best to send them one at a time.
- *
- * void ( *message_routine )( char * ):The driver routine calls this message
- * routine to print out major progress
- * messages and error messages. This can
- * be as simple or complicated a routine as
- * the user desires. All the routine needs
- * to be able to do is print out a string.
- * Note that none of the strings have any
- * embedded control characters. If this
- * parameter is a NULL, then no message
- * routine is called.
- *
- * void ( *idle_routine)( XFER * ): This idle routine is called whenever
- * the driver is waiting for buffers to
- * empty out or fill up. It passes a
- * pointer to the current Xfer status
- * block. This information will typically
- * be used to update a status display.
- * See XFER.H for documentation on what
- * the fields in the parameter block mean.
- * ANSITERM.C has an example of a status
- * screen using this information. If this
- * parameter is a NULL, then no idle
- * routine is called.
- *
- * unsigned int abort_key: The driver routine looks at the
- * keyboard frequently to see if the user
- * wants to abort. The calling program
- * defines the acceptable abort key with
- * this parameter.
- *
- * DESCRIPTION
- *
- * This routine calls the driver program to perform a YMODEM-G file send.
- * Like the Ymodem routine, multiple file names can be specified in the
- * file_name parameter. Since the "G" protocol type does away with most
- * of the XMODEM handshaking, this protocol should only be used on an
- * error free connection. The remote end must be able to keep up with
- * incoming data with no handshaking.
- *
- * SIDE EFFECTS
- *
- * File(s) may have been transfered.
- *
- * RETURNS
- *
- * The routine returns one of the defined XFER_RETURN codes defined
- * in XFER.H.
- *
- * AUTHOR
- * Mark Nelson 28-Aug-1989 20:57:40.92
- *
- * MODIFICATIONS
- *
- */
-
- int GF_CONV YmodemGSend( 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 xmodem;
-
- xmodem.port = port;
- xmodem.return_file_name = NULL;
- xmodem.filename = file_name_list;
- xmodem.file_length = 0L;
- xmodem.message_routine = message_routine;
- xmodem.idle_routine = idle_routine;
- xmodem.abort_key = abort_key;
- xmodem.transfer_type = XFER_TYPE_YMODEM_G;
- xmodem.x.xmodem.crc_mode = TRUE;
- _YmodemSend( &xmodem );
- return( xmodem.return_status );
- }
-
-
-