summaryrefslogtreecommitdiffstats
path: root/applypatch/include/applypatch/applypatch.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-28 21:11:11 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-03-28 21:11:11 +0200
commit862b7e8523800e638eb1230680c30ebad2f6e5c8 (patch)
treea917dd3d7eeb25c00acdb7d96a417dd2c13a0288 /applypatch/include/applypatch/applypatch.h
parentapplypatch: Change the ssize_t length parameters to size_t. (diff)
parentMerge changes from topic 'sinkfn' (diff)
downloadandroid_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.gz
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.bz2
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.lz
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.xz
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.tar.zst
android_bootable_recovery-862b7e8523800e638eb1230680c30ebad2f6e5c8.zip
Diffstat (limited to 'applypatch/include/applypatch/applypatch.h')
-rw-r--r--applypatch/include/applypatch/applypatch.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/applypatch/include/applypatch/applypatch.h b/applypatch/include/applypatch/applypatch.h
index 52fb58287..da55432d5 100644
--- a/applypatch/include/applypatch/applypatch.h
+++ b/applypatch/include/applypatch/applypatch.h
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <sys/stat.h>
+#include <functional>
#include <memory>
#include <string>
#include <vector>
@@ -41,7 +42,7 @@ struct FileContents {
// and use it as the source instead.
#define CACHE_TEMP_SOURCE "/cache/saved.file"
-using SinkFn = size_t (*)(const unsigned char*, size_t, void*);
+using SinkFn = std::function<size_t(const unsigned char*, size_t)>;
// applypatch.cpp
int ShowLicenses();
@@ -67,13 +68,13 @@ 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,
- size_t patch_offset, SinkFn sink, void* token, SHA_CTX* ctx);
+ size_t patch_offset, SinkFn sink, SHA_CTX* ctx);
int ApplyBSDiffPatchMem(const unsigned char* old_data, size_t old_size, const Value* patch,
size_t patch_offset, std::vector<unsigned char>* new_data);
// imgpatch.cpp
int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value* patch, SinkFn sink,
- void* token, SHA_CTX* ctx, const Value* bonus_data);
+ SHA_CTX* ctx, const Value* bonus_data);
// freecache.cpp
int MakeFreeSpaceOnCache(size_t bytes_needed);