X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcrc%2Fcrc.h;h=25789b7712b7d307b394a6a246109b0bd003cc99;hp=d3184cb1a7b606fdb9c9e8bf9327321633e4dda8;hb=d9cbd7d4454ae35e4e2f6d18a9469bf26948e4b9;hpb=2a9b3284774fe371bb39787d2c19127d7691ff59 diff --git a/ccan/crc/crc.h b/ccan/crc/crc.h index d3184cb1..25789b77 100644 --- a/ccan/crc/crc.h +++ b/ccan/crc/crc.h @@ -1,3 +1,4 @@ +/* Licensed under GPLv2+ - see LICENSE file for details */ #ifndef CCAN_CRC_H #define CCAN_CRC_H #include @@ -29,11 +30,13 @@ * as 0 the first time, and the current crc result from then on. * * Example: + * #include + * ... * // Check that iovec has the crc we expect (Castagnoli version) - * bool check_crc(uint32_t expected, const struct iovec *iov, int iovcnt) + * static bool check_crc(uint32_t expected, const struct iovec *iov, int l) * { * uint32_t crc = 0; - * while (iovcnt >= 0) { + * while (l >= 0) { * crc = crc32c(crc, iov->iov_base, iov->iov_len); * iov++; * } @@ -52,7 +55,7 @@ uint32_t crc32c(uint32_t start_crc, const void *buf, size_t size); * * Example: * // This dumb code only handles Castagnoli, so assert that here. - * void check_user_crc_table(const uint32_t *usertab) + * static void check_user_crc_table(const uint32_t *usertab) * { * const uint32_t *ctab = crc32c_table(); * if (!ctab || memcmp(ctab, usertab, 1024) != 0)