Let lz4toasm accept LZ4 files that lack extracted-size field (#858)

lz4toasm should now more easily accept LZ4 files output by
compressor programs that do not support the extracted-size
field, such as Stephan Brumme's smallz4.

This patch also proposes to add a new lz4len() function to
the libc: it parses an LZ4 compressed block to compute the
unpacked content size, without really unpacking the block.

Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
This commit is contained in:
tkchia 2023-07-24 02:12:22 +08:00 committed by GitHub
parent 3eec69f9c3
commit 0ffc0dd461
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 2 deletions

View file

@ -17,6 +17,7 @@ void rldecode(void *dest, const struct RlDecode *) _Hide;
void rldecode2(void *dest, const struct RlDecode *) _Hide;
const uint8_t *lz4check(const void *data) _Hide;
void *lz4cpy(void *dest, const void *blockdata, size_t blocksize) _Hide;
size_t lz4len(const void *blockdata, size_t blocksize) _Hide;
void *lz4decode(void *dest, const void *src) _Hide;
COSMOPOLITAN_C_END_