/* $Id: crc_32.h,v 1.2 2001/05/15 19:14:33 ozra Exp $ */
/**************************************************************************
* *
* Copyright (C) 2000 Grub, Inc. *
* *
* 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 (at your option) *
* 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. *
* *
* 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. *
* *
* Author: Ledio Ago - lajesus (email: lajesus@yahoo.com) *
* *
**************************************************************************
* *
* File: crc_32.h *
* *
* Description: This file holds function for implementation of crc. *
* The goal is calculate the crc of individual character. *
* - gen_crc_table: It will build the crc table *
* - crc_reset: It will reset the value of the variable where the *
* will be stored. *
* - get_crc: It will calculate the crc value of single character. *
* *
*************************************************************************/
#ifndef _CRC_32_H_
#define _CRC_32_H_
extern unsigned long crc_table[256];
/*
* Function: gen_crc_table
*
* Description: Function gen_crc_table will build the crc table.
*
* Input: None
* Output: None.
*/
void gen_crc_table();
/*
* Function: crc_reset
*
* Description: Function crc_reset will reset the value of the variable where the
* crc will be stored.
*
* Input: crc, unsigned long type pointer variable will be used to store the
* individual crc value of each character in the block of characters
* Output: None.
*/
void crc_reset( unsigned long *crc );
/*
* Function: get_crc
*
* Description: Function get_crc will calculate the crc of each individual character
*
* Input: crc, unsigned long type pointer will be used store the crc value of
* a character.
* ch, integer type will be use to store the integer value of each
* character.
* Output: It will return the crc value of each character.
*/
unsigned long get_crc( unsigned long *crc, int ch );
#endif