source: main/trunk/greenstone2/build-src/packages/isis-gdl/CRC32.h@ 34961

Last change on this file since 34961 was 34961, checked in by anupama, 3 years ago

Merging Dr Bainbridge's mg-long related updates for IsisGdl that got IsisGdl working on 64 bit linux, and on new Macs that were no longer backwards compatible with 32 bit. Tested only to compile and run (CDS-ISIS tutorial) on 64 bit linux. Merged version of code untested on Mac, though it was used to generate the static 64 bit Mac IsisGdl before. Also untested on 32 bit linux, but Dr Bainbridge had earlier indicated it was backwards. At present the release kit code is still grabbing the statically built IsisGdl (for 32 and nowadayas also 64 bit Mac/Linux) as before and including in binaries. This can be changed later. These code changes are for locally compiling up GS from SVN with an IsisGdl built on the local machine meant to work on that local machine.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/**********************************************************************
2 *
3 * CRC32.h
4 * Copyright (C) 2003 UNESCO
5 *
6 * A component of the Greenstone digital library software
7 * from the New Zealand Digital Library Project at the
8 * University of Waikato, New Zealand.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 *********************************************************************/
25
26////////////////////////////////////////////////////////////////////////////////////
27// CRC32.H
28//
29// The CRC32 functions (Cyclic Redundancy Check) are used to
30// calculate a sophisticated checksum based on the algebra of
31// polynomials. The Cyclic Redundancy Check, is a way to detect
32// bit errors that occur during data storage or transmission.
33// The CRC-32 algorithm operates on a block of data as a single
34// large numerical value. The algorithm divides this large value
35// by the CRC-32 polynomial or generator polynomial, leaving the
36// remainder 32-bit, which is the checksum.
37#ifndef __CRC32_H__
38#define __CRC32_H__
39
40#include <fstream>
41
42mg_u_long CalcCRC32(char *buf, unsigned int len); // **** was just 'unsigned len'
43mg_u_long CalcCRC32(const char *buf, unsigned int len); // **** was just 'unsigned len'
44mg_u_long CalcCRC32(unsigned char c, mg_u_long CRC);
45mg_u_long CalcCRC32(std::fstream &infile);
46
47#ifdef __USE_CRC32_TABLE_FUNCTIONS__
48#include <iostream>
49int makeCRC32(std::ostream &stream);
50#endif
51
52#endif // __CRC32_H__
Note: See TracBrowser for help on using the repository browser.