diff options
author | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2014-03-23 11:15:37 (GMT) |
---|---|---|
committer | yann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd> | 2014-03-23 11:15:37 (GMT) |
commit | 848fdf3c15e6e7c2a24a868ace02dc3180f5275c (patch) | |
tree | d379e2f07c92e4b4cdeeeaf540c35631c384785c /programs | |
parent | a9d8640c1f3898cd47eb1faf22db013e8b9911db (diff) | |
download | lz4-848fdf3c15e6e7c2a24a868ace02dc3180f5275c.zip lz4-848fdf3c15e6e7c2a24a868ace02dc3180f5275c.tar.gz lz4-848fdf3c15e6e7c2a24a868ace02dc3180f5275c.tar.bz2 |
Added : lz4cat utility for posx systems
OS-X compatible dynamic library, thanks to Jan Stepien
corrected : relative symbolic link for versioned library
git-svn-id: https://lz4.googlecode.com/svn/trunk@115 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'programs')
-rw-r--r-- | programs/Makefile | 2 | ||||
-rw-r--r-- | programs/lz4cli.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/programs/Makefile b/programs/Makefile index 868c5fb..54a19cf 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -86,11 +86,13 @@ ifneq (,$(filter $(shell uname),Linux Darwin)) install: lz4 lz4c @install -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/ @install -m 755 lz4 $(DESTDIR)$(BINDIR)/lz4 + @ln -s $(DESTDIR)$(BINDIR)/lz4 $(DESTDIR)$(BINDIR)/lz4cat @install -m 755 lz4c $(DESTDIR)$(BINDIR)/lz4c @install -m 644 lz4.1 $(DESTDIR)$(MANDIR)/lz4.1 @echo lz4 installation completed uninstall: + rm -f $(DESTDIR)$(BINDIR)/lz4cat [ -x $(DESTDIR)$(BINDIR)/lz4 ] && rm -f $(DESTDIR)$(BINDIR)/lz4 [ -x $(DESTDIR)$(BINDIR)/lz4c ] && rm -f $(DESTDIR)$(BINDIR)/lz4c [ -f $(DESTDIR)$(MANDIR)/lz4.1 ] && rm -f $(DESTDIR)$(MANDIR)/lz4.1 diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 26e0111..fc5bd81 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -109,11 +109,12 @@ //**************************** #define COMPRESSOR_NAME "LZ4 Compression CLI" #ifndef LZ4_VERSION -# define LZ4_VERSION "v1.1.3" +# define LZ4_VERSION "v1.1.5" #endif #define AUTHOR "Yann Collet" #define WELCOME_MESSAGE "*** %s %i-bits %s, by %s (%s) ***\n", COMPRESSOR_NAME, (int)(sizeof(void*)*8), LZ4_VERSION, AUTHOR, __DATE__ #define LZ4_EXTENSION ".lz4" +#define LZ4_CAT "lz4cat" #define KB *(1U<<10) #define MB *(1U<<20) @@ -310,6 +311,10 @@ int main(int argc, char** argv) LZ4IO_setOverwrite(0); blockSize = LZ4IO_setBlockSizeID(LZ4_BLOCKSIZEID_DEFAULT); + // lz4cat behavior + if (!strcmp(programName, LZ4_CAT)) { decode=1; forceStdout=1; output_filename=stdoutmark; displayLevel=1; } + + // command switches for(i=1; i<argc; i++) { char* argument = argv[i]; @@ -335,7 +340,7 @@ int main(int argc, char** argv) if ((argument[0]=='c') && (argument[1]=='0')) { cLevel=0; argument++; continue; } // -c0 (fast compression) if ((argument[0]=='c') && (argument[1]=='1')) { cLevel=9; argument++; continue; } // -c1 (high compression) if ((argument[0]=='h') && (argument[1]=='c')) { cLevel=9; argument++; continue; } // -hc (high compression) - if (*argument=='y') { LZ4IO_setOverwrite(1); continue; } // -y (answer 'yes' to overwrite permission) + if (*argument=='y') { LZ4IO_setOverwrite(1); continue; } // -y (answer 'yes' to overwrite permission) if (*argument=='s') { displayLevel=1; continue; } // -s (silent mode) #endif // DISABLE_LZ4C_LEGACY_OPTIONS |