"Fossies" - the Fresh Open Source Software Archive

Member "memcached-1.6.9/crc32c.h" (21 Nov 2020, 770 Bytes) of package /linux/www/memcached-1.6.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "crc32c.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.6.8_vs_1.6.9.

    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 */