summaryrefslogtreecommitdiffstats
path: root/lz4.h
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-06-02 06:07:19 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-06-02 06:07:19 (GMT)
commitb636779b0e168c346b42e85af816ce37a8ed9880 (patch)
tree03c4d8882c25162102c6df6e46b238a5864ed77b /lz4.h
parent302e7e2f2bddc4a9d1ff108c0d9a5079a11b6ed0 (diff)
downloadlz4-b636779b0e168c346b42e85af816ce37a8ed9880.zip
lz4-b636779b0e168c346b42e85af816ce37a8ed9880.tar.gz
lz4-b636779b0e168c346b42e85af816ce37a8ed9880.tar.bz2
unified structure model
Diffstat (limited to 'lz4.h')
-rw-r--r--lz4.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/lz4.h b/lz4.h
index b18599f..8a7db0c 100644
--- a/lz4.h
+++ b/lz4.h
@@ -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);
/*