diff options
Diffstat (limited to 'libappfuse/include/libappfuse/FuseAppLoop.h')
-rw-r--r-- | libappfuse/include/libappfuse/FuseAppLoop.h | 44 |
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 | |||
22 | namespace android { | ||
23 | namespace fuse { | ||
24 | |||
25 | class 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 | |||
39 | bool StartFuseAppLoop(int fd, FuseAppLoopCallback* callback); | ||
40 | |||
41 | } // namespace fuse | ||
42 | } // namespace android | ||
43 | |||
44 | #endif // ANDROID_LIBAPPFUSE_FUSEAPPLOOP_H_ | ||