crc32.h

Go to the documentation of this file.
00001 #ifndef __CRC32_H__
00002 #define __CRC32_H__
00003 
00004 #ifndef _ANSI_ARGS_
00005 #ifdef PROTOTYPES
00006 #define _ANSI_ARGS_(c) c
00007 #else
00008 #define _ANSI_ARGS_(c) ()
00009 #endif
00010 #endif
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 typedef unsigned long crc32_t;
00017 #define Z_NULL 0
00018 
00019 crc32_t crc32 _ANSI_ARGS_((crc32_t crc, const unsigned char *buf, unsigned int len));
00020 /*
00021  Update a running crc with the bytes buf[0..len-1] and return the updated
00022  crc. If buf is NULL, this function returns the required initial value
00023  for the crc. Pre- and post-conditioning (one's complement) is performed
00024  within this function so it shouldn't be done by the application.
00025  Usage example:
00026 
00027  uLong crc = crc32(0L, Z_NULL, 0);
00028 
00029  while (read_buffer(buffer, length) != EOF) {
00030  crc = crc32(crc, buffer, length);
00031  }
00032  if (crc != original_crc) error();
00033 */
00034 
00035 #ifdef __cplusplus
00036 }
00037 #endif
00038 #endif

Generated on Sun Oct 12 01:45:29 2008 for NNTPGrab by  1.5.4