#include <sys/types.h>#include <signal.h>#include <setjmp.h>#include <ctype.h>#include <errno.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <utime.h>#include <stdio.h>#include "rbsb.c"#include "crctab.c"#include "zm.c"Include dependency graph for sz.c:

Go to the source code of this file.
Defines | |
| #define | VERSION "sz 2.12 05-29-88" |
| #define | PUBDIR "/usr/spool/uucppublic" |
| #define | SS_NORMAL 0 |
| #define | LOGFILE "/tmp/szlog" |
| #define | sendline(c) putchar((c) & 0377) |
| #define | xsendline(c) putchar(c) |
| #define | PATHLEN 256 |
| #define | OK 0 |
| #define | FALSE 0 |
| #define | TRUE 1 |
| #define | ERROR (-1) |
| #define | ENQ 005 |
| #define | CAN ('X'&037) |
| #define | XOFF ('s'&037) |
| #define | XON ('q'&037) |
| #define | SOH 1 |
| #define | STX 2 |
| #define | EOT 4 |
| #define | ACK 6 |
| #define | NAK 025 |
| #define | CPMEOF 032 |
| #define | WANTCRC 0103 |
| #define | WANTG 0107 |
| #define | TIMEOUT (-2) |
| #define | RCDO (-3) |
| #define | RETRYMAX 10 |
| #define | HOWMANY 2 |
Functions | |
| _PROTOTYPE (void onintr,(int sig)) | |
| _PROTOTYPE (int main,(int argc, char *argv[])) | |
| _PROTOTYPE (int wcsend,(int argc, char *argp[])) | |
| _PROTOTYPE (int wcs,(char *oname)) | |
| _PROTOTYPE (int wctxpn,(char *name)) | |
| _PROTOTYPE (int getnak,(void)) | |
| _PROTOTYPE (int wctx,(long flen)) | |
| _PROTOTYPE (int wcputsec,(char *buf, int sectnum, int cseclen)) | |
| _PROTOTYPE (int filbuf,(char *buf, int count)) | |
| _PROTOTYPE (int fooseek,(FILE *fptr, long pos, int whence)) | |
| _PROTOTYPE (int readline,(int timeout)) | |
| _PROTOTYPE (void flushmo,(void)) | |
| void | zperr () |
| _PROTOTYPE (char *substr,(char *s, char *t)) | |
| _PROTOTYPE (int zsendfile,(char *buf, int blen)) | |
| _PROTOTYPE (int getinsync,(int flag)) | |
| _PROTOTYPE (void bttyout,(int c)) | |
| _PROTOTYPE (void chkinvok,(char *s)) | |
| _PROTOTYPE (void countem,(int argc, char **argv)) | |
| _PROTOTYPE (void chartest,(int m)) | |
| void | bibi (int n) |
| void | onintr (int sig) |
| int | main (int argc, argv) |
| int | wcsend (int argc, argp) |
| int | wcs (char *oname) |
| int | wctxpn (char *name) |
| int | getnak () |
| int | wctx (long flen) |
| int | wcputsec (char *buf, int sectnum, int cseclen) |
| int | filbuf (char *buf, int count) |
| int | zfilbuf () |
| void | vfile (char *f, char *a, char *b, char *c) |
| void | alrm (int sig) |
| int | readline (int timeout) |
| void | flushmo () |
| void | purgeline () |
| void | canit () |
| void | zperr (char *s, char *p, char *u) |
| char * | substr (char *s, char *t) |
| int | usage () |
| int | getzrxinit () |
| int | sendzsinit () |
| int | zsendfile (char *buf, int blen) |
| int | zsendfdata () |
| int | getinsync (int flag) |
| void | saybibi () |
| void | bttyout (int c) |
| int | zsendcmd (char *buf, int blen) |
| void | chkinvok (char *s) |
| void | countem (int argc, char **argv) |
| void | chartest (int m) |
Variables | |
| int | Zmodem = 0 |
| unsigned | Baudrate = 2400 |
| unsigned | Txwindow |
| unsigned | Txwspac |
| unsigned | Txwcnt |
| long | Lrxpos |
| int | errors |
| int | Filesleft |
| long | Totalleft |
| char | Myattn [] = { 03, 0336, 0 } |
| FILE * | in |
| int | Canseek = 1 |
| char | txbuf [1024] |
| long | vpos = 0 |
| char | Lastrx |
| char | Crcflg |
| int | Verbose = 0 |
| int | Modem2 = 0 |
| int | Restricted = 0 |
| int | Quiet = 0 |
| int | Ascii = 0 |
| int | Fullname = 0 |
| int | Unlinkafter = 0 |
| int | Dottoslash = 0 |
| int | firstsec |
| int | errcnt = 0 |
| int | blklen = 128 |
| int | Optiong |
| int | Eofseen |
| int | BEofseen |
| int | Totsecs |
| int | Filcnt = 0 |
| int | Lfseen = 0 |
| unsigned | Rxbuflen = 16384 |
| int | Tframlen = 0 |
| int | blkopt = 0 |
| int | Rxflags = 0 |
| long | bytcnt |
| int | Wantfcs32 = TRUE |
| char | Lzconv |
| char | Lzmanag |
| int | Lskipnocor |
| char | Lztrans |
| char | zconv |
| char | zmanag |
| char | ztrans |
| int | Command |
| char * | Cmdstr |
| int | Cmdtries = 11 |
| int | Cmdack1 |
| int | Exitcode = 0 |
| int | Test |
| char * | qbf = "The quick brown fox jumped over the lazy dog's back 1234567890\r\n" |
| long | Lastsync |
| int | Beenhereb4 |
| jmp_buf | tohere |
| jmp_buf | intrjmp |
| int | Zctlesc |
| int | Nozmodem = 0 |
| char * | Progname = "sz" |
| int | Zrwindow = 1400 |
| char * | babble [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 83 of file sz.c. Referenced by chartest(), rzfile(), saybibi(), wcputsec(), wcrx(), wcrxpn(), zmputs(), zputhex(), and zshhdr(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Definition at line 962 of file sz.c. References tohere. |
|
|
Definition at line 255 of file sz.c. References abort(), canit(), cucheck(), exit(), fflush(), fprintf(), mode, SIGQUIT, stderr, and stdout. |
|
|
|
|
|
Definition at line 1018 of file sz.c. References fflush(), printf, purgeline(), stdout, and strlen(). |
|
|
Definition at line 1720 of file sz.c. References fflush(), flushmo(), mode, printf, readline(), sendline, and stdout. Referenced by main(). |
|
|
|
|
||||||||||||
|
Definition at line 1693 of file sz.c. References c, f, fflush(), Filesleft, fprintf(), if(), stderr, Totalleft, and Verbose. Referenced by main(). |
|
||||||||||||
|
Definition at line 825 of file sz.c. References Ascii, c, CPMEOF, EOF, fileno(), getc, in, Lfseen, m, read, and TRUE. Referenced by wctx(). |
|
|
|
|
|
Definition at line 1533 of file sz.c. References c, printf, Rxpos, Test, and ZRPOS. Referenced by zsendfdata(). |
|
|
Definition at line 662 of file sz.c. References Ascii, blklen, CAN, Crcflg, ERROR, FALSE, firstch(), getzrxinit(), Lastrx, mode, NAK, Optiong, readline(), TIMEOUT, TRUE, WANTCRC, WANTG, ZPAD, and zperr(). Referenced by wctxpn(). |
|
|
Definition at line 1134 of file sz.c. References Baudrate, blklen, blkopt, CANFC32, CANFDX, Command, ERROR, f, fileno(), Fromcu, fstat, in, iofd, L, mode, Rxbuflen, Rxflags, Rxhdr, Rxpos, S_IFCHR, S_IFMT, S_IFREG, sendzsinit(), SIG_IGN, SIGINT, signal(), stohdr(), TESCCTL, Tframlen, TIMEOUT, Txfcs32, Txhdr, Txwindow, Txwspac, vfile(), Wantfcs32, ZACK, ZCAN, ZCHALLENGE, ZCOMMAND, ZF0, zgethdr(), ZNAK, ZP0, ZP1, ZRINIT, ZRQINIT, and zshhdr(). |
|
||||||||||||
|
Definition at line 282 of file sz.c. References Ascii, atoi, bibi(), blklen, blkopt, BUFSIZ, canit(), chartest(), chkinvok(), Cmdack1, Cmdstr, Cmdtries, Command, countem(), cp, cucheck(), Dottoslash, errcnt, ERROR, exit(), Exitcode, FALSE, fflush(), freopen(), from_cu(), Fromcu, Fullname, getenv(), getzrxinit(), iofd, L, LOGFILE, Lskipnocor, Lzconv, Lzmanag, mode, Modem2, NULL, OS, printf, putc, Quiet, Restricted, Rxtimeout, setbuf(), SIG_IGN, SIGINT, SIGKILL, signal(), SIGQUIT, SIGTERM, SS_NORMAL, stderr, stdout, stohdr(), strcmp, strlen(), substr(), Test, Tframlen, toupper, TRUE, Twostop, Txhdr, Txwindow, Txwspac, Unlinkafter, usage, Verbose, VERSION, vfile(), Wantfcs32, wcsend(), ZCACK1, ZCBIN, ZCNL, ZCOMMAND, ZCRESUM, ZF0, ZMAPND, ZMCLOB, ZMNEW, ZMNEWL, ZMPROT, Znulls, ZRQINIT, zsendcmd(), and zshhdr(). |
|
|
|
|
|
|
|
|
Definition at line 974 of file sz.c. References alarm, c, fflush(), fprintf(), iofd, read, setjmp, SIGALRM, signal(), stderr, stdout, TIMEOUT, tohere, Verbose, and zperr(). |
|
|
Definition at line 1586 of file sz.c. References flushmo(), L, Rxhdr, sendline, stohdr(), TIMEOUT, Txhdr, ZCAN, ZFIN, zgethdr(), and zshhdr(). Referenced by zsendcmd(). |
|
|
Definition at line 1239 of file sz.c. References c, errors, L, Myattn, OK, Rxflags, stohdr(), TESCCTL, Txhdr, ZF0, zshhdr(), and ZSINIT. Referenced by getzrxinit(). |
|
||||||||||||
|
|
|
|
Definition at line 1118 of file sz.c. References cucheck(), exit(), fprintf(), OS, SS_NORMAL, stderr, and VERSION. |
|
||||||||||||||||||||
|
|
|
||||||||||||||||
|
Definition at line 746 of file sz.c. References checksum(), cp, firstch(), fprintf(), Lastrx, RETRYMAX, sendline, SOH, stderr, STX, Totsecs, updcrc, and Verbose. Referenced by wctx(). |
|
|
Definition at line 533 of file sz.c. References BEofseen, c, canit(), Eofseen, errcnt, ERROR, f, fclose(), Filcnt, fileno(), fopen(), fprintf(), fstat, getenv(), getpid, in, NULL, OK, p, PATHLEN, PUBDIR, Restricted, S_IFBLK, S_IFDIR, S_IFMT, sprintf(), stderr, stdin, strcmp, strcpy(), strlen(), strncmp(), substr(), unlink, Unlinkafter, vpos, wctx(), wctxpn(), Zmodem, and ZSKIP. Referenced by wcsend(). |
|
||||||||||||
|
Definition at line 493 of file sz.c. References bytcnt, Crcflg, ERROR, FALSE, firstsec, n, Totsecs, TRUE, and wcs(). Referenced by main(). |
|
|
Definition at line 698 of file sz.c. References blklen, CAN, Crcflg, ERROR, filbuf(), firstch(), firstsec, L, NAK, readline(), Rxtimeout, TIMEOUT, TRUE, vfile(), WANTCRC, WANTG, wcputsec(), and zperr(). Referenced by wcs(). |
|
|
Definition at line 596 of file sz.c. References Dottoslash, ERROR, f, fileno(), fprintf(), fstat, getnak(), in, Modem2, name2, OK, p, PATHLEN, stderr, stdin, strcpy(), strlen(), Zmodem, and zperr(). Referenced by wcs(). |
|
|
Definition at line 863 of file sz.c. References BEofseen, blklen, bytcnt, Eofseen, fread(), in, n, and vpos. Referenced by zsendfdata(). |
|
||||||||||||||||
|
|
|
|
|
|
||||||||||||
|
Definition at line 1610 of file sz.c. References c, Cmdack1, Cmdtries, ERROR, errors, Exitcode, getpid, listen, OK, Rxhdr, Rxpos, Rxtimeout, saybibi(), stohdr(), system(), TIMEOUT, Txhdr, vfile(), ZABORT, ZCAN, ZCOMMAND, ZCOMPL, ZCRCW, ZF0, ZFIN, zgethdr(), ZRINIT, ZRPOS, ZRQINIT, zsbhdr(), zsdata(), and ZSKIP. Referenced by main(). |
|
|
Definition at line 1329 of file sz.c. References Beenhereb4, bytcnt, c, CAN, canit(), Crc32t, e, Eofseen, ERROR, exit(), FALSE, fclose(), fflush(), fprintf(), Fromcu, getinsync(), in, intrjmp, ioctl, iofd, Lastsync, Lrxpos, mode, OK, printf, purgeline(), qbf, readline(), Rxbuflen, setjmp, SIG_IGN, SIGINT, signal(), sleep, SS_NORMAL, stderr, stdout, stohdr(), strlen(), TCFLSH, Test, Txhdr, Txpos, Txwcnt, Txwindow, Txwspac, Verbose, vfile(), XOFF, ZACK, ZCAN, ZCRCE, ZCRCG, ZCRCQ, ZCRCW, ZDATA, ZEOF, zfilbuf(), ZPAD, ZRINIT, ZRPOS, zsbhdr(), zsdata(), and ZSKIP. Referenced by zsendfile(). |
|
||||||||||||
|
Definition at line 1269 of file sz.c. References bytcnt, c, clearerr, crc(), EOF, ERROR, fclose(), fseek(), getc, in, L, Lastsync, Lskipnocor, Lzconv, Lzmanag, Lztrans, readline(), Rxhdr, Rxpos, stohdr(), TIMEOUT, Txhdr, Txpos, UPDC32, ZABORT, ZCAN, ZCRC, ZCRCW, ZF0, ZF1, ZF2, ZF3, ZFILE, ZFIN, zgethdr(), ZMSKNOLOC, ZPAD, ZRINIT, ZRPOS, zsbhdr(), zsdata(), zsendfdata(), and ZSKIP. |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 218 of file sz.c. Referenced by zsendfdata(). |
|
|
|
|
|
Definition at line 189 of file sz.c. Referenced by chkinvok(), getnak(), getzrxinit(), main(), wctx(), and zfilbuf(). |
|
|
Definition at line 198 of file sz.c. Referenced by getzrxinit(), and main(). |
|
|
Definition at line 200 of file sz.c. Referenced by wcsend(), zfilbuf(), zsendfdata(), and zsendfile(). |
|
|
|
|
|
Definition at line 212 of file sz.c. Referenced by main(), and zsendcmd(). |
|
|
Definition at line 210 of file sz.c. Referenced by main(). |
|
|
Definition at line 211 of file sz.c. Referenced by main(), and zsendcmd(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 213 of file sz.c. Referenced by main(), and zsendcmd(). |
|
|
Definition at line 194 of file sz.c. Referenced by wcs(). |
|
|
Definition at line 139 of file sz.c. Referenced by countem(). |
|
|
|
|
|
Definition at line 184 of file sz.c. Referenced by main(). |
|
|
|
|
|
Definition at line 221 of file sz.c. Referenced by onintr(), and zsendfdata(). |
|
|
|
|
|
Definition at line 217 of file sz.c. Referenced by zsendfdata(), and zsendfile(). |
|
|
Definition at line 195 of file sz.c. Referenced by filbuf(). |
|
|
Definition at line 129 of file sz.c. Referenced by zsendfdata(). |
|
|
Definition at line 204 of file sz.c. Referenced by main(), and zsendfile(). |
|
|
Definition at line 202 of file sz.c. Referenced by main(), and zsendfile(). |
|
|
|
|
|
Definition at line 205 of file sz.c. Referenced by zsendfile(). |
|
|
Definition at line 180 of file sz.c. Referenced by chkinvok(), main(), and wctxpn(). |
|
|
Definition at line 151 of file sz.c. Referenced by sendzsinit(). |
|
|
|
|
|
Definition at line 190 of file sz.c. Referenced by getnak(). |
|
|
|
|
|
Definition at line 216 of file sz.c. Referenced by zsendfdata(). |
|
|
|
|
|
|
|
|
Definition at line 196 of file sz.c. Referenced by getzrxinit(), and zsendfdata(). |
|
|
Definition at line 199 of file sz.c. Referenced by getzrxinit(), and sendzsinit(). |
|
|
Definition at line 214 of file sz.c. Referenced by getinsync(), main(), and zsendfdata(). |
|
|
Definition at line 197 of file sz.c. Referenced by getzrxinit(), and main(). |
|
|
|
|
|
Definition at line 140 of file sz.c. Referenced by countem(). |
|
|
Definition at line 193 of file sz.c. Referenced by wcputsec(), and wcsend(). |
|
|
|
|
|
Definition at line 128 of file sz.c. Referenced by zsendfdata(). |
|
|
Definition at line 126 of file sz.c. Referenced by getzrxinit(), main(), and zsendfdata(). |
|
|
Definition at line 127 of file sz.c. Referenced by getzrxinit(), main(), and zsendfdata(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 201 of file sz.c. Referenced by getzrxinit(), and main(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4.6