Closed kushagra10025 closed 2 years ago
. step 0 (reference https://github.com/sisong/HDiffPatch/tree/master/.github/workflows/ci.yml )
download all source code by git cmd:
cd <code patch>
git clone --depth=1 https://github.com/sisong/HDiffPatch.git HDiffPatch
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 -b fix-make-build --depth=1 https://github.com/sisong/lzma.git lzma
git clone -b v1.5.2 --depth=1 https://github.com/facebook/zstd.git zstd
. step 1
open HDiffPatch\builds\vc2019\HDiffPatch.sln by vs2022, Compiled out hdiffz.exe & hpatchz.exe
. step 2
add source code files to your project (reference HDiffZ.vcxproj & HPatchZ.vcxproj),
& add needed compressers(such as zstd.vcxproj) to your project.
call create_single_compressed_diff() (same as hdiffz -SD -m ...
)
(or call create_single_compressed_diff_block() (same as hdiffz -block -SD -m ...
))
or call create_single_compressed_diff_stream() (same as hdiffz -SD -s ...
), to create single compressed diff.
call patch_single_stream() to apply diff.
Thanks @sisong for the reply. This helped me setup the Library easily and further I cleaned the structure and shifted to CMake for the build system. Works wonderfully! Thanks a lot.
Sorry for asking if this is pretty evident but I have been trying to call the API from my program which generated Diffs between two Files and then another Program Patches it.
I have studied the entire code for over 2 weeks now (including the command-line tool) but every time I try to perform the API call it throws some error like
Unreferenced Error in patch.h at line #include<stdlib.h>
and such.Will you be kind enough to provide the steps on how to only integrate the library for creating single compressed diff and patch between two files. Let's say I create a empty Visual Studio Solution with the following structure (other requirements like
zlib, zstd, bzip2, lzma
already linekd):can you kindly direct me as to what should be the code within main.cpp to create diff and patch between
file.txt
andfile_mod.txt
.This will help me very much as the functionality by this library is something I am using towards my graduation project.
Visual Studio 2022 - v143 Windows 10 SDK
Thanks & Regards.