summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko2010-10-27 15:26:45 +0200
committerDenys Vlasenko2010-10-27 15:26:45 +0200
commit9ce642f9746dfc29d119d0680b769677e3ea6da6 (patch)
treef8d2bcd08c691979058b610b32573a742a3e3024 /include
parentdd88ba88f5082b1785539b1fb87af7320515b8c9 (diff)
downloadbusybox-9ce642f9746dfc29d119d0680b769677e3ea6da6.zip
busybox-9ce642f9746dfc29d119d0680b769677e3ea6da6.tar.gz
libbb: introduce and use common crc32 routine
function old new delta crc32_block_endian1 - 37 +37 crc32_block_endian0 - 34 +34 global_crc32_table - 8 +8 file_read 82 87 +5 gzip_main 211 214 +3 xz_crc32 40 35 -5 crc32_table 8 - -8 calculate_gunzip_crc 54 34 -20 lzo_crc32 54 25 -29 cksum_main 298 211 -87 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 2/4 up/down: 87/-149) Total: -62 bytes Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h
index d14728e..587a5f9 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1543,11 +1543,10 @@ void sha512_begin(sha512_ctx_t *ctx) FAST_FUNC;
void sha512_hash(sha512_ctx_t *ctx, const void *buffer, size_t len) FAST_FUNC;
void sha512_end(sha512_ctx_t *ctx, void *resbuf) FAST_FUNC;
-/* TODO: add global crc32_table pointer and create
- * LE and BE functions to calculate crc32 over given bytes.
- * Currently we have about five reimplementations...
- */
+extern uint32_t *global_crc32_table;
uint32_t *crc32_filltable(uint32_t *tbl256, int endian) FAST_FUNC;
+uint32_t crc32_block_endian1(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) FAST_FUNC;
+uint32_t crc32_block_endian0(uint32_t val, const void *buf, unsigned len, uint32_t *crc_table) FAST_FUNC;
typedef struct masks_labels_t {
const char *labels;