File: crc32.h

package info (click to toggle)
abiword 0.7.7-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 20,604 kB
  • ctags: 18,358
  • sloc: cpp: 88,791; ansic: 66,296; sh: 7,777; makefile: 3,397; xml: 687; perl: 361; awk: 273; sed: 36; csh: 28
file content (37 lines) | stat: -rw-r--r-- 1,137 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* crc32.h

   header file for crc32 checksum

   C implementation of CRC-32 checksums for NAACCR records.  Code is based
   upon and utilizes algorithm published by Ross Williams.

   This file contains:
      CRC lookup table
      function CalcCRC32 for calculating CRC-32 checksum
      function AssignCRC32 for assigning CRC-32 in NAACCR record
      function CheckCRC32 for checking CRC-32 in NAACCR record

   Provided by:
      Eric Durbin
      Kentucky Cancer Registry
      University of Kentucky
      October 14, 1998

   Status:
      Public Domain
*/

#define CRC32_XINIT 0xFFFFFFFFL         /* initial value */
#define CRC32_XOROT 0xFFFFFFFFL         /* final xor value */

#define MINIMUM_CHECKSUM_LEN     8
#define MAXIMUM_CHECKSUM_LEN    99

/* NAACCR 6.0 Specifications */
#define NAACCR_60_CHECKSUM_POS  942
#define NAACCR_60_CHECKSUM_LEN  10

/* function prototypes */
unsigned long CalcCRC32(unsigned char *, unsigned long, unsigned long, unsigned long);
int AssignCRC32(unsigned char *, unsigned long, unsigned long, unsigned long);
int CompareCRC32(unsigned char *, unsigned long, unsigned long, unsigned long);