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