Update stty, sysctl, test, uname, xargs, zmodem.
This commit is contained in:
@@ -69,6 +69,7 @@ FILE *fopen (const char *, const char *);
|
||||
FILE *fdopen (int, const char *);
|
||||
FILE *freopen (const char *, const char *, FILE *);
|
||||
FILE *popen (const char *, const char *);
|
||||
int pclose(FILE *stream);
|
||||
FILE *tmpfile (void);
|
||||
int fclose (FILE *);
|
||||
long ftell (FILE *);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
TOPSRC = $(shell cd ../../..; pwd)
|
||||
include $(TOPSRC)/target.mk
|
||||
|
||||
CFLAGS = -O -Werror -g
|
||||
CFLAGS = -O -Werror -g -Wno-string-plus-int
|
||||
|
||||
SRCS = stty.c
|
||||
OBJS = stty.o
|
||||
|
||||
@@ -160,6 +160,11 @@ struct special {
|
||||
char *arg;
|
||||
char *Nfmt = "%-8s";
|
||||
|
||||
static void prmodes(int all);
|
||||
static void pit(struct special *sp);
|
||||
static int eq(char *string);
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
register char **argv;
|
||||
@@ -328,6 +333,7 @@ done:
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
eq(string)
|
||||
char *string;
|
||||
{
|
||||
@@ -344,10 +350,11 @@ char *string;
|
||||
fprintf(stderr, str + ((lmode & what) != 0)); any++; \
|
||||
}
|
||||
|
||||
void
|
||||
prmodes(all)
|
||||
int all; /* 0 for short display, !0 for long display */
|
||||
{
|
||||
register m;
|
||||
int m;
|
||||
int any, i;
|
||||
register struct special *sp;
|
||||
|
||||
@@ -455,6 +462,7 @@ prmodes(all)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
pit(sp)
|
||||
struct special *sp;
|
||||
{
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
|
||||
struct ctlname topname[] = CTL_NAMES;
|
||||
struct ctlname kernname[] = CTL_KERN_NAMES;
|
||||
@@ -97,6 +98,12 @@ extern int optind, errno;
|
||||
#define BOOTTIME 0x0002
|
||||
#define CONSDEV 0x0004
|
||||
|
||||
static void usage(void);
|
||||
static void debuginit(void);
|
||||
static void listall(char *prefix, struct list *lp);
|
||||
static void parse(char *string, int flags);
|
||||
static int findname(char *string, char *level, char **bufp, struct list *namelist);
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
@@ -146,6 +153,7 @@ main(argc, argv)
|
||||
/*
|
||||
* List all variables known to the system.
|
||||
*/
|
||||
void
|
||||
listall(prefix, lp)
|
||||
char *prefix;
|
||||
struct list *lp;
|
||||
@@ -171,11 +179,13 @@ listall(prefix, lp)
|
||||
* Lookup and print out the MIB entry if it exists.
|
||||
* Set a new value if requested.
|
||||
*/
|
||||
void
|
||||
parse(string, flags)
|
||||
char *string;
|
||||
int flags;
|
||||
{
|
||||
int indx, type, state, size, len;
|
||||
int indx, type, state, len;
|
||||
size_t size;
|
||||
int special = 0;
|
||||
void *newval = (void *)0;
|
||||
int intval, newsize = 0;
|
||||
@@ -430,9 +440,11 @@ doit:
|
||||
/*
|
||||
* Initialize the set of debugging names
|
||||
*/
|
||||
void
|
||||
debuginit()
|
||||
{
|
||||
int mib[3], size, loc, i;
|
||||
int mib[3], loc, i;
|
||||
size_t size;
|
||||
|
||||
if (secondlevel[CTL_DEBUG].list != 0)
|
||||
return;
|
||||
@@ -480,6 +492,7 @@ struct list inetvars[] = {
|
||||
/*
|
||||
* handle internet requests
|
||||
*/
|
||||
int
|
||||
sysctl_inet(string, bufpp, mib, flags, typep)
|
||||
char *string;
|
||||
char **bufpp;
|
||||
@@ -521,6 +534,7 @@ sysctl_inet(string, bufpp, mib, flags, typep)
|
||||
/*
|
||||
* Scan a list of names searching for a particular name.
|
||||
*/
|
||||
int
|
||||
findname(string, level, bufp, namelist)
|
||||
char *string;
|
||||
char *level;
|
||||
@@ -546,9 +560,9 @@ findname(string, level, bufp, namelist)
|
||||
return (i);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n\t%s\n",
|
||||
"sysctl [-n] variable ...", "sysctl [-n] -w variable=value ...",
|
||||
"sysctl [-n] -a", "sysctl [-n] -A");
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "operators.h"
|
||||
|
||||
@@ -84,7 +85,11 @@ extern char binary_op[][4];
|
||||
extern char andor_op[][4];
|
||||
extern int op_priority[];
|
||||
extern int op_argflag[];
|
||||
extern long atol();
|
||||
|
||||
static int expr_is_false(struct value *val);
|
||||
static int posix_unary_op(char **argv);
|
||||
static int posix_binary_op(char **argv);
|
||||
static int lookup_op(char *name, char table[][4]);
|
||||
|
||||
/*
|
||||
* Execute an operator. Op is the operator. Sp is the stack pointer;
|
||||
@@ -279,6 +284,7 @@ overflow()
|
||||
err(2, "expression is too complex");
|
||||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
@@ -423,7 +429,7 @@ main(argc, argv)
|
||||
valsp->u.num);
|
||||
#else
|
||||
(void)sprintf(p,
|
||||
"%d", valsp->u.num);
|
||||
"%ld", valsp->u.num);
|
||||
#endif
|
||||
valsp->u.string = p;
|
||||
} else if (valsp->type == BOOLEAN) {
|
||||
@@ -492,17 +498,15 @@ expr_is_false(val)
|
||||
int
|
||||
lookup_op(name, table)
|
||||
char *name;
|
||||
char *table;
|
||||
char table[][4];
|
||||
{
|
||||
char *tp;
|
||||
char c;
|
||||
int i;
|
||||
|
||||
c = name[1];
|
||||
tp = table;
|
||||
for(i = 0; strcmp((char *)(tp + i),"ZZZ") ; i=i+4){
|
||||
if ((char)(tp + i)[1] == c && !strcmp((char *)(tp + i), name))
|
||||
return (i/4);
|
||||
for (i = 0; strcmp(table[i], "ZZZ"); i++) {
|
||||
if (table[i][1] == c && strcmp(table[i], name) == 0)
|
||||
return i;
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern int optind;
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ usage()
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
@@ -15,13 +15,13 @@ MANSRC = rz.1 sz.1
|
||||
all: rz sz $(MAN)
|
||||
|
||||
rz: rz.o
|
||||
$(CC) $(LDFLAGS) -o rz.elf $< $(LIBS)
|
||||
$(LD) $(LDFLAGS) -o rz.elf $< $(LIBS)
|
||||
$(OBJDUMP) -S rz.elf > rz.dis
|
||||
$(SIZE) rz.elf
|
||||
$(ELF2AOUT) rz.elf $@ && rm rz.elf
|
||||
|
||||
sz: sz.o
|
||||
$(CC) $(LDFLAGS) -o sz.elf $< $(LIBS)
|
||||
$(LD) $(LDFLAGS) -o sz.elf $< $(LIBS)
|
||||
$(OBJDUMP) -S sz.elf > sz.dis
|
||||
$(SIZE) sz.elf
|
||||
$(ELF2AOUT) sz.elf $@ && rm sz.elf
|
||||
|
||||
18
src/cmd/zmodem/decl.h
Normal file
18
src/cmd/zmodem/decl.h
Normal file
@@ -0,0 +1,18 @@
|
||||
void bibi (int);
|
||||
void vfile(char *f, ...);
|
||||
void flushmo(void);
|
||||
void zsendline(int c);
|
||||
void zsdar32(char *buf, int length, int frameend);
|
||||
int zrdatr32(char *buf, int length);
|
||||
int zdlread(void);
|
||||
void zperr(char *s, ...);
|
||||
int readline(unsigned timeout);
|
||||
void bttyout(int c);
|
||||
char *substr(char *s, char *t);
|
||||
void chkinvok(char *s);
|
||||
void usage(void);
|
||||
int wcrxpn(char *rpn);
|
||||
int procheader(char *name);
|
||||
int wcrx(void);
|
||||
int wcgetsec(char *rxbuf, int maxtime);
|
||||
int putsec(char *buf, int n);
|
||||
@@ -52,7 +52,7 @@ int Locbit = LLITOUT|LDECCTQ; /* Bit SUPPOSED to disable output
|
||||
Howmany must be 255 or less
|
||||
#endif
|
||||
|
||||
extern void bibi (int);
|
||||
#include "decl.h"
|
||||
|
||||
/*
|
||||
* return 1 iff stdout and stderr are different devices
|
||||
@@ -60,21 +60,21 @@ extern void bibi (int);
|
||||
* different line
|
||||
*/
|
||||
int Fromcu; /* Were called from cu or yam */
|
||||
from_cu()
|
||||
|
||||
void from_cu()
|
||||
{
|
||||
struct stat a, b;
|
||||
|
||||
fstat(1, &a); fstat(2, &b);
|
||||
Fromcu = a.st_rdev != b.st_rdev;
|
||||
return;
|
||||
}
|
||||
cucheck()
|
||||
|
||||
void cucheck()
|
||||
{
|
||||
if (Fromcu)
|
||||
fprintf(stderr,"Please read the manual page BUGS chapter!\r\n");
|
||||
}
|
||||
|
||||
|
||||
struct {
|
||||
unsigned baudr;
|
||||
int speedcode;
|
||||
@@ -111,7 +111,7 @@ int Twostop; /* Use two stop bits */
|
||||
/*
|
||||
* Return non 0 iff something to read from io descriptor f
|
||||
*/
|
||||
rdchk(f)
|
||||
int rdchk(f)
|
||||
{
|
||||
static long lf;
|
||||
|
||||
@@ -126,13 +126,15 @@ rdchk(f)
|
||||
#include <fcntl.h>
|
||||
|
||||
int checked = 0;
|
||||
|
||||
/*
|
||||
* Nonblocking I/O is a bit different in System V, Release 2
|
||||
* Note: this rdchk vsn throws away a byte, OK for ZMODEM
|
||||
* sender because protocol design anticipates this problem.
|
||||
*/
|
||||
#define EATSIT
|
||||
rdchk(f)
|
||||
|
||||
int rdchk(f)
|
||||
{
|
||||
int lf, savestat;
|
||||
static char bchecked;
|
||||
@@ -148,11 +150,10 @@ rdchk(f)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
static unsigned
|
||||
getspeed(code)
|
||||
{
|
||||
register n;
|
||||
int n;
|
||||
|
||||
for (n=0; speeds[n].baudr; ++n)
|
||||
if (speeds[n].speedcode == code)
|
||||
@@ -160,8 +161,6 @@ getspeed(code)
|
||||
return 38400; /* Assume fifo if ioctl failed */
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef ICANON
|
||||
struct termio oldtty, tty;
|
||||
#else
|
||||
@@ -176,9 +175,9 @@ struct tchars oldtch, tch;
|
||||
* 1: save old tty stat, set raw mode
|
||||
* 0: restore original tty mode
|
||||
*/
|
||||
mode(n)
|
||||
int mode(n)
|
||||
{
|
||||
static did0 = FALSE;
|
||||
static int did0 = FALSE;
|
||||
|
||||
vfile("mode:%d", n);
|
||||
switch(n) {
|
||||
@@ -320,7 +319,7 @@ mode(n)
|
||||
}
|
||||
}
|
||||
|
||||
sendbrk()
|
||||
void sendbrk()
|
||||
{
|
||||
#ifdef V7
|
||||
#ifdef TIOCSBRK
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
#include <setjmp.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define OK 0
|
||||
#define FALSE 0
|
||||
@@ -152,7 +153,6 @@ unsigned Effbaud = 2400;
|
||||
#endif
|
||||
#include "crctab.c"
|
||||
|
||||
char *substr();
|
||||
FILE *fout;
|
||||
|
||||
/*
|
||||
@@ -206,7 +206,6 @@ char secbuf[1025];
|
||||
|
||||
char linbuf[HOWMANY];
|
||||
int Lleft=0; /* number of characters in linbuf */
|
||||
time_t timep[2];
|
||||
char Lzmanag; /* Local file management request */
|
||||
char zconv; /* ZMODEM file conversion request */
|
||||
char zmanag; /* ZMODEM file management request */
|
||||
@@ -217,6 +216,23 @@ int Zrwindow = 1400; /* RX window size (controls garbage count) */
|
||||
|
||||
jmp_buf tohere; /* For the interrupt on RX timeout */
|
||||
|
||||
static void zmputs(char *s);
|
||||
static void canit(void);
|
||||
static int wcreceive(int argc, char **argp);
|
||||
static int tryz(void);
|
||||
static int rzfiles(void);
|
||||
static void checkpath(char *name);
|
||||
static void report(int sct);
|
||||
static int closeit(void);
|
||||
static int IsAnyLower(char *s);
|
||||
static void uncaps(char *s);
|
||||
static int make_dirs(char *pathname);
|
||||
static int sys2(char *s);
|
||||
static void ackbibi(void);
|
||||
static void exec2(char *s);
|
||||
static int rzfile(void);
|
||||
static void sendline(int c);
|
||||
|
||||
#define xsendline(c) sendline(c)
|
||||
|
||||
#include "zm.c"
|
||||
@@ -243,13 +259,13 @@ bibi(n)
|
||||
exit(128+n);
|
||||
}
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
char *argv[];
|
||||
{
|
||||
register char *cp;
|
||||
register npats;
|
||||
int npats;
|
||||
char *virgin, **patts;
|
||||
char *getenv();
|
||||
int exitcode;
|
||||
|
||||
Rxtimeout = 100;
|
||||
@@ -358,7 +374,7 @@ char *argv[];
|
||||
exit(exitcode ? exitcode:SS_NORMAL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
cucheck();
|
||||
@@ -385,16 +401,18 @@ usage()
|
||||
fprintf(stderr, "\t\t\042The High Reliability Software\042\n");
|
||||
exit(SS_NORMAL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Debugging information output interface routine
|
||||
*/
|
||||
/* VARARGS1 */
|
||||
vfile(f, a, b, c, d)
|
||||
char *f;
|
||||
long a, b, c, d;
|
||||
void
|
||||
vfile(char *f, ...)
|
||||
{
|
||||
if (Verbose > 2) {
|
||||
fprintf(stderr, f, a, b, c, d);
|
||||
va_list args;
|
||||
va_start(args, f);
|
||||
vfprintf(stderr, f, args);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
||||
@@ -406,16 +424,17 @@ long a, b, c, d;
|
||||
char *rbmsg =
|
||||
"%s ready. To begin transfer, type \"%s file ...\" to your modem program\r\n\n";
|
||||
|
||||
int
|
||||
wcreceive(argc, argp)
|
||||
char **argp;
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
|
||||
if (Batch || argc==0) {
|
||||
Crcflg=1;
|
||||
if ( !Quiet)
|
||||
fprintf(stderr, rbmsg, Progname, Nozmodem?"sb":"sz");
|
||||
if (c=tryz()) {
|
||||
if ((c = tryz())) {
|
||||
if (c == ZCOMPL)
|
||||
return OK;
|
||||
if (c == ERROR)
|
||||
@@ -471,10 +490,11 @@ fubar:
|
||||
* Length is indeterminate as long as less than Blklen
|
||||
* A null string represents no more files (YMODEM)
|
||||
*/
|
||||
int
|
||||
wcrxpn(rpn)
|
||||
char *rpn; /* receive a pathname */
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
|
||||
#ifdef NFGVMIN
|
||||
readline(readline_timeout);
|
||||
@@ -504,7 +524,7 @@ et_tu:
|
||||
* Adapted from CMODEM13.C, written by
|
||||
* Jack M. Wierda and Roderick W. Hart
|
||||
*/
|
||||
|
||||
int
|
||||
wcrx()
|
||||
{
|
||||
register int sectnum, sectcurr;
|
||||
@@ -525,7 +545,7 @@ wcrx()
|
||||
cblklen = Bytesleft>Blklen ? Blklen:Bytesleft;
|
||||
if (putsec(secbuf, cblklen)==ERROR)
|
||||
return ERROR;
|
||||
if ((Bytesleft-=cblklen) < 0)
|
||||
if ((Bytesleft -= cblklen) < 0)
|
||||
Bytesleft = 0;
|
||||
sendchar=ACK;
|
||||
}
|
||||
@@ -558,12 +578,12 @@ wcrx()
|
||||
***************** NO ACK IS SENT IF SECTOR IS RECEIVED OK **************
|
||||
* (Caller must do that when he is good and ready to get next sector)
|
||||
*/
|
||||
|
||||
int
|
||||
wcgetsec(rxbuf, maxtime)
|
||||
char *rxbuf;
|
||||
int maxtime;
|
||||
{
|
||||
register checksum, wcj, firstch;
|
||||
int checksum, wcj, firstch;
|
||||
register unsigned short oldcrc;
|
||||
register char *p;
|
||||
int sectcurr;
|
||||
@@ -660,6 +680,7 @@ humbug:
|
||||
*
|
||||
* timeout is in tenths of seconds
|
||||
*/
|
||||
int
|
||||
readline(timeout)
|
||||
unsigned int timeout;
|
||||
{
|
||||
@@ -719,11 +740,10 @@ unsigned int timeout;
|
||||
return (*cdq++ & 0377);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Purge the modem input queue of all characters
|
||||
*/
|
||||
void
|
||||
purgeline()
|
||||
{
|
||||
Lleft = 0;
|
||||
@@ -735,10 +755,10 @@ purgeline()
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Process incoming file information header
|
||||
*/
|
||||
int
|
||||
procheader(name)
|
||||
char *name;
|
||||
{
|
||||
@@ -853,6 +873,7 @@ char *name;
|
||||
* it's because some required directory was not present, and if
|
||||
* so, create all required dirs.
|
||||
*/
|
||||
int
|
||||
make_dirs(pathname)
|
||||
register char *pathname;
|
||||
{
|
||||
@@ -948,9 +969,10 @@ int dmode;
|
||||
* If not in binary mode, carriage returns, and all characters
|
||||
* starting with CPMEOF are discarded.
|
||||
*/
|
||||
int
|
||||
putsec(buf, n)
|
||||
char *buf;
|
||||
register n;
|
||||
int n;
|
||||
{
|
||||
register char *p;
|
||||
|
||||
@@ -979,6 +1001,7 @@ register n;
|
||||
/*
|
||||
* Send a character to modem. Small is beautiful.
|
||||
*/
|
||||
void
|
||||
sendline(c)
|
||||
{
|
||||
char d;
|
||||
@@ -989,14 +1012,11 @@ sendline(c)
|
||||
write(1, &d, 1);
|
||||
}
|
||||
|
||||
flushmo() {}
|
||||
void flushmo() {}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* make string s lower case */
|
||||
void
|
||||
uncaps(s)
|
||||
register char *s;
|
||||
{
|
||||
@@ -1004,9 +1024,11 @@ register char *s;
|
||||
if (isupper(*s))
|
||||
*s = tolower(*s);
|
||||
}
|
||||
|
||||
/*
|
||||
* IsAnyLower returns TRUE if string s has lower case letters.
|
||||
*/
|
||||
int
|
||||
IsAnyLower(s)
|
||||
register char *s;
|
||||
{
|
||||
@@ -1042,17 +1064,20 @@ register char *s,*t;
|
||||
* Log an error
|
||||
*/
|
||||
/*VARARGS1*/
|
||||
zperr(s,p,u)
|
||||
char *s, *p, *u;
|
||||
void zperr(char *s, ...)
|
||||
{
|
||||
if (Verbose <= 0)
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, s);
|
||||
fprintf(stderr, "Retry %d: ", errors);
|
||||
fprintf(stderr, s, p, u);
|
||||
vfprintf(stderr, s, args);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
/* send cancel string to get the other end to shut up */
|
||||
void
|
||||
canit()
|
||||
{
|
||||
static char canistr[] = {
|
||||
@@ -1063,13 +1088,13 @@ canit()
|
||||
raw_wbuf(strlen(canistr), canistr);
|
||||
purgeline();
|
||||
#else
|
||||
printf(canistr);
|
||||
fputs(canistr, stdout);
|
||||
Lleft=0; /* Do read next time ... */
|
||||
fflush(stdout);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
report(sct)
|
||||
int sct;
|
||||
{
|
||||
@@ -1082,6 +1107,7 @@ int sct;
|
||||
* If called as [-][dir/../]rzCOMMAND set the pipe flag
|
||||
* If called as rb use YMODEM protocol
|
||||
*/
|
||||
void
|
||||
chkinvok(s)
|
||||
char *s;
|
||||
{
|
||||
@@ -1110,6 +1136,7 @@ char *s;
|
||||
/*
|
||||
* Totalitarian Communist pathname processing
|
||||
*/
|
||||
void
|
||||
checkpath(name)
|
||||
char *name;
|
||||
{
|
||||
@@ -1135,10 +1162,11 @@ char *name;
|
||||
* Return ZFILE if Zmodem filename received, -1 on error,
|
||||
* ZCOMPL if transaction finished, else 0
|
||||
*/
|
||||
int
|
||||
tryz()
|
||||
{
|
||||
register c, n;
|
||||
register cmdzack1flg;
|
||||
int c, n;
|
||||
int cmdzack1flg;
|
||||
|
||||
if (Nozmodem) /* Check for "rb" program name */
|
||||
return 0;
|
||||
@@ -1238,9 +1266,10 @@ again:
|
||||
/*
|
||||
* Receive 1 or more files with ZMODEM protocol
|
||||
*/
|
||||
int
|
||||
rzfiles()
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
|
||||
for (;;) {
|
||||
switch (c = rzfile()) {
|
||||
@@ -1267,9 +1296,10 @@ rzfiles()
|
||||
* Receive a file with ZMODEM protocol
|
||||
* Assumes file name frame is in secbuf
|
||||
*/
|
||||
int
|
||||
rzfile()
|
||||
{
|
||||
register c, n;
|
||||
int c, n;
|
||||
long rxbytes;
|
||||
|
||||
Eofseen=FALSE;
|
||||
@@ -1448,10 +1478,11 @@ moredata:
|
||||
* Send a string to the modem, processing for \336 (sleep 1 sec)
|
||||
* and \335 (break signal)
|
||||
*/
|
||||
void
|
||||
zmputs(s)
|
||||
char *s;
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
|
||||
while (*s) {
|
||||
switch (c = *s++) {
|
||||
@@ -1468,10 +1499,9 @@ char *s;
|
||||
/*
|
||||
* Close the receive dataset, return OK or ERROR
|
||||
*/
|
||||
int
|
||||
closeit()
|
||||
{
|
||||
time_t time();
|
||||
|
||||
#ifndef vax11c
|
||||
if (Topipe) {
|
||||
if (pclose(fout)) {
|
||||
@@ -1486,9 +1516,14 @@ closeit()
|
||||
}
|
||||
#ifndef vax11c
|
||||
if (Modtime) {
|
||||
timep[0] = time(NULL);
|
||||
timep[1] = Modtime;
|
||||
utime(Pathname, timep);
|
||||
struct timeval tv[2];
|
||||
|
||||
tv[0].tv_sec = time(NULL);
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_sec = Modtime;
|
||||
tv[1].tv_usec = 0;
|
||||
|
||||
utimes(Pathname, tv);
|
||||
}
|
||||
#endif
|
||||
if ((Filemode&S_IFMT) == S_IFREG)
|
||||
@@ -1499,9 +1534,10 @@ closeit()
|
||||
/*
|
||||
* Ack a ZFIN packet, let byegones be byegones
|
||||
*/
|
||||
void
|
||||
ackbibi()
|
||||
{
|
||||
register n;
|
||||
int n;
|
||||
|
||||
vfile("ackbibi:");
|
||||
Readnum = 1;
|
||||
@@ -1523,11 +1559,10 @@ ackbibi()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Local console output simulation
|
||||
*/
|
||||
void
|
||||
bttyout(c)
|
||||
{
|
||||
if (Verbose || Fromcu)
|
||||
@@ -1538,6 +1573,7 @@ bttyout(c)
|
||||
/*
|
||||
* Strip leading ! if present, do shell escape.
|
||||
*/
|
||||
int
|
||||
sys2(s)
|
||||
register char *s;
|
||||
{
|
||||
@@ -1545,9 +1581,11 @@ register char *s;
|
||||
++s;
|
||||
return system(s);
|
||||
}
|
||||
|
||||
/*
|
||||
* Strip leading ! if present, do exec.
|
||||
*/
|
||||
void
|
||||
exec2(s)
|
||||
register char *s;
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#define VERSION "sz 3.07 2-02-90"
|
||||
#define PUBDIR "/usr/spool/uucppublic"
|
||||
|
||||
/*% cc -compat -M2 -Ox -K -i -DTXBSIZE=16384 -DNFGVMIN -DREADCHECK sz.c -lx -o sz; size sz
|
||||
// % cc -compat -M2 -Ox -K -i -DTXBSIZE=16384 -DNFGVMIN -DREADCHECK sz.c -lx -o sz; size sz
|
||||
|
||||
/*% cc -Zi -DXX -DNFGVMIN -DREADCHECK sz.c -lx -o xsz; size xsz
|
||||
<-xtx-*> cc -Osal -DTXBSIZE=32768 -DSV sz.c -lx -o $B/sz; size $B/sz
|
||||
@@ -94,8 +94,6 @@
|
||||
long Thisflen;
|
||||
#endif
|
||||
|
||||
char *substr(), *getenv();
|
||||
|
||||
#define LOGFILE "/tmp/szlog"
|
||||
#define SS_NORMAL 0
|
||||
#include <stdio.h>
|
||||
@@ -106,10 +104,11 @@ char *substr(), *getenv();
|
||||
#include <setjmp.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
extern int errno;
|
||||
#include <stdarg.h>
|
||||
|
||||
#define STATIC
|
||||
|
||||
#define sendline(c) putchar(c & 0377)
|
||||
#define sendline(c) putchar((unsigned char)(c))
|
||||
#define xsendline(c) putchar(c)
|
||||
|
||||
#define PATHLEN 256
|
||||
@@ -248,6 +247,25 @@ STATIC int Beenhereb4; /* How many times we've been ZRPOS'd same place */
|
||||
STATIC jmp_buf tohere; /* For the interrupt on RX timeout */
|
||||
STATIC jmp_buf intrjmp; /* For the interrupt on RX CAN */
|
||||
|
||||
static void canit(void);
|
||||
static void chartest(int m);
|
||||
static void countem(int argc, char **argv);
|
||||
static int getzrxinit(void);
|
||||
static int zsendcmd(char *buf, int blen);
|
||||
static int wcsend(int argc, char *argp[]);
|
||||
static int wcs(char *oname);
|
||||
static int getnak(void);
|
||||
static void saybibi(void);
|
||||
static int wctxpn(char *name);
|
||||
static int wctx(long flen);
|
||||
static int zsendfile(char *buf, int blen);
|
||||
static int wcputsec(char *buf, int sectnum, int cseclen);
|
||||
static int filbuf(char *buf, int count);
|
||||
static void purgeline(void);
|
||||
static int sendzsinit(void);
|
||||
static int zsendfdata(void);
|
||||
static int getinsync(int flag);
|
||||
|
||||
#ifdef XARGSFILE
|
||||
char *
|
||||
mystrsave(s)
|
||||
@@ -314,11 +332,12 @@ STATIC int Zrwindow = 1400; /* RX window size (controls garbage count) */
|
||||
char *xargv[XARGSMAX+1];
|
||||
#endif
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
char *argv[];
|
||||
{
|
||||
register char *cp;
|
||||
register npats;
|
||||
int npats;
|
||||
int dm;
|
||||
char **patts;
|
||||
static char xXbuf[BUFSIZ];
|
||||
@@ -555,10 +574,11 @@ char *argv[];
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
int
|
||||
wcsend(argc, argp)
|
||||
char *argp[];
|
||||
{
|
||||
register n;
|
||||
int n;
|
||||
|
||||
Crcflg=FALSE;
|
||||
firstsec=TRUE;
|
||||
@@ -597,10 +617,11 @@ char *argp[];
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
wcs(oname)
|
||||
char *oname;
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
register char *p, *q;
|
||||
#ifdef STAT
|
||||
struct stat f;
|
||||
@@ -706,6 +727,7 @@ char *oname;
|
||||
* as provided by the Unix fstat call.
|
||||
* N.B.: modifies the passed name, may extend it!
|
||||
*/
|
||||
int
|
||||
wctxpn(name)
|
||||
char *name;
|
||||
{
|
||||
@@ -800,9 +822,10 @@ char *name;
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
getnak()
|
||||
{
|
||||
register firstch;
|
||||
int firstch;
|
||||
|
||||
Lastrx = 0;
|
||||
for (;;) {
|
||||
@@ -835,7 +858,7 @@ getnak()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
wctx(flen)
|
||||
long flen;
|
||||
{
|
||||
@@ -861,7 +884,7 @@ long flen;
|
||||
for (;;) {
|
||||
if (flen <= (charssent + 896L))
|
||||
thisblklen = 128;
|
||||
if ( !filbuf(txbuf, thisblklen))
|
||||
if (!filbuf(txbuf, thisblklen))
|
||||
break;
|
||||
if (wcputsec(txbuf, ++sectnum, thisblklen)==ERROR)
|
||||
return ERROR;
|
||||
@@ -884,12 +907,13 @@ long flen;
|
||||
return OK;
|
||||
}
|
||||
|
||||
int
|
||||
wcputsec(buf, sectnum, cseclen)
|
||||
char *buf;
|
||||
int sectnum;
|
||||
int cseclen; /* data length of this sector to send */
|
||||
{
|
||||
register checksum, wcj;
|
||||
int checksum, wcj;
|
||||
register char *cp;
|
||||
unsigned oldcrc;
|
||||
int firstch;
|
||||
@@ -964,10 +988,11 @@ cancan:
|
||||
}
|
||||
|
||||
/* fill buf with count chars padding with ^Z for CPM */
|
||||
int
|
||||
filbuf(buf, count)
|
||||
register char *buf;
|
||||
{
|
||||
register c, m;
|
||||
int c, m;
|
||||
|
||||
if ( !Ascii) {
|
||||
m = read(fileno(in), buf, count);
|
||||
@@ -1001,6 +1026,7 @@ register char *buf;
|
||||
}
|
||||
|
||||
/* Fill buffer with blklen chars */
|
||||
int
|
||||
zfilbuf()
|
||||
{
|
||||
int n;
|
||||
@@ -1044,6 +1070,7 @@ zfilbuf()
|
||||
|
||||
#ifdef TXBSIZE
|
||||
/* Replacement for brain damaged fseek function. Returns 0==success */
|
||||
int
|
||||
fooseek(fptr, pos, whence)
|
||||
FILE *fptr;
|
||||
long pos;
|
||||
@@ -1134,14 +1161,14 @@ long pos;
|
||||
#define fseek fooseek
|
||||
#endif
|
||||
|
||||
|
||||
/* VARARGS1 */
|
||||
vfile(f, a, b, c, d)
|
||||
char *f;
|
||||
long a, b, c, d;
|
||||
void
|
||||
vfile(char *f, ...)
|
||||
{
|
||||
if (Verbose > 2) {
|
||||
fprintf(stderr, f, a, b, c, d);
|
||||
va_list args;
|
||||
va_start(args, f);
|
||||
vfprintf(stderr, f, args);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
||||
@@ -1158,7 +1185,9 @@ alrm(sig)
|
||||
* readline(timeout) reads character(s) from file descriptor 0
|
||||
* timeout is in tenths of seconds
|
||||
*/
|
||||
int
|
||||
readline(timeout)
|
||||
unsigned timeout;
|
||||
{
|
||||
register int c;
|
||||
static char byt[1];
|
||||
@@ -1184,12 +1213,13 @@ readline(timeout)
|
||||
return (byt[0]&0377);
|
||||
}
|
||||
|
||||
void
|
||||
flushmo()
|
||||
{
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
purgeline()
|
||||
{
|
||||
#ifdef USG
|
||||
@@ -1202,6 +1232,7 @@ purgeline()
|
||||
#endif
|
||||
|
||||
/* send cancel string to get the other end to shut up */
|
||||
void
|
||||
canit()
|
||||
{
|
||||
static char canistr[] = {
|
||||
@@ -1212,7 +1243,7 @@ canit()
|
||||
raw_wbuf(strlen(canistr), canistr);
|
||||
purgeline();
|
||||
#else
|
||||
printf(canistr);
|
||||
fputs(canistr, stdout);
|
||||
fflush(stdout);
|
||||
#endif
|
||||
}
|
||||
@@ -1222,13 +1253,16 @@ canit()
|
||||
* Log an error
|
||||
*/
|
||||
/*VARARGS1*/
|
||||
zperr(s,p,u)
|
||||
char *s, *p, *u;
|
||||
void
|
||||
zperr(char *s, ...)
|
||||
{
|
||||
if (Verbose <= 0)
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, s);
|
||||
fprintf(stderr, "Retry %d: ", errors);
|
||||
fprintf(stderr, s, p, u);
|
||||
fprintf(stderr, s, args);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
@@ -1307,6 +1341,7 @@ char *babble[] = {
|
||||
""
|
||||
};
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
char **pp;
|
||||
@@ -1323,9 +1358,10 @@ usage()
|
||||
/*
|
||||
* Get the receiver's init parameters
|
||||
*/
|
||||
int
|
||||
getzrxinit()
|
||||
{
|
||||
register n;
|
||||
int n;
|
||||
#ifdef STAT
|
||||
struct stat f;
|
||||
#endif
|
||||
@@ -1462,9 +1498,10 @@ getzrxinit()
|
||||
}
|
||||
|
||||
/* Send send-init information */
|
||||
int
|
||||
sendzsinit()
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
|
||||
if (Myattn[0] == '\0' && (!Zctlesc || (Rxflags & TESCCTL)))
|
||||
return OK;
|
||||
@@ -1495,10 +1532,11 @@ sendzsinit()
|
||||
}
|
||||
|
||||
/* Send file name and related info */
|
||||
int
|
||||
zsendfile(buf, blen)
|
||||
char *buf;
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
register UNSL long crc;
|
||||
long lastcrcrq = -1;
|
||||
char *p;
|
||||
@@ -1585,10 +1623,11 @@ again:
|
||||
}
|
||||
|
||||
/* Send the data in the file */
|
||||
int
|
||||
zsendfdata()
|
||||
{
|
||||
register c, e, n;
|
||||
register newcnt;
|
||||
int c, e, n;
|
||||
int newcnt;
|
||||
register long tcount = 0;
|
||||
int junkcount; /* Counts garbage chars received by TX */
|
||||
static int tleft = 6; /* Counter for test mode */
|
||||
@@ -1656,7 +1695,7 @@ gotack:
|
||||
if (Test) {
|
||||
if ( --tleft)
|
||||
while (tcount < 20000) {
|
||||
printf(qbf); fflush(stdout);
|
||||
fputs(qbf, stdout); fflush(stdout);
|
||||
tcount += strlen(qbf);
|
||||
#ifdef READCHECK
|
||||
while (rdchk(0)) {
|
||||
@@ -1787,9 +1826,10 @@ gotack:
|
||||
/*
|
||||
* Respond to receiver's complaint, get back in sync with receiver
|
||||
*/
|
||||
int
|
||||
getinsync(flag)
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
|
||||
for (;;) {
|
||||
if (Test) {
|
||||
@@ -1839,8 +1879,8 @@ getinsync(flag)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Say "bibi" to the receiver, try to do it cleanly */
|
||||
void
|
||||
saybibi()
|
||||
{
|
||||
for (;;) {
|
||||
@@ -1857,6 +1897,7 @@ saybibi()
|
||||
}
|
||||
|
||||
/* Local screen character display function */
|
||||
void
|
||||
bttyout(c)
|
||||
{
|
||||
if (Verbose)
|
||||
@@ -1864,10 +1905,11 @@ bttyout(c)
|
||||
}
|
||||
|
||||
/* Send command and related info */
|
||||
int
|
||||
zsendcmd(buf, blen)
|
||||
char *buf;
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
long cmdnum;
|
||||
|
||||
#ifdef GENIE
|
||||
@@ -1925,6 +1967,7 @@ listen:
|
||||
/*
|
||||
* If called as sb use YMODEM protocol
|
||||
*/
|
||||
void
|
||||
chkinvok(s)
|
||||
char *s;
|
||||
{
|
||||
@@ -1949,10 +1992,11 @@ char *s;
|
||||
}
|
||||
|
||||
#ifdef STAT
|
||||
void
|
||||
countem(argc, argv)
|
||||
register char **argv;
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
struct stat f;
|
||||
|
||||
for (Totalleft = 0, Filesleft = 0; --argc >=0; ++argv) {
|
||||
@@ -1975,10 +2019,11 @@ register char **argv;
|
||||
Filesleft, Totalleft);
|
||||
}
|
||||
#else
|
||||
void
|
||||
countem(argc, argv)
|
||||
register char **argv;
|
||||
{
|
||||
register c;
|
||||
int c;
|
||||
register char *p;
|
||||
long size;
|
||||
|
||||
@@ -2015,9 +2060,10 @@ register char **argv;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
chartest(m)
|
||||
{
|
||||
register n;
|
||||
int n;
|
||||
|
||||
mode(m);
|
||||
printf("\r\n\nCharacter Transparency Test Mode %d\r\n", m);
|
||||
|
||||
@@ -129,7 +129,7 @@ char *Rxcdq = Rxlbuf; /* pointer for removing chars from Rxlbuf */
|
||||
*
|
||||
* timeout is in tenths of seconds
|
||||
*/
|
||||
|
||||
int
|
||||
readline(timeout)
|
||||
int timeout;
|
||||
{
|
||||
@@ -224,7 +224,7 @@ flushmoc()
|
||||
/*
|
||||
* Wait for the modem line outbuffer to drain
|
||||
*/
|
||||
flushmo()
|
||||
void flushmo()
|
||||
{
|
||||
fflush(stdout);
|
||||
flushmoc();
|
||||
|
||||
@@ -75,8 +75,8 @@ int Znulls; /* Number of nulls to send at beginning of ZDATA hdr */
|
||||
char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */
|
||||
char *Altcan; /* Alternate canit string */
|
||||
|
||||
static lastsent; /* Last char we sent */
|
||||
static Not8bit; /* Seven bits seen on header */
|
||||
static int lastsent; /* Last char we sent */
|
||||
static int Not8bit; /* Seven bits seen on header */
|
||||
|
||||
static char *frametypes[] = {
|
||||
"No Response to Error Correction Request", /* -4 */
|
||||
@@ -111,7 +111,20 @@ static char *frametypes[] = {
|
||||
|
||||
static char badcrc[] = "Bad CRC";
|
||||
|
||||
static void zsbh32(int len, char *hdr, int type, int flavour);
|
||||
static void zputhex(int c);
|
||||
static void zsda32(char *buf, int length, int frameend);
|
||||
static int zrdat32(char *buf, int length);
|
||||
static void garbitch(void);
|
||||
static int noxrd7(void);
|
||||
static int zrbhd32(char *hdr);
|
||||
static int zrbhdr(char *hdr);
|
||||
static int zgethex(void);
|
||||
static int zrhhdr(char *hdr);
|
||||
static int zgeth1(void);
|
||||
|
||||
/* Send ZMODEM binary header hdr of type type */
|
||||
void
|
||||
zsbhdr(len, type, hdr)
|
||||
register char *hdr;
|
||||
{
|
||||
@@ -156,8 +169,8 @@ register char *hdr;
|
||||
flushmo();
|
||||
}
|
||||
|
||||
|
||||
/* Send ZMODEM binary header hdr of type type */
|
||||
void
|
||||
zsbh32(len, hdr, type, flavour)
|
||||
register char *hdr;
|
||||
{
|
||||
@@ -182,6 +195,7 @@ register char *hdr;
|
||||
}
|
||||
|
||||
/* Send ZMODEM HEX header hdr of type type */
|
||||
void
|
||||
zshhdr(len, type, hdr)
|
||||
register char *hdr;
|
||||
{
|
||||
@@ -223,6 +237,8 @@ register char *hdr;
|
||||
* Send binary array buf of length length, with ending ZDLE sequence frameend
|
||||
*/
|
||||
static char *Zendnames[] = { "ZCRCE", "ZCRCG", "ZCRCQ", "ZCRCW"};
|
||||
|
||||
void
|
||||
zsdata(buf, length, frameend)
|
||||
register char *buf;
|
||||
{
|
||||
@@ -252,6 +268,7 @@ register char *buf;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
zsda32(buf, length, frameend)
|
||||
register char *buf;
|
||||
{
|
||||
@@ -281,6 +298,7 @@ register char *buf;
|
||||
* and CRC. Returns the ending character or error code.
|
||||
* NB: On errors may store length+1 bytes!
|
||||
*/
|
||||
int
|
||||
zrdata(buf, length)
|
||||
register char *buf;
|
||||
{
|
||||
@@ -343,6 +361,7 @@ crcfoo:
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
int
|
||||
zrdat32(buf, length)
|
||||
register char *buf;
|
||||
{
|
||||
@@ -401,6 +420,7 @@ crcfoo:
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
void
|
||||
garbitch()
|
||||
{
|
||||
zperr("Garbled data subpacket");
|
||||
@@ -418,6 +438,7 @@ garbitch()
|
||||
* Otherwise return negative on error.
|
||||
* Return ERROR instantly if ZCRCW sequence, for fast error recovery.
|
||||
*/
|
||||
int
|
||||
zgethdr(hdr, eflag)
|
||||
char *hdr;
|
||||
{
|
||||
@@ -583,6 +604,7 @@ fifi:
|
||||
}
|
||||
|
||||
/* Receive a binary style header (type and position) */
|
||||
int
|
||||
zrbhdr(hdr)
|
||||
register char *hdr;
|
||||
{
|
||||
@@ -618,6 +640,7 @@ register char *hdr;
|
||||
}
|
||||
|
||||
/* Receive a binary style header (type and position) with 32 bit FCS */
|
||||
int
|
||||
zrbhd32(hdr)
|
||||
register char *hdr;
|
||||
{
|
||||
@@ -660,8 +683,8 @@ register char *hdr;
|
||||
return Rxtype;
|
||||
}
|
||||
|
||||
|
||||
/* Receive a hex style header (type and position) */
|
||||
int
|
||||
zrhhdr(hdr)
|
||||
char *hdr;
|
||||
{
|
||||
@@ -710,6 +733,7 @@ char *hdr;
|
||||
}
|
||||
|
||||
/* Send a byte as two hex digits */
|
||||
void
|
||||
zputhex(c)
|
||||
register int c;
|
||||
{
|
||||
@@ -727,6 +751,7 @@ register int c;
|
||||
* Send character c with ZMODEM escape sequence encoding.
|
||||
* Escape XON, XOFF. Escape CR following @ (Telenet net escape)
|
||||
*/
|
||||
void
|
||||
zsendline(c)
|
||||
{
|
||||
|
||||
@@ -766,6 +791,7 @@ zsendline(c)
|
||||
}
|
||||
|
||||
/* Decode two lower case hex digits into an 8 bit byte value */
|
||||
int
|
||||
zgethex()
|
||||
{
|
||||
register int c;
|
||||
@@ -777,6 +803,8 @@ zgethex()
|
||||
#endif
|
||||
return c;
|
||||
}
|
||||
|
||||
int
|
||||
zgeth1()
|
||||
{
|
||||
register int c, n;
|
||||
@@ -803,6 +831,7 @@ zgeth1()
|
||||
* Read a byte, checking for ZMODEM escape encoding
|
||||
* including CAN*5 which represents a quick abort
|
||||
*/
|
||||
int
|
||||
zdlread()
|
||||
{
|
||||
register int c;
|
||||
@@ -868,6 +897,7 @@ again2:
|
||||
* Read a character from the modem line with timeout.
|
||||
* Eat parity, XON and XOFF characters.
|
||||
*/
|
||||
int
|
||||
noxrd7()
|
||||
{
|
||||
register int c;
|
||||
@@ -891,6 +921,7 @@ noxrd7()
|
||||
}
|
||||
|
||||
/* Store long integer pos in Txhdr */
|
||||
void
|
||||
stohdr(pos)
|
||||
long pos;
|
||||
{
|
||||
|
||||
@@ -119,16 +119,16 @@
|
||||
long rclhdr();
|
||||
|
||||
/* Globals used by ZMODEM functions */
|
||||
extern Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */
|
||||
extern Rxtype; /* Type of header received */
|
||||
extern Rxcount; /* Count of data bytes received */
|
||||
extern Rxtimeout; /* Tenths of seconds to wait for something */
|
||||
extern int Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame */
|
||||
extern int Rxtype; /* Type of header received */
|
||||
extern int Rxcount; /* Count of data bytes received */
|
||||
extern int Rxtimeout; /* Tenths of seconds to wait for something */
|
||||
extern long Rxpos; /* Received file position */
|
||||
extern long Txpos; /* Transmitted file position */
|
||||
extern Txfcs32; /* TURE means send binary frames with 32 bit FCS */
|
||||
extern Crc32t; /* Display flag indicating 32 bit CRC being sent */
|
||||
extern Crc32; /* Display flag indicating 32 bit CRC being received */
|
||||
extern Znulls; /* Number of nulls to send at beginning of ZDATA hdr */
|
||||
extern int Txfcs32; /* TURE means send binary frames with 32 bit FCS */
|
||||
extern int Crc32t; /* Display flag indicating 32 bit CRC being sent */
|
||||
extern int Crc32; /* Display flag indicating 32 bit CRC being received */
|
||||
extern int Znulls; /* Number of nulls to send at beginning of ZDATA hdr */
|
||||
extern char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */
|
||||
extern char *Altcan; /* Alternate canit string */
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
*/
|
||||
|
||||
/* Send data subpacket RLE encoded with 32 bit FCS */
|
||||
void
|
||||
zsdar32(buf, length, frameend)
|
||||
char *buf;
|
||||
{
|
||||
@@ -95,8 +96,8 @@ char *buf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Receive data subpacket RLE encoded with 32 bit FCS */
|
||||
int
|
||||
zrdatr32(buf, length)
|
||||
register char *buf;
|
||||
{
|
||||
@@ -182,4 +183,3 @@ badpkt:
|
||||
zperr("Data subpacket too long");
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -96,9 +96,10 @@ struct stat
|
||||
#define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE)
|
||||
#else
|
||||
|
||||
int chmod (const char *path, mode_t mode);
|
||||
int fchmod (int fd, mode_t mode);
|
||||
mode_t umask (mode_t cmask);
|
||||
int chmod(const char *path, mode_t mode);
|
||||
int fchmod(int fd, mode_t mode);
|
||||
mode_t umask(mode_t cmask);
|
||||
int mkdir(const char *path, mode_t mode);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user