diff --git a/CHANGES.md b/CHANGES.md index 46979c4..e4ac0b1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ +v0.7 +- add snappy (c version) +- update versions: zstd 1.4.5, lz4 1.9.2 +- add github workflow actions + v0.6 - update versions: zstd 1.3.8, lz4 1.8.3, brotli 1.0.7 @@ -6,15 +11,16 @@ v0.5 - use correct lizard version (v1.0) v0.4 -- added brotli, added lizard (was lz5 v2.0) +- add brotli +- add lizard (was lz5 v2.0) - add man pages for the sample programs -- merged the target platforms unix and windows to "programs" -- changed options, the tools are like bzip2 or gzip now +- merge the target platforms unix and windows to "programs" +- change options, the tools are like bzip2 or gzip now - use BSD 2-Clause license for everything v0.3 - update to zstd 1.1.3 and lz4 1.7.5 -- changed options, -T is used for the thread count now (like zstdmt of Yann) +- change options, -T is used for the thread count now (like zstdmt of Yann) v0.2 - update to zstd 1.1.2, lz4 1.7.4, lz5 1.5 diff --git a/LICENSE b/LICENSE index da52765..edaebc3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD License -Copyright (c) 2016 - 2017, Tino Reichardt, All rights reserved. +Copyright (c) 2016 - 2020, Tino Reichardt, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 6c2c670..1407fc6 100644 --- a/README.md +++ b/README.md @@ -57,4 +57,4 @@ size | value | description [Snappy-c]:https://github.com/andikleen/snappy-c -/TR 2017-05-24 +/TR 2020-06-08 diff --git a/man/generate-man b/man/generate-man index 2ac5d45..c7894dd 100755 --- a/man/generate-man +++ b/man/generate-man @@ -1,8 +1,8 @@ #!/bin/sh -# /TR 2017-05-22 +# /TR 2020-06-08 # lib version -ZSTDMT="v0.4" +ZSTDMT="v0.7" function generate() { PROGNAME="$1" @@ -14,16 +14,56 @@ function generate() { SUFFIX="$7" HOMEPAGE="$8" + if [ $LMAX == 0 ]; then + LEVELNUMBERS="" + else + LEVELNUMBERS="1234567890" + fi + + if [ $ALGORITHM == "lizard" ]; then + LEVELNOTES=`printf "%q" " +.TP +.BI -10..-19 +fastLZ4: designed to give better decompression speed than LZ4 i.e. over 2000 MB/s +.TP +.BI -20..-29 +LIZv1: designed to give better ratio than LZ4 keeping 75% decompression speed +.TP +.BI -30..-39 +fastLZ4 + Huffman: Huffman coding to fastLZ4 +.TP +.BI -40..-49 +LIZv1 + Huffman: give the best ratio at decompression speed of 1000 MB/s +.br +The default is -3"` + LEVELNOTES=${LEVELNOTES:2:-1} + elif [ $ALGORITHM == "snappy" ]; then + LEVELNOTES="" + else + LEVELNOTES=`printf "%q" " +.TP +.BI -$LMIN..$LMAX +Use the compression method with a level -$LMIN to -$LMAX. +.br +Compression level -$LMIN is the fastest, but provides a poorer level +of compression. +.br +Compression level -$LMAX provides the best level of compression, but is +also the slowest. +.br +The default is -$LDEF"` + LEVELNOTES=${LEVELNOTES:2:-1} + fi + cat generic.man | sed \ -e "s|%PROGNAME%|$PROGNAME|g" \ -e "s|%ALGORITHM%|$ALGORITHM|g" \ - -e "s|%LMIN%|$LMIN|g" \ - -e "s|%LMAX%|$LMAX|g" \ - -e "s|%LDEF%|$LDEF|g" \ -e "s|%VERSION%|$VERSION|g" \ -e "s|%SUFFIX%|$SUFFIX|g" \ -e "s|%HOMEPAGE%|$HOMEPAGE|g" \ -e "s|%ZSTDMT%|$ZSTDMT|g" \ + -e "s|%LEVELNUMBERS%|$LEVELNUMBERS|g" \ + -e "s|%LEVELNOTES%|$LEVELNOTES|g" \ > "$PROGNAME.1" } @@ -33,3 +73,4 @@ generate "lizard-mt" "lizard" 10 49 3 "v2.0" "liz" "https://github.com/ generate "lz4-mt" "lz4" 1 12 3 "v1.8.3" "lz4" "https://github.com/lz4/lz4" generate "lz5-mt" "lz5" 1 15 3 "v1.5" "lz5" "https://github.com/inikep/lz5" generate "zstd-mt" "zstd" 1 22 3 "v1.3.7" "zst" "https://github.com/facebook/zstd" +generate "snappy-mt" "snappy" 0 0 0 "v0.0.0" "snp" "https://github.com/andikleen/snappy-c" diff --git a/man/generic.man b/man/generic.man index e629047..a6fa9d6 100644 --- a/man/generic.man +++ b/man/generic.man @@ -11,7 +11,7 @@ .SH SYNOPSIS .B %PROGNAME% -.RB [ -1234567890cdzfhklLqrtvV ] +.RB [ -%LEVELNUMBERS%cdzfhklLqrtvV ] .RB [ "-S \fIsuffix\fP" ] .RB [ "\fIfile\fP ..." ] @@ -25,18 +25,7 @@ It's based on the zstdmt library version %ZSTDMT% and version %VERSION% of the % More information about %ALGORITHM% can be found here: %HOMEPAGE% .SH OPTIONS - -.TP -.BI -%LMIN%..%LMAX% -Use the compression method with a level -%LMIN% to -%LMAX%. -.br -Compression level -%LMIN% is the fastest, but provides a poorer level -of compression. -.br -Compression level -%LMAX% provides the best level of compression, but is -also the slowest. -.br -The default is -%LDEF%. +%LEVELNOTES% .TP .BI -c @@ -162,7 +151,7 @@ cat somefile.%SUFFIX% | %PROGNAME% -d > somefile Please report any bugs to https://github.com/mcmilk/zstdmt/issues .SH AUTHOR -This manual page was written by Tino Reichardt +Tino Reichardt .SH "SEE ALSO" .BR bzip2 (1), diff --git a/programs/Makefile b/programs/Makefile index 39a2f0a..b8d9736 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -6,7 +6,7 @@ # current versions we're using (tagged in their main repo) BRO_VER = "v1.0.7" LIZ_VER = "v1.0" -LZ4_VER = "v1.8.3" +LZ4_VER = "v1.9.2" LZ5_VER = "v1.5" ZSTD_VER= "v1.4.5" SNAP_VER= "v0.0.0" @@ -24,8 +24,8 @@ LN = ln -sf CC = $(CROSS)gcc RANLIB = $(CROSS)ranlib STRIP = $(CROSS)strip -#SFLAGS = -R .note -R .comment -SFLAGS = #-R .note .comment +SFLAGS = -R .note -R .comment +#SFLAGS = -R .note .comment CFLAGS = -W -pthread -Wall -pipe CFLAGS += -fomit-frame-pointer @@ -41,7 +41,7 @@ PRGS = lizard-mt$(EXTENSION) \ lz5-mt$(EXTENSION) \ brotli-mt$(EXTENSION) \ zstd-mt$(EXTENSION) \ - snappy-c-mt$(EXTENSION) + snappy-mt$(EXTENSION) all: loadsource $(PRGS) again: clean $(PRGS) @@ -147,7 +147,7 @@ CF_ZSTD = $(CFLAGS) -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/compress \ -I$(ZSTDDIR)/decompress -I$(ZSTDDIR)/legacy # snappy-c, https://github.com/andikleen/snappy-c -SNAPDIR = snappy-c +SNAPDIR = snappy LIBSNAP += $(SNAPDIR)/snappy.c CF_SNAP = $(CFLAGS) -I$(SNAPDIR) @@ -184,25 +184,24 @@ zstd-mt$(EXTENSION): $(LN) $@ un$@ $(LN) $@ zstdcat-mt -snappy-c-mt$(EXTENSION): +snappy-mt$(EXTENSION): $(CC) $(CF_SNAP) -DVERSION='$(SNAP_VER)' -o $@ $(LIBSNAP) $(LDFLAGS) $(STRIP) $(SFLAGS) $@ $(LN) $@ un$@ - $(LN) $@ snappy-ccat-mt + $(LN) $@ snappycat-mt loadsource: - test -d lz4 || git clone https://github.com/Cyan4973/lz4 -b $(LZ4_VER) --depth=1 lz4 - test -d lz5 || git clone https://github.com/inikep/lz5 -b $(LZ5_VER) --depth=1 lz5 - test -d zstd || git clone https://github.com/facebook/zstd -b $(ZSTD_VER) --depth=1 zstd - test -d lizard || git clone https://github.com/inikep/lizard -b $(LIZ_VER) --depth=1 lizard - test -d brotli || git clone https://github.com/google/brotli -b $(BRO_VER) --depth=1 brotli - test -d snappy-c || git clone https://github.com/andikleen/snappy-c --depth=1 snappy-c - # cd snappy && cmake CMakeLists.txt && cd .. + test -d lz4 || git clone https://github.com/Cyan4973/lz4 -b $(LZ4_VER) --depth=1 lz4 + test -d lz5 || git clone https://github.com/inikep/lz5 -b $(LZ5_VER) --depth=1 lz5 + test -d zstd || git clone https://github.com/facebook/zstd -b $(ZSTD_VER) --depth=1 zstd + test -d lizard || git clone https://github.com/inikep/lizard -b $(LIZ_VER) --depth=1 lizard + test -d brotli || git clone https://github.com/google/brotli -b $(BRO_VER) --depth=1 brotli + test -d snappy || git clone https://github.com/andikleen/snappy-c --depth=1 snappy # tests are unix / linux only tests: @dd if=/dev/urandom of=testbytes.raw bs=1M count=10 2>/dev/null - @for m in brotli lizard lz4 lz5 zstd snappy-c ; do \ + @for m in brotli lizard lz4 lz5 zstd snappy ; do \ cat testbytes.raw | ./$$m-mt -z > compressed.$$m ; \ cat compressed.$$m | ./$$m-mt -d > testbytes-$$m.raw ; \ cmp testbytes.raw testbytes-$$m.raw && echo "SUCCESS: $$m" || echo "FAILING: $$m" ; \ @@ -215,8 +214,8 @@ install: clean: rm -f $(PRGS) - rm -f unbrotli-mt unlizard-mt unlz4-mt unlz5-mt unzstd-mt unsnappy-c-mt - rm -f brotlicat-mt lizardcat-mt lz4cat-mt lz5cat-mt zstdcat-mt snappy-ccat-mt + rm -f unbrotli-mt unlizard-mt unlz4-mt unlz5-mt unzstd-mt unsnappy-mt + rm -f brotlicat-mt lizardcat-mt lz4cat-mt lz5cat-mt zstdcat-mt snappycat-mt mrproper: clean - rm -rf brotli lizard lz4 lz5 zstd snappy-c + rm -rf brotli lizard lz4 lz5 zstd snappy diff --git a/programs/main.c b/programs/main.c index 560ff83..60b85fd 100644 --- a/programs/main.c +++ b/programs/main.c @@ -1,6 +1,6 @@ /** - * Copyright (c) 2017 Tino Reichardt + * Copyright (c) 2017 - 2020 Tino Reichardt * All rights reserved. * * This source code is licensed under the BSD-style license found in the @@ -81,8 +81,8 @@ static void panic(const char *msg) static void version(void) { - printf("%s version %s, zstdmt v0.4\n" - "\nCopyright (c) 2016 - 2017 Tino Reichardt" "\n" + printf("%s version %s, zstdmt v0.7\n" + "\nCopyright (c) 2016 - 2020 Tino Reichardt" "\n" "\n", progname, VERSION); exit(0); } @@ -90,7 +90,7 @@ static void version(void) static void license(void) { printf("\n %s version %s\n" - "\n Copyright (c) 2016 - 2017 Tino Reichardt" + "\n Copyright (c) 2016 - 2020 Tino Reichardt" "\n " "\n Redistribution and use in source and binary forms, with or without modification," "\n are permitted provided that the following conditions are met:"