* For conditions of distribution and use, see copyright notice in zlib.h
*/
-#ifndef USE_HOSTCC
+#ifdef USE_HOSTCC
+#include <arpa/inet.h>
+#else
#include <common.h>
#endif
#include <compiler.h>
#define tole(x) cpu_to_le32(x)
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
local int crc_table_empty = 1;
local uint32_t crc_table[256];
*/
const uint32_t * ZEXPORT get_crc_table()
{
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
if (crc_table_empty) make_crc_table();
#endif
return (const uint32_t *)crc_table;
const uint32_t *tab = crc_table;
const uint32_t *b =(const uint32_t *)buf;
size_t rem_len;
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
if (crc_table_empty)
make_crc_table();
#endif
return crc;
}
+
+void crc32_wd_buf(const unsigned char *input, unsigned int ilen,
+ unsigned char *output, unsigned int chunk_sz)
+{
+ uint32_t crc;
+
+ crc = crc32_wd(0, input, ilen, chunk_sz);
+ crc = htonl(crc);
+ memcpy(output, &crc, sizeof(crc));
+}