diff options
author | Tao Bao <tbao@google.com> | 2017-11-11 02:09:47 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-11-11 02:09:47 +0100 |
commit | de07371b034c92458c6f21eb2a88988dbf1e8160 (patch) | |
tree | 52c1336bbc9b9859377e53b4debc8fb20ff18dd9 /applypatch/include | |
parent | Merge "Include bspatch.h from bsdiff/" (diff) | |
parent | applypatch: Change the patch parameter to const Value& in Apply{BSDiff,Image}Patch. (diff) | |
download | android_bootable_recovery-de07371b034c92458c6f21eb2a88988dbf1e8160.tar android_bootable_recovery-de07371b034c92458c6f21eb2a88988dbf1e8160.tar.gz android_bootable_recovery-de07371b034c92458c6f21eb2a88988dbf1e8160.tar.bz2 android_bootable_recovery-de07371b034c92458c6f21eb2a88988dbf1e8160.tar.lz android_bootable_recovery-de07371b034c92458c6f21eb2a88988dbf1e8160.tar.xz android_bootable_recovery-de07371b034c92458c6f21eb2a88988dbf1e8160.tar.zst android_bootable_recovery-de07371b034c92458c6f21eb2a88988dbf1e8160.zip |
Diffstat (limited to 'applypatch/include')
-rw-r--r-- | applypatch/include/applypatch/applypatch.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/applypatch/include/applypatch/applypatch.h b/applypatch/include/applypatch/applypatch.h index bcb8a4126..6d7ffd78c 100644 --- a/applypatch/include/applypatch/applypatch.h +++ b/applypatch/include/applypatch/applypatch.h @@ -45,6 +45,7 @@ extern std::string cache_temp_source; using SinkFn = std::function<size_t(const unsigned char*, size_t)>; // applypatch.cpp + int ShowLicenses(); size_t FreeSpaceForFile(const char* filename); int CacheSizeCheck(size_t bytes); @@ -66,15 +67,25 @@ int LoadFileContents(const char* filename, FileContents* file); int SaveFileContents(const char* filename, const FileContents* file); // bspatch.cpp + void ShowBSDiffLicense(); -int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value* patch, + +// Applies the bsdiff-patch given in 'patch' (from offset 'patch_offset' to the end) to the source +// data given by (old_data, old_size). Writes the patched output through the given 'sink', and +// updates the SHA-1 context with the output data. Returns 0 on success. +int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value& patch, size_t patch_offset, SinkFn sink, SHA_CTX* ctx); // imgpatch.cpp -int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value* patch, SinkFn sink, + +// Applies the imgdiff-patch given in 'patch' to the source data given by (old_data, old_size), with +// the optional bonus data. Writes the patched output through the given 'sink', and updates the +// SHA-1 context with the output data. Returns 0 on success. +int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value& patch, SinkFn sink, SHA_CTX* ctx, const Value* bonus_data); // freecache.cpp + int MakeFreeSpaceOnCache(size_t bytes_needed); #endif |