-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
split up into library and windows / unix test tools
- pre compiled windows binaries for testing will be uploaded - no real code change, just movements of files gelöscht: Makefile geändert: README.md neue Datei: lib/README.md umbenannt: list.h -> lib/list.h umbenannt: lz4mt.h -> lib/lz4mt.h umbenannt: lz4mt_common.c -> lib/lz4mt_common.c umbenannt: lz4mt_compress.c -> lib/lz4mt_compress.c umbenannt: lz4mt_decompress.c -> lib/lz4mt_decompress.c umbenannt: lz5mt.h -> lib/lz5mt.h umbenannt: lz5mt_common.c -> lib/lz5mt_common.c umbenannt: lz5mt_compress.c -> lib/lz5mt_compress.c umbenannt: lz5mt_decompress.c -> lib/lz5mt_decompress.c umbenannt: mem.h -> lib/mem.h umbenannt: threading.c -> lib/threading.c umbenannt: threading.h -> lib/threading.h umbenannt: zstdmt.h -> lib/zstdmt.h umbenannt: zstdmt_common.c -> lib/zstdmt_common.c umbenannt: zstdmt_compress.c -> lib/zstdmt_compress.c umbenannt: zstdmt_decompress.c -> lib/zstdmt_decompress.c geändert: multistream/README.md neue Datei: unix/Makefile neue Datei: unix/README.md umbenannt: lz4mt.c -> unix/lz4mt.c umbenannt: lz5mt.c -> unix/lz5mt.c umbenannt: util.c -> unix/util.c umbenannt: util.h -> unix/util.h umbenannt: zstdmt.c -> unix/zstdmt.c neue Datei: windows/Makefile neue Datei: windows/README.md neue Datei: windows/README.mdc neue Datei: windows/lz4mt.c neue Datei: windows/lz5mt.c neue Datei: windows/zstdmt.c
- Loading branch information
Showing
33 changed files
with
1,387 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
# Multithreading Library for [LZ4], [LZ5] and [ZStandard] | ||
|
||
|
||
### Compression | ||
``` | ||
typedef struct { | ||
void *buf; /* ptr to data */ | ||
size_t size; /* current filled in buf */ | ||
size_t allocated; /* length of buf */ | ||
} LZ4MT_Buffer; | ||
/** | ||
* reading and writing functions | ||
* - you can use stdio functions or plain read/write ... | ||
* - a sample is given in 7-Zip ZS or lz4mt.c | ||
*/ | ||
typedef int (fn_read) (void *args, LZ4MT_Buffer * in); | ||
typedef int (fn_write) (void *args, LZ4MT_Buffer * out); | ||
typedef struct { | ||
fn_read *fn_read; | ||
void *arg_read; | ||
fn_write *fn_write; | ||
void *arg_write; | ||
} LZ4MT_RdWr_t; | ||
typedef struct LZ4MT_CCtx_s LZ4MT_CCtx; | ||
/* 1) allocate new cctx */ | ||
LZ4MT_CCtx *LZ4MT_createCCtx(int threads, int level, int inputsize); | ||
/* 2) threaded compression */ | ||
size_t LZ4MT_CompressCCtx(LZ4MT_CCtx * ctx, LZ4MT_RdWr_t * rdwr); | ||
/* 3) get some statistic */ | ||
size_t LZ4MT_GetFramesCCtx(LZ4MT_CCtx * ctx); | ||
size_t LZ4MT_GetInsizeCCtx(LZ4MT_CCtx * ctx); | ||
size_t LZ4MT_GetOutsizeCCtx(LZ4MT_CCtx * ctx); | ||
/* 4) free cctx */ | ||
void LZ4MT_freeCCtx(LZ4MT_CCtx * ctx); | ||
``` | ||
|
||
### Decompression | ||
``` | ||
typedef struct LZ4MT_DCtx_s LZ4MT_DCtx; | ||
/* 1) allocate new cctx */ | ||
LZ4MT_DCtx *LZ4MT_createDCtx(int threads, int inputsize); | ||
/* 2) threaded compression */ | ||
size_t LZ4MT_DecompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr); | ||
/* 3) get some statistic */ | ||
size_t LZ4MT_GetFramesDCtx(LZ4MT_DCtx * ctx); | ||
size_t LZ4MT_GetInsizeDCtx(LZ4MT_DCtx * ctx); | ||
size_t LZ4MT_GetOutsizeDCtx(LZ4MT_DCtx * ctx); | ||
/* 4) free cctx */ | ||
void LZ4MT_freeDCtx(LZ4MT_DCtx * ctx); | ||
``` | ||
|
||
## Todo | ||
|
||
- add Makefile |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
CC = gcc | ||
STRIP = strip | ||
#CC = clang | ||
|
||
CFLAGS = -W -pthread -Wall -pipe | ||
CFLAGS += -fomit-frame-pointer | ||
CFLAGS += -I ../lib | ||
LDFLAGS = -lpthread | ||
# -static | ||
|
||
#CFLAGS += -DDEBUGME | ||
#CFLAGS += -g | ||
CFLAGS += -O3 | ||
#CFLAGS += -march=native | ||
#CFLAGS += -Wno-unused-but-set-variable | ||
#CFLAGS += -Wno-unused-variable | ||
#CFLAGS += -Wno-unused-function | ||
|
||
PRGS = zstdmt lz4mt lz5mt | ||
|
||
COMMON = util.c | ||
LIBLZ4 = ../lib/threading.c ../lib/lz4mt_common.c ../lib/lz4mt_compress.c ../lib/lz4mt_decompress.c | ||
LIBLZ5 = ../lib/threading.c ../lib/lz5mt_common.c ../lib/lz5mt_compress.c ../lib/lz5mt_decompress.c | ||
LIBZSTD = ../lib/threading.c ../lib/zstdmt_common.c ../lib/zstdmt_compress.c ../lib/zstdmt_decompress.c | ||
|
||
all: $(PRGS) | ||
again: clean $(PRGS) | ||
|
||
lz4mt: | ||
$(CC) $(CFLAGS) $(LDFLAGS) -llz4 -o $@ lz4mt.c $(LIBLZ4) $(COMMON) | ||
$(STRIP) $@ | ||
|
||
lz5mt: | ||
$(CC) $(CFLAGS) $(LDFLAGS) -llz5 -o $@ lz5mt.c $(LIBLZ5) $(COMMON) | ||
$(STRIP) $@ | ||
|
||
zstdmt: | ||
$(CC) $(CFLAGS) $(LDFLAGS) -lzstd -o $@ zstdmt.c $(LIBZSTD) $(COMMON) | ||
$(STRIP) $@ | ||
|
||
clean: | ||
rm -rf $(PRGS) | ||
|
||
.c.c: | ||
$(CC) $(CFLAGS) -c $< -o $@ |
Oops, something went wrong.