home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
pub
/
victor9000
/
vickermit.h
< prev
next >
Wrap
C/C++ Source or Header
|
2020-01-01
|
2KB
|
76 lines
/*
* K e r m i t File Transfer Utility
*
* Unix Kermit, Columbia University, 1983
*
* usage: kermit [csr][dlbe line baud escapechar] [f1 f2 ...]
*
* where c=connect, s=send [files], r=receive, d=debug,
* l=tty line, b=baud rate, e=escape char (decimal ascii code).
* For "host" mode Kermit, format is either "kermit r" to
* receive files, or "kermit s f1 f2 ..." to send f1 .. fn.
*
*/
#include <stdio.h>
#include <sgtty.h>
#include <signal.h>
#include <setjmp.h>
#define DBUGSW 0
#define MAXPACK 94 /* Maximum packet size */
#define SOH 1 /* Start of header */
#define SP 32 /* ASCII space */
#define DEL 127 /* Delete (rubout) */
#define CTRLD 4
#define BRKCHR CTRLD /* default break-connection character */
#define MAXTRY 5 /* Times to retry a packet */
#define MYQUOTE '#' /* Quote character I will use */
#define MYPAD 0 /* Number of padding characters I will need */
#define MYPCHAR 0 /* Padding character I need */
#define MYEOL '\n' /* End-Of-Line character I need */
#define MYTIME 5 /* Seconds after which I should be timed out */
#define MAXTIM 20 /* Maximum timeout interval */
#define MINTIM 2 /* Minumum timeout interval */
#define TRUE -1
#define FALSE 0
/*
* Global Variables
*/
int size, /* Size of present data */
n, /* Message number */
rpsiz, /* Maximum receive packet size */
spsiz, /* Maximum send packet size */
pad, /* How much padding to send */
timint, /* Timeout for foreign host on sends */
numtry, /* Times this packet retried */
oldtry, /* Times previous packet retried */
fd, /* file pointer of file to read/write */
remfd, /* file pointer of the host's tty */
remspd, /* speed of this tty */
host, /* -1 means we're a host-mode kermit */
debug; /* -1 means debugging */
char state, /* Present state of the automaton */
padchar, /* Padding character to send */
eol, /* End-Of-Line character to send */
escchr, /* Connect command escape character */
quote, /* Quote character in incoming data */
**filelist, /* list of files to be sent */
*filnam, /* current file name */
recpkt[MAXPACK], /* Receive packet buffer */
packet[MAXPACK]; /* Packet buffer */
jmp_buf env; /* environment ptr for timeout longjump */
struct sgttyb
rawmode, /* host tty "raw" mode */
cookedmode, /* host tty "normal" mode */
remttymode; /* remote tty line "raw" mode */