home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 October / Chip Ekim 2003.iso / prog / share / tod / setup.exe / crc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-09-16  |  799 b   |  30 lines

  1. /**************************************\
  2. * crc.h                                *
  3. * CRC functions from the 05 Jul 1997   *
  4. * release of SNIPPETS                  *
  5. \**************************************/
  6.  
  7. #ifndef CRC__H
  8. #define CRC__H
  9.  
  10.  
  11. #include <stdlib.h>
  12.  
  13. /* These typedefs are correct on nearly all ix86 compilers. */
  14. typedef unsigned char BYTE;
  15. typedef unsigned short WORD;
  16. typedef unsigned long DWORD;
  17.  
  18. typedef enum {Error_ = -1, Success_, False_ = 0, True_} Boolean_T;
  19.  
  20. /*
  21.  *  File: CRC_32.C
  22.  */
  23. #define UPDC32(octet,crc) (crc_32_tab[((crc) ^ ((BYTE)octet)) & 0xff] ^ ((crc) >> 8))
  24.  
  25. DWORD updateCRC32(unsigned char ch, DWORD crc);
  26. Boolean_T crc32file(const char *name, DWORD *crc, long *charcnt);
  27. DWORD crc32buf(const char *buf, size_t len);
  28.  
  29. #endif /* CRC__H */
  30.