]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/fstab-util.h
update TODO
[thirdparty/systemd.git] / src / shared / fstab-util.h
CommitLineData
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
bc9e5a4c 9bool fstab_is_extrinsic(const char *mount, const char *opts);
b9088048 10int fstab_is_mount_point(const char *mount);
6c1921e9 11int fstab_has_fstype(const char *fstype);
6550203e
LP
12
13int fstab_filter_options(const char *opts, const char *names, const char **namefound, char **value, char **filtered);
d15d0333 14
3519d230
KZ
15int fstab_extract_values(const char *opts, const char *name, char ***values);
16
d15d0333
ZJS
17static inline bool fstab_test_option(const char *opts, const char *names) {
18 return !!fstab_filter_options(opts, names, NULL, NULL, NULL);
19}
20
21int fstab_find_pri(const char *options, int *ret);
b9f111b9
ZJS
22
23static inline bool fstab_test_yes_no_option(const char *opts, const char *yes_no) {
b9f111b9
ZJS
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
10c353e1 29 assert_se(fstab_filter_options(opts, yes_no, &opt, NULL, NULL) >= 0);
b9f111b9
ZJS
30
31 return opt == yes_no;
32}
6550203e
LP
33
34char *fstab_node_to_udev_node(const char *p);
ed4ad488
ZJS
35
36static inline const char* fstab_path(void) {
37 return secure_getenv("SYSTEMD_FSTAB") ?: "/etc/fstab";
38}