#ifdef NFGM
long
-UPDC32(b, c)
-long c;
+UPDC32(int b, long c)
{
return (cr3tab[((int)c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFF));
}
/*
* Return non 0 iff something to read from io descriptor f
*/
-int rdchk(f)
+int rdchk(int f)
{
static long lf;
static unsigned
-getspeed(code)
-int code;
+getspeed(int code)
{
register int n;
#include <unistd.h>
#include <utime.h>
#include <stdio.h>
+#include <stdarg.h>
#define OK 0
#define FALSE 0
void bttyout(int c );
int sys2(char *s );
void exec2(char *s );
+/*
+ * Debugging information output interface routine
+ */
+void vfile(const char *s, ...);
/*
* Max value for HOWMANY is 255.
}
/* called by signal interrupt or terminate to clean things up */
-void bibi(n)
-int n;
+void bibi(int n)
{
if (Zmodem)
zmputs(Attn);
exit(128+n);
}
-int main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
register char *cp;
register int npats;
fprintf(stderr, "\t\t\042The High Reliability Software\042\n");
exit(SS_NORMAL);
}
-/*
- * Debugging information output interface routine
- */
-/* VARARGS1 */
-void vfile(f, a, b, c)
-register char *f,*a,*b,*c;
+void vfile(const char *string, ...)
{
if (Verbose > 2) {
- fprintf(stderr, f, a, b, c);
+ va_list args;
+ va_start(args, string);
+ vfprintf(stderr, string, args);
+ va_end(args);
fprintf(stderr, "\n");
}
}
char *rbmsg =
"%s ready. To begin transfer, type \"%s file ...\" to your modem program\r\n\n";
-int wcreceive(argc, argp)
-int argc;
-char **argp;
+int wcreceive(int argc, char **argp)
{
register int c;
* Fetch a pathname from the other end as a C ctyle ASCIZ string.
* Length is indeterminate as long as less than Blklen
* A null string represents no more files (YMODEM)
+ *
+ * Parameter rpn is for receiving a pathname
*/
-int wcrxpn(rpn)
-char *rpn; /* receive a pathname */
+int wcrxpn(char *rpn)
{
register int c;
* (Caller must do that when he is good and ready to get next sector)
*/
-int wcgetsec(rxbuf, maxtime)
-char *rxbuf;
-int maxtime;
+int wcgetsec(char *rxbuf, int maxtime)
{
register int checksum, wcj, firstch;
register unsigned short oldcrc;
*
* timeout is in tenths of seconds
*/
-int readline(timeout)
-int timeout;
+int readline(int timeout)
{
register int n;
static char *cdq; /* pointer for removing chars from linbuf */
/*
* Process incoming file information header
*/
-int procheader(name)
-char *name;
+int procheader(char *name)
{
register char *openmode, *p;
* it's because some required directory was not present, and if
* so, create all required dirs.
*/
-int make_dirs(pathname)
-register char *pathname;
+int make_dirs(char *pathname)
{
register char *p; /* Points into path */
int madeone = 0; /* Did we do anything yet? */
/*
* Make a directory. Compatible with the mkdir() system call on 4.2BSD.
*/
-int makedir(dpath, dmode)
-char *dpath;
-int dmode;
+int makedir(char *dpath, int dmode)
{
int cpid, status;
struct stat statbuf;
* If not in binary mode, carriage returns, and all characters
* starting with CPMEOF are discarded.
*/
-int putsec(buf, n)
-char *buf;
-register int n;
+int putsec(char *buf, int n)
{
register char *p;
/*
* Send a character to modem. Small is beautiful.
*/
-void sendline(c)
-int c;
+void sendline(int c)
{
char d;
/* make string s lower case */
-void uncaps(s)
-register char *s;
+void uncaps(char *s)
{
for ( ; *s; ++s)
if (isupper(*s))
/*
* IsAnyLower returns TRUE if string s has lower case letters.
*/
-int IsAnyLower(s)
-register char *s;
+int IsAnyLower(char *s)
{
for ( ; *s; ++s)
if (islower(*s))
* returns pointer to token within string if found, NULL otherwise
*/
char *
-substr(s, t)
-register char *s,*t;
+substr(char *s, char *t)
{
register char *ss,*tt;
/* search for first char of token */
* Log an error
*/
/*VARARGS1*/
-void zperr(s,p,u)
-char *s, *p, *u;
+void zperr(char *s, char *p, char *u)
{
if (Verbose <= 0)
return;
}
-void report(sct)
-int sct;
+void report(int sct)
{
if (Verbose>1)
fprintf(stderr,"%03d%c",sct,sct%10? ' ' : '\r');
* If called as [-][dir/../]rzCOMMAND set the pipe flag
* If called as rb use YMODEM protocol
*/
-void chkinvok(s)
-char *s;
+void chkinvok(char *s)
{
register char *p;
/*
* Totalitarian Communist pathname processing
*/
-void checkpath(name)
-char *name;
+void checkpath(char *name)
{
if (Restricted) {
if (fopen(name, "r") != NULL) {
* Send a string to the modem, processing for \336 (sleep 1 sec)
* and \335 (break signal)
*/
-void zmputs(s)
-char *s;
+void zmputs(char *s)
{
register int c;
/*
* Local console output simulation
*/
-void bttyout(c)
-int c;
+void bttyout(int c)
{
if (Verbose || Fromcu)
putc(c, stderr);
/*
* Strip leading ! if present, do shell escape.
*/
-int sys2(s)
-register char *s;
+int sys2(char *s)
{
if (*s == '!')
++s;
/*
* Strip leading ! if present, do exec.
*/
-void exec2(s)
-register char *s;
+void exec2(char *s)
{
if (*s == '!')
++s;
#include <unistd.h>
#include <utime.h>
#include <stdio.h>
+#include <stdarg.h>
#define PATHLEN 256
#define OK 0
void chartest(int m );
/* called by signal interrupt or terminate to clean things up */
-void bibi(n)
-int n;
+void bibi(int n)
{
canit(); fflush(stdout); mode(0);
fprintf(stderr, "sz: caught signal %d; exiting\n", n);
exit(128+n);
}
/* Called when ZMODEM gets an interrupt (^X) */
-void onintr(sig)
-int sig;
+void onintr(int sig)
{
signal(SIGINT, SIG_IGN);
longjmp(intrjmp, -1);
#include "zm.c"
-int main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
register char *cp;
register int npats;
/*NOTREACHED*/
}
-int wcsend(argc, argp)
-int argc;
-char *argp[];
+int wcsend(int argc, char *argp[])
{
register int n;
return OK;
}
-int wcs(oname)
-char *oname;
+int wcs(char *oname)
{
register int c;
register char *p;
* as provided by the Unix fstat call.
* N.B.: modifies the passed name, may extend it!
*/
-int wctxpn(name)
-char *name;
+int wctxpn(char *name)
{
register char *p, *q;
char name2[PATHLEN];
}
-int wctx(flen)
-long flen;
+int wctx(long flen)
{
register int thisblklen;
register int sectnum, attempts, firstch;
else
return OK;
}
-
-int wcputsec(buf, sectnum, cseclen)
-char *buf;
-int sectnum;
-int cseclen; /* data length of this sector to send */
+/**
+ * @param cseclen :data length of this sector to send
+ */
+int wcputsec(char *buf, int sectnum, int cseclen)
{
register int checksum, wcj;
register char *cp;
}
/* fill buf with count chars padding with ^Z for CPM */
-int filbuf(buf, count)
-register char *buf;
-int count;
+int filbuf(char *buf, int count)
{
register int c, m;
}
#ifdef TXBSIZE
-int fooseek(fptr, pos, whence)
-FILE *fptr;
-long pos;
+int fooseek(FILE *fptr, long pos, int whence)
{
int m, n;
#define fseek fooseek
#endif
-
-/* VARARGS1 */
-void vfile(f, a, b, c)
-register char *f,*a,*b,*c;
+void vfile(const char *string, ...)
{
if (Verbose > 2) {
- fprintf(stderr, f, a, b, c);
+ va_list args;
+ va_start(args, string);
+ vfprintf(stderr, string, args);
+ va_end(args);
fprintf(stderr, "\n");
}
}
-void alrm(sig)
-int sig;
+void alrm(int sig)
{
longjmp(tohere, -1);
}
* readline(timeout) reads character(s) from file descriptor 0
* timeout is in tenths of seconds
*/
-int readline(timeout)
-int timeout;
+int readline(int timeout)
{
register int c;
static char byt[1];
* Log an error
*/
/*VARARGS1*/
-void zperr(s,p,u)
-char *s, *p, *u;
+void zperr(char *s, char *p, char *u)
{
if (Verbose <= 0)
return;
* returns pointer to token within string if found, NULL otherwise
*/
char *
-substr(s, t)
-register char *s,*t;
+substr(char *s, char *t)
{
register char *ss,*tt;
/* search for first char of token */
}
/* Send file name and related info */
-int zsendfile(buf, blen)
-char *buf;
-int blen;
+int zsendfile(char *buf, int blen)
{
register int c;
register UNSL long crc;
/*
* Respond to receiver's complaint, get back in sync with receiver
*/
-int getinsync(flag)
-int flag;
+int getinsync(int flag)
{
register int c;
}
/* Local screen character display function */
-void bttyout(c)
-int c;
+void bttyout(int c)
{
if (Verbose)
putc(c, stderr);
}
/* Send command and related info */
-int zsendcmd(buf, blen)
-char *buf;
-int blen;
+int zsendcmd(char *buf, int blen)
{
register int c;
long cmdnum;
/*
* If called as sb use YMODEM protocol
*/
-void chkinvok(s)
-char *s;
+void chkinvok(char *s)
{
#ifdef vax11c
Progname = "sz";
#endif
}
-void countem(argc, argv)
-int argc;
-register char **argv;
+void countem(int argc, char **argv)
{
register int c;
struct stat f;
Filesleft, Totalleft);
}
-void chartest(m)
-int m;
+void chartest(int m)
{
register int n;
static char badcrc[] = "Bad CRC";
/* Send ZMODEM binary header hdr of type type */
-void zsbhdr(type, hdr)
-int type;
-register char *hdr;
+void zsbhdr(int type, char *hdr)
{
register int n;
register unsigned short crc;
/* Send ZMODEM binary header hdr of type type */
-void zsbh32(hdr, type)
-register char *hdr;
-int type;
+void zsbh32(char *hdr, int type)
{
register int n;
register UNSL long crc;
}
/* Send ZMODEM HEX header hdr of type type */
-void zshhdr(type, hdr)
-int type;
-register char *hdr;
+void zshhdr(int type, char *hdr)
{
register int n;
register unsigned short crc;
*/
static char *Zendnames[] = { "ZCRCE", "ZCRCG", "ZCRCQ", "ZCRCW"};
-void zsdata(buf, length, frameend)
-register char *buf;
-int length;
-int frameend;
+void zsdata(char *buf, int length, int frameend)
{
register unsigned short crc;
}
}
-void zsda32(buf, length, frameend)
-register char *buf;
-int length;
-int frameend;
+void zsda32(char *buf, int length, int frameend)
{
register int c;
register UNSL long crc;
* and CRC. Returns the ending character or error code.
* NB: On errors may store length+1 bytes!
*/
-int zrdata(buf, length)
-register char *buf;
-int length;
+int zrdata(char *buf, int length)
{
register int c;
register unsigned short crc;
return ERROR;
}
-int zrdat32(buf, length)
-register char *buf;
-int length;
+int zrdat32(char *buf, int length)
{
register int c;
register UNSL long crc;
* Otherwise return negative on error.
* Return ERROR instantly if ZCRCW sequence, for fast error recovery.
*/
-int zgethdr(hdr, eflag)
-char *hdr;
-int eflag;
+int zgethdr(char *hdr, int eflag)
{
register int c, n, cancount;
}
/* Receive a binary style header (type and position) */
-int zrbhdr(hdr)
-register char *hdr;
+int zrbhdr(char *hdr)
{
register int c, n;
register unsigned short crc;
}
/* Receive a binary style header (type and position) with 32 bit FCS */
-int zrbhdr32(hdr)
-register char *hdr;
+int zrbhdr32(char *hdr)
{
register int c, n;
register UNSL long crc;
/* Receive a hex style header (type and position) */
-int zrhhdr(hdr)
-char *hdr;
+int zrhhdr(char *hdr)
{
register int c;
register unsigned short crc;
}
/* Send a byte as two hex digits */
-void zputhex(c)
-register int c;
+void zputhex(int c)
{
static char digits[] = "0123456789abcdef";
* Send character c with ZMODEM escape sequence encoding.
* Escape XON, XOFF. Escape CR following @ (Telenet net escape)
*/
-void zsendline(c)
-int c;
+void zsendline(int c)
{
/* Quick check for non control characters */
}
/* Store long integer pos in Txhdr */
-void stohdr(pos)
-long pos;
+void stohdr(long pos)
{
Txhdr[ZP0] = pos;
Txhdr[ZP1] = pos>>8;
/* Recover a long integer from a header */
long
-rclhdr(hdr)
-register char *hdr;
+rclhdr(char *hdr)
{
register long l;
/* rz.c sz.c */
-void vfile();
+void vfile(const char *s, ...);
void bibi(int n );
/* End of ZMODEM.H */