]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
d15d0333 ZJS |
2 | #pragma once |
3 | ||
d15d0333 ZJS |
4 | #include <stdbool.h> |
5 | #include <stddef.h> | |
6550203e | 6 | |
b9f111b9 | 7 | #include "macro.h" |
d15d0333 | 8 | |
b9088048 | 9 | int fstab_is_mount_point(const char *mount); |
6c1921e9 | 10 | int fstab_has_fstype(const char *fstype); |
6550203e LP |
11 | |
12 | int fstab_filter_options(const char *opts, const char *names, const char **namefound, char **value, char **filtered); | |
d15d0333 | 13 | |
3519d230 KZ |
14 | int fstab_extract_values(const char *opts, const char *name, char ***values); |
15 | ||
d15d0333 ZJS |
16 | static inline bool fstab_test_option(const char *opts, const char *names) { |
17 | return !!fstab_filter_options(opts, names, NULL, NULL, NULL); | |
18 | } | |
19 | ||
20 | int fstab_find_pri(const char *options, int *ret); | |
b9f111b9 ZJS |
21 | |
22 | static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no) { | |
23 | int r; | |
24 | const char *opt; | |
25 | ||
26 | /* If first name given is last, return 1. | |
27 | * If second name given is last or neither is found, return 0. */ | |
28 | ||
29 | r = fstab_filter_options(opts, yes_no, &opt, NULL, NULL); | |
30 | assert(r >= 0); | |
31 | ||
32 | return opt == yes_no; | |
33 | } | |
6550203e LP |
34 | |
35 | char *fstab_node_to_udev_node(const char *p); |