diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2508b25f..75eaa114 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -10,24 +10,29 @@ jobs:
- uses: actions/checkout@v2
- name: makeInit
run: |
- make LZMA=0 ZSTD=0 MD5=0 -j
+ make LDEF=0 LZMA=0 ZSTD=0 MD5=0 -j
make clean
- - name: makeUnDef
+ - name: makeNoAll
run: |
git clone --depth=1 https://github.com/sisong/libmd5.git ../libmd5
git clone --depth=1 https://github.com/sisong/lzma.git ../lzma
git clone --depth=1 https://github.com/sisong/zstd.git ../zstd
- make DIR_DIFF=0 MT=0 BSD=0 VCD=0 ZLIB=0 BZIP2=0 -j
+ make DIR_DIFF=0 MT=0 BSD=0 VCD=0 ZLIB=0 LDEF=0 BZIP2=0 -j
+ make clean
+ - name: makeNoldef
+ run: |
+ make LDEF=0 -j
make clean
- name: makeAll
run: |
+ git clone --depth=1 https://github.com/sisong/zlib.git ../zlib
+ git clone --depth=1 https://github.com/sisong/libdeflate.git ../libdeflate
make -j
make clean
- - name: makeByCode
+ - name: makeByBz2Code
run: |
- git clone --depth=1 https://github.com/sisong/zlib.git ../zlib
git clone --depth=1 https://github.com/sisong/bzip2.git ../bzip2
- make ZLIB=1 BZIP2=1 -j
+ make BZIP2=1 -j
clang-build:
runs-on: ubuntu-latest
@@ -41,6 +46,8 @@ jobs:
git clone --depth=1 https://github.com/sisong/libmd5.git ../libmd5
git clone --depth=1 https://github.com/sisong/lzma.git ../lzma
git clone --depth=1 https://github.com/sisong/zstd.git ../zstd
+ git clone --depth=1 https://github.com/sisong/zlib.git ../zlib
+ git clone --depth=1 https://github.com/sisong/libdeflate.git ../libdeflate
- name: makeByClang
run: |
make CL=1 -j
@@ -54,6 +61,8 @@ jobs:
git clone --depth=1 https://github.com/sisong/libmd5.git ../libmd5
git clone --depth=1 https://github.com/sisong/lzma.git ../lzma
git clone --depth=1 https://github.com/sisong/zstd.git ../zstd
+ git clone --depth=1 https://github.com/sisong/zlib.git ../zlib
+ git clone --depth=1 https://github.com/sisong/libdeflate.git ../libdeflate
- name: buildByXcode
run: |
xcodebuild -workspace builds/xcode/HDiffPatch.xcworkspace -scheme hdiffz -configuration Release OBJROOT=$PWD/bin SYMROOT=$PWD/bin
@@ -72,7 +81,7 @@ jobs:
git clone --depth=1 https://github.com/sisong/lzma.git ../lzma
git clone --depth=1 https://github.com/sisong/zstd.git ../zstd
cd ./builds/android_ndk_jni_mk
- ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk APP_PLATFORM=android-16 APP_ABI=all
+ ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=./Application.mk APP_PLATFORM=android-16 APP_ABI=all
windows-ndk-build:
runs-on: windows-latest
@@ -87,7 +96,7 @@ jobs:
git clone --depth=1 https://github.com/sisong/zstd.git ../zstd
git clone --depth=1 https://github.com/sisong/bzip2.git ../bzip2
cd ./builds/android_ndk_jni_mk
- ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk BSD=1 BZIP2=1
+ ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=./Application.mk BSD=1 BZIP2=1
ubuntu-ndk-build:
runs-on: ubuntu-latest
@@ -103,7 +112,7 @@ jobs:
git clone --depth=1 https://github.com/sisong/bzip2.git ../bzip2
git clone --depth=1 https://github.com/sisong/zstd.git ../zstd
cd ./builds/android_ndk_jni_mk
- ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk BSD=1 BZIP2=1 VCD=1
+ ndk-build NDK_PROJECT_PATH=. NDK_APPLICATION_MK=./Application.mk BSD=1 BZIP2=1 VCD=1
vc-build:
runs-on: windows-latest
@@ -114,11 +123,12 @@ jobs:
msbuild-architecture: x64
- name: initAndClone
run: |
- git clone --depth=1 https://github.com/sisong/zlib.git ../zlib
- git clone --depth=1 https://github.com/sisong/bzip2.git ../bzip2
git clone --depth=1 https://github.com/sisong/libmd5.git ../libmd5
git clone --depth=1 https://github.com/sisong/lzma.git ../lzma
git clone --depth=1 https://github.com/sisong/zstd.git ../zstd
+ git clone --depth=1 https://github.com/sisong/bzip2.git ../bzip2
+ git clone --depth=1 https://github.com/sisong/zlib.git ../zlib
+ git clone --depth=1 https://github.com/sisong/libdeflate.git ../libdeflate
- name: buildByVC
run: |
msbuild builds/vc/HDiffPatch.sln -t:rebuild -verbosity:diag -property:Configuration=Release
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3cc6a4c9..0ceeb964 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@
full changelog at: https://github.com/sisong/HDiffPatch/commits
+## [v4.8.0](https://github.com/sisong/HDiffPatch/tree/v4.8.0) - 2024-07-26
+### Added
+* cmdline hdiffz support option "-c-ldef-{1..12}"; used libdeflate compressor, compatible with -c-zlib, faster or better than zlib;
+ (hpatchz now default closed libdeflate decompressor)
+* add plugin ldefCompressPlugin, pldefCompressPlugin, ldefDecompressPlugin;
+### Changed
+* released Android libhpatchz.so support Android 15 with 16KB page size;
+
## [v4.7.0](https://github.com/sisong/HDiffPatch/tree/v4.7.0) - 2024-07-12
### Added
* cmdline hdiffz support option "-BSD -SD", to create diffFile compatible with another BSDIFF format "ENDSLEY/BSDIFF43", https://github.com/mendsley/bsdiff ; patch support this format from v4.6.7
@@ -54,7 +62,7 @@ if diffFile created by empty oldPath, then extract with default option `$selfExt
## [v4.3.0](https://github.com/sisong/HDiffPatch/tree/v4.3.0) - 2022-09-23
### Changed
-* recode some patch error code: decompresser errors, file error, disk space full error, jni error
+* recode some patch error code: decompressor errors, file error, disk space full error, jni error
## [v4.2.0](https://github.com/sisong/HDiffPatch/tree/v4.2.0) - 2022-05-15
### Added
diff --git a/Makefile b/Makefile
index be7128b9..42dc21c2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,22 @@
# args
DIR_DIFF := 1
MT := 1
+# used libdeflate?
+LDEF := 1
# 0: not need zlib; 1: compile zlib source code; 2: used -lz to link zlib lib;
-ZLIB := 2
+ifeq ($(LDEF),0)
+ ZLIB := 2
+else
+ ZLIB := 1
+endif
# 0: not need lzma; 1: compile lzma source code; 2: used -llzma to link lzma lib;
LZMA := 1
+# lzma decompressor used arm64 asm optimize?
ARM64ASM := 0
-RISCV32 := 0
+# lzma only can used software CRC? (no hardware CRC)
+USE_CRC_EMU := 0
+# supported atomic uint64?
+ATOMIC_U64 := 1
# 0: not need zstd; 1: compile zstd source code; 2: used -lzstd to link zstd lib;
ZSTD := 1
MD5 := 1
@@ -17,9 +27,9 @@ CL := 0
M32 := 0
# build for out min size
MINS := 0
-# support VCDIFF?
+# need support VCDIFF?
VCD := 1
-# support bsdiff&bspatch?
+# need support bsdiff&bspatch?
BSD := 1
ifeq ($(OS),Windows_NT) # mingw?
CC := gcc
@@ -28,10 +38,21 @@ else
# 0: not need bzip2 (must BSD=0); 1: compile bzip2 source code; 2: used -lbz2 to link bzip2 lib;
BZIP2 := 2
endif
-ifeq ($(BZIP2),0)
- ifeq ($(BSD),0)
+ifeq ($(BSD),0)
+else
+ ifeq ($(BZIP2),0)
+ $(error error: support bsdiff need BZIP2! set BSD=0 or BZIP2>0 continue)
+ endif
+endif
+
+ifeq ($(LDEF),0)
+else
+ ifeq ($(ZLIB),2)
+ $(error error: now libdeflate decompressor not support -lz! need zlib source code, set ZLIB=1 continue)
else
- $(error error: support bsdiff need BZIP2! set BSD=0 continue)
+ ifeq ($(ZLIB),0)
+ $(warning warning: libdeflate can't support all of the deflate code, when no zlib source code)
+ endif
endif
endif
@@ -159,7 +180,7 @@ ifeq ($(BZIP2),1) # http://www.bzip.org https://github.com/sisong/bzip2
endif
ZLIB_PATH := ../zlib
-ifeq ($(ZLIB),1) # http://zlib.net https://github.com/sisong/zlib
+ifeq ($(ZLIB),1) # https://github.com/sisong/zlib/tree/bit_pos_padding
HPATCH_OBJ += $(ZLIB_PATH)/adler32.o \
$(ZLIB_PATH)/crc32.o \
$(ZLIB_PATH)/inffast.o \
@@ -170,6 +191,14 @@ ifeq ($(ZLIB),1) # http://zlib.net https://github.com/sisong/zlib
HDIFF_OBJ += $(ZLIB_PATH)/deflate.o
endif
+LDEF_PATH := ../libdeflate
+ifeq ($(LDEF),1) # https://github.com/sisong/libdeflate/tree/stream-mt
+ HPATCH_OBJ += $(LDEF_PATH)/lib/deflate_decompress.o\
+ $(LDEF_PATH)/lib/utils.o \
+ $(LDEF_PATH)/lib/x86/cpu_features.o
+ HDIFF_OBJ += $(LDEF_PATH)/lib/deflate_compress.o
+endif
+
HDIFF_OBJ += \
hdiffz_import_patch.o \
libHDiffPatch/HPatchLite/hpatch_lite.o \
@@ -213,8 +242,7 @@ DEF_FLAGS := \
-D_IS_NEED_DEFAULT_CompressPlugin=0 \
-D_IS_NEED_ALL_ChecksumPlugin=0 \
-D_IS_NEED_DEFAULT_ChecksumPlugin=0
-ifeq ($(RISCV32),0)
-else
+ifeq ($(ATOMIC_U64),0)
DEF_FLAGS += -D_IS_NO_ATOMIC_U64=1
endif
ifeq ($(M32),0)
@@ -243,7 +271,19 @@ ifeq ($(ZLIB),0)
else
DEF_FLAGS += -D_CompressPlugin_zlib
ifeq ($(ZLIB),1)
- DEF_FLAGS += -I$(ZLIB_PATH)
+ DEF_FLAGS += -I$(ZLIB_PATH)
+ endif
+endif
+ifeq ($(LDEF),0)
+else
+ DEF_FLAGS += -D_CompressPlugin_ldef
+ ifeq ($(LDEF),1)
+ DEF_FLAGS += -I$(LDEF_PATH)
+ endif
+ ifeq ($(ZLIB),1)
+ DEF_FLAGS += -D_CompressPlugin_ldef_is_use_zlib=1
+ else
+ DEF_FLAGS += -D_CompressPlugin_ldef_is_use_zlib=0
endif
endif
ifeq ($(DIR_DIFF),0)
@@ -284,9 +324,10 @@ else
else
DEF_FLAGS += -DZ7_LZMA_DEC_OPT
endif
- ifeq ($(VCD),0)
- else
- DEF_FLAGS += -DUSE_CRC_EMU
+ ifneq ($(VCD),0)
+ ifneq ($(USE_CRC_EMU),0)
+ DEF_FLAGS += -DUSE_CRC_EMU
+ endif
endif
endif
endif
diff --git a/README.md b/README.md
index c2469c88..475092e2 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# [HDiffPatch]
-[![release](https://img.shields.io/badge/release-v4.7.0-blue.svg)](https://github.com/sisong/HDiffPatch/releases)
+[![release](https://img.shields.io/badge/release-v4.8.0-blue.svg)](https://github.com/sisong/HDiffPatch/releases)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/HDiffPatch/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/HDiffPatch/pulls)
[![+issue Welcome](https://img.shields.io/github/issues-raw/sisong/HDiffPatch?color=green&label=%2Bissue%20welcome)](https://github.com/sisong/HDiffPatch/issues)
@@ -50,17 +50,19 @@ apply the delta:
`$ cd
/HDiffPatch`
### Linux or MacOS X ###
Try:
-`$ make LZMA=0 ZSTD=0 MD5=0`
+`$ make LDEF=0 LZMA=0 ZSTD=0 MD5=0`
bzip2 : if the build fails with `fatal error: bzlib.h: No such file or directory`, use your system's package manager to install the libbz2 package and try again; or download & make with libbz2 source code:
```
$ git clone https://github.com/sisong/bzip2.git ../bzip2
-$ make LZMA=0 ZSTD=0 MD5=0 BZIP2=1
+$ make LDEF=0 LZMA=0 ZSTD=0 MD5=0 BZIP2=1
```
-if need lzma zstd & md5 support, Try:
+if need lzma zstd & md5 ... default support, Try:
```
$ git clone https://github.com/sisong/libmd5.git ../libmd5
$ git clone https://github.com/sisong/lzma.git ../lzma
$ git clone https://github.com/sisong/zstd.git ../zstd
+$ git clone https://github.com/sisong/zlib.git ../zlib
+$ git clone https://github.com/sisong/libdeflate.git ../libdeflate
$ make
```
Tip: You can use `$ make -j` to compile in parallel.
@@ -72,6 +74,7 @@ $ git clone https://github.com/sisong/libmd5.git ../libmd5
$ git clone https://github.com/sisong/lzma.git ../lzma
$ git clone https://github.com/sisong/zstd.git ../zstd
$ git clone https://github.com/sisong/zlib.git ../zlib
+$ git clone https://github.com/sisong/libdeflate.git ../libdeflate
$ git clone https://github.com/sisong/bzip2.git ../bzip2
```
@@ -149,11 +152,14 @@ options:
-c-zlib[-{1..9}[-dictBits]] DEFAULT level 9
dictBits can 9--15, DEFAULT 15.
support run by multi-thread parallel, fast!
+ -c-ldef[-{1..12}] DEFAULT level 12
+ compatible with -c-zlib, faster or better compress than zlib;
+ used libdeflate compressor, & dictBits always 15.
+ support run by multi-thread parallel, fast!
-c-bzip2[-{1..9}] (or -bz2) DEFAULT level 9
-c-pbzip2[-{1..9}] (or -pbz2) DEFAULT level 8
support run by multi-thread parallel, fast!
NOTE: code not compatible with it compressed by -c-bzip2!
- and code size may be larger than if it compressed by -c-bzip2.
-c-lzma[-{0..9}[-dictSize]] DEFAULT level 7
dictSize can like 4096 or 4k or 4m or 128m etc..., DEFAULT 8m
support run by 2-thread parallel.
diff --git a/README_cn.md b/README_cn.md
index a039152a..c5bceefe 100644
--- a/README_cn.md
+++ b/README_cn.md
@@ -1,5 +1,5 @@
# [HDiffPatch]
-[![release](https://img.shields.io/badge/release-v4.7.0-blue.svg)](https://github.com/sisong/HDiffPatch/releases)
+[![release](https://img.shields.io/badge/release-v4.8.0-blue.svg)](https://github.com/sisong/HDiffPatch/releases)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sisong/HDiffPatch/blob/master/LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg)](https://github.com/sisong/HDiffPatch/pulls)
[![+issue Welcome](https://img.shields.io/github/issues-raw/sisong/HDiffPatch?color=green&label=%2Bissue%20welcome)](https://github.com/sisong/HDiffPatch/issues)
@@ -50,17 +50,19 @@
`$ cd /HDiffPatch`
### Linux or MacOS X ###
试试:
-`$ make LZMA=0 ZSTD=0 MD5=0`
+`$ make LDEF=0 LZMA=0 ZSTD=0 MD5=0`
bzip2 : 如果编译失败,显示 `fatal error: bzlib.h: No such file or directory`,请使用系统的包管理器安装libbz2,然后再试一次;或者下载并使用libbz2源代码来编译:
```
$ git clone https://github.com/sisong/bzip2.git ../bzip2
-$ make LZMA=0 ZSTD=0 MD5=0 BZIP2=1
+$ make LDEF=0 LZMA=0 ZSTD=0 MD5=0 BZIP2=1
```
-如果需要支持 lzma、zstd 和 md5,试试:
+如果需要支持 lzma、zstd 和 md5 等 默认编译设置,试试:
```
$ git clone https://github.com/sisong/libmd5.git ../libmd5
$ git clone https://github.com/sisong/lzma.git ../lzma
$ git clone https://github.com/sisong/zstd.git ../zstd
+$ git clone https://github.com/sisong/zlib.git ../zlib
+$ git clone https://github.com/sisong/libdeflate.git ../libdeflate
$ make
```
提示:你可以使用 `$ make -j` 来并行编译。
@@ -72,6 +74,7 @@ $ git clone https://github.com/sisong/libmd5.git ../libmd5
$ git clone https://github.com/sisong/lzma.git ../lzma
$ git clone https://github.com/sisong/zstd.git ../zstd
$ git clone https://github.com/sisong/zlib.git ../zlib
+$ git clone https://github.com/sisong/libdeflate.git ../libdeflate
$ git clone https://github.com/sisong/bzip2.git ../bzip2
```
@@ -149,9 +152,13 @@ $ git clone https://github.com/sisong/bzip2.git ../bzip2
-c-zlib[-{1..9}[-dictBits]] 默认级别 9
压缩字典比特数dictBits可以为9到15, 默认为15。
支持多线程并行压缩,很快!
+ -c-ldef[-{1..12}] 默认级别 12
+ 输出压缩数据格式兼容于-c-zlib, 但比zlib压缩得更快或压缩得更小;
+ 使用了libdeflate压缩算法,且压缩字典比特数dictBits始终为15。
+ 支持多线程并行压缩,很快!
-c-bzip2[-{1..9}] (或 -bz2) 默认级别 9
-c-pbzip2[-{1..9}] (或 -pbz2) 默认级别 8
- 支持并行压缩,生成的补丁和-c-bzip2的输出格式不同,一般也可能稍大一点。
+ 支持并行压缩,生成的补丁和-c-bzip2的输出格式稍有不同。
-c-lzma[-{0..9}[-dictSize]] 默认级别 7
压缩字典大小dictSize可以设置为 4096, 4k, 4m, 128m等, 默认为8m
支持2个线程并行压缩。
@@ -161,7 +168,7 @@ $ git clone https://github.com/sisong/bzip2.git ../bzip2
警告: lzma和lzma2是不同的压缩编码格式。
-c-zstd[-{0..22}[-dictBits]] 默认级别 20
压缩字典比特数dictBits 可以为10到30, 默认为23。
- 支持多线程并行压缩,很快。
+ 支持多线程并行压缩,较快。
-C-checksumType
为文件夹间diff设置数据校验算法, 默认为fadler64;
支持的校验选项:
diff --git a/builds/android_ndk_jni_mk/Application.mk b/builds/android_ndk_jni_mk/Application.mk
index fd17b7a4..2e35ef46 100644
--- a/builds/android_ndk_jni_mk/Application.mk
+++ b/builds/android_ndk_jni_mk/Application.mk
@@ -3,5 +3,6 @@ APP_CFLAGS += -s -Wno-error=format-security
APP_CFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
APP_CFLAGS += -ffunction-sections -fdata-sections
APP_LDFLAGS += -s -Wl,--gc-sections,--as-needed
+APP_LDFLAGS += -Wl,-z,max-page-size=16384
APP_BUILD_SCRIPT := Android.mk
APP_ABI := armeabi armeabi-v7a arm64-v8a x86 x86_64
diff --git a/builds/codeblocks/HDiffZ.cbp b/builds/codeblocks/HDiffZ.cbp
index 54826bdd..e0d23700 100644
--- a/builds/codeblocks/HDiffZ.cbp
+++ b/builds/codeblocks/HDiffZ.cbp
@@ -71,6 +71,8 @@
+
+
@@ -97,6 +99,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -170,6 +184,9 @@
+
+
+
diff --git a/builds/codeblocks/HPatchZ.cbp b/builds/codeblocks/HPatchZ.cbp
index 90127298..134583ed 100644
--- a/builds/codeblocks/HPatchZ.cbp
+++ b/builds/codeblocks/HPatchZ.cbp
@@ -70,6 +70,8 @@
+
+
@@ -93,6 +95,15 @@
+
+
+
+
+
+
+
+
+
@@ -133,6 +144,9 @@
+
+
+
diff --git a/builds/codeblocks/unitTest.cbp b/builds/codeblocks/unitTest.cbp
index e1a72fcc..4129630e 100644
--- a/builds/codeblocks/unitTest.cbp
+++ b/builds/codeblocks/unitTest.cbp
@@ -31,12 +31,17 @@
+
+
+
+
+
@@ -56,6 +61,13 @@
+
+
+
+
+
+
+
diff --git a/builds/vc/HDiffPatch.sln b/builds/vc/HDiffPatch.sln
index c338d9fc..a29ac001 100644
--- a/builds/vc/HDiffPatch.sln
+++ b/builds/vc/HDiffPatch.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31402.337
+# Visual Studio Version 17
+VisualStudioVersion = 17.10.35027.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "hdiffz", "hdiffz.vcxproj", "{63934A83-25F5-4161-B19D-DFBAB1C257F1}"
ProjectSection(ProjectDependencies) = postProject
@@ -27,6 +27,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcxproj", "{35
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testHashClash", "testHashClash.vcxproj", "{22873560-BDA7-4915-8C7D-DF7C380B4E55}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libdeflate", "libdeflate.vcxproj", "{4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
@@ -163,6 +165,22 @@ Global
{22873560-BDA7-4915-8C7D-DF7C380B4E55}.Release|x64.Build.0 = Release|x64
{22873560-BDA7-4915-8C7D-DF7C380B4E55}.Release|x86.ActiveCfg = Release|Win32
{22873560-BDA7-4915-8C7D-DF7C380B4E55}.Release|x86.Build.0 = Release|Win32
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|ARM.ActiveCfg = Debug|ARM
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|ARM.Build.0 = Debug|ARM
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|ARM64.Build.0 = Debug|ARM64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|x64.ActiveCfg = Debug|x64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|x64.Build.0 = Debug|x64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|x86.ActiveCfg = Debug|Win32
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Debug|x86.Build.0 = Debug|Win32
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|ARM.ActiveCfg = Release|ARM
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|ARM.Build.0 = Release|ARM
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|ARM64.ActiveCfg = Release|ARM64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|ARM64.Build.0 = Release|ARM64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|x64.ActiveCfg = Release|x64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|x64.Build.0 = Release|x64
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|x86.ActiveCfg = Release|Win32
+ {4FFA1879-E1A6-4B99-B9D1-3265F48DAE0D}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/builds/vc/HDiffZ.vcxproj b/builds/vc/HDiffZ.vcxproj
index 55614dc8..b6c40e98 100644
--- a/builds/vc/HDiffZ.vcxproj
+++ b/builds/vc/HDiffZ.vcxproj
@@ -132,28 +132,28 @@
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -161,7 +161,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -169,7 +169,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -177,7 +177,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -185,7 +185,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -437,6 +437,9 @@
{61ff6ece-a15b-4be1-a78b-62de892ae25c}
+
+ {4ffa1879-e1a6-4b99-b9d1-3265f48dae0d}
+
{0849cd0e-1b9b-44eb-8937-a278b6a7e2cf}
diff --git a/builds/vc/HPatchZ.vcxproj b/builds/vc/HPatchZ.vcxproj
index 31bbfef2..4973d414 100644
--- a/builds/vc/HPatchZ.vcxproj
+++ b/builds/vc/HPatchZ.vcxproj
@@ -132,28 +132,28 @@
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
true
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -161,7 +161,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -169,7 +169,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -177,7 +177,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -185,7 +185,7 @@
false
AllRules.ruleset
- ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;$(IncludePath)
+ ..\..\..\zlib;..\..\..\bzip2;..\..\..\zstd\lib;..\..\..\zstd\lib\common;..\..\..\zstd\lib\compress;..\..\..\zstd\lib\decompress;..\..\..\lz4\lib;..\..\..\lzma\C;..\..\..\lzham_codec\include;..\..\..\brotli\c\include;..\..\..\libmd5;..\..\..\libdeflate;$(IncludePath)
$(ReferencePath)
$(Configuration)\$(Platform)\
$(Configuration)\$(Platform)\obj\
@@ -420,6 +420,9 @@
{61ff6ece-a15b-4be1-a78b-62de892ae25c}
+
+ {4ffa1879-e1a6-4b99-b9d1-3265f48dae0d}
+
{0849cd0e-1b9b-44eb-8937-a278b6a7e2cf}
diff --git a/builds/vc/libdeflate.vcxproj b/builds/vc/libdeflate.vcxproj
new file mode 100644
index 00000000..21eeef23
--- /dev/null
+++ b/builds/vc/libdeflate.vcxproj
@@ -0,0 +1,332 @@
+
+
+
+
+ Debug
+ ARM
+
+
+ Debug
+ ARM64
+
+
+ Debug
+ Win32
+
+
+ Release
+ ARM
+
+
+ Release
+ ARM64
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+
+ true
+ true
+ true
+ true
+
+
+
+
+
+
+ true
+ true
+ true
+ true
+
+
+
+ 17.0
+ Win32Proj
+ {4ffa1879-e1a6-4b99-b9d1-3265f48dae0d}
+ libdeflate
+ 10.0
+
+
+
+ StaticLibrary
+ true
+ v143
+ Unicode
+
+
+ StaticLibrary
+ true
+ v143
+ Unicode
+
+
+ StaticLibrary
+ false
+ v143
+ true
+ Unicode
+
+
+ StaticLibrary
+ false
+ v143
+ true
+ Unicode
+
+
+ StaticLibrary
+ true
+ v143
+ Unicode
+
+
+ StaticLibrary
+ true
+ v143
+ Unicode
+
+
+ StaticLibrary
+ false
+ v143
+ true
+ Unicode
+
+
+ StaticLibrary
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+ $(Platform)\$(Configuration)\
+ $(Platform)\$(Configuration)\objl\
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreadedDebug
+
+
+
+
+ true
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreadedDebug
+
+
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreaded
+
+
+
+
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreaded
+
+
+
+
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreadedDebug
+
+
+
+
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreadedDebug
+
+
+
+
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreaded
+
+
+
+
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ NotUsing
+
+
+ MultiThreaded
+
+
+
+
+ true
+ true
+ true
+
+
+
+
+
+
\ No newline at end of file
diff --git a/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata b/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata
index 956232a7..38f0939f 100644
--- a/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata
+++ b/builds/xcode/HDiffPatch.xcworkspace/contents.xcworkspacedata
@@ -23,6 +23,12 @@
+
+
+
+
diff --git a/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
new file mode 100644
index 00000000..f9b0d7c5
--- /dev/null
+++ b/builds/xcode/HDiffPatch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
@@ -0,0 +1,8 @@
+
+
+
+
+ PreviewsEnabled
+
+
+
diff --git a/builds/xcode/hdiffz.xcodeproj/project.pbxproj b/builds/xcode/hdiffz.xcodeproj/project.pbxproj
index 8b2eb3a1..4bacd81b 100644
--- a/builds/xcode/hdiffz.xcodeproj/project.pbxproj
+++ b/builds/xcode/hdiffz.xcodeproj/project.pbxproj
@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
0D225ADB2A997B6200DBD5B1 /* liblzma.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D225ADA2A997B6200DBD5B1 /* liblzma.a */; };
+ 0D5690472AB02E90006657AC /* liblibdeflate.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D5690462AB02E90006657AC /* liblibdeflate.a */; };
+ 0D5690492AB02E97006657AC /* libzlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D5690482AB02E97006657AC /* libzlib.a */; };
0D571A66275CEB3B00672D57 /* libzstd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D571A65275CEB3B00672D57 /* libzstd.a */; };
0D571A69275CF68900672D57 /* match_block.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0D571A68275CF68900672D57 /* match_block.cpp */; };
0D571A6F275CF71A00672D57 /* bspatch_wrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D571A6B275CF71A00672D57 /* bspatch_wrapper.c */; };
@@ -31,7 +33,6 @@
D690ABBB1F2079E80089DC57 /* suffix_string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D690ABB21F2079E80089DC57 /* suffix_string.cpp */; };
D690ABBC1F2079E80089DC57 /* patch.c in Sources */ = {isa = PBXBuildFile; fileRef = D690ABB51F2079E80089DC57 /* patch.c */; };
D690AEFB1F2097C90089DC57 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D690AEFA1F2097C90089DC57 /* libbz2.tbd */; };
- D690AEFD1F2097D30089DC57 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D690AEFC1F2097D30089DC57 /* libz.tbd */; };
D69EECD9220BD8E2001EF085 /* compress_parallel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D69EECD8220BD8E2001EF085 /* compress_parallel.cpp */; };
D69EECDF220C49DE001EF085 /* parallel_channel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D69EECDB220C49DE001EF085 /* parallel_channel.cpp */; };
D69EECE0220C49DE001EF085 /* parallel_import.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D69EECDD220C49DE001EF085 /* parallel_import.cpp */; };
@@ -58,6 +59,8 @@
/* Begin PBXFileReference section */
0D225ADA2A997B6200DBD5B1 /* liblzma.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblzma.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 0D5690462AB02E90006657AC /* liblibdeflate.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblibdeflate.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 0D5690482AB02E97006657AC /* libzlib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libzlib.a; sourceTree = BUILT_PRODUCTS_DIR; };
0D571A65275CEB3B00672D57 /* libzstd.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libzstd.a; sourceTree = BUILT_PRODUCTS_DIR; };
0D571A68275CF68900672D57 /* match_block.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = match_block.cpp; sourceTree = ""; };
0D571A6B275CF71A00672D57 /* bspatch_wrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bspatch_wrapper.c; path = ../../bsdiff_wrapper/bspatch_wrapper.c; sourceTree = ""; };
@@ -155,9 +158,10 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 0D5690492AB02E97006657AC /* libzlib.a in Frameworks */,
+ 0D5690472AB02E90006657AC /* liblibdeflate.a in Frameworks */,
0D225ADB2A997B6200DBD5B1 /* liblzma.a in Frameworks */,
0D571A66275CEB3B00672D57 /* libzstd.a in Frameworks */,
- D690AEFD1F2097D30089DC57 /* libz.tbd in Frameworks */,
D690AEFB1F2097C90089DC57 /* libbz2.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -351,6 +355,8 @@
D690ABBD1F20832E0089DC57 /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 0D5690482AB02E97006657AC /* libzlib.a */,
+ 0D5690462AB02E90006657AC /* liblibdeflate.a */,
0D225ADA2A997B6200DBD5B1 /* liblzma.a */,
0D571A65275CEB3B00672D57 /* libzstd.a */,
D690AEFC1F2097D30089DC57 /* libz.tbd */,
@@ -535,6 +541,8 @@
../../../lz4/lib/,
../../../zstd/lib/,
../../../lzma/C/,
+ ../../../zlib/,
+ ../../../libdeflate/,
);
MACOSX_DEPLOYMENT_TARGET = 10.9;
MTL_ENABLE_DEBUG_INFO = YES;
@@ -594,6 +602,8 @@
../../../lz4/lib/,
../../../zstd/lib/,
../../../lzma/C/,
+ ../../../zlib/,
+ ../../../libdeflate/,
);
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
diff --git a/builds/xcode/hpatchz.xcodeproj/project.pbxproj b/builds/xcode/hpatchz.xcodeproj/project.pbxproj
index 90f33364..41f2140f 100644
--- a/builds/xcode/hpatchz.xcodeproj/project.pbxproj
+++ b/builds/xcode/hpatchz.xcodeproj/project.pbxproj
@@ -8,12 +8,13 @@
/* Begin PBXBuildFile section */
0D225C102AB01FAA00DBD5B1 /* liblzma.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D225C0F2AB01FAA00DBD5B1 /* liblzma.a */; };
+ 0D5690432AB02E69006657AC /* liblibdeflate.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D5690422AB02E69006657AC /* liblibdeflate.a */; };
+ 0D5690452AB02E6C006657AC /* libzlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D5690442AB02E6C006657AC /* libzlib.a */; };
0D571A5C275CE9CE00672D57 /* libzstd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0D571A5B275CE9CE00672D57 /* libzstd.a */; };
0D571A62275CEAE900672D57 /* bspatch_wrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D571A61275CEAE900672D57 /* bspatch_wrapper.c */; };
0DA2A8E52910E70D000E86E1 /* vcpatch_wrapper.c in Sources */ = {isa = PBXBuildFile; fileRef = 0DA2A8E42910E70D000E86E1 /* vcpatch_wrapper.c */; };
D6241AE521DE47EC00E2846A /* new_stream.c in Sources */ = {isa = PBXBuildFile; fileRef = D6241AE321DE47EC00E2846A /* new_stream.c */; };
D64B4BEF2077AAAA0039C38B /* hpatchz.c in Sources */ = {isa = PBXBuildFile; fileRef = D64B4BEE2077AAAA0039C38B /* hpatchz.c */; };
- D64B4BF92077B9090039C38B /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D64B4BF82077B9090039C38B /* libz.tbd */; };
D64B4BFB2077B91A0039C38B /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = D64B4BFA2077B91A0039C38B /* libbz2.tbd */; };
D67D3BF421D3C5870050632A /* ref_stream.c in Sources */ = {isa = PBXBuildFile; fileRef = D67D3BF121D3C5870050632A /* ref_stream.c */; };
D67D3BF521D3C5870050632A /* dir_patch.c in Sources */ = {isa = PBXBuildFile; fileRef = D67D3BF221D3C5870050632A /* dir_patch.c */; };
@@ -40,6 +41,8 @@
/* Begin PBXFileReference section */
0D225B192A99893300DBD5B1 /* liblzma.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblzma.a; sourceTree = BUILT_PRODUCTS_DIR; };
0D225C0F2AB01FAA00DBD5B1 /* liblzma.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblzma.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 0D5690422AB02E69006657AC /* liblibdeflate.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = liblibdeflate.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 0D5690442AB02E6C006657AC /* libzlib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libzlib.a; sourceTree = BUILT_PRODUCTS_DIR; };
0D571A5B275CE9CE00672D57 /* libzstd.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libzstd.a; sourceTree = BUILT_PRODUCTS_DIR; };
0D571A61275CEAE900672D57 /* bspatch_wrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = bspatch_wrapper.c; path = ../../bsdiff_wrapper/bspatch_wrapper.c; sourceTree = ""; };
0DA2A8E42910E70D000E86E1 /* vcpatch_wrapper.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = vcpatch_wrapper.c; path = ../../vcdiff_wrapper/vcpatch_wrapper.c; sourceTree = ""; };
@@ -52,7 +55,6 @@
D64B4BF22077AB550039C38B /* _clock_for_demo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = _clock_for_demo.h; path = ../../_clock_for_demo.h; sourceTree = ""; };
D64B4BF32077AB550039C38B /* decompress_plugin_demo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = decompress_plugin_demo.h; path = ../../decompress_plugin_demo.h; sourceTree = ""; };
D64B4BF42077AB550039C38B /* file_for_patch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_for_patch.h; path = ../../file_for_patch.h; sourceTree = ""; };
- D64B4BF82077B9090039C38B /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
D64B4BFA2077B91A0039C38B /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; };
D6553CB3165FA1A9009D4C44 /* hpatchz */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = hpatchz; sourceTree = BUILT_PRODUCTS_DIR; };
D67D3BF021D3C5870050632A /* dir_patch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dir_patch.h; sourceTree = ""; };
@@ -82,10 +84,11 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 0D5690452AB02E6C006657AC /* libzlib.a in Frameworks */,
+ 0D5690432AB02E69006657AC /* liblibdeflate.a in Frameworks */,
0D225C102AB01FAA00DBD5B1 /* liblzma.a in Frameworks */,
0D571A5C275CE9CE00672D57 /* libzstd.a in Frameworks */,
D64B4BFB2077B91A0039C38B /* libbz2.tbd in Frameworks */,
- D64B4BF92077B9090039C38B /* libz.tbd in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -95,11 +98,12 @@
D64B4BF72077B9090039C38B /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 0D5690442AB02E6C006657AC /* libzlib.a */,
+ 0D5690422AB02E69006657AC /* liblibdeflate.a */,
0D225C0F2AB01FAA00DBD5B1 /* liblzma.a */,
0D225B192A99893300DBD5B1 /* liblzma.a */,
0D571A5B275CE9CE00672D57 /* libzstd.a */,
D64B4BFA2077B91A0039C38B /* libbz2.tbd */,
- D64B4BF82077B9090039C38B /* libz.tbd */,
);
name = Frameworks;
sourceTree = "";
@@ -276,7 +280,6 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "-";
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
@@ -300,6 +303,8 @@
../../../lz4/lib/,
../../../zstd/lib/,
../../../lzma/C/,
+ ../../../zlib/,
+ ../../../libdeflate/,
);
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
@@ -331,7 +336,6 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "-";
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEPLOYMENT_POSTPROCESSING = YES;
@@ -352,6 +356,8 @@
../../../lz4/lib/,
../../../zstd/lib/,
../../../lzma/C/,
+ ../../../zlib/,
+ ../../../libdeflate/,
);
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 10.9;
diff --git a/builds/xcode/libdeflate.xcodeproj/project.pbxproj b/builds/xcode/libdeflate.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..4b4e08cd
--- /dev/null
+++ b/builds/xcode/libdeflate.xcodeproj/project.pbxproj
@@ -0,0 +1,286 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 55;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 0D0A720C2B555D1B00D6E0D1 /* cpu_features.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D0A720B2B555D1B00D6E0D1 /* cpu_features.c */; };
+ 0D0A72102B555D9400D6E0D1 /* deflate_decompress.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D0A720D2B555D9400D6E0D1 /* deflate_decompress.c */; };
+ 0D0A72112B555D9400D6E0D1 /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D0A720E2B555D9400D6E0D1 /* utils.c */; };
+ 0D0A72122B555D9400D6E0D1 /* deflate_compress.c in Sources */ = {isa = PBXBuildFile; fileRef = 0D0A720F2B555D9400D6E0D1 /* deflate_compress.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ 0D0A71FE2B555BFB00D6E0D1 /* liblibdeflate.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibdeflate.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ 0D0A720B2B555D1B00D6E0D1 /* cpu_features.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cpu_features.c; path = ../../../libdeflate/lib/x86/cpu_features.c; sourceTree = ""; };
+ 0D0A720D2B555D9400D6E0D1 /* deflate_decompress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = deflate_decompress.c; path = ../../../libdeflate/lib/deflate_decompress.c; sourceTree = ""; };
+ 0D0A720E2B555D9400D6E0D1 /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utils.c; path = ../../../libdeflate/lib/utils.c; sourceTree = ""; };
+ 0D0A720F2B555D9400D6E0D1 /* deflate_compress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = deflate_compress.c; path = ../../../libdeflate/lib/deflate_compress.c; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 0D0A71FC2B555BFB00D6E0D1 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 0D0A71F52B555BFB00D6E0D1 = {
+ isa = PBXGroup;
+ children = (
+ 0D0A720F2B555D9400D6E0D1 /* deflate_compress.c */,
+ 0D0A720D2B555D9400D6E0D1 /* deflate_decompress.c */,
+ 0D0A720E2B555D9400D6E0D1 /* utils.c */,
+ 0D0A720B2B555D1B00D6E0D1 /* cpu_features.c */,
+ 0D0A71FF2B555BFB00D6E0D1 /* Products */,
+ );
+ sourceTree = "";
+ };
+ 0D0A71FF2B555BFB00D6E0D1 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 0D0A71FE2B555BFB00D6E0D1 /* liblibdeflate.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 0D0A71FA2B555BFB00D6E0D1 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 0D0A71FD2B555BFB00D6E0D1 /* libdeflate */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 0D0A72022B555BFB00D6E0D1 /* Build configuration list for PBXNativeTarget "libdeflate" */;
+ buildPhases = (
+ 0D0A71FA2B555BFB00D6E0D1 /* Headers */,
+ 0D0A71FB2B555BFB00D6E0D1 /* Sources */,
+ 0D0A71FC2B555BFB00D6E0D1 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = libdeflate;
+ productName = libdeflate;
+ productReference = 0D0A71FE2B555BFB00D6E0D1 /* liblibdeflate.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 0D0A71F62B555BFB00D6E0D1 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ BuildIndependentTargetsInParallel = 1;
+ LastUpgradeCheck = 1310;
+ TargetAttributes = {
+ 0D0A71FD2B555BFB00D6E0D1 = {
+ CreatedOnToolsVersion = 13.1;
+ };
+ };
+ };
+ buildConfigurationList = 0D0A71F92B555BFB00D6E0D1 /* Build configuration list for PBXProject "libdeflate" */;
+ compatibilityVersion = "Xcode 13.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 0D0A71F52B555BFB00D6E0D1;
+ productRefGroup = 0D0A71FF2B555BFB00D6E0D1 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 0D0A71FD2B555BFB00D6E0D1 /* libdeflate */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 0D0A71FB2B555BFB00D6E0D1 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 0D0A72112B555D9400D6E0D1 /* utils.c in Sources */,
+ 0D0A72102B555D9400D6E0D1 /* deflate_decompress.c in Sources */,
+ 0D0A720C2B555D1B00D6E0D1 /* cpu_features.c in Sources */,
+ 0D0A72122B555D9400D6E0D1 /* deflate_compress.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 0D0A72002B555BFB00D6E0D1 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 0D0A72012B555BFB00D6E0D1 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 0D0A72032B555BFB00D6E0D1 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ EXECUTABLE_PREFIX = lib;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ 0D0A72042B555BFB00D6E0D1 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ EXECUTABLE_PREFIX = lib;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 0D0A71F92B555BFB00D6E0D1 /* Build configuration list for PBXProject "libdeflate" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 0D0A72002B555BFB00D6E0D1 /* Debug */,
+ 0D0A72012B555BFB00D6E0D1 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 0D0A72022B555BFB00D6E0D1 /* Build configuration list for PBXNativeTarget "libdeflate" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 0D0A72032B555BFB00D6E0D1 /* Debug */,
+ 0D0A72042B555BFB00D6E0D1 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 0D0A71F62B555BFB00D6E0D1 /* Project object */;
+}
diff --git a/builds/xcode/libdeflate.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/builds/xcode/libdeflate.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000..61e04806
--- /dev/null
+++ b/builds/xcode/libdeflate.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/builds/xcode/lzma.xcodeproj/project.pbxproj b/builds/xcode/lzma.xcodeproj/project.pbxproj
index 9ee1c9f1..b044f3a1 100644
--- a/builds/xcode/lzma.xcodeproj/project.pbxproj
+++ b/builds/xcode/lzma.xcodeproj/project.pbxproj
@@ -460,7 +460,6 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -515,7 +514,6 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
diff --git a/builds/xcode/zlib.xcodeproj/project.pbxproj b/builds/xcode/zlib.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..8b9b5b2d
--- /dev/null
+++ b/builds/xcode/zlib.xcodeproj/project.pbxproj
@@ -0,0 +1,308 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 48;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ D6DA376020468A05009AEF45 /* inflate.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA363B20468A05009AEF45 /* inflate.c */; };
+ D6DA376520468A05009AEF45 /* deflate.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA364820468A05009AEF45 /* deflate.c */; };
+ D6DA37AC20468A05009AEF45 /* crc32.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA372220468A05009AEF45 /* crc32.c */; };
+ D6DA37AE20468A05009AEF45 /* zutil.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA372520468A05009AEF45 /* zutil.c */; };
+ D6DA37BE20468A05009AEF45 /* inftrees.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA374120468A05009AEF45 /* inftrees.c */; };
+ D6DA37C120468A05009AEF45 /* trees.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA374B20468A05009AEF45 /* trees.c */; };
+ D6DA37C420468A05009AEF45 /* inffast.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA375820468A05009AEF45 /* inffast.c */; };
+ D6DA37C520468A05009AEF45 /* adler32.c in Sources */ = {isa = PBXBuildFile; fileRef = D6DA375920468A05009AEF45 /* adler32.c */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ D6888897204688D30042E2B3 /* libzlib.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libzlib.a; sourceTree = BUILT_PRODUCTS_DIR; };
+ D6DA363B20468A05009AEF45 /* inflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inflate.c; sourceTree = ""; };
+ D6DA364820468A05009AEF45 /* deflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = deflate.c; sourceTree = ""; };
+ D6DA372220468A05009AEF45 /* crc32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = crc32.c; sourceTree = ""; };
+ D6DA372520468A05009AEF45 /* zutil.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zutil.c; sourceTree = ""; };
+ D6DA374120468A05009AEF45 /* inftrees.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inftrees.c; sourceTree = ""; };
+ D6DA374B20468A05009AEF45 /* trees.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = trees.c; sourceTree = ""; };
+ D6DA375820468A05009AEF45 /* inffast.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = inffast.c; sourceTree = ""; };
+ D6DA375920468A05009AEF45 /* adler32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = adler32.c; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ D6888894204688D30042E2B3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ D688888E204688D30042E2B3 = {
+ isa = PBXGroup;
+ children = (
+ D6DA363820468A05009AEF45 /* zlib */,
+ D6888898204688D30042E2B3 /* Products */,
+ );
+ sourceTree = "";
+ };
+ D6888898204688D30042E2B3 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D6888897204688D30042E2B3 /* libzlib.a */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ D6DA363820468A05009AEF45 /* zlib */ = {
+ isa = PBXGroup;
+ children = (
+ D6DA363B20468A05009AEF45 /* inflate.c */,
+ D6DA364820468A05009AEF45 /* deflate.c */,
+ D6DA372220468A05009AEF45 /* crc32.c */,
+ D6DA372520468A05009AEF45 /* zutil.c */,
+ D6DA374120468A05009AEF45 /* inftrees.c */,
+ D6DA374B20468A05009AEF45 /* trees.c */,
+ D6DA375820468A05009AEF45 /* inffast.c */,
+ D6DA375920468A05009AEF45 /* adler32.c */,
+ );
+ name = zlib;
+ path = ../../../zlib;
+ sourceTree = "";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D6888895204688D30042E2B3 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ D6888896204688D30042E2B3 /* zlib */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = D688889B204688D30042E2B3 /* Build configuration list for PBXNativeTarget "zlib" */;
+ buildPhases = (
+ D6888893204688D30042E2B3 /* Sources */,
+ D6888894204688D30042E2B3 /* Frameworks */,
+ D6888895204688D30042E2B3 /* Headers */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = zlib;
+ productName = zlib;
+ productReference = D6888897204688D30042E2B3 /* libzlib.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ D688888F204688D30042E2B3 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 1000;
+ ORGANIZATIONNAME = housisong;
+ TargetAttributes = {
+ D6888896204688D30042E2B3 = {
+ CreatedOnToolsVersion = 9.2;
+ ProvisioningStyle = Automatic;
+ };
+ };
+ };
+ buildConfigurationList = D6888892204688D30042E2B3 /* Build configuration list for PBXProject "zlib" */;
+ compatibilityVersion = "Xcode 8.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = D688888E204688D30042E2B3;
+ productRefGroup = D6888898204688D30042E2B3 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ D6888896204688D30042E2B3 /* zlib */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ D6888893204688D30042E2B3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ D6DA376020468A05009AEF45 /* inflate.c in Sources */,
+ D6DA37C520468A05009AEF45 /* adler32.c in Sources */,
+ D6DA37AE20468A05009AEF45 /* zutil.c in Sources */,
+ D6DA376520468A05009AEF45 /* deflate.c in Sources */,
+ D6DA37C120468A05009AEF45 /* trees.c in Sources */,
+ D6DA37C420468A05009AEF45 /* inffast.c in Sources */,
+ D6DA37BE20468A05009AEF45 /* inftrees.c in Sources */,
+ D6DA37AC20468A05009AEF45 /* crc32.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ D6888899204688D30042E2B3 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ D688889A204688D30042E2B3 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ CODE_SIGN_IDENTITY = "-";
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = s;
+ GCC_PREPROCESSOR_DEFINITIONS = NDEBUG;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.9;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ D688889C204688D30042E2B3 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ EXECUTABLE_PREFIX = lib;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ D688889D204688D30042E2B3 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_STYLE = Automatic;
+ EXECUTABLE_PREFIX = lib;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ D6888892204688D30042E2B3 /* Build configuration list for PBXProject "zlib" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D6888899204688D30042E2B3 /* Debug */,
+ D688889A204688D30042E2B3 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ D688889B204688D30042E2B3 /* Build configuration list for PBXNativeTarget "zlib" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ D688889C204688D30042E2B3 /* Debug */,
+ D688889D204688D30042E2B3 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = D688888F204688D30042E2B3 /* Project object */;
+}
diff --git a/builds/xcode/zlib.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/builds/xcode/zlib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000..da22f1ac
--- /dev/null
+++ b/builds/xcode/zlib.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj b/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj
index b1bd7eed..27e12d6d 100644
--- a/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj
+++ b/builds/xcode_iOS_hpatchz/hpatchz.xcodeproj/project.pbxproj
@@ -510,13 +510,19 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Z7_ST,
- USE_CRC_EMU,
ZSTD_STATIC_LINKING_ONLY,
"ZSTD_HAVE_WEAK_SYMBOLS=0",
"ZSTD_TRACE=0",
"ZSTD_DISABLE_ASM=1",
"ZSTDLIB_VISIBLE=",
"ZSTDLIB_HIDDEN=",
+ "_IS_NEED_DEFAULT_CompressPlugin=0",
+ _CompressPlugin_zlib,
+ _CompressPlugin_bz2,
+ _CompressPlugin_lzma,
+ _CompressPluginlzma2,
+ _CompressPlugin_zstd,
+ _CompressPlugn_7zXZ,
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -584,13 +590,19 @@
GCC_PREPROCESSOR_DEFINITIONS = (
NDEBUG,
Z7_ST,
- USE_CRC_EMU,
ZSTD_STATIC_LINKING_ONLY,
"ZSTD_HAVE_WEAK_SYMBOLS=0",
"ZSTD_TRACE=0",
"ZSTD_DISABLE_ASM=1",
"ZSTDLIB_VISIBLE=",
"ZSTDLIB_HIDDEN=",
+ "_IS_NEED_DEFAULT_CompressPlugin=0",
+ _CompressPlugin_zlib,
+ _CompressPlugin_bz2,
+ _CompressPlugin_lzma,
+ _CompressPluginlzma2,
+ _CompressPlugin_zstd,
+ _CompressPlugn_7zXZ,
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@@ -642,15 +654,22 @@
CODE_SIGN_STYLE = Automatic;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
- Z7_LZMA_DEC_OPT,
Z7_ST,
- USE_CRC_EMU,
ZSTD_STATIC_LINKING_ONLY,
"ZSTD_HAVE_WEAK_SYMBOLS=0",
"ZSTD_TRACE=0",
"ZSTD_DISABLE_ASM=1",
"ZSTDLIB_VISIBLE=",
"ZSTDLIB_HIDDEN=",
+ "_IS_NEED_DEFAULT_CompressPlugin=0",
+ _CompressPlugin_zlib,
+ _CompressPlugin_bz2,
+ _CompressPlugin_lzma,
+ _CompressPluginlzma2,
+ _CompressPlugin_zstd,
+ _CompressPlugn_7zXZ,
+ Z7_LZMA_DEC_OPT,
+ USE_CRC_EMU,
"$(inherited)",
);
OTHER_LDFLAGS = "-ObjC";
@@ -666,15 +685,22 @@
CODE_SIGN_STYLE = Automatic;
GCC_PREPROCESSOR_DEFINITIONS = (
NDEBUG,
- Z7_LZMA_DEC_OPT,
Z7_ST,
- USE_CRC_EMU,
ZSTD_STATIC_LINKING_ONLY,
"ZSTD_HAVE_WEAK_SYMBOLS=0",
"ZSTD_TRACE=0",
"ZSTD_DISABLE_ASM=1",
"ZSTDLIB_VISIBLE=",
"ZSTDLIB_HIDDEN=",
+ "_IS_NEED_DEFAULT_CompressPlugin=0",
+ _CompressPlugin_zlib,
+ _CompressPlugin_bz2,
+ _CompressPlugin_lzma,
+ _CompressPluginlzma2,
+ _CompressPlugin_zstd,
+ _CompressPlugn_7zXZ,
+ Z7_LZMA_DEC_OPT,
+ USE_CRC_EMU,
);
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-ObjC";
diff --git a/checksum_plugin_demo.h b/checksum_plugin_demo.h
index 9e4ba8e8..411e08bd 100644
--- a/checksum_plugin_demo.h
+++ b/checksum_plugin_demo.h
@@ -60,13 +60,16 @@
#ifdef _ChecksumPlugin_crc32
#if (_IsNeedIncludeDefaultChecksumHead)
-# ifdef _CompressPlugin_ldef
+# ifndef _IS_USED_LIBDEFLATE_CRC32
+# define _IS_USED_LIBDEFLATE_CRC32 0
+#endif
+#if (_IS_USED_LIBDEFLATE_CRC32)
# include "libdeflate.h" // https://github.com/ebiggers/libdeflate
# else
# include "zlib.h" // http://zlib.net/ https://github.com/madler/zlib
# endif
#endif
-#ifdef _CompressPlugin_ldef
+#if (_IS_USED_LIBDEFLATE_CRC32)
# define _crc32 libdeflate_crc32
#else
# define _crc32 crc32
@@ -91,7 +94,7 @@ static void _crc32_begin(hpatch_checksumHandle handle){
static void _crc32_append(hpatch_checksumHandle handle,
const unsigned char* part_data,const unsigned char* part_data_end){
hpatch_uint32_t* pv=(hpatch_uint32_t*)handle;
-#ifdef _CompressPlugin_ldef
+#if (_IS_USED_LIBDEFLATE_CRC32)
*pv=_crc32(*pv,part_data,part_data_end-part_data);
#else
uLong v=*pv;
diff --git a/compress_plugin_demo.h b/compress_plugin_demo.h
index 70d0a43c..1ccd968a 100644
--- a/compress_plugin_demo.h
+++ b/compress_plugin_demo.h
@@ -28,8 +28,10 @@
#ifndef HDiff_compress_plugin_demo_h
#define HDiff_compress_plugin_demo_h
//compress plugin demo:
-// zlibCompressPlugin
-// pzlibCompressPlugin
+// zlibCompressPlugin // zlib's deflate encoding
+// pzlibCompressPlugin // compatible with zlib's deflate encoding
+// ldefCompressPlugin // compatible with zlib's deflate encoding
+// pldefCompressPlugin // compatible with zlib's deflate encoding
// bz2CompressPlugin
// pbz2CompressPlugin
// lzmaCompressPlugin
@@ -41,8 +43,7 @@
// lzhamCompressPlugin
// tuzCompressPlugin
-
-// _7zXZCompressPlugin : support for create_vcdiff(), as "xdelta3 -S lzma ..."
+// _7zXZCompressPlugin : support for create_vcdiff(), compatible with "xdelta3 -S lzma ..."
#include "libHDiffPatch/HDiff/diff_types.h"
#include "compress_parallel.h"
@@ -102,13 +103,13 @@ static const char* _fun_name(void){ \
return kCompressType; \
}
-hpatch_inline static
+static
hpatch_StreamPos_t _default_maxCompressedSize(hpatch_StreamPos_t dataSize){
hpatch_StreamPos_t result=dataSize+(dataSize>>3)+1024*2;
assert(result>dataSize);
return result;
}
-hpatch_inline static
+static
int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadNum){
return 1;
}
@@ -233,11 +234,11 @@ int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadN
data_buf=_temp_buf+sizeof(_zlib_TCompress)+kCompressBufSize;
if (!self) _compress_error_return("deflateInit2()");
if (plugin->isNeedSaveWindowBits){
- unsigned char* pchar=(unsigned char*)&plugin->windowBits;
+ const unsigned char* pchar=(const unsigned char*)&plugin->windowBits;
if (!out_code->write(out_code,0,pchar,pchar+1)) _compress_error_return("out_code->write()");
++result;
}
- do {
+ while (readFromPosstreamSize){
size_t readLen=kCompressBufSize;
if (readLen>(hpatch_StreamPos_t)(in_data->streamSize-readFromPos))
readLen=(size_t)(in_data->streamSize-readFromPos);
@@ -247,7 +248,7 @@ int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadN
if (!_zlib_compress_part(self,data_buf,data_buf+readLen,
(readFromPos==in_data->streamSize),&result,&outStream_isCanceled))
_compress_error_return("_zlib_compress_part()");
- } while (readFromPosstreamSize);
+ }
clear:
if (!_zlib_compress_close_by(compressPlugin,self))
{ result=kCompressFailResult; if (strlen(errAt)==0) errAt="deflateEnd()"; }
@@ -272,62 +273,73 @@ int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadN
plugin->thread_num=threadNum;
return threadNum;
}
- static hdiff_compressBlockHandle _pzlib_openBlockCompressor(hdiff_TParallelCompress* pc){
- return pc;
- }
static void _pzlib_closeBlockCompressor(hdiff_TParallelCompress* pc,
hdiff_compressBlockHandle blockCompressor){
- assert(blockCompressor==pc);
+ z_stream* stream=(z_stream*)blockCompressor;
+ if (!stream) return;
+ if (stream->state!=0){
+ int ret=deflateEnd(stream);
+ assert((Z_OK==ret)|(Z_DATA_ERROR==ret));
+ }
+ free(stream);
+ }
+ static hdiff_compressBlockHandle _pzlib_openBlockCompressor(hdiff_TParallelCompress* pc){
+ const TCompressPlugin_pzlib* plugin=(const TCompressPlugin_pzlib*)pc->import;
+ z_stream* stream=(z_stream*)malloc(sizeof(z_stream));
+ if (!stream) return 0;
+ memset(stream,0,sizeof(z_stream));
+ int err = deflateInit2(stream,plugin->base.compress_level,Z_DEFLATED,
+ plugin->base.windowBits,plugin->base.mem_level,Z_DEFAULT_STRATEGY);
+ if (err!=Z_OK){//error
+ _pzlib_closeBlockCompressor(pc,stream);
+ return 0;
+ }
+ return stream;
}
static int _pzlib_compress2(Bytef* dest,uLongf* destLen,const unsigned char* block_data,
const unsigned char* block_dictEnd,const unsigned char* block_dataEnd,
- int level,int mem_level,int windowBits,int isEndBlock){
- z_stream stream;
+ int isEndBlock,z_stream* stream){
int err;
- stream.next_in = (Bytef*)block_dictEnd;
- stream.avail_in = (uInt)(block_dataEnd-block_dictEnd);
- stream.next_out = dest;
- stream.avail_out = (uInt)*destLen;
- stream.zalloc = 0;
- stream.zfree = 0;
- stream.opaque = 0;
- err = deflateInit2(&stream,level,Z_DEFLATED,windowBits,mem_level,Z_DEFAULT_STRATEGY);
- if (err != Z_OK) return err;
#define _check_zlib_err(_must_V) { if (err!=(_must_V)) goto _errorReturn; }
+ err=deflateReset(stream);
+ _check_zlib_err(Z_OK);
+ stream->next_in = (Bytef*)block_dictEnd;
+ stream->avail_in = (uInt)(block_dataEnd-block_dictEnd);
+ stream->next_out = dest;
+ stream->avail_out = (uInt)*destLen;
+ stream->total_out = 0;
if (block_datatotal_out;
return err;
_errorReturn:
- deflateEnd(&stream);
return err == Z_OK ? Z_BUF_ERROR : err;
#undef _check_zlib_err
}
@@ -336,7 +348,7 @@ int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadN
hpatch_StreamPos_t blockIndex,hpatch_StreamPos_t blockCount,unsigned char* out_code,unsigned char* out_codeEnd,
const unsigned char* block_data,const unsigned char* block_dictEnd,const unsigned char* block_dataEnd){
const TCompressPlugin_pzlib* plugin=(const TCompressPlugin_pzlib*)pc->import;
- hpatch_BOOL isAdding=(blockIndex==0)&&(plugin->base.isNeedSaveWindowBits);
+ const hpatch_BOOL isAdding=(blockIndex==0)&&(plugin->base.isNeedSaveWindowBits);
if (isAdding){
if (out_code>=out_codeEnd) return 0;//error;
out_code[0]=plugin->base.windowBits;
@@ -344,8 +356,7 @@ int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadN
}
uLongf codeLen=(uLongf)(out_codeEnd-out_code);
if (Z_OK!=_pzlib_compress2(out_code,&codeLen,block_data,block_dictEnd,block_dataEnd,
- plugin->base.compress_level,plugin->base.mem_level,
- plugin->base.windowBits,blockIndex+1==blockCount?1:0))
+ blockIndex+1==blockCount?1:0,(z_stream*)blockCompressor))
return 0; //error
return codeLen+(isAdding?1:0);
}
@@ -353,7 +364,7 @@ int _default_setParallelThreadNumber(hdiff_TCompress* compressPlugin,int threadN
const hpatch_TStreamOutput* out_code,
const hpatch_TStreamInput* in_data){
TCompressPlugin_pzlib* plugin=(TCompressPlugin_pzlib*)compressPlugin;
- const size_t blockSize=128*1024;
+ const size_t blockSize=256*1024;
if ((plugin->thread_num<=1)||(plugin->base.compress_level==0)
||(in_data->streamSize=thread_num) return base_step_size;
+ size_t step_size=(size_t)((data_size+thread_num-1)/thread_num);
+ const size_t minStep=_kMinBaseStep;
+ step_size=(step_size>minStep)?step_size:minStep;
+ return step_size;
+ }
+ typedef struct{
+ hdiff_TCompress base;
+ int compress_level; //0..12
+ hpatch_BOOL isNeedSaveWindowBits;
+ } TCompressPlugin_ldef;
+
+ static hpatch_StreamPos_t _ldef_compress(const hdiff_TCompress* compressPlugin,
+ const hpatch_TStreamOutput* out_code,
+ const hpatch_TStreamInput* in_data){
+ const TCompressPlugin_ldef* plugin=(const TCompressPlugin_ldef*)compressPlugin;
+ hpatch_StreamPos_t result=0; //writedPos
+ hpatch_StreamPos_t readFromPos=0;
+ const char* errAt="";
+ int outStream_isCanceled=0;
+ unsigned char* data_buf=0;
+ unsigned char* code_buf=0;
+ struct libdeflate_compressor* c=0;
+ size_t in_border_nbytes=0;
+ const size_t in_step_size=_ldef_getBestWorkStepSize(in_data->streamSize,plugin->compress_level,1);
+ const size_t _in_buf_size=_ldef_kDictSize+in_step_size+_ldef_kMax_in_border_nbytes;
+ const size_t block_bound=libdeflate_deflate_compress_bound_block(in_step_size);
+
+ data_buf=(unsigned char*)malloc(_in_buf_size+block_bound);
+ if (!data_buf) _compress_error_return("memory alloc");
+ code_buf=data_buf+_in_buf_size;
+
+ c=libdeflate_alloc_compressor(plugin->compress_level);
+ if (!c) _compress_error_return("libdeflate_alloc_compressor()");
+
+ if (plugin->isNeedSaveWindowBits){//save deflate windowBits
+ const unsigned char* pchar=(const unsigned char*)&_ldef_kWindowBits;
+ if (!out_code->write(out_code,0,pchar,pchar+1)) _compress_error_return("out_code->write()");
+ ++result;
+ }
+ while (readFromPosstreamSize){
+ const size_t curDictSize=(readFromPos>0)?_ldef_kDictSize:0;
+ size_t readLen=in_step_size;
+ size_t codeLen;
+ if (readLen>(hpatch_StreamPos_t)(in_data->streamSize-readFromPos))
+ readLen=(size_t)(in_data->streamSize-readFromPos);
+ {
+ unsigned char* dst_buf=data_buf+curDictSize+in_border_nbytes;
+ size_t cur_in_border_nbytes=_ldef_kMax_in_border_nbytes;
+ if (readLen+cur_in_border_nbytes>(hpatch_StreamPos_t)(in_data->streamSize-readFromPos))
+ cur_in_border_nbytes=(size_t)(in_data->streamSize-readFromPos-readLen);
+ if (!in_data->read(in_data,readFromPos+in_border_nbytes,dst_buf,
+ dst_buf+readLen+cur_in_border_nbytes-in_border_nbytes))
+ _compress_error_return("in_data->read()");
+ in_border_nbytes=cur_in_border_nbytes;
+ }
+ readFromPos+=readLen;
+
+ codeLen=libdeflate_deflate_compress_block_continue(c,data_buf,curDictSize,readLen,in_border_nbytes,
+ (readFromPos==in_data->streamSize),code_buf,block_bound,hpatch_FALSE);
+
+ if (codeLen>0){
+ _stream_out_code_write(out_code,outStream_isCanceled,result,code_buf,codeLen);
+ }else
+ _compress_error_return("libdeflate_deflate_compress_block_continue()");
+ if (readFromPosstreamSize){
+ memmove(data_buf,data_buf+readLen+curDictSize-_ldef_kDictSize,_ldef_kDictSize+in_border_nbytes);
+ }
+ }
+ clear:
+ if (c) libdeflate_free_compressor(c);
+ _check_compress_result(result,outStream_isCanceled,"_ldef_compress()",errAt);
+ if (data_buf) free(data_buf);
+ return result;
+ }
+ _def_fun_compressType(_ldef_compressType,"zlib");
+ _def_fun_compressType(_ldef_compressTypeForDisplay,"ldef (zlib compatible)");
+ static const TCompressPlugin_ldef ldefCompressPlugin={
+ {_ldef_compressType,_default_maxCompressedSize,_default_setParallelThreadNumber,
+ _ldef_compress,_ldef_compressTypeForDisplay}, 12,hpatch_TRUE};
+
+# if (_IS_USED_MULTITHREAD)
+ //pldef
+ typedef struct {
+ TCompressPlugin_ldef base;
+ int thread_num; // 1..
+ hdiff_TParallelCompress pc;
+ } TCompressPlugin_pldef;
+ static int _pldef_setThreadNum(hdiff_TCompress* compressPlugin,int threadNum){
+ TCompressPlugin_pldef* plugin=(TCompressPlugin_pldef*)compressPlugin;
+ plugin->thread_num=threadNum;
+ return threadNum;
+ }
+ static hdiff_compressBlockHandle _pldef_openBlockCompressor(hdiff_TParallelCompress* pc){
+ const TCompressPlugin_pldef* plugin=(const TCompressPlugin_pldef*)pc->import;
+ return libdeflate_alloc_compressor(plugin->base.compress_level);
+ }
+ static void _pldef_closeBlockCompressor(hdiff_TParallelCompress* pc,
+ hdiff_compressBlockHandle blockCompressor){
+ libdeflate_free_compressor((struct libdeflate_compressor*)blockCompressor);
+ }
+ static
+ size_t _pldef_compressBlock(hdiff_TParallelCompress* pc,hdiff_compressBlockHandle blockCompressor,
+ hpatch_StreamPos_t blockIndex,hpatch_StreamPos_t blockCount,unsigned char* out_code,unsigned char* out_codeEnd,
+ const unsigned char* block_data,const unsigned char* block_dictEnd,const unsigned char* block_dataEnd){
+ const TCompressPlugin_pldef* plugin=(const TCompressPlugin_pldef*)pc->import;
+ struct libdeflate_compressor* c=(struct libdeflate_compressor*)blockCompressor;
+ const hpatch_BOOL isAdding=(blockIndex==0)&&plugin->base.isNeedSaveWindowBits;
+ if (isAdding){
+ if (out_code>=out_codeEnd) return 0;//error;
+ out_code[0]=_ldef_kWindowBits;
+ ++out_code;
+ }
+
+ size_t codeLen=libdeflate_deflate_compress_block(c,block_data,block_dictEnd-block_data,block_dataEnd-block_dictEnd,
+ blockIndex+1==blockCount,out_code,out_codeEnd-out_code,1);
+ if (codeLen==0)
+ return 0; //error
+ return codeLen+(isAdding?1:0);
+ }
+ static hpatch_StreamPos_t _pldef_compress(const hdiff_TCompress* compressPlugin,
+ const hpatch_TStreamOutput* out_code,
+ const hpatch_TStreamInput* in_data){
+ TCompressPlugin_pldef* plugin=(TCompressPlugin_pldef*)compressPlugin;
+ const size_t blockSize=_ldef_getBestWorkStepSize(in_data->streamSize,plugin->base.compress_level,plugin->thread_num);
+ if ((plugin->thread_num<=1)||(plugin->base.compress_level==0)
+ ||(in_data->streamSizepc.import=plugin;
+ return parallel_compress_blocks(&plugin->pc,plugin->thread_num,_ldef_kDictSize,blockSize,out_code,in_data);
+ }
+ }
+
+ static const TCompressPlugin_pldef pldefCompressPlugin={
+ { {_ldef_compressType,_default_maxCompressedSize,_pldef_setThreadNum,
+ _pldef_compress,_ldef_compressTypeForDisplay}, 9,hpatch_TRUE},
+ kDefaultCompressThreadNumber ,{0,_default_maxCompressedSize,_pldef_openBlockCompressor,
+ _pldef_closeBlockCompressor,_pldef_compressBlock} };
+# endif // _IS_USED_MULTITHREAD
+#endif//_CompressPlugin_ldef
+
+
#ifdef _CompressPlugin_bz2
#if (_IsNeedIncludeDefaultCompressHead)
# include "bzlib.h" // http://www.bzip.org/ https://github.com/sisong/bzip2
diff --git a/decompress_plugin_demo.h b/decompress_plugin_demo.h
index 32c471f2..ded23328 100644
--- a/decompress_plugin_demo.h
+++ b/decompress_plugin_demo.h
@@ -28,7 +28,8 @@
#ifndef HPatch_decompress_plugin_demo_h
#define HPatch_decompress_plugin_demo_h
//decompress plugin demo:
-// zlibDecompressPlugin;
+// zlibDecompressPlugin; // support all deflate encoding by zlib
+// ldefDecompressPlugin; // optimized deompress speed for deflate encoding
// bz2DecompressPlugin;
// lzmaDecompressPlugin;
// lzma2DecompressPlugin;
@@ -190,21 +191,21 @@ static void __dec_free(void* _, void* address){
return result;
}
- static hpatch_BOOL _zlib_reset_for_next_node(_zlib_TDecompress* self){
- //backup
- Bytef* next_out_back=self->d_stream.next_out;
- Bytef* next_in_back=self->d_stream.next_in;
- unsigned int avail_out_back=self->d_stream.avail_out;
- unsigned int avail_in_back=self->d_stream.avail_in;
- //reset
- if (Z_OK!=inflateReset(&self->d_stream)) _dec_onDecErr_rt();
- //restore
- self->d_stream.next_out=next_out_back;
- self->d_stream.next_in=next_in_back;
- self->d_stream.avail_out=avail_out_back;
- self->d_stream.avail_in=avail_in_back;
- return hpatch_TRUE;
- }
+ static hpatch_BOOL _zlib_reset_for_next_node(z_stream* d_stream){
+ //backup
+ Bytef* next_out_back=d_stream->next_out;
+ Bytef* next_in_back=d_stream->next_in;
+ unsigned int avail_out_back=d_stream->avail_out;
+ unsigned int avail_in_back=d_stream->avail_in;
+ //reset
+ if (Z_OK!=inflateReset(d_stream)) return hpatch_FALSE;
+ //restore
+ d_stream->next_out=next_out_back;
+ d_stream->next_in=next_in_back;
+ d_stream->avail_out=avail_out_back;
+ d_stream->avail_in=avail_in_back;
+ return hpatch_TRUE;
+ }
static hpatch_BOOL __zlib_do_inflate(hpatch_decompressHandle decompressHandle){
_zlib_TDecompress* self=(_zlib_TDecompress*)decompressHandle;
uInt avail_out_back,avail_in_back;
@@ -229,8 +230,8 @@ static void __dec_free(void* _, void* address){
_dec_onDecErr_rt();//error;
}else if (ret==Z_STREAM_END){
if (self->d_stream.avail_in+codeLen>0){ //next compress node!
- if (!_zlib_reset_for_next_node(self))
- return hpatch_FALSE;//error;
+ if (!_zlib_reset_for_next_node(&self->d_stream))
+ _dec_onDecErr_rt();//error;
}else{//all end
if (self->d_stream.avail_out!=0)
_dec_onDecErr_rt();//error;
@@ -257,7 +258,7 @@ static void __dec_free(void* _, void* address){
hpatch_decompressHandle decompressHandle){
_zlib_TDecompress* self=(_zlib_TDecompress*)decompressHandle;
while (self->code_begin!=self->code_end){ //for end tag code
- unsigned char _empty;
+ unsigned char _empty=0;
self->d_stream.next_out = &_empty;
self->d_stream.avail_out=0;
if (!__zlib_do_inflate(self))
@@ -272,7 +273,307 @@ static void __dec_free(void* _, void* address){
static hpatch_TDecompress zlibDecompressPlugin_deflate={_zlib_is_can_open,_zlib_decompress_open_deflate,
_zlib_decompress_close,_zlib_decompress_part};
#endif//_CompressPlugin_zlib
+
+
+#ifdef _CompressPlugin_ldef
+#if (_IsNeedIncludeDefaultCompressHead)
+# include "libdeflate.h" // https://github.com/sisong/libdeflate/tree/stream-mt based on https://github.com/ebiggers/libdeflate
+# if (_CompressPlugin_ldef_is_use_zlib)
+# include "zlib.h" // https://github.com/sisong/zlib/tree/bit_pos_padding based on https://github.com/madler/zlib
+# endif
+#endif
+ static const size_t _de_ldef_kDictSize = 1024*32;
+ static const size_t _de_ldef_kMaxBlockSize =1024*32*19;
+ // used _de_ldef_kMaxBlockSize*2 memory; optimized speed for
+ // libdefalte & zlib's deflate code ..., when theirs input deflate code compress block size<=_de_ldef_kMaxBlockSize/2;
+ // if (_de_ldef_kMaxBlockSize>=compress block size>_de_ldef_kMaxBlockSize/2) speed will little slower;
+ // if (compress block size>_de_ldef_kMaxBlockSize) && if (_CompressPlugin_ldef_is_use_zlib!=0),
+ // then swap to zlib decompressor & very slower (slower than zlib); && if (_CompressPlugin_ldef_is_use_zlib==0) will decompress fail.
+
+ typedef struct _ldef_TDecompress{
+ hpatch_StreamPos_t code_begin;
+ hpatch_StreamPos_t code_end;
+ const struct hpatch_TStreamInput* codeStream;
+
+ unsigned char* data_buf;
+ size_t data_buf_size;
+ unsigned char* code_buf;
+ size_t code_buf_size;
+ struct libdeflate_decompressor* d;
+ hpatch_dec_error_t decError;
+
+ size_t data_cur;
+ size_t out_cur;
+ size_t code_cur;
+ #if (_CompressPlugin_ldef_is_use_zlib)
+ hpatch_BOOL is_swap_to_zlib;
+ z_stream d_stream;
+ #endif
+ } _ldef_TDecompress;
+
+ #if (_CompressPlugin_ldef_is_use_zlib)
+ static hpatch_inline hpatch_BOOL _ldef_is_swap_to_zlib(_ldef_TDecompress* self){
+ return self->is_swap_to_zlib;
+ }
+ static hpatch_BOOL _ldef_decompress_part(hpatch_decompressHandle decompressHandle,
+ unsigned char* out_part_data,unsigned char* out_part_data_end);
+ static hpatch_BOOL _ldef_swap_from_zlib(_ldef_TDecompress* self){
+ const size_t out_part_len=self->d_stream.avail_out;
+ self->is_swap_to_zlib=hpatch_FALSE;
+ libdeflate_deflate_decompress_block_reset(self->d);
+ {
+ unsigned long shift_v;
+ unsigned int shift_bit;
+ zlib_inflate_shift_value(&self->d_stream,&shift_v,&shift_bit);
+ if (shift_bit>>3) _dec_onDecErr_rt();
+ libdeflate_deflate_decompress_set_state(self->d,(shift_v<<3)|shift_bit);
+ }
+ assert(self->data_cur==_de_ldef_kDictSize);
+ self->code_cur=self->code_buf_size-self->d_stream.avail_in;
+ assert(self->d_stream.next_in==self->code_buf+self->code_cur);
+ {
+ uInt dict_size=0;
+ if (Z_OK!=inflateGetDictionary(&self->d_stream,0,&dict_size)) _dec_onDecErr_rt();
+ if (Z_OK!=inflateGetDictionary(&self->d_stream,self->data_buf+self->data_cur-dict_size,0)) _dec_onDecErr_rt();
+ }
+ if (out_part_len>0)
+ return _ldef_decompress_part(self,self->d_stream.next_out,self->d_stream.next_out+out_part_len);
+ else
+ return hpatch_TRUE;
+ }
+ static hpatch_BOOL _ldef_decompress_part_by_zlib(_ldef_TDecompress* self,
+ unsigned char* out_part_data,size_t out_part_len){
+ self->d_stream.next_out=out_part_data;
+ self->d_stream.avail_out=(uInt)out_part_len;
+ while (self->d_stream.avail_out){
+ uInt avail_out_back,avail_in_back;
+ int ret;
+ hpatch_StreamPos_t codeLen=(self->code_end-self->code_begin);
+ if ((self->d_stream.avail_in==0)&&(codeLen>0)) {
+ size_t readLen=self->code_buf_size;
+ if (readLen>codeLen) readLen=(size_t)codeLen;
+ self->d_stream.next_in=self->code_buf+self->code_buf_size-readLen;
+ if (!self->codeStream->read(self->codeStream,self->code_begin,self->d_stream.next_in,
+ self->d_stream.next_in+readLen)) return hpatch_FALSE;//error;
+ self->d_stream.avail_in=(uInt)readLen;
+ self->code_begin+=readLen;
+ codeLen-=readLen;
+ }
+
+ avail_out_back=self->d_stream.avail_out;
+ avail_in_back=self->d_stream.avail_in;
+ ret=inflate(&self->d_stream,Z_BLOCK);
+ if (ret==Z_OK){
+ if ((self->d_stream.avail_in==avail_in_back)&&(self->d_stream.avail_out==avail_out_back))
+ _dec_onDecErr_rt();//error;
+ if (zlib_inflate_is_block_end(&self->d_stream)&&(!zlib_inflate_is_last_block_end(&self->d_stream)))
+ return _ldef_swap_from_zlib(self);
+ }else if (ret==Z_STREAM_END){
+ if (self->d_stream.avail_in+codeLen>0){ //next compress node!
+ zlib_inflate_set_shift_value(&self->d_stream,0,0);
+ return _ldef_swap_from_zlib(self);
+ }else{//all end
+ if (self->d_stream.avail_out!=0)
+ _dec_onDecErr_rt();//error;
+ }
+ }else{
+ _dec_onDecErr_rt();//error;
+ }
+ }
+ return hpatch_TRUE;
+ }
+ static hpatch_BOOL _ldef_swap_to_zlib(_ldef_TDecompress* self,size_t dec_state,
+ unsigned char* out_part_data,size_t out_part_len){
+ self->is_swap_to_zlib=hpatch_TRUE;
+ if (self->d_stream.state==0){
+ if (Z_OK!=inflateInit2(&self->d_stream,-15)){
+ if (!self->decError) self->decError=hpatch_dec_open_error;
+ return hpatch_FALSE;
+ }
+ }else{
+ if (Z_OK!=inflateReset(&self->d_stream)) _dec_onDecErr_rt();
+ }
+ zlib_inflate_set_shift_value(&self->d_stream,(uLong)(dec_state>>3),(uInt)(dec_state&((1<<3)-1)));
+ if (Z_OK!=inflateSetDictionary(&self->d_stream,self->data_buf+self->data_cur-_de_ldef_kDictSize,(uInt)_de_ldef_kDictSize)) _dec_onDecErr_rt();
+ self->d_stream.next_in=self->code_buf+self->code_cur;
+ self->d_stream.avail_in=(uInt)(self->code_buf_size-self->code_cur);
+ return _ldef_decompress_part_by_zlib(self,out_part_data,out_part_len);
+ }
+ #endif //_CompressPlugin_ldef_is_use_zlib
+
+ static hpatch_BOOL _ldef_is_can_open(const char* compressType){
+ return (0==strcmp(compressType,"zlib"))||(0==strcmp(compressType,"pzlib"));
+ }
+
+ static _ldef_TDecompress* _ldef_decompress_open_at(hpatch_TDecompress* decompressPlugin,
+ const hpatch_TStreamInput* codeStream,
+ hpatch_StreamPos_t code_begin,hpatch_StreamPos_t code_end,
+ int isSavedWindowBits,_ldef_TDecompress* self,
+ size_t data_buf_size,size_t code_buf_size){
+ if (isSavedWindowBits){//load kWindowBits
+ signed char kWindowBits=0;
+ if (code_end-code_begin<1) _dec_openErr_rt();
+ if (!codeStream->read(codeStream,code_begin,(unsigned char*)&kWindowBits,
+ (unsigned char*)&kWindowBits+1)) return 0;
+ ++code_begin;
+ if (!((-15<=kWindowBits)&&(kWindowBits<0)))
+ _dec_openErr_rt(); //now, unsupported these window bits
+ }
+
+ memset(self,0,sizeof(_ldef_TDecompress));
+ self->d=libdeflate_alloc_decompressor();
+ if (!self->d) _dec_memErr_rt();
+ self->data_buf=((unsigned char*)self)+sizeof(_ldef_TDecompress);
+ self->data_buf_size=data_buf_size;
+ self->code_buf=self->data_buf+data_buf_size;
+ self->code_buf_size=code_buf_size;
+ self->codeStream=codeStream;
+ self->code_begin=code_begin;
+ self->code_end=code_end;
+
+ self->data_cur=_de_ldef_kDictSize; //empty
+ self->out_cur=_de_ldef_kDictSize;
+ self->code_cur=code_buf_size; //empty
+ return self;
+ }
+
+ static hpatch_decompressHandle _ldef_decompress_open(hpatch_TDecompress* decompressPlugin,
+ hpatch_StreamPos_t dataSize,
+ const hpatch_TStreamInput* codeStream,
+ hpatch_StreamPos_t code_begin,
+ hpatch_StreamPos_t code_end){
+ _ldef_TDecompress* self=0;
+ const hpatch_StreamPos_t in_size=code_end-code_begin;
+ const size_t data_buf_size=_de_ldef_kDictSize+((_de_ldef_kMaxBlockSized_stream.state!=0){
+ _dec_close_check(Z_OK==inflateEnd(&self->d_stream));
+ }
+ #endif
+ if (self->d!=0)
+ libdeflate_free_decompressor(self->d);
+ memset(self,0,sizeof(_ldef_TDecompress));
+ return result;
+ }
+ static hpatch_BOOL _ldef_decompress_close(struct hpatch_TDecompress* decompressPlugin,
+ hpatch_decompressHandle decompressHandle){
+ _ldef_TDecompress* self=(_ldef_TDecompress*)decompressHandle;
+ hpatch_BOOL result=_ldef_decompress_close_by(decompressPlugin,self);
+ if (self) free(self);
+ return result;
+ }
+
+ static hpatch_BOOL _ldef_decompress_part(hpatch_decompressHandle decompressHandle,
+ unsigned char* out_part_data,unsigned char* out_part_data_end){
+ _ldef_TDecompress* self=(_ldef_TDecompress*)decompressHandle;
+ size_t out_part_len=out_part_data_end-out_part_data;
+ #if (_CompressPlugin_ldef_is_use_zlib)
+ if (_ldef_is_swap_to_zlib(self)&&out_part_len)
+ return _ldef_decompress_part_by_zlib(self,out_part_data,out_part_len);
+ #endif
+ const size_t kDictSize=_de_ldef_kDictSize;
+ // [ ( dict ) | dataBuf ] [ codeBuf ]
+ // ^ ^ ^ ^ ^ ^ ^
+ // data_buf out_cur data_cur data_buf_size code_buf code_cur code_buf_size
+ while (out_part_len) {
+ {//write data out
+ size_t out_len=self->data_cur-self->out_cur;
+ if (out_len){ //have data
+ out_len=(out_lendata_buf+self->out_cur,out_len);
+ self->out_cur+=out_len;
+ out_part_data+=out_len;
+ out_part_len-=out_len;
+ continue;
+ }
+ }
+
+ size_t kLimitDataSize=_de_ldef_kMaxBlockSize/2+kDictSize;
+ size_t kLimitCodeSize=self->code_buf_size/2;
+ __datas_prepare:
+ {//read code in
+ if (self->code_cur>kLimitCodeSize){
+ const hpatch_StreamPos_t _codeSize=self->code_end-self->code_begin;
+ size_t read_len=(self->code_cur<_codeSize)?self->code_cur:(size_t)_codeSize;
+ if (read_len){
+ size_t code_len=self->code_buf_size-self->code_cur;
+ unsigned char* pcode=self->code_buf+self->code_cur;
+ unsigned char* pdst=pcode-read_len;
+ memmove(pdst,pcode,code_len);
+ pdst+=code_len;
+ if (!self->codeStream->read(self->codeStream,self->code_begin,pdst,pdst+read_len))
+ return 0; //read error
+ self->code_begin+=read_len;
+ self->code_cur-=read_len;
+ }
+ }
+ }
+ {//move dict
+ if (self->data_cur>kLimitDataSize){
+ size_t move_offset=self->data_cur-kDictSize;
+ if (move_offset){
+ memmove(self->data_buf,self->data_buf+move_offset,kDictSize);
+ self->data_cur=kDictSize;
+ self->out_cur=kDictSize;
+ }
+ }
+ }
+ {// decompress
+ int is_final_block_ret;
+ size_t actual_in_nbytes_ret;
+ size_t actual_out_nbytes_ret;
+ const size_t dec_state=libdeflate_deflate_decompress_get_state(self->d);
+ enum libdeflate_result ret=libdeflate_deflate_decompress_block(self->d,
+ self->code_buf+self->code_cur,self->code_buf_size-self->code_cur,
+ self->data_buf,self->data_cur,self->data_buf_size-self->data_cur,
+ &actual_in_nbytes_ret,&actual_out_nbytes_ret,
+ LIBDEFLATE_STOP_BY_ANY_BLOCK,&is_final_block_ret);
+ if (ret!=LIBDEFLATE_SUCCESS){
+ if ((self->code_begin==self->code_end)&&(ret!=LIBDEFLATE_INSUFFICIENT_SPACE))
+ _dec_onDecErr_rt();
+ if ((self->data_cur>kDictSize)||((self->code_cur>0)&&(self->code_begincode_end))){
+ kLimitDataSize=kDictSize;
+ kLimitCodeSize=0;
+ libdeflate_deflate_decompress_set_state(self->d,dec_state);
+ goto __datas_prepare; //retry by libdefalte
+ }
+ #if (_CompressPlugin_ldef_is_use_zlib)
+ return _ldef_swap_to_zlib(self,dec_state,out_part_data,out_part_len); //retry by zlib
+ #else
+ _dec_onDecErr_rt();
+ #endif
+ }
+ self->code_cur+=actual_in_nbytes_ret;
+ self->data_cur+=actual_out_nbytes_ret;
+ if (is_final_block_ret)
+ libdeflate_deflate_decompress_block_reset(self->d);
+ }
+ }
+ return hpatch_TRUE;
+ }
+ static hpatch_TDecompress ldefDecompressPlugin={_ldef_is_can_open,_ldef_decompress_open,
+ _ldef_decompress_close,_ldef_decompress_part};
+#endif//_CompressPlugin_ldef
+
+
#ifdef _CompressPlugin_bz2
#if (_IsNeedIncludeDefaultCompressHead)
# include "bzlib.h" // http://www.bzip.org/ https://github.com/sisong/bzip2
diff --git a/hdiffz.cpp b/hdiffz.cpp
index 57b5f8f4..59b2872b 100644
--- a/hdiffz.cpp
+++ b/hdiffz.cpp
@@ -66,21 +66,31 @@
#if (_IS_NEED_DEFAULT_CompressPlugin)
//===== select needs decompress plugins or change to your plugin=====
# define _CompressPlugin_zlib // memory requires less
+# define _CompressPlugin_ldef // faster or better compress than zlib / (now used ldef+zlib decompressor)
# define _CompressPlugin_bz2
# define _CompressPlugin_lzma // better compresser
# define _CompressPlugin_lzma2 // better compresser
-# define _CompressPlugin_zstd // better compresser / faster decompresser
+# define _CompressPlugin_zstd // better compresser / faster decompressor
#if (_IS_NEED_VCDIFF)
-# define _CompressPlugin_7zXZ //only for VCDIFF
+# define _CompressPlugin_7zXZ //only for VCDIFF, used lzma2
#endif
+
#endif
#if (_IS_NEED_ALL_CompressPlugin)
//===== select needs decompress plugins or change to your plugin=====
-# define _CompressPlugin_lz4 // faster compresser / faster decompresser
-# define _CompressPlugin_lz4hc // faster decompresser
-# define _CompressPlugin_brotli// better compresser / faster decompresser
+# define _CompressPlugin_lz4 // faster compresser / faster decompressor
+# define _CompressPlugin_lz4hc // compress slower & better than lz4 / (used lz4 decompressor)
+# define _CompressPlugin_brotli// better compresser / faster decompressor
# define _CompressPlugin_lzham // better compresser / decompress faster than lzma2
-# define _CompressPlugin_tuz // decompress requires tiny code(.text) & ram
+# define _CompressPlugin_tuz // slower compresser / decompress requires tiny code(.text) & ram
+#endif
+#ifdef _CompressPlugin_ldef
+# ifndef _CompressPlugin_ldef_is_use_zlib
+# define _CompressPlugin_ldef_is_use_zlib 1 //now ldef need zlib decompressor for any all of deflate code
+# endif
+# ifndef _IS_NEED_decompressor_ldef_replace_zlib
+# define _IS_NEED_decompressor_ldef_replace_zlib 0
+# endif
#endif
#if (_IS_NEED_BSDIFF)
@@ -227,13 +237,20 @@ static void printUsage(){
" support run by multi-thread parallel, fast!\n"
# endif
#endif
+#ifdef _CompressPlugin_ldef
+ " -c-ldef[-{1..12}] DEFAULT level 12\n"
+ " compatible with -c-zlib, faster or better compress than zlib;\n"
+ " used libdeflate compressor, & dictBits always 15.\n"
+# if (_IS_USED_MULTITHREAD)
+ " support run by multi-thread parallel, fast!\n"
+# endif
+#endif
#ifdef _CompressPlugin_bz2
" -c-bzip2[-{1..9}] (or -bz2) DEFAULT level 9\n"
# if (_IS_USED_MULTITHREAD)
" -c-pbzip2[-{1..9}] (or -pbz2) DEFAULT level 8\n"
" support run by multi-thread parallel, fast!\n"
" NOTE: code not compatible with it compressed by -c-bzip2!\n"
- " and code size may be larger than if it compressed by -c-bzip2.\n"
# endif
#endif
#ifdef _CompressPlugin_lzma
@@ -503,8 +520,12 @@ static hpatch_BOOL _getIsVcDiffFile(const char* diffFileName) {
#define _try_rt_dec(dec) { if (dec.is_can_open(compressType)) return &dec; }
static hpatch_TDecompress* __find_decompressPlugin(const char* compressType){
-#ifdef _CompressPlugin_zlib
+#if ((defined(_CompressPlugin_ldef))&&_IS_NEED_decompressor_ldef_replace_zlib)
+ _try_rt_dec(ldefDecompressPlugin);
+#else
+# ifdef _CompressPlugin_zlib
_try_rt_dec(zlibDecompressPlugin);
+# endif
#endif
#ifdef _CompressPlugin_bz2
_try_rt_dec(bz2DecompressPlugin);
@@ -653,7 +674,8 @@ static int _checkSetCompress(hdiff_TCompress** out_compressPlugin,
size_t dictSize=0;
const size_t defaultDictSize=(1<<20)*8; //8m
#endif
-#if (defined _CompressPlugin_zlib)||(defined _CompressPlugin_zstd)||(defined _CompressPlugin_brotli)||(defined _CompressPlugin_lzham)
+#if (defined _CompressPlugin_zlib)||(defined _CompressPlugin_ldef)||(defined _CompressPlugin_zstd) \
+ ||(defined _CompressPlugin_brotli)||(defined _CompressPlugin_lzham)
size_t dictBits=0;
const size_t defaultDictBits=20+3; //8m
const size_t defaultDictBits_zlib=15; //32k
@@ -673,6 +695,19 @@ static int _checkSetCompress(hdiff_TCompress** out_compressPlugin,
*out_compressPlugin=&_pzlibCompressPlugin.base.base; }}
# endif // _IS_USED_MULTITHREAD
#endif
+#ifdef _CompressPlugin_ldef
+ __getCompressSet(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"ldef","pldef",
+ &compressLevel,1,12,12, &dictBits,15,15,defaultDictBits_zlib),"-c-ldef-?"){
+# if (!_IS_USED_MULTITHREAD)
+ static TCompressPlugin_ldef _ldefCompressPlugin=ldefCompressPlugin;
+ _ldefCompressPlugin.compress_level=(int)compressLevel;
+ *out_compressPlugin=&_ldefCompressPlugin.base; }}
+# else
+ static TCompressPlugin_pldef _pldefCompressPlugin=pldefCompressPlugin;
+ _pldefCompressPlugin.base.compress_level=(int)compressLevel;
+ *out_compressPlugin=&_pldefCompressPlugin.base.base; }}
+# endif // _IS_USED_MULTITHREAD
+#endif
#ifdef _CompressPlugin_bz2
__getCompressSet(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"bzip2","bz2",
&compressLevel,1,9,9),"-c-bzip2-?"){
@@ -1453,6 +1488,7 @@ static int hdiff_in_mem(const char* oldFileName,const char* newFileName,const ch
hpatch_BOOL isSingleCompressedDiff=hpatch_FALSE;
#if (_IS_NEED_BSDIFF)
hpatch_BOOL isBsDiff=hpatch_FALSE;
+ hpatch_BOOL isSingleCompressedBsDiff=hpatch_FALSE;
#endif
#if (_IS_NEED_VCDIFF)
hpatch_BOOL isVcDiff=hpatch_FALSE;
@@ -1481,11 +1517,11 @@ static int hdiff_in_mem(const char* oldFileName,const char* newFileName,const ch
if (!diffSets.isDoDiff)
printf("test single compressed diffData!\n");
#if (_IS_NEED_BSDIFF)
- }else if (getIsBsDiff_mem(diffMem.data(),diffMem.data_end(),&isSingleCompressedDiff)){
+ }else if (getIsBsDiff_mem(diffMem.data(),diffMem.data_end(),&isSingleCompressedBsDiff)){
*saved_decompressPlugin=_bz2DecompressPlugin_unsz;
isBsDiff=hpatch_TRUE;
if (!diffSets.isDoDiff)
- printf(isSingleCompressedDiff?"test endsley/bsdiff's diffData!\n":"test bsdiff4's diffData!\n");
+ printf(isSingleCompressedBsDiff?"test endsley/bsdiff's diffData!\n":"test bsdiff4's diffData!\n");
#endif
#if (_IS_NEED_VCDIFF)
}else if (getVcDiffInfo_mem(&vcdiffInfo,diffMem.data(),diffMem.data_end(),hpatch_FALSE)){
@@ -1609,6 +1645,7 @@ static int hdiff_by_stream(const char* oldFileName,const char* newFileName,const
hpatch_BOOL isSingleCompressedDiff=hpatch_FALSE;
#if (_IS_NEED_BSDIFF)
hpatch_BOOL isBsDiff=hpatch_FALSE;
+ hpatch_BOOL isSingleCompressedBsDiff=hpatch_FALSE;
#endif
#if (_IS_NEED_VCDIFF)
hpatch_BOOL isVcDiff=hpatch_FALSE;
@@ -1630,11 +1667,11 @@ static int hdiff_by_stream(const char* oldFileName,const char* newFileName,const
if (!diffSets.isDoDiff)
printf("test single compressed diffData!\n");
#if (_IS_NEED_BSDIFF)
- }else if (getIsBsDiff(&diffData_in.base,&isSingleCompressedDiff)){
+ }else if (getIsBsDiff(&diffData_in.base,&isSingleCompressedBsDiff)){
*saved_decompressPlugin=_bz2DecompressPlugin_unsz;
isBsDiff=hpatch_TRUE;
if (!diffSets.isDoDiff)
- printf(isSingleCompressedDiff?"test endsley/bsdiff's diffData!\n":"test bsdiff4's diffData!\n");
+ printf(isSingleCompressedBsDiff?"test endsley/bsdiff's diffData!\n":"test bsdiff4's diffData!\n");
#endif
#if (_IS_NEED_VCDIFF)
}else if (getVcDiffInfo(&vcdiffInfo,&diffData_in.base,hpatch_FALSE)){
@@ -1655,16 +1692,18 @@ static int hdiff_by_stream(const char* oldFileName,const char* newFileName,const
else saved_decompressPlugin->decError=hpatch_dec_ok;
}
bool diffrt;
- if (isSingleCompressedDiff)
- diffrt=check_single_compressed_diff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
#if (_IS_NEED_BSDIFF)
- else if (isBsDiff)
+ if (isBsDiff)
diffrt=check_bsdiff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
+ else
#endif
#if (_IS_NEED_VCDIFF)
- else if (isVcDiff)
+ if (isVcDiff)
diffrt=check_vcdiff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
+ else
#endif
+ if (isSingleCompressedDiff)
+ diffrt=check_single_compressed_diff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
else
diffrt=check_compressed_diff(&newData.base,&oldData.base,&diffData_in.base,saved_decompressPlugin);
check(diffrt,HDIFF_PATCH_ERROR,"patch check diff data");
@@ -1689,9 +1728,10 @@ int hdiff(const char* oldFileName,const char* newFileName,const char* outDiffFil
hpatch_printPath_utf8(fnameInfo.c_str());
if (diffSets.isDoDiff) {
- const char* compressType="";
- if (compressPlugin) compressType=compressPlugin->compressType();
- printf("hdiffz run with compress plugin: \"%s\"\n",compressType);
+ const char* compressTypeTxt="";
+ if (compressPlugin) compressTypeTxt=compressPlugin->compressTypeForDisplay?
+ compressPlugin->compressTypeForDisplay():compressPlugin->compressType();
+ printf("hdiffz run with compress plugin: \"%s\"\n",compressTypeTxt);
if (diffSets.isSingleCompressedDiff){
#if (_IS_NEED_BSDIFF)
if (!diffSets.isBsDiff)
@@ -1782,9 +1822,10 @@ int hdiff_resave(const char* diffFileName,const char* outDiffFileName,
}
}
{
- const char* compressType="";
- if (compressPlugin) compressType=compressPlugin->compressType();
- printf("resave diffFile with compress plugin: \"%s\"\n",compressType);
+ const char* compressTypeTxt="";
+ if (compressPlugin) compressTypeTxt=compressPlugin->compressTypeForDisplay?
+ compressPlugin->compressTypeForDisplay():compressPlugin->compressType();
+ printf("resave diffFile with compress plugin: \"%s\"\n",compressTypeTxt);
}
#if (_IS_NEED_DIR_DIFF_PATCH)
if (isDirDiff){ //checksumPlugin
@@ -1911,11 +1952,12 @@ int hdiff_dir(const char* _oldPath,const char* _newPath,const char* outDiffFileN
bool isManifest= (!newManifestFileName.empty());
if (diffSets.isDoDiff) {
const char* checksumType="";
- const char* compressType="";
+ const char* compressTypeTxt="";
if (checksumPlugin)
checksumType=checksumPlugin->checksumType();
- if (compressPlugin) compressType=compressPlugin->compressType();
- printf("hdiffz run %sdir diff with compress plugin: \"%s\"\n",isManifest?"manifest ":"",compressType);
+ if (compressPlugin) compressTypeTxt=compressPlugin->compressTypeForDisplay?
+ compressPlugin->compressTypeForDisplay():compressPlugin->compressType();
+ printf("hdiffz run %sdir diff with compress plugin: \"%s\"\n",isManifest?"manifest ":"",compressTypeTxt);
printf("hdiffz run %sdir diff with checksum plugin: \"%s\"\n",isManifest?"manifest ":"",checksumType);
}
printf("\n");
diff --git a/hpatchz.c b/hpatchz.c
index bb1b4b67..ba292a95 100644
--- a/hpatchz.c
+++ b/hpatchz.c
@@ -78,7 +78,14 @@
#endif
#if (_IS_NEED_DEFAULT_CompressPlugin)
//===== select needs decompress plugins or change to your plugin=====
-# define _CompressPlugin_zlib
+# ifndef _IS_NEED_decompressor_ldef_replace_zlib
+# define _IS_NEED_decompressor_ldef_replace_zlib 0
+# endif
+# if (_IS_NEED_decompressor_ldef_replace_zlib)
+# define _CompressPlugin_ldef //optimized zlib&ldef's deflate code decompress speed by libdeflate
+# else
+# define _CompressPlugin_zlib
+# endif
# define _CompressPlugin_bz2
# define _CompressPlugin_lzma
# define _CompressPlugin_lzma2
@@ -94,6 +101,14 @@
# define _CompressPlugin_lzham
# define _CompressPlugin_tuz
#endif
+#ifdef _CompressPlugin_ldef
+# ifndef _CompressPlugin_ldef_is_use_zlib
+# define _CompressPlugin_ldef_is_use_zlib 1 //now ldef need zlib decompressor for any all of deflate code
+# endif
+# if (_IS_NEED_decompressor_ldef_replace_zlib&&(defined(_CompressPlugin_zlib)))
+# undef _CompressPlugin_zlib
+# endif
+#endif
#if (_IS_NEED_BSDIFF)
# include "bsdiff_wrapper/bspatch_wrapper.h"
@@ -781,8 +796,12 @@ int hpatch_cmd_line(int argc, const char * argv[]){
#define _try_rt_dec(dec) { if (dec.is_can_open(compressType)) return &dec; }
static const hpatch_TDecompress* __find_decompressPlugin(const char* compressType){
-#ifdef _CompressPlugin_zlib
+#if ((defined(_CompressPlugin_ldef))&&_IS_NEED_decompressor_ldef_replace_zlib)
+ _try_rt_dec(ldefDecompressPlugin);
+#else
+# ifdef _CompressPlugin_zlib
_try_rt_dec(zlibDecompressPlugin);
+# endif
#endif
#ifdef _CompressPlugin_bz2
_try_rt_dec(bz2DecompressPlugin);
diff --git a/libHDiffPatch/HDiff/diff_types.h b/libHDiffPatch/HDiff/diff_types.h
index 765bd3d5..dc5157a2 100644
--- a/libHDiffPatch/HDiff/diff_types.h
+++ b/libHDiffPatch/HDiff/diff_types.h
@@ -103,6 +103,7 @@ extern "C"
hpatch_StreamPos_t (*compress)(const struct hdiff_TCompress* compressPlugin,
const hpatch_TStreamOutput* out_code,
const hpatch_TStreamInput* in_data);
+ const char* (*compressTypeForDisplay)(void);//like compressType but just for display,can NULL
} hdiff_TCompress;
static hpatch_inline
diff --git a/libHDiffPatch/HPatch/patch.c b/libHDiffPatch/HPatch/patch.c
index 8ef9856c..38eb5f9c 100644
--- a/libHDiffPatch/HPatch/patch.c
+++ b/libHDiffPatch/HPatch/patch.c
@@ -1626,7 +1626,7 @@ static hpatch_BOOL _cache_old_load(const hpatch_TStreamInput*oldData,
_TArrayCovers* arrayCovers,hpatch_size_t maxCachedLen,hpatch_size_t sumCacheLen,
TByte* old_cache,TByte* old_cache_end,TByte* cache_buf_end){
const hpatch_size_t kMinSpaceLen =(1<<(20+2));//跳过seekTime*speed长度的空间(SSD可以更小)时间上划得来,否则就顺序访问;
- const hpatch_size_t kAccessPageSize=(1<<(10+2));//页面对齐访问;
+ const hpatch_size_t kAccessPageSize=4096;//磁盘页面对齐访问(只和速度有关,但影响不大);
hpatch_BOOL result=hpatch_TRUE;
hpatch_size_t cur_i=0,i;
const hpatch_size_t coverCount=arrayCovers->coverCount;
diff --git a/libHDiffPatch/HPatch/patch_types.h b/libHDiffPatch/HPatch/patch_types.h
index 59caa9cb..eedc74c0 100644
--- a/libHDiffPatch/HPatch/patch_types.h
+++ b/libHDiffPatch/HPatch/patch_types.h
@@ -37,7 +37,7 @@ extern "C" {
#endif
#define HDIFFPATCH_VERSION_MAJOR 4
-#define HDIFFPATCH_VERSION_MINOR 7
+#define HDIFFPATCH_VERSION_MINOR 8
#define HDIFFPATCH_VERSION_RELEASE 0
#define _HDIFFPATCH_VERSION HDIFFPATCH_VERSION_MAJOR.HDIFFPATCH_VERSION_MINOR.HDIFFPATCH_VERSION_RELEASE
diff --git a/test/unit_test.cpp b/test/unit_test.cpp
index 2be67a36..915260d6 100644
--- a/test/unit_test.cpp
+++ b/test/unit_test.cpp
@@ -151,8 +151,14 @@ static hsync_TDictCompress* _getDictCompressPlugin(){
#endif
}
-#define _IS_USES_MY_RAND
-#ifdef _IS_USES_MY_RAND
+#ifndef _IS_USES_MY_RAND
+# define _IS_USES_MY_RAND 1
+#endif
+#if (_IS_USES_MY_RAND)
+ #ifdef RAND_MAX
+ # undef RAND_MAX
+ #endif
+ #define RAND_MAX 0x7fff
class CMyRand{
public:
unsigned int _my_holdrand;