home *** CD-ROM | disk | FTP | other *** search
/ PCMania 10 / Pcmania_Ep2_10_CD-01.iso / ARTICULOS / tecnologia / DLOCK2.ZIP / CRC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-02  |  499 b   |  17 lines

  1. /* crc.h -- header for CCITT CRC-32 function.
  2.    This file is in the Public Domain.
  3. */
  4.  
  5. extern unsigned long int *Ccitt32Table;
  6.  
  7. extern int CALLTYPE BuildCRCTable(void);    
  8. /* Allocates 1024 byte table and fills it. */
  9.  
  10. /* Make sure that the following macro is called after BuildCRCTable() but
  11.    before crc32done(). */
  12.  
  13. #define crc32(crc, c)(((crc>>8)&0x00FFFFFFL)^(Ccitt32Table[(int)((int)crc^c)&0xFF]))
  14.  
  15. extern void CALLTYPE crc32done(void);   /* Frees up 1024 bytes of RAM. */
  16.  
  17.