diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2014-06-02 06:07:19 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2014-06-02 06:07:19 (GMT) |
commit | b636779b0e168c346b42e85af816ce37a8ed9880 (patch) | |
tree | 03c4d8882c25162102c6df6e46b238a5864ed77b /lz4.h | |
parent | 302e7e2f2bddc4a9d1ff108c0d9a5079a11b6ed0 (diff) | |
download | lz4-b636779b0e168c346b42e85af816ce37a8ed9880.zip lz4-b636779b0e168c346b42e85af816ce37a8ed9880.tar.gz lz4-b636779b0e168c346b42e85af816ce37a8ed9880.tar.bz2 |
unified structure model
Diffstat (limited to 'lz4.h')
-rw-r--r-- | lz4.h | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -175,11 +175,19 @@ int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* /* * LZ4_dict_t * information structure to track an LZ4 stream - * set it to zero (memset()) before first use/ + * use LZ4_loadDict() (or set it to zero) to init it before first use. */ typedef struct { unsigned int table[LZ4_DICTSIZE_U32]; } LZ4_dict_t; /* + * LZ4_loadDict + * Use this function to load a static dictionary into LZ4_dict. + * You can load a size of 0 to init an LZ4_dict_t structure + * Return : 1 if OK, 0 if error + */ +int LZ4_loadDict (LZ4_dict_t* LZ4_dict, const char* dictionary, int dictSize); + +/* * LZ4_compress_usingDict * Compress data block 'source', using blocks compressed before to improve compression ratio * Previous data blocks are assumed to still be present at their previous location. @@ -194,21 +202,13 @@ int LZ4_compress_usingDict (LZ4_dict_t* LZ4_dict, const char* source, char* dest int LZ4_compress_limitedOutput_usingDict (LZ4_dict_t* LZ4_dict, const char* source, char* dest, int inputSize, int maxOutputSize); /* - * LZ4_setDictPos - * If previous data blocks cannot be guaranteed to remain at their previous location in memory - * save them into a safe place, and - * use this function to indicate where to find them. - * Return : 1 if OK, 0 if error - */ -int LZ4_setDictPos (LZ4_dict_t* LZ4_dict, const char* dictionary, int dictSize); - -/* - * LZ4_loadDict - * Use this function to load a static dictionary into LZ4_dict. - * It will be used to improve compression of next chained block. + * LZ4_moveDict + * If previous data block cannot be guaranteed to remain at its previous location in memory + * save it into a safe place (char* safeBuffer) + * before calling again LZ4_compress_usingDict() * Return : 1 if OK, 0 if error */ -int LZ4_loadDict (LZ4_dict_t* LZ4_dict, const char* dictionary, int dictSize); +int LZ4_moveDict (LZ4_dict_t* LZ4_dict, char* safeBuffer, int dictSize); /* |