moved zstd.h to /lib
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
v0.7.5
|
v0.7.5
|
||||||
Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers
|
Fixed : premature end of frame when zero-sized raw block, reported by Eric Biggers
|
||||||
|
Modified : minor compression level adaptations
|
||||||
Update : specification, to v0.1.2 : max huffman depth at 11 bits
|
Update : specification, to v0.1.2 : max huffman depth at 11 bits
|
||||||
|
|
||||||
v0.7.4
|
v0.7.4
|
||||||
|
|||||||
+5
-5
@@ -31,9 +31,9 @@
|
|||||||
# ################################################################
|
# ################################################################
|
||||||
|
|
||||||
# Version numbers
|
# Version numbers
|
||||||
LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./common/zstd.h`
|
LIBVER_MAJOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MAJOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
|
||||||
LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./common/zstd.h`
|
LIBVER_MINOR_SCRIPT:=`sed -n '/define ZSTD_VERSION_MINOR/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
|
||||||
LIBVER_PATCH_SCRIPT:=`sed -n '/define ZSTD_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./common/zstd.h`
|
LIBVER_PATCH_SCRIPT:=`sed -n '/define ZSTD_VERSION_RELEASE/s/.*[[:blank:]]\([0-9][0-9]*\).*/\1/p' < ./zstd.h`
|
||||||
LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT)
|
LIBVER_SCRIPT:= $(LIBVER_MAJOR_SCRIPT).$(LIBVER_MINOR_SCRIPT).$(LIBVER_PATCH_SCRIPT)
|
||||||
LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT))
|
LIBVER_MAJOR := $(shell echo $(LIBVER_MAJOR_SCRIPT))
|
||||||
LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
|
LIBVER_MINOR := $(shell echo $(LIBVER_MINOR_SCRIPT))
|
||||||
@@ -46,7 +46,7 @@ PREFIX ?= /usr/local
|
|||||||
LIBDIR ?= $(PREFIX)/lib
|
LIBDIR ?= $(PREFIX)/lib
|
||||||
INCLUDEDIR=$(PREFIX)/include
|
INCLUDEDIR=$(PREFIX)/include
|
||||||
|
|
||||||
CPPFLAGS= -I./common -DXXH_NAMESPACE=ZSTD_
|
CPPFLAGS= -I. -I./common -DXXH_NAMESPACE=ZSTD_
|
||||||
CFLAGS ?= -O3
|
CFLAGS ?= -O3
|
||||||
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
|
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
|
||||||
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)
|
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)
|
||||||
@@ -117,7 +117,7 @@ install: libzstd libzstd.pc
|
|||||||
@cp -a libzstd.$(SHARED_EXT) $(DESTDIR)$(LIBDIR)
|
@cp -a libzstd.$(SHARED_EXT) $(DESTDIR)$(LIBDIR)
|
||||||
@cp -a libzstd.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
|
@cp -a libzstd.pc $(DESTDIR)$(LIBDIR)/pkgconfig/
|
||||||
@install -m 644 libzstd.a $(DESTDIR)$(LIBDIR)/libzstd.a
|
@install -m 644 libzstd.a $(DESTDIR)$(LIBDIR)/libzstd.a
|
||||||
@install -m 644 common/zstd.h $(DESTDIR)$(INCLUDEDIR)/zstd.h
|
@install -m 644 zstd.h $(DESTDIR)$(INCLUDEDIR)/zstd.h
|
||||||
@install -m 644 common/zbuff.h $(DESTDIR)$(INCLUDEDIR)/zbuff.h
|
@install -m 644 common/zbuff.h $(DESTDIR)$(INCLUDEDIR)/zbuff.h
|
||||||
@install -m 644 dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)/zdict.h
|
@install -m 644 dictBuilder/zdict.h $(DESTDIR)$(INCLUDEDIR)/zdict.h
|
||||||
@echo zstd static and shared library installed
|
@echo zstd static and shared library installed
|
||||||
|
|||||||
+35
-46
@@ -1,62 +1,51 @@
|
|||||||
zstd - library files
|
zstd - library files
|
||||||
================================
|
================================
|
||||||
|
|
||||||
The __lib__ directory contains several files, but depending on target use case, some of them may not be necessary.
|
The __lib__ directory contains several directories.
|
||||||
|
Depending on target use case, it's enough to include only files from relevant directories.
|
||||||
#### Minimal library files
|
|
||||||
|
|
||||||
To build the zstd library the following files are required:
|
|
||||||
|
|
||||||
- [common/bitstream.h](common/bitstream.h)
|
|
||||||
- [common/error_private.h](common/error_private.h)
|
|
||||||
- [common/error_public.h](common/error_public.h)
|
|
||||||
- common/fse.h
|
|
||||||
- common/fse_decompress.c
|
|
||||||
- common/huf.h
|
|
||||||
- [common/mem.h](common/mem.h)
|
|
||||||
- [common/zstd.h]
|
|
||||||
- common/zstd_internal.h
|
|
||||||
- compress/fse_compress.c
|
|
||||||
- compress/huf_compress.c
|
|
||||||
- compress/zstd_compress.c
|
|
||||||
- compress/zstd_opt.h
|
|
||||||
- decompress/huf_decompress.c
|
|
||||||
- decompress/zstd_decompress.c
|
|
||||||
|
|
||||||
Stable API is exposed in [common/zstd.h].
|
|
||||||
Advanced and experimental API can be enabled by defining `ZSTD_STATIC_LINKING_ONLY`.
|
|
||||||
Never use them with a dynamic library, as their definition may change in future versions.
|
|
||||||
|
|
||||||
[common/zstd.h]: common/zstd.h
|
|
||||||
|
|
||||||
|
|
||||||
#### Separate compressor and decompressor
|
#### API
|
||||||
|
|
||||||
To build a separate zstd compressor all files from `common/` and `compressor/` directories are required.
|
Zstandard's stable API is exposed within [zstd.h](zstd.h),
|
||||||
In a similar way to build a separate zstd decompressor all files from `common/` and `decompressor/` directories are needed.
|
at the root of `lib` directory.
|
||||||
|
|
||||||
|
|
||||||
#### Buffered streaming
|
#### Advanced API
|
||||||
|
|
||||||
This complementary API makes streaming integration easier.
|
Some additional API may be useful if you're looking into advanced features :
|
||||||
It is used by `zstd` command line utility, and [7zip plugin](http://mcmilk.de/projects/7-Zip-ZStd) :
|
- common/error_public.h : transform function result into an `enum`,
|
||||||
|
for precise error handling.
|
||||||
- common/zbuff.h
|
- ZSTD_STATIC_LINKING_ONLY : if you define this macro _before_ including `zstd.h`,
|
||||||
- compress/zbuff_compress.c
|
it will give access to advanced and experimental API.
|
||||||
- decompress/zbuff_decompress.c
|
These APIs shall ___never be used with dynamic library___ !
|
||||||
|
They are not "stable", their definition may change in the future.
|
||||||
|
Only static linking is allowed.
|
||||||
|
|
||||||
|
|
||||||
#### Dictionary builder
|
#### Modular build
|
||||||
|
|
||||||
In order to create dictionaries from some training sets,
|
Directory `common/` is required in all circumstances.
|
||||||
it's needed to include all files from [dictBuilder directory](dictBuilder/)
|
You can select to support compression only, by just adding files from the `compress/` directory,
|
||||||
|
In a similar way, you can build a decompressor-only library with the `decompress/` directory.
|
||||||
|
|
||||||
|
Other optional functionalities provided are :
|
||||||
|
|
||||||
|
- `dictBuilder/` : this directory contains source files required to create dictionaries.
|
||||||
|
The API can be consulted in `dictBuilder/zdict.h`.
|
||||||
|
It also depends on `common/` and `compress/` .
|
||||||
|
|
||||||
|
- `legacy/` : this directory contains source code to decompress previous versions of Zstd,
|
||||||
|
starting from `v0.1`. The main API can be consulted in `legacy/zstd_legacy.h`.
|
||||||
|
Note that it's required to compile the library with `ZSTD_LEGACY_SUPPORT = 1` .
|
||||||
|
Advanced API from each version can be found in its relevant header file.
|
||||||
|
For example, advanced API for version `v0.4` is in `zstd_v04.h` .
|
||||||
|
It also depends on `common/` and `decompress/` .
|
||||||
|
|
||||||
|
|
||||||
#### Legacy support
|
#### Streaming API
|
||||||
|
|
||||||
Zstandard can decode previous formats, starting from v0.1.
|
Streaming is currently provided by `common/zbuff.h`.
|
||||||
Support for these format is provided in [folder legacy](legacy/).
|
|
||||||
It's also required to compile the library with `ZSTD_LEGACY_SUPPORT = 1`.
|
|
||||||
|
|
||||||
|
|
||||||
#### Miscellaneous
|
#### Miscellaneous
|
||||||
@@ -64,5 +53,5 @@ It's also required to compile the library with `ZSTD_LEGACY_SUPPORT = 1`.
|
|||||||
The other files are not source code. There are :
|
The other files are not source code. There are :
|
||||||
|
|
||||||
- LICENSE : contains the BSD license text
|
- LICENSE : contains the BSD license text
|
||||||
- Makefile : script to compile or install zstd library (static or dynamic)
|
- Makefile : script to compile or install zstd library (static and dynamic)
|
||||||
- libzstd.pc.in : for pkg-config (make install)
|
- libzstd.pc.in : for pkg-config (`make install`)
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@ MANDIR = $(PREFIX)/share/man/man1
|
|||||||
|
|
||||||
ZSTDDIR = ../lib
|
ZSTDDIR = ../lib
|
||||||
|
|
||||||
CPPFLAGS= -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -DXXH_NAMESPACE=ZSTD_
|
CPPFLAGS= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -DXXH_NAMESPACE=ZSTD_
|
||||||
CFLAGS ?= -O3 # -falign-loops=32 # not always beneficial
|
CFLAGS ?= -O3 # -falign-loops=32 # not always beneficial
|
||||||
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
|
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef
|
||||||
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)
|
FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(MOREFLAGS)
|
||||||
|
|||||||
Reference in New Issue
Block a user