Peter A. Bigot | 312f05e | 2019-07-21 17:06:54 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019 Peter Bigot Consulting, LLC |
| 3 | * |
| 4 | * SPDX-License-Identifier: Apache-2.0 |
| 5 | */ |
| 6 | |
| 7 | /* Utility functions for use by filesystem implementations. */ |
| 8 | |
| 9 | #ifndef ZEPHYR_SUBSYS_FS_FS_IMPL_H_ |
| 10 | #define ZEPHYR_SUBSYS_FS_FS_IMPL_H_ |
| 11 | |
Gerard Marull-Paretas | 5113c14 | 2022-05-06 11:12:04 +0200 | [diff] [blame] | 12 | #include <zephyr/fs/fs.h> |
Peter A. Bigot | 312f05e | 2019-07-21 17:06:54 -0500 | [diff] [blame] | 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /** |
| 19 | * @brief Strip the mount point prefix from a path. |
| 20 | * |
| 21 | * @param path an absolute path beginning with a mount point. |
| 22 | * |
| 23 | * @param mp a pointer to the mount point within which @p path is found |
| 24 | * |
| 25 | * @return the absolute path within the mount point. Behavior is |
| 26 | * undefined if @p path does not start with the mount point prefix. |
| 27 | */ |
| 28 | const char *fs_impl_strip_prefix(const char *path, |
| 29 | const struct fs_mount_t *mp); |
| 30 | |
| 31 | |
| 32 | #ifdef __cplusplus |
| 33 | } |
| 34 | #endif |
| 35 | |
| 36 | #endif /* ZEPHYR_SUBSYS_FS_FS_IMPL_H_ */ |