summaryrefslogtreecommitdiffstats
path: root/examples/frameCompress.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2015-06-28 10:34:12 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2015-06-28 10:34:12 (GMT)
commit7273da38babc3ab5b2ca011b46c5e7e2602ca48a (patch)
tree1ccc78018aaeaf6dfb7fadede0221e21fe20b9e5 /examples/frameCompress.c
parent0cc38f9ebc8d4e84a2a3ba33067a134d0ebc36af (diff)
downloadlz4-7273da38babc3ab5b2ca011b46c5e7e2602ca48a.zip
lz4-7273da38babc3ab5b2ca011b46c5e7e2602ca48a.tar.gz
lz4-7273da38babc3ab5b2ca011b46c5e7e2602ca48a.tar.bz2
minor example clarification
Diffstat (limited to 'examples/frameCompress.c')
-rw-r--r--examples/frameCompress.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/examples/frameCompress.c b/examples/frameCompress.c
index 7b13579..b52b042 100644
--- a/examples/frameCompress.c
+++ b/examples/frameCompress.c
@@ -1,3 +1,6 @@
+// LZ4frame API example : compress a file
+// Based on sample code from Zbigniew Jędrzejewski-Szmek
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -10,10 +13,10 @@
#define LZ4_FOOTER_SIZE 4
static const LZ4F_preferences_t lz4_preferences = {
- { 5, 0, 0, 0, 0, { 0, 0 } },
- 0,
- 0,
- { 0, 0, 0, 0 },
+ { LZ4F_max256KB, LZ4F_blockLinked, LZ4F_noContentChecksum, LZ4F_frame, 0, { 0, 0 } },
+ 0, /* compression level */
+ 0, /* autoflush */
+ { 0, 0, 0, 0 }, /* reserved, must be set to 0 */
};
static int compress_file(FILE *in, FILE *out, size_t *size_in, size_t *size_out) {
@@ -155,6 +158,7 @@ static int compress(const char *input, const char *output) {
return r;
}
+
int main(int argc, char **argv) {
if (argc < 2 || argc > 3) {
fprintf(stderr, "Syntax: %s <input> <output>\n", argv[0]);