/*
 * crc32.h
 *
 * Calculates 32-bit CRCs (Cyclic Redundancy Checks)
 *
 *  1993-1998 Straylight
 */

/*----- Licensing note ----------------------------------------------------*
 *
 * This file is part of Straylight's Dynamic Linking System (SDLS)
 *
 * SDLS 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 2, or (at your option)
 * any later version.
 *
 * SDLS 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with SDLS.  If not, write to the Free Software Foundation,
 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __crc32_h
#define __crc32_h

#ifndef __stddef_h
  #include <stddef.h>
#endif

/*
 * long crc32(long seed,void *data,size_t size,int diff)
 *
 * Use
 *  Calculates the CRC for a block of data.  The system has been designed to
 *  allow a CRC calculation to be carried out in stages, the result of
 *  previous calculations being used for continuation.
 *
 * Parameters
 *  long seed == 0 to start a calculation, or the result from the previous
 *    one to continue.
 *  void *data == pointer to the data to check
 *  size_t size == size (in bytes) of the data (just this block)
 *  int diff == the address difference between bytes to check (normally one,
 *    for all bytes).
 *
 * Returns
 *   The CRC for all the data checked so far.
 */

long crc32(long seed,void *data,size_t size,int diff);

#endif
