-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvfs_user.h
More file actions
63 lines (57 loc) · 2.44 KB
/
vfs_user.h
File metadata and controls
63 lines (57 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* @file vfs_user.h
* @brief VFS user files header.
*
* DAPLink Interface Firmware
* Copyright (c) 2020, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef VFS_USER_H
#define VFS_USER_H
#include <stdbool.h>
#include "virtual_fs.h"
#ifdef __cplusplus
extern "C" {
#endif
//! @brief Hook for file changes in root directory.
//!
//! @param filename Name of the file that has changed.
//! @param change Type of change.
//! @param file
//! @param new_file_data Data being written to the file if _change_ is #VFS_FILE_CHANGED.
//! @retval true The hook handled the change notification, the caller should do nothing else.
//! @retval false The hook did nothing, continue with normal behaviour.
bool vfs_user_file_change_handler_hook(const vfs_filename_t filename,
vfs_file_change_t change, vfs_file_t file, vfs_file_t new_file_data);
//! @brief Hook for magic files.
//!
//! This hook is intended to simplify checking for magic files. In addition to allowing support for
//! new magic files, you can also change the behaviour of or disable standard magic files.
//!
//! @param filename Name of the file that was created.
//! @param[out] do_remount Whether the caller should remount the MSD volume. Only applies if true
//! is returned. The default is true, so if the hook does not modify this parameter and returns
//! true, a remount is performed.
//! @retval true The hook handled the specified file. A remount will be performed if requested,
//! but otherwise no other standard behaviour is applied.
//! @retval false The hook did not handle the file; continue with canonical behaviour.
bool vfs_user_magic_file_hook(const vfs_filename_t filename, bool *do_remount);
// Build the filesystem by calling vfs_init and then adding files with vfs_create_file
void vfs_user_build_filesystem(void);
void vfs_user_disconnecting();
#ifdef __cplusplus
}
#endif
#endif // VFS_USER_H