/*************************************************************************
NIXMAIL CRC routines
--------------------------------------------------------------------------

    Copyright (C) 1992 Anthony Rumble

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 1, or
    any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details. <copying>

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

--------------------------------------------------------------------------
RCS Info

$Header: /home/smilie/emsi/RCS/crctab.h,v 1.1 1992/12/06 09:39:47 smilie Exp $

$Log: crctab.h,v $
 * Revision 1.1  1992/12/06  09:39:47  smilie
 * Initial revision
 *

$Id: crctab.h,v 1.1 1992/12/06 09:39:47 smilie Exp $

*************************************************************************/
#ifndef _CRCTAB_H
#define _CRCTAB_H

extern unsigned short crctab[256];

typedef signed char sbyte;
typedef signed short sword;
typedef unsigned char ubyte;
typedef unsigned short uword;
typedef unsigned char bool;

extern unsigned int makecrc(unsigned char *p, int size);
extern unsigned long makecrc32(unsigned char *p, int size);

#define updcrc(cp, crc) ( crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp)
#ifdef NFGM
long
UPDC32(b, c)
long c;
{
return (cr3tab[((int)c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFF));
}

#else

#define UPDC32(b, c) (cr3tab[((int)c ^ b) & 0xff] ^ ((c >> 8) & 0x00FFFFFF))
#endif	/* NFGM */

#endif

