home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
308.lha
/
Brik_v2.0
/
addbfcrc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-10-08
|
651b
|
22 lines
/* ::[[ @(#) addbfcrc.c 1.10 89/07/08 10:34:48 ]]:: */
/* Adapted from zmodem source code, which contained Gary Brown's code */
#ifndef LINT
static char sccsid[]="::[[ @(#) addbfcrc.c 1.10 89/07/08 10:34:48 ]]::";
#endif
typedef unsigned long tcrc; /* type of crc value -- same as in brik.c */
extern tcrc crccode; /* holds all crc values */
extern tcrc crctab[]; /* the crc calculation table */
void addbfcrc (buf, size)
register char *buf;
register int size;
{
int i;
for (i = 0; i < size; i ++) {
crccode = crctab[(int) ((crccode) ^ (buf[i])) & 0xff] ^
(((crccode) >> 8) & 0x00FFFFFFL);
}
}