summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaichi Hirono2016-11-07 19:17:51 -0600
committerDaichi Hirono2016-11-14 18:47:31 -0600
commita0aecda12b9a76aa15a8c5175e15538574a05af7 (patch)
treeac1e8eda1f03a8922445ae13d6d7a4173158c4ec /libappfuse/include/libappfuse/FuseAppLoop.h
parentb5ce6f02dd11b42c03884dd9531c6c8a80bcecda (diff)
downloadplatform-system-core-a0aecda12b9a76aa15a8c5175e15538574a05af7.tar.gz
platform-system-core-a0aecda12b9a76aa15a8c5175e15538574a05af7.tar.xz
platform-system-core-a0aecda12b9a76aa15a8c5175e15538574a05af7.zip
Add FuseAppLoop to libappfuse.
The class is used at the app side (StorageManager) to parse FUSE commands. Bug: 32260320 Test: libappfuse_test Change-Id: I1ae2904d3290a041f1efbf8fc10ba032eda5449c
Diffstat (limited to 'libappfuse/include/libappfuse/FuseAppLoop.h')
-rw-r--r--libappfuse/include/libappfuse/FuseAppLoop.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/libappfuse/include/libappfuse/FuseAppLoop.h b/libappfuse/include/libappfuse/FuseAppLoop.h
new file mode 100644
index 000000000..c3edfcc32
--- /dev/null
+++ b/libappfuse/include/libappfuse/FuseAppLoop.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specic language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ANDROID_LIBAPPFUSE_FUSEAPPLOOP_H_
18#define ANDROID_LIBAPPFUSE_FUSEAPPLOOP_H_
19
20#include "libappfuse/FuseBuffer.h"
21
22namespace android {
23namespace fuse {
24
25class FuseAppLoopCallback {
26 public:
27 virtual bool IsActive() = 0;
28 virtual int64_t OnGetSize(uint64_t inode) = 0;
29 virtual int32_t OnFsync(uint64_t inode) = 0;
30 virtual int32_t OnWrite(
31 uint64_t inode, uint64_t offset, uint32_t size, const void* data) = 0;
32 virtual int32_t OnRead(
33 uint64_t inode, uint64_t offset, uint32_t size, void* data) = 0;
34 virtual int32_t OnOpen(uint64_t inode) = 0;
35 virtual int32_t OnRelease(uint64_t inode) = 0;
36 virtual ~FuseAppLoopCallback() = default;
37};
38
39bool StartFuseAppLoop(int fd, FuseAppLoopCallback* callback);
40
41} // namespace fuse
42} // namespace android
43
44#endif // ANDROID_LIBAPPFUSE_FUSEAPPLOOP_H_