ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Convert-UUlib/uulib/crc32.h
Revision: 1.3
Committed: Mon Aug 24 04:38:23 2009 UTC (17 years ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: rel-1_34, rel-1_33, rel-1_32, rel-1_31, rel-1_3, rel-1_5, rel-1_4, rel-1_6, rel-1_62
Changes since 1.2: +1 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #ifndef __CRC32_H__
2     #define __CRC32_H__
3    
4     #ifndef _ANSI_ARGS_
5     #ifdef PROTOTYPES
6     #define _ANSI_ARGS_(c) c
7     #else
8     #define _ANSI_ARGS_(c) ()
9     #endif
10     #endif
11    
12     #ifdef __cplusplus
13     extern "C" {
14     #endif
15    
16 root 1.3 typedef unsigned int crc32_t;
17 root 1.1 #define Z_NULL 0
18    
19 root 1.2 #define crc32 uulib_crc32
20    
21 root 1.1 crc32_t crc32 _ANSI_ARGS_((crc32_t crc, const unsigned char *buf, unsigned int len));
22     /*
23     Update a running crc with the bytes buf[0..len-1] and return the updated
24     crc. If buf is NULL, this function returns the required initial value
25     for the crc. Pre- and post-conditioning (one's complement) is performed
26     within this function so it shouldn't be done by the application.
27     Usage example:
28    
29     uLong crc = crc32(0L, Z_NULL, 0);
30    
31     while (read_buffer(buffer, length) != EOF) {
32     crc = crc32(crc, buffer, length);
33     }
34     if (crc != original_crc) error();
35     */
36    
37     #ifdef __cplusplus
38     }
39     #endif
40     #endif