]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
d15d0333 ZJS |
2 | #pragma once |
3 | ||
69a283c5 | 4 | #include "forward.h" |
d15d0333 | 5 | |
1177373b YW |
6 | bool fstab_enabled_full(int enabled); |
7 | static inline bool fstab_enabled(void) { | |
8 | return fstab_enabled_full(-1); | |
9 | } | |
10 | static inline bool fstab_set_enabled(bool enabled) { | |
11 | return fstab_enabled_full(enabled); | |
12 | } | |
13 | ||
bc9e5a4c | 14 | bool fstab_is_extrinsic(const char *mount, const char *opts); |
6c1921e9 | 15 | int fstab_has_fstype(const char *fstype); |
6550203e | 16 | |
99299d0d MY |
17 | int fstab_is_mount_point_full(const char *where, const char *path); |
18 | static inline int fstab_is_mount_point(const char *where) { | |
19 | return fstab_is_mount_point_full(where, NULL); | |
20 | } | |
24c0078a MY |
21 | static inline int fstab_has_node(const char *path) { |
22 | return fstab_is_mount_point_full(NULL, path); | |
23 | } | |
99299d0d | 24 | |
58bf70f9 | 25 | int fstab_has_mount_point_prefix_strv(char * const *prefixes); |
8a132658 | 26 | |
ff0c31bc ZJS |
27 | int fstab_filter_options( |
28 | const char *opts, | |
29 | const char *names, | |
30 | const char **ret_namefound, | |
31 | char **ret_value, | |
32 | char ***ret_values, | |
33 | char **ret_filtered); | |
d15d0333 | 34 | static inline bool fstab_test_option(const char *opts, const char *names) { |
5d193883 | 35 | return fstab_filter_options(opts, names, NULL, NULL, NULL, NULL); |
d15d0333 | 36 | } |
b9f111b9 | 37 | static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no) { |
5d193883 | 38 | const char *opt_found; |
b9f111b9 ZJS |
39 | |
40 | /* If first name given is last, return 1. | |
41 | * If second name given is last or neither is found, return 0. */ | |
42 | ||
5d193883 | 43 | assert_se(fstab_filter_options(opts, yes_no, &opt_found, NULL, NULL, NULL) >= 0); |
b9f111b9 | 44 | |
5d193883 | 45 | return opt_found == yes_no; |
b9f111b9 | 46 | } |
5d193883 | 47 | int fstab_find_pri(const char *opts, int *ret); |
6550203e | 48 | |
ff3f2953 | 49 | char* fstab_node_to_udev_node(const char *p); |
ed4ad488 | 50 | |
69a283c5 | 51 | const char* fstab_path(void); |
35df78cd MY |
52 | |
53 | bool fstab_is_bind(const char *options, const char *fstype); |