/* Public domain */ #ifndef __CRC_H__ #define __CRC_H__ #if THINK_C extern const unsigned short crc16_table[]; extern const unsigned long crc32_table[]; #define UpdateCRC(b, c) (crc16_table[(((unsigned short)c >> 8) & 0xff) ^ \ (unsigned short)(b)] ^ ((unsigned short)c << 8)) #define UpdateCRC32(b, c) (crc32_table[((unsigned long)c ^ \ (unsigned short)(b)) & 0xff] ^ (unsigned long)((unsigned long)c >> 8)) #else unsigned short UpdateCRC(unsigned char b, unsigned short crc); unsigned long UpdateCRC32(unsigned char b, unsigned long crc); #endif #endif /* __CRC_H__ */