mirror of
https://github.com/lz4/lz4.git
synced 2024-11-24 18:33:50 +08:00
added examples to make all
This commit is contained in:
parent
742f2b683e
commit
2fe3aa9854
3
Makefile
3
Makefile
@ -39,6 +39,7 @@ INCLUDEDIR=$(PREFIX)/include
|
||||
LZ4DIR = lib
|
||||
PRGDIR = programs
|
||||
TESTDIR = tests
|
||||
EXDIR = examples
|
||||
|
||||
|
||||
# Define nul output
|
||||
@ -57,6 +58,7 @@ all:
|
||||
@$(MAKE) -C $(LZ4DIR) $@
|
||||
@$(MAKE) -C $(PRGDIR) $@
|
||||
@$(MAKE) -C $(TESTDIR) $@
|
||||
@$(MAKE) -C $(EXDIR) $@
|
||||
|
||||
lib:
|
||||
@$(MAKE) -C $(LZ4DIR)
|
||||
@ -73,6 +75,7 @@ clean:
|
||||
@$(MAKE) -C $(PRGDIR) $@ > $(VOID)
|
||||
@$(MAKE) -C $(TESTDIR) $@ > $(VOID)
|
||||
@$(MAKE) -C $(LZ4DIR) $@ > $(VOID)
|
||||
@$(MAKE) -C $(EXDIR) $@ > $(VOID)
|
||||
@$(MAKE) -C examples $@ > $(VOID)
|
||||
@$(RM) lz4$(EXT)
|
||||
@echo Cleaning completed
|
||||
|
@ -68,8 +68,9 @@ void test_compress(FILE* outFp, FILE* inpFp)
|
||||
if (0 == inpBytes) break;
|
||||
|
||||
{
|
||||
char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
|
||||
const int cmpBytes = LZ4_compressHC_continue(lz4Stream, inpPtr, cmpBuf, inpBytes);
|
||||
#define CMPBUFSIZE (LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES))
|
||||
char cmpBuf[CMPBUFSIZE];
|
||||
const int cmpBytes = LZ4_compress_HC_continue(lz4Stream, inpPtr, cmpBuf, inpBytes, CMPBUFSIZE);
|
||||
|
||||
if(cmpBytes <= 0) break;
|
||||
write_int32(outFp, cmpBytes);
|
||||
@ -97,7 +98,7 @@ void test_decompress(FILE* outFp, FILE* inpFp)
|
||||
for(;;)
|
||||
{
|
||||
int cmpBytes = 0;
|
||||
char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
|
||||
char cmpBuf[CMPBUFSIZE];
|
||||
|
||||
{
|
||||
const size_t r0 = read_int32(inpFp, &cmpBytes);
|
||||
|
@ -64,8 +64,9 @@ void test_compress(FILE* outFp, FILE* inpFp)
|
||||
if (0 == inpBytes) break;
|
||||
|
||||
{
|
||||
char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
|
||||
const int cmpBytes = LZ4_compress_continue(lz4Stream, inpPtr, cmpBuf, inpBytes);
|
||||
#define CMPBUFSIZE (LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES))
|
||||
char cmpBuf[CMPBUFSIZE];
|
||||
const int cmpBytes = LZ4_compress_fast_continue(lz4Stream, inpPtr, cmpBuf, inpBytes, CMPBUFSIZE, 0);
|
||||
if(cmpBytes <= 0) break;
|
||||
write_int32(outFp, cmpBytes);
|
||||
write_bin(outFp, cmpBuf, cmpBytes);
|
||||
@ -90,7 +91,7 @@ void test_decompress(FILE* outFp, FILE* inpFp)
|
||||
|
||||
for(;;) {
|
||||
int cmpBytes = 0;
|
||||
char cmpBuf[LZ4_COMPRESSBOUND(MESSAGE_MAX_BYTES)];
|
||||
char cmpBuf[CMPBUFSIZE];
|
||||
|
||||
{
|
||||
const size_t r0 = read_int32(inpFp, &cmpBytes);
|
||||
|
Loading…
Reference in New Issue
Block a user