home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
UTILS
/
SQUSQ
/
IO.C
< prev
next >
Wrap
C/C++ Source or Header
|
2000-06-30
|
599b
|
42 lines
#include <bdscio.h>
#include <dio.h>
#include "sqcom.h"
#include "sq.h"
#define STDOUT 4 /* console only (error) stream */
/* Get next byte from file and update checksum */
int
getc_crc(ib)
struct _buf *ib;
{
int c;
c = getc(ib);
if(c != EOF)
crc += c; /* checksum */
return c;
}
/* Output functions with error reporting */
putce(c, iob)
int c;
struct _buf *iob;
{
if(putc(c, iob) == ERROR) {
fprintf(STDOUT, "Write error in putc()\n");
exit(1);
}
}
putwe(w, iob)
int w;
struct _buf *iob;
{
if(putw(w, iob) != w) {
fprintf(STDOUT,"Write error in putw()\n");
exit(1);
}
}