summaryrefslogtreecommitdiffstats
path: root/fuse_sideload/include/fuse_sideload.h
diff options
context:
space:
mode:
authorxunchang <xunchang@google.com>2019-03-16 00:04:32 +0100
committerxunchang <xunchang@google.com>2019-03-19 21:03:59 +0100
commit5e6832a24d39f15261be0cad19708274db57a126 (patch)
tree0e556c1f464c230f410028b8abf6378f0b45c92e /fuse_sideload/include/fuse_sideload.h
parentCreate a FuseDataProvider base class (diff)
downloadandroid_bootable_recovery-5e6832a24d39f15261be0cad19708274db57a126.tar
android_bootable_recovery-5e6832a24d39f15261be0cad19708274db57a126.tar.gz
android_bootable_recovery-5e6832a24d39f15261be0cad19708274db57a126.tar.bz2
android_bootable_recovery-5e6832a24d39f15261be0cad19708274db57a126.tar.lz
android_bootable_recovery-5e6832a24d39f15261be0cad19708274db57a126.tar.xz
android_bootable_recovery-5e6832a24d39f15261be0cad19708274db57a126.tar.zst
android_bootable_recovery-5e6832a24d39f15261be0cad19708274db57a126.zip
Diffstat (limited to '')
-rw-r--r--fuse_sideload/include/fuse_sideload.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/fuse_sideload/include/fuse_sideload.h b/fuse_sideload/include/fuse_sideload.h
index 821c7c808..1b7759a7f 100644
--- a/fuse_sideload/include/fuse_sideload.h
+++ b/fuse_sideload/include/fuse_sideload.h
@@ -17,7 +17,9 @@
#ifndef __FUSE_SIDELOAD_H
#define __FUSE_SIDELOAD_H
-#include <functional>
+#include <memory>
+
+#include "fuse_provider.h"
// Define the filenames created by the sideload FUSE filesystem.
static constexpr const char* FUSE_SIDELOAD_HOST_MOUNTPOINT = "/sideload";
@@ -26,15 +28,7 @@ static constexpr const char* FUSE_SIDELOAD_HOST_PATHNAME = "/sideload/package.zi
static constexpr const char* FUSE_SIDELOAD_HOST_EXIT_FLAG = "exit";
static constexpr const char* FUSE_SIDELOAD_HOST_EXIT_PATHNAME = "/sideload/exit";
-struct provider_vtab {
- // read a block
- std::function<bool(uint32_t block, uint8_t* buffer, uint32_t fetch_size)> read_block;
-
- // close down
- std::function<void(void)> close;
-};
-
-int run_fuse_sideload(const provider_vtab& vtab, uint64_t file_size, uint32_t block_size,
+int run_fuse_sideload(std::unique_ptr<FuseDataProvider>&& provider,
const char* mount_point = FUSE_SIDELOAD_HOST_MOUNTPOINT);
#endif