aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/crc32.h
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2011-08-31 11:47:27 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2011-08-31 11:47:27 +0000
commit84b3c5da84829bff2d89bcdc4351ab451a332ce8 (patch)
treedcba77617a427261533eace98c505c5cfc198a33 /wsutil/crc32.h
parent5198e05412667027ef63aaabc097f11fb8f7f781 (diff)
Make lookup functions for accessing crc32c_table and crc32_ccitt_table.
svn path=/trunk/; revision=38817
Diffstat (limited to 'wsutil/crc32.h')
-rw-r--r--wsutil/crc32.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/wsutil/crc32.h b/wsutil/crc32.h
index f69dba6ebf..d77a9d64cf 100644
--- a/wsutil/crc32.h
+++ b/wsutil/crc32.h
@@ -41,9 +41,10 @@ extern "C" {
((crc32c_value & 0x0000ff00) << 8) | \
((crc32c_value & 0x000000ff) << 24))
-#define CRC32C(c,d) (c=(c>>8)^crc32c_table[(c^(d))&0xFF])
+#define CRC32C(c,d) (c=(c>>8)^crc32c_table_lookup((c^(d))&0xFF))
-WS_VAR_IMPORT const guint32 crc32c_table[256];
+guint32 crc32c_table_lookup (guchar pos);
+guint32 crc32_ccitt_table_lookup (guchar pos);
/** Compute CRC32C checksum of a buffer of data.
@param buf The buffer containing the data.
@@ -52,8 +53,6 @@ WS_VAR_IMPORT const guint32 crc32c_table[256];
@return The CRC32C checksum. */
extern guint32 crc32c_calculate(const void *buf, int len, guint32 crc);
-WS_VAR_IMPORT const guint32 crc32_ccitt_table[256];
-
/** Compute CRC32 CCITT checksum of a buffer of data.
@param buf The buffer containing the data.
@param len The number of bytes to include in the computation.