1 #ifndef CRC32C_H
2 #define    CRC32C_H
3 
4 
5 // crc32c.h -- header for crc32c.c
6 // Copyright (C) 2015 Mark Adler
7 // See crc32c.c for the license.
8 
9 #include <stdint.h>
10 
11 // Return the CRC-32C of buf[0..len-1] given the starting CRC crc.  This can be
12 // used to calculate the CRC of a sequence of bytes a chunk at a time, using
13 // the previously returned crc in the next call.  The first call must be with
14 // crc == 0.  crc32c() uses the Intel crc32 hardware instruction if available.
15 typedef uint32_t (*crc_func)(uint32_t crc, const void *buf, size_t len);
16 extern crc_func crc32c;
17 
18 void crc32c_init(void);
19 
20 // Expose a prototype for the crc32c software variant simply for testing purposes
21 uint32_t crc32c_sw(uint32_t crc, void const *buf, size_t len);
22 
23 #endif    /* CRC32C_H */
24