Annotation of gcl520h/xfer.h, revision 1.1

1.1     ! root        1: #ifndef XFER_DOT_H
        !             2: #define XFER_DOT_H
        !             3: 
        !             4: /*
        !             5:  *  XFER.H                 5.20A  June 8, 1995
        !             6:  *
        !             7:  *  The Greenleaf Comm Library
        !             8:  *
        !             9:  *  Copyright (C) 1984-1995 Greenleaf Software Inc.  All Rights Reserved.
        !            10:  *
        !            11:  * MODIFICATIONS
        !            12:  *
        !            13:  * December 12, 1992  4.00A : Initial release
        !            14:  *
        !            15:  * December 13, 1994  5.10A : Added the 5.00D patch.
        !            16:  *
        !            17:  * August 18, 1995    5.20B : Added the error_code member to the FILE_ENGINE
        !            18:  *                            structure.
        !            19:  */
        !            20: 
        !            21:  /*
        !            22:  * This header file contains all the public definitions for the code
        !            23:  * that supports various types of file transfers.  This header file
        !            24:  * defines the universal XFER protocol structure, plus a bunch of
        !            25:  * constants.  Any defined file transfer taking place has a parameter
        !            26:  * block associated with it.  This block contains nearly all of the
        !            27:  * information needed to figure out what is going on in the transfer at
        !            28:  * any given time.  The only time the high level code really needs to care
        !            29:  * about the contents of this structure is if the idle routine is doing
        !            30:  * any processing on the data.  The definitions of the structure elements
        !            31:  * follows:
        !            32:  *
        !            33:  * file_engine:              This is a pointer to the file engine structure
        !            34:  *                           that helps the file transfer routines expand
        !            35:  *                           wild cards and open files.  This is still
        !            36:  *                           undocumented, so it isn't real easy for a user
        !            37:  *                           to replace this with a function of their own.
        !            38:  *
        !            39:  * filename :                A pointer to the name of the file presently
        !            40:  *                           being transferred.
        !            41:  *
        !            42:  * block_number:             This is the file block number, which starts
        !            43:  *                           at 0 and keeps incrementing each time a new
        !            44:  *                           block is transferred.
        !            45:  *
        !            46:  * byte_count:               This is the total byte count for the transfer.
        !            47:  *                           It starts at 0 and goes up when receiving a
        !            48:  *                           file.  When sending a file it starts at the
        !            49:  *                           file size and counts down to 0.
        !            50:  *
        !            51:  * file_length:              This is the number of bytes that are expected
        !            52:  *                           for the file to be transfered.  This number is
        !            53:  *                           presently only used during YMODEM file reception.
        !            54:  *
        !            55:  * file_time:                The time stamp for the file currently being
        !            56:  *                           transferred, in UNIX format.
        !            57:  *
        !            58:  * message_routine:          This is a routine used to print out periodic
        !            59:  *                           transfer status messages.  The parameter is a
        !            60:  *                           simple character string.
        !            61:  *
        !            62:  * idle_routine:             This is the user defined idle routine which
        !            63:  *                           can print out more detailed information
        !            64:  *                           than the message_routine. It gets a pointer
        !            65:  *                           to the current status block.
        !            66:  *
        !            67:  * buffer:                   This is a pointer to the packet buffer.  It
        !            68:  *                           gets set up during initialization, and is
        !            69:  *                           freed when the driver exits.
        !            70:  *
        !            71:  * file:                     This is a file pointer to the currently open
        !            72:  *                           file.  It gets opened and closed by the driver
        !            73:  *                           routine.
        !            74:  *
        !            75:  * port:                     This is the port structure for the port being
        !            76:  *                           used for the transfer.  It needs to be an open
        !            77:  *                           port.  This was changed to be a PORT * in 3.10.
        !            78:  *
        !            79:  * abort_key:                Anytime the user hits a key, the driver reads
        !            80:  *                           it out, and checks to see if it is the same
        !            81:  *                           as the abort_key in the structure.  If it is,
        !            82:  *                           the protocol driver cleans up and exits.
        !            83:  *
        !            84:  * return_status:            This is the current return status the driver
        !            85:  *                           has.  This normally is the XFER_SUCCESS
        !            86:  *                           constant, unless an error has occurred.
        !            87:  *
        !            88:  * current_block_size:       This is the size of the block currently being
        !            89:  *                           sent or received.
        !            90:  *
        !            91:  * current_block_checksum:   After the block is read in, the block checksum
        !            92:  *                           is stored in this structure element.
        !            93:  *
        !            94:  * current_block_number:     This is the block number that went out with
        !            95:  *                           the buffer currently being sent or received.
        !            96:  *
        !            97:  * monitor_cd:               If this flag is set, the abort function will
        !            98:  *                           periodically check for loss of carrier.  If
        !            99:  *                           carrier goes low, the transfer aborts.
        !           100:  *
        !           101:  * subdirectories:           This flag is set if wildcard expansion is
        !           102:  *                           supposed to search through subdirectories.
        !           103:  *
        !           104:  * error_count:              This counter keeps track of the number of errors
        !           105:  *                           that have occurred during this transfer.
        !           106:  *
        !           107:  * block_error_count:        This int keeps track of the number of errors
        !           108:  *                           encountered during the current block.
        !           109:  *
        !           110:  * transfer_type:            The protocol being used during this transfer.
        !           111:  *
        !           112:  * sending:                  This flag is set to be TRUE during uploads, and
        !           113:  *                           false during downloads.
        !           114:  *
        !           115:  * strip_path_from_filename: Some of the protocols in use here send and
        !           116:  *                           receive file names before each file.  This
        !           117:  *                           element controls whether the path component is
        !           118:  *                           stripped from those file names, either before
        !           119:  *                           sending the name or after receiving it.
        !           120:  *
        !           121:  * x.xmodem.ack_timeout:     This int contains the length in milliseconds of
        !           122:  *                           the XMODEM ACK timeout.  It defaults to 10
        !           123:  *                           seconds, but some installations may want to
        !           124:  *                           jack up the value.
        !           125:  *
        !           126:  * x.xmodem.last_control_character:
        !           127:  *                           This is the last character received while waiting
        !           128:  *                           for a control character, such as NAK, ACK or CAN
        !           129:  *                           during an xmodem file transfer.
        !           130:  *
        !           131:  * x.xmodem.crc_mode:        This flag is set true if the 16 bit CRC checksum
        !           132:  *                           calculation method is in use, and false if
        !           133:  *                           the additive checksum system is in used during
        !           134:  *                           an xmodem file transfer.
        !           135:  *
        !           136:  * x.zmodem.cancel_count:    During a ZMODEM file transfer, this element
        !           137:  *                           keeps track of the count of ZCAN characters.
        !           138:  *
        !           139:  * x.zmodem.garbage_count:   Used to keep track of the number of garbage
        !           140:  *                           characters received during a ZMODEM receive.
        !           141:  *
        !           142:  * x.zmodem.rx_flag:         The ZMODEM rx flags received from the remote
        !           143:  *                           end.
        !           144:  *
        !           145:  * x.zmodem.error_recovery:  This element is set when the ZMODEM sender
        !           146:  *                           is undergoing an error recovery.
        !           147:  *
        !           148:  * x.zmodem.rx_buffer_size:  The size of the receiver's RX buffer, sent
        !           149:  *                           during initialization.
        !           150:  *
        !           151:  * x.zmodem.rx_frame_output_count :
        !           152:  *                           This element keeps track of how many bytes have
        !           153:  *                           been sent in the current frame.  The receiver
        !           154:  *                           may have sent a buffer size, and we don't
        !           155:  *                           want to exceed it.
        !           156:  *
        !           157:  *
        !           158:  * x.zmodem.header:          A copy of the header bytes received when the
        !           159:  *                           last header was read in.
        !           160:  *
        !           161:  * x.zmodem.header_type:     The type of the most recent header.
        !           162:  *
        !           163:  * x.zmodem.crash_recovery:  If this flag is set, the ZMODEM receiver will
        !           164:  *                           always check to see if a file exsists before
        !           165:  *                           beginning to download.  If the file does exist,
        !           166:  *                           ZMODEM will attempt to perform a crash recovery.
        !           167:  *
        !           168:  * x.zmodem.block_before_write:
        !           169:  *                           If this flag is set, ZMODEM will always try
        !           170:  *                           to block the sender before writing to the disk.
        !           171:  *                           This may be necessary to prevent hardware
        !           172:  *                           overrun errors during disk access.
        !           173:  *
        !           174:  * x.zmodem.use_window :     If this flag is set, a window will be used for
        !           175:  *                           sending a file, which causes the sender to
        !           176:  *                           wait for a ZACK before continuing to next
        !           177:  *                           window.  This is on by default and can be
        !           178:  *                           turned off with the XFER_ZMODEM_NO_WINDOW
        !           179:  *                           option.
        !           180:  *
        !           181:  * x.zmodem.window_size :    This indicates the size of the window that
        !           182:  *                           the sender will use if use_window is set.
        !           183:  *
        !           184:  * x.zmodem.management_options :
        !           185:  *                           This will indicate which file management
        !           186:  *                           option is used.
        !           187:  *
        !           188:  * x.kermit.max_length:      This is the maximum buffer size that the other
        !           189:  *                           end wants me to send.  This size refers to
        !           190:  *                           the actual data size sent in the packet, which
        !           191:  *                           is the size of the data block plus 3.
        !           192:  *
        !           193:  * x.kermit.qbin:            This flag is used to indicate whether binary
        !           194:  *                           characters should be quoted, i.e. eighth bit
        !           195:  *                           prefixing.  It is set during the startup
        !           196:  *                           negotiation.
        !           197:  *
        !           198:  * x.kermit.text_mode:       This flag indicates whether upper bits are to
        !           199:  *                           be stripped out of the file before it is sent,
        !           200:  *                           or as it is received.
        !           201:  *
        !           202:  * x.kermit.timeout:         This is the time in seconds that the remote
        !           203:  *                           end wants me to use to time out his
        !           204:  *                           transmissions.
        !           205:  *
        !           206:  * x.kermit.pad_count:       This is the number of pad characters that the
        !           207:  *                           remote end wants me to send before every packet.
        !           208:  *
        !           209:  * x.kermit.pad_char:        This is the pad character the remote end expects.
        !           210:  *
        !           211:  * x.kermit.eol:             This is the the line terminator that the remote
        !           212:  *                           end wants.
        !           213:  *
        !           214:  * x.kermit.quote_char:      This is the quote character that the remote end
        !           215:  *                           will be using.
        !           216:  *
        !           217:  * x.kermit.his_qbin_char:   This is the quote character that the remote end
        !           218:  *                           will be using for eight bit prefixing.
        !           219:  *
        !           220:  * x.kermit.my_qbin_char:    This is the quote character that I will be
        !           221:  *                           using for eighth bit prefixing.
        !           222:  *
        !           223:  * x.kermit.repeat_flag:     This is used to indicate whether or not run
        !           224:  *                           length encoding is to be used.  It is set
        !           225:  *                           during the startup negotiation phase.
        !           226:  *
        !           227:  * x.kermit.his_repeat_char: This is the character the remote end has
        !           228:  *                           sent to tell what he wants as a repeat char
        !           229:  *                           when performing run length encoding.
        !           230:  *
        !           231:  * x.kermit.my_repeat_char:  This is the character I want to use when
        !           232:  *                           when performing run length encoding.
        !           233:  *
        !           234:  * x.kermit.his_capbilities: A copy of the remote end's capability bits.
        !           235:  *                           We get this during startup.
        !           236:  *
        !           237:  * x.ascii.timeout_time:     This is the timeout value that determines how
        !           238:  *                           long an ASCII receive will sit idle with no
        !           239:  *                           characters coming in.  This used to be hardcoded,
        !           240:  *                           but now it is adjustable.
        !           241:  *
        !           242:  * x.ascii.received_character_printer:
        !           243:  *                           This is a pointer to a function used during ASCII
        !           244:  *                           file transfers.  It is a user supplied function
        !           245:  *                           that will print out a character at a time to serve
        !           246:  *                           as a line monitor during the file transfer.
        !           247:  *
        !           248:  * x.ascii.delay_milliseconds_per_line:
        !           249:  *                           This is the value for the number of ms to be
        !           250:  *                           delayed after every line is sent during an ASCII
        !           251:  *                           file transfer.
        !           252:  *
        !           253:  * x.ascii.strip_lf:         This is a flag which is used to tell whether or
        !           254:  *                           or not line feed characters should be stripped
        !           255:  *                           during Ascii file transfers.
        !           256:  *
        !           257:  */
        !           258: 
        !           259: #include <stdio.h>
        !           260: #include "commlib.h"
        !           261: 
        !           262: typedef struct t_file_engine {
        !           263:     int ( GF_CONV *get_next_filename )( struct t_file_engine GF_DLL_FAR *engine );
        !           264:     int ( GF_CONV *destroy_file_engine )( struct t_file_engine GF_DLL_FAR *engine );
        !           265:     void GF_DLL_FAR *local_data;
        !           266:     char output_name[ 512 ];
        !           267:     long length;
        !           268:     long unix_time;
        !           269:     int year;
        !           270:     int month;
        !           271:     int day;
        !           272:     int hour;
        !           273:     int minutes;
        !           274:     int seconds;
        !           275:     int error_code;
        !           276: } FILE_ENGINE;
        !           277: 
        !           278: typedef struct xfer{
        !           279:                     FILE_ENGINE GF_DLL_FAR *file_engine;
        !           280:                     char GF_DLL_FAR *filename;  /* File presntly being xfered */
        !           281:                     long block_number;
        !           282:                     long byte_count;
        !           283:                     long file_length;
        !           284:                     long file_time;
        !           285:                     void (GF_CONV *message_routine)(char GF_DLL_FAR *message);
        !           286:                     void (GF_CONV *idle_routine)(struct xfer GF_DLL_FAR *x);
        !           287:                     char GF_DLL_FAR *buffer;
        !           288:                     FILE GF_DLL_FAR *file;
        !           289:                     PORT GF_DLL_FAR *port;
        !           290:                     unsigned int abort_key;
        !           291:                     int file_count;
        !           292:                     int return_status;
        !           293:                     int current_block_size;
        !           294:                     int current_block_checksum;
        !           295:                     int current_block_number;
        !           296:                     int monitor_cd;
        !           297:                     int subdirectories;
        !           298:                     int error_count;
        !           299:                     int block_error_count;
        !           300:                     char sending;
        !           301:                     char strip_path_from_filename;
        !           302:                     int idle_window;
        !           303:                     char transfer_type;
        !           304:                     union {
        !           305:                               struct x_options {
        !           306:                                          long ack_timeout;
        !           307:                                          int last_control_char;
        !           308:                                          char crc_mode;
        !           309:                               } xmodem;
        !           310:                               struct csb_options {
        !           311:                                          void GF_DLL_FAR *bplus_data;
        !           312:                                          int use_b_plus;
        !           313:                                          int want_7_bit;
        !           314:                                          char resume_download;
        !           315:                                          char resume_upload;
        !           316:                                          char send_file_info;
        !           317:                                          char window_size;
        !           318:                                          char rec_window_size;
        !           319:                                          char use_transport;
        !           320:                                          char check_method;
        !           321:                               } csb;
        !           322:                               struct z_options {
        !           323:                                          int cancel_count;
        !           324:                                          int garbage_count;
        !           325:                                          int rx_flags;
        !           326:                                          int error_recovery;
        !           327:                                          unsigned int rx_buffer_size;
        !           328:                                          unsigned int rx_frame_output_count;
        !           329:                                          unsigned char header[ 4 ];
        !           330:                                          int header_type;
        !           331:                                          int crash_recovery;
        !           332:                                          int block_before_write;
        !           333:                                          int use_window;
        !           334:                                          int window_size;
        !           335:                                          int conversion_options;
        !           336:                                          int management_options;
        !           337:                                          int read_full_packet;
        !           338:                                          int max_errors;
        !           339:                                          int subpacket_size;
        !           340:                               } zmodem;
        !           341:                               struct k_options {
        !           342:                                          int  max_length;
        !           343:                                          int  qbin;
        !           344:                                          int  text_mode;
        !           345:                                          char timeout;
        !           346:                                          char pad_count;
        !           347:                                          char pad_char;
        !           348:                                          char eol;
        !           349:                                          char quote_char;
        !           350:                                          char his_qbin_char;
        !           351:                                          char my_qbin_char;
        !           352:                                          char repeat_flag;
        !           353:                                          char his_repeat_char;
        !           354:                                          char my_repeat_char;
        !           355:                                          char his_capabilities;
        !           356:                               } kermit;
        !           357:                               struct a_options {
        !           358:                                          long timeout_time;
        !           359:                                          void (GF_CONV *received_character_printer)(char c);
        !           360:                                          int  delay_milliseconds_per_line;
        !           361:                                          int  delay_milliseconds_per_char;
        !           362:                                          char strip_lf;
        !           363:                               } ascii;
        !           364:                           } x;
        !           365:                    } XFER;
        !           366: 
        !           367: /*
        !           368:  * These seven constants define all the possible protocols used during
        !           369:  * file transfers.  Note that type 0, standard XMODEM, can have crc_mode set
        !           370:  * to be true or false, so it looks kind of like two protocols in one.
        !           371:  */
        !           372: #define XFER_TYPE_XMODEM     0
        !           373: #define XFER_TYPE_XMODEM_1K  1
        !           374: #define XFER_TYPE_YMODEM     2
        !           375: #define XFER_TYPE_XMODEM_1KG 3
        !           376: #define XFER_TYPE_YMODEM_G   4
        !           377: #define XFER_TYPE_KERMIT     5
        !           378: #define XFER_TYPE_ASCII      6
        !           379: #define XFER_TYPE_ZMODEM     7
        !           380: #define XFER_TYPE_BPLUS      8
        !           381: /*
        !           382:  * These are several global constants used to define basic parameters used
        !           383:  * to define some of the transfer parameters for the various families.
        !           384:  */
        !           385: #define XMODEM_RECEIVE_TIMEOUT        10000L /*Buffer receive timeout in seconds */
        !           386: #define XMODEM_STARTUP_TIMEOUT        5000L  /*Sender startup timeout            */
        !           387: #define XMODEM_ACK_TIMEOUT            10000L /*Time to wait for ACK after buff   */
        !           388: #define XMODEM_MAX_ERRORS             10 /*Maximum number of block retries   */
        !           389: 
        !           390: #define KERMIT_MY_MAX_SIZE            94  /*My maximum kermit buffer size.    */
        !           391: #define KERMIT_MY_PACKET_TIMEOUT      10  /*Buffer receive timeout in seconds */
        !           392: #define KERMIT_MY_EOL                 '\r'/*The EOL character I want.         */
        !           393: #define KERMIT_MY_PAD_COUNT           0   /*My incoming pad character count.  */
        !           394: #define KERMIT_MY_PAD_CHAR            0   /*My incoming pad characer.         */
        !           395: #define KERMIT_MY_QUOTE_CHAR          '#' /*My quote character.               */
        !           396: #define KERMIT_MY_QBIN_CHAR           '&' /*My default QBIN quoting character */
        !           397: #define KERMIT_MY_QBIN_DEFAULT        'Y' /*My default QBIN receive state     */
        !           398: #define KERMIT_MY_MARK_CHARACTER      1   /*My mark character, normally ^A    */
        !           399: #define KERMIT_MY_REPEAT_CHARACTER    '~' /*My repeat char                    */
        !           400: #define KERMIT_MAX_ERRORS             10  /*Maximum number of errors in Kermit*/
        !           401: /* Change to 5 during debugging */
        !           402: #define ZMODEM_MAX_ERRORS             10 /*Maximum number of block retries    */
        !           403: #define BPLUS_MAX_ERRORS              10 /*Maximum number of errors in        */
        !           404:                                          /*CompuServe B+                      */
        !           405: #define BPLUS_DEFAULT_PACKET_SIZE     1031 /* Size of B+ packet                */
        !           406: 
        !           407: #define ASCII_RECEIVE_TIMEOUT         10000 /* Timeout timer for ASCII download */
        !           408: 
        !           409: /*
        !           410:  * These are all the possible return values that can result from an
        !           411:  * transfer.  They should all be somewhat self-explanatory.  For deeper
        !           412:  * explanations, it is necessary to go to the source code.
        !           413:  */
        !           414: 
        !           415: #define XFER_RETURN_SUCCESS         0   /* Successfull file transfer        */
        !           416: #define XFER_RETURN_CANT_GET_BUFFER -601/* Failed to allocate comm buffer   */
        !           417: #define XFER_RETURN_CANT_OPEN_FILE  -602/* Couldn't open transfer file      */
        !           418: #define XFER_RETURN_CANT_SEND_NAK   -603/* Buffer full, can't send NAK      */
        !           419: #define XFER_RETURN_CANT_SEND_ACK   -604/* Buffer full, can't send ACK      */
        !           420: #define XFER_RETURN_KEYBOARD_ABORT  -605/* User hit the abort key           */
        !           421: #define XFER_RETURN_REMOTE_ABORT    -606/* CAN-CAN abort from remote end    */
        !           422: #define XFER_RETURN_FILE_ERROR      -607/* Failure during file I/O          */
        !           423: #define XFER_RETURN_PACKET_TIMEOUT  -608/* Timed out waiting for packet     */
        !           424: #define XFER_RETURN_BAD_PACKET_SIZE -609/* Got an invalid packet size       */
        !           425: #define XFER_RETURN_TOO_MANY_ERRORS -610/* Got too many errors to go on     */
        !           426: #define XFER_RETURN_LOGIC_ERROR     -611/* Internal error, will never happen*/
        !           427: #define XFER_RETURN_CANT_PUT_BUFFER -612/* Error transmitting buffer        */
        !           428: #define XFER_RETURN_CANT_SEND_EOT   -613/* Buffer full, can't send EOT      */
        !           429: #define XFER_RETURN_PROTOCOL_ERROR  -614/* Usually a bad packet type in kerm*/
        !           430: #define XFER_RETURN_CANT_PUT_CHAR   -615/* Error transmitting a character   */
        !           431: #define XFER_RETURN_CANT_GET_CHAR   -616/* Error receiving a character      */
        !           432: #define XFER_RETURN_ASCII_TIMEOUT   -617/* Nothing happening during ASCII   */
        !           433: #define XFER_RETURN_LOST_CARRIER    -618/* Lost carrier during Xfer         */
        !           434: #define XFER_RETURN_NO_FILES        -619/* Sent no files                    */
        !           435: #define XFER_SEND_ZSKIP             -620/* Receiver should send ZSKIP       */
        !           436: #define XFER_RETURN_BAD_PACKET_SEQ  -621/* CompuServe B+ packet sequence err*/
        !           437: #define XFER_RETURN_PACKET_ARRIVED  -622/* CompuServe B+ packet arrived     */
        !           438: #define XFER_RETURN_FILE_ENGINE_ERR -623/* File engine failed               */
        !           439: 
        !           440: /*
        !           441:  * File management options supported by Zmodem
        !           442:  */
        !           443: #define ZMRECOV   3
        !           444: #define ZMNEWL    1
        !           445: #define ZMAPND    3
        !           446: #define ZMCLOB    4
        !           447: #define ZMNEW     5
        !           448: #define ZMDIFF    6
        !           449: #define ZMPROT    7
        !           450: 
        !           451: enum FileTransferOptions { XFER_END_OPTIONS = 0,
        !           452:                            XFER_NOP = 1001,
        !           453:                            XFER_KERMIT_BINARY_PREFIX = 1002,
        !           454:                            XFER_KERMIT_TEXT_MODE = 1003,
        !           455:                            XFER_KERMIT_DISABLE_RLE = 1004,
        !           456:                            XFER_USE_FULL_PATH_NAME = 1005,
        !           457:                            XFER_MONITOR_CARRIER = 1006,
        !           458:                            XFER_ABORT_KEY = 1007,
        !           459:                            XFER_ADDITIVE_CHECKSUM = 1008,
        !           460:                            XFER_SUBDIRECTORIES = 1009,
        !           461:                            XFER_FILE_ENGINE_CONSTRUCTOR = 1010,
        !           462:                            XFER_USE_G_OPTION = 1011,
        !           463:                            XFER_ASCII_TIMEOUT_TIME = 1012,
        !           464:                            XFER_ASCII_CHAR_DELAY = 1013,
        !           465:                            XFER_ZMODEM_CRASH_RECOVERY = 1014,
        !           466:                            XFER_ZMODEM_BLOCK_BEFORE_WRITE = 1015,
        !           467:                            XFER_XMODEM_ACK_TIMEOUT = 1016,
        !           468:                            XFER_ZMODEM_NO_WINDOW = 1017,
        !           469:                            XFER_ZMODEM_OVERWRITE_NEWL = 1018,
        !           470:                            XFER_ZMODEM_OVERWRITE_APPEND = 1019,
        !           471:                            XFER_ZMODEM_OVERWRITE_ALWAYS = 1020,
        !           472:                            XFER_ZMODEM_OVERWRITE_DIFF = 1021,
        !           473:                            XFER_ZMODEM_OVERWRITE_PROT = 1022,
        !           474:                            XFER_ZMODEM_OVERWRITE_NEW = 1023,
        !           475:                            XFER_BPLUS_CHECK_METHOD = 1024,
        !           476:                            XFER_BPLUS_SEND_FILE_INFO = 1025,
        !           477:                            XFER_BPLUS_RESUME_DOWNLOAD = 1026,
        !           478:                            XFER_DISPLAY_IDLE = 1027,
        !           479:                            XFER_ZMODEM_SET_MAX_ERRORS = 1028,
        !           480:                            XFER_ZMODEM_SET_WINDOW_SIZE = 1029
        !           481:                          };
        !           482: 
        !           483: typedef struct xfer_options {
        !           484:     int kermit_bin_prefix;
        !           485:     int kermit_text_mode;
        !           486:     int kermit_disable_rle;
        !           487:     int full_path;
        !           488:     int monitor_cd;
        !           489:     int abort_key_opt;
        !           490:     int abort_key;
        !           491:     int additive_checksum;
        !           492:     int xmodem_ack_timeout_opt;
        !           493:     int xmodem_ack_timeout;
        !           494:     int subdirectories;
        !           495:     int g_option;
        !           496:     int ascii_timeout_opt;
        !           497:     int ascii_timeout;
        !           498:     int crash_recovery;
        !           499:     int blocking;
        !           500:     int zmodem_window;
        !           501:     int ovw_mgmt;
        !           502:     int bp_check_opt;
        !           503:     int bp_check_method;
        !           504:     int bp_file_info;
        !           505:     int bp_resume_dl;
        !           506:     int idle_display;
        !           507:     int idle_hwnd;
        !           508:     int zmodem_errors_opt;
        !           509:     int zmodem_max_errors;
        !           510:     int zmodem_window_opt;
        !           511:     int zmodem_window_size;
        !           512: } XFER_OPTIONS;
        !           513: 
        !           514: 
        !           515: /*                  FILE TRANSFER FUNCTION PROTOTYPES
        !           516:  *
        !           517:  * These are the function prototypes for the user interface routines.
        !           518:  *
        !           519:  */
        !           520: 
        !           521: #ifdef __cplusplus
        !           522: 
        !           523: extern "C" {
        !           524: #endif
        !           525: 
        !           526: #define XmodemReceive( p, f, m, i )            /* Tag: File Xfer public */ \
        !           527:           XmodemReceiveWithOptions( p, f, m, i, XFER_END_OPTIONS )
        !           528: 
        !           529: #define Xmodem1KReceive( p, f, m, i )          /* Tag: File Xfer public */ \
        !           530:           Xmodem1KReceiveWithOptions( p, f, m, i, XFER_END_OPTIONS )
        !           531: 
        !           532: #define YmodemReceive( p, m, i )               /* Tag: File Xfer public */ \
        !           533:           YmodemReceiveWithOptions( p, m, i, XFER_END_OPTIONS )
        !           534: 
        !           535: #define KermitReceive( p, m, i )               /* Tag: File Xfer public */ \
        !           536:           KermitReceiveWithOptions( p, m, i, XFER_END_OPTIONS )
        !           537: 
        !           538: #define AsciiReceive( p, f, m, i, e, s )       /* Tag: File Xfer public */ \
        !           539:           AsciiReceiveWithOptions( p, f, m, i, e, s, XFER_END_OPTIONS )
        !           540: 
        !           541: #define ZmodemReceive( p, m, i )               /* Tag: File Xfer public */ \
        !           542:           ZmodemReceiveWithOptions( p, m, i, XFER_END_OPTIONS )
        !           543: 
        !           544: #define XmodemSend( p, f, m, i )               /* Tag: File Xfer public */ \
        !           545:           XmodemSendWithOptions( p, f, m, i, XFER_END_OPTIONS )
        !           546: 
        !           547: #define Xmodem1KSend( p, f, m, i )             /* Tag: File Xfer public */ \
        !           548:           Xmodem1KSendWithOptions( p, f, m, i, XFER_END_OPTIONS )
        !           549: 
        !           550: #define YmodemSend( p, f, m, i )               /* Tag: File Xfer public */ \
        !           551:           YmodemSendWithOptions( p, f, m, i, XFER_END_OPTIONS )
        !           552: 
        !           553: #define KermitSend( p, f, m, i )               /* Tag: File Xfer public */ \
        !           554:           KermitSendWithOptions( p, f, m, i, XFER_END_OPTIONS )
        !           555: 
        !           556: #define AsciiSend( p, f, m, i, e, s, l )       /* Tag: File Xfer public */ \
        !           557:           AsciiSendWithOptions( p, f, m, i, e, s, l, XFER_END_OPTIONS )
        !           558: 
        !           559: #define ZmodemSend( p, f, m, i )               /* Tag: File Xfer public */ \
        !           560:           ZmodemSendWithOptions( p, f, m, i, XFER_END_OPTIONS )
        !           561: 
        !           562: int GF_CDECL YmodemReceiveWithOptions(
        !           563:                  PORT GF_DLL_FAR *port,
        !           564:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           565:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           566:                  enum FileTransferOptions first_option,
        !           567:                  ... );
        !           568: 
        !           569: int GF_CDECL KermitReceiveWithOptions(
        !           570:                  PORT GF_DLL_FAR *port,
        !           571:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           572:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           573:                  enum FileTransferOptions first_option,
        !           574:                  ... );
        !           575: 
        !           576: int GF_CDECL ZmodemReceiveWithOptions(
        !           577:                  PORT GF_DLL_FAR *port,
        !           578:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           579:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           580:                  enum FileTransferOptions first_option,
        !           581:                  ... );
        !           582: 
        !           583: int GF_CDECL YmodemSendWithOptions(
        !           584:                 PORT GF_DLL_FAR *port,
        !           585:                 char GF_DLL_FAR *file_name_list,
        !           586:                 void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           587:                 void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           588:                 enum FileTransferOptions first_option,
        !           589:                 ... );
        !           590: 
        !           591: int GF_CDECL KermitSendWithOptions(
        !           592:                  PORT GF_DLL_FAR *port,
        !           593:                  char GF_DLL_FAR *file_name_list,
        !           594:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           595:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           596:                  enum FileTransferOptions first_option,
        !           597:                  ... );
        !           598: 
        !           599: int GF_CDECL ZmodemSendWithOptions(
        !           600:                  PORT GF_DLL_FAR *port,
        !           601:                  char GF_DLL_FAR *file_name,
        !           602:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           603:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           604:                  enum FileTransferOptions first_option,
        !           605:                  ... );
        !           606: 
        !           607: int GF_CDECL XmodemReceiveWithOptions(
        !           608:                  PORT GF_DLL_FAR *port,
        !           609:                  char GF_DLL_FAR *file_name,
        !           610:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           611:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           612:                  enum FileTransferOptions first_option,
        !           613:                  ... );
        !           614: 
        !           615: int GF_CDECL Xmodem1KReceiveWithOptions(
        !           616:                  PORT GF_DLL_FAR *port,
        !           617:                  char GF_DLL_FAR *file_name,
        !           618:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           619:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           620:                  enum FileTransferOptions first_option,
        !           621:                  ... );
        !           622: 
        !           623: int GF_CDECL AsciiReceiveWithOptions(
        !           624:                  PORT GF_DLL_FAR *port,
        !           625:                  char GF_DLL_FAR *file_name,
        !           626:                  void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           627:                  void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           628:                  void ( GF_DLL_FAR GF_CONV *echo_routine )( char c ),
        !           629:                  char strip_lf,
        !           630:                  enum FileTransferOptions first_option,
        !           631:                  ... );
        !           632: 
        !           633: int GF_CDECL XmodemSendWithOptions(
        !           634:                 PORT GF_DLL_FAR *port,
        !           635:                 char GF_DLL_FAR *file_name,
        !           636:                 void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           637:                 void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           638:                 enum FileTransferOptions first_option,
        !           639:                 ... );
        !           640: 
        !           641: int GF_CDECL Xmodem1KSendWithOptions(
        !           642:                 PORT GF_DLL_FAR *port,
        !           643:                 char GF_DLL_FAR *file_name,
        !           644:                 void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           645:                 void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           646:                 enum FileTransferOptions first_option,
        !           647:                 ... );
        !           648: 
        !           649: int GF_CDECL AsciiSendWithOptions(
        !           650:                 PORT GF_DLL_FAR *port,
        !           651:                 char GF_DLL_FAR *file_name,
        !           652:                 void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           653:                 void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           654:                 void ( GF_DLL_FAR GF_CONV *echo_routine )( char c ),
        !           655:                 char strip_lf,
        !           656:                 int line_delay,
        !           657:                 enum FileTransferOptions first_option,
        !           658:                 ... );
        !           659: 
        !           660: int GF_CDECL CompuServeBPlusWithOptions(
        !           661:                 PORT GF_DLL_FAR *port,
        !           662:                 void ( GF_DLL_FAR GF_CONV *message_routine )( char GF_DLL_FAR *message ),
        !           663:                 void ( GF_DLL_FAR GF_CONV *idle_routine )( XFER GF_DLL_FAR *status_block ),
        !           664:                 enum FileTransferOptions first_option,
        !           665:                 ... );
        !           666: 
        !           667: int GF_CONV CompuServeBPlusRespond( PORT GF_DLL_FAR *port, int use_bplus );
        !           668: XFER_OPTIONS GF_DLL_FAR * GF_CONV CLSetFileTransferOptions( int GF_DLL_FAR options[] );
        !           669: int GF_CONV CLFileSend( PORT GF_DLL_FAR *port,
        !           670:                         int transfer_type,
        !           671:                         char GF_DLL_FAR *file_name_list,
        !           672:                         int ascii_strip_lf,
        !           673:                         int ascii_line_delay,
        !           674:                         XFER_OPTIONS GF_DLL_FAR *send_options );
        !           675: int GF_CONV CLFileReceive( PORT GF_DLL_FAR *port,
        !           676:                            int transfer_type,
        !           677:                            char GF_DLL_FAR *file_name,
        !           678:                            int ascii_strip_lf,
        !           679:                            XFER_OPTIONS GF_DLL_FAR *rec_options );
        !           680: 
        !           681: 
        !           682: /*
        !           683:  * A couple of file transfer utilities.
        !           684:  */
        !           685: 
        !           686: FILE_ENGINE GF_DLL_FAR * GF_CONV CreateDosFileEngine( char GF_DLL_FAR *input_names,
        !           687:                                                       int recurse_flag );
        !           688: char GF_DLL_FAR * GF_CONV XferStripPathComponent( char GF_DLL_FAR *name );
        !           689: void GF_CONV ProcessTXFile( FILE_ENGINE GF_DLL_FAR *engine );
        !           690: void GF_CONV CloseXferFile( XFER GF_DLL_FAR *xfer );
        !           691: long GF_CONV CreateUnixTime( int year,
        !           692:                              int month,
        !           693:                              int day,
        !           694:                              int hour,
        !           695:                              int minute,
        !           696:                              int second );
        !           697: 
        !           698: /*
        !           699:  * Global variables used by the file transfer routines.
        !           700:  */
        !           701: 
        !           702: void GF_CONV SetXferFileOpenFunctionPtr( FILE *(GF_CONV *f)( XFER GF_DLL_FAR *status,
        !           703:                                                              char GF_DLL_FAR *name,
        !           704:                                                              char GF_DLL_FAR *mode ) );
        !           705: void GF_CONV SetDefaultAbortKey( int abort_key );
        !           706: void GF_CONV SetGlobalXmodemPadCharacter( int new_pad_char );
        !           707: 
        !           708: /*
        !           709:  * To get around a compiler warning from Watcom, I have to
        !           710:  * typedef the function called by the abort function.
        !           711:  * void GF_CONV SetAbortXferFunctionPtr( int (GF_CONV *f)( XFER GF_DLL_FAR *status ) );
        !           712:  */
        !           713: 
        !           714: typedef int (GF_DLL_FAR GF_CONV *GF_ABORT_FN)(XFER GF_DLL_FAR *);
        !           715: void GF_CONV SetAbortXferFunctionPtr( GF_ABORT_FN );
        !           716: 
        !           717: #ifdef __cplusplus
        !           718: }
        !           719: #endif
        !           720: 
        !           721: #endif /* #ifndef XFER_DOT_H */
        !           722: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.