1 | /** |
---|
2 | * (C) Copyright 2014- ECMWF. |
---|
3 | * |
---|
4 | * This software is licensed under the terms of the Apache Licence Version 2.0 |
---|
5 | * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. |
---|
6 | * |
---|
7 | * In applying this licence, ECMWF does not waive the privileges and immunities |
---|
8 | * granted to it by virtue of its status as an intergovernmental organisation |
---|
9 | * nor does it submit to any jurisdiction. |
---|
10 | */ |
---|
11 | |
---|
12 | /* crc.h */ |
---|
13 | /* Calculates 32-bit Cyclic Redundancy Check as in Unix cksum command */ |
---|
14 | /* Also calculates 64-bit Cyclic Redundancy Check */ |
---|
15 | |
---|
16 | /* Sami Saarinen, 17-Feb-2005 : crc32 */ |
---|
17 | /* 24-Jun-2005 : Added crc64 */ |
---|
18 | /* 29-Dec-2005 : Added protos for direct C-calls */ |
---|
19 | /* 29-Dec-2005 : Length argument for crc64 now 64-bit int */ |
---|
20 | |
---|
21 | /* C callables */ |
---|
22 | |
---|
23 | extern unsigned int |
---|
24 | pp_cksum32(int nbuf, unsigned int nCRC); |
---|
25 | |
---|
26 | extern unsigned int |
---|
27 | pp_cksum32but64len(long long int nbuf, unsigned int nCRC); |
---|
28 | |
---|
29 | extern unsigned long long int |
---|
30 | pp_cksum64(long long int nbuf, unsigned long long int nCRC); |
---|
31 | |
---|
32 | extern unsigned int |
---|
33 | cksum32(const char *buf, int nbuf, unsigned int nCRC); |
---|
34 | |
---|
35 | extern unsigned long long int |
---|
36 | cksum64(const char *buf, long long int nbuf, unsigned long long int nCRC); |
---|
37 | |
---|
38 | /* Fortran callable */ |
---|
39 | |
---|
40 | extern void |
---|
41 | crc32_(const void *vbuf, const int *pnbuf, |
---|
42 | unsigned int *pnCRC /* Note: An in & out -variable */); |
---|
43 | |
---|
44 | extern void |
---|
45 | crc64_(const void *vbuf, const long long int *pnbuf, |
---|
46 | unsigned long long int *pnCRC /* Note: An in & out -variable */); |
---|