summaryrefslogtreecommitdiffstats
path: root/applypatch/include/applypatch/applypatch.h
diff options
context:
space:
mode:
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);