summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/utils_disk.c10
-rw-r--r--lib/utils_disk.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/utils_disk.c b/lib/utils_disk.c
index 877b80d..cfd6a97 100644
--- a/lib/utils_disk.c
+++ b/lib/utils_disk.c
@@ -155,3 +155,13 @@ np_seen_name(struct name_list *list, const char *name)
155 return FALSE; 155 return FALSE;
156} 156}
157 157
158int
159np_regex_match_mount_entry (struct mount_entry* me, regex_t* re)
160{
161 if (regexec(re, me->me_devname, (size_t) 0, NULL, 0) == 0 ||
162 regexec(re, me->me_mountdir, (size_t) 0, NULL, 0) == 0 ) {
163 return true;
164 } else {
165 return false;
166 }
167}
diff --git a/lib/utils_disk.h b/lib/utils_disk.h
index 331c16d..6263339 100644
--- a/lib/utils_disk.h
+++ b/lib/utils_disk.h
@@ -2,6 +2,7 @@
2 2
3#include "mountlist.h" 3#include "mountlist.h"
4#include "utils_base.h" 4#include "utils_base.h"
5#include "regex.h"
5 6
6struct name_list 7struct name_list
7{ 8{
@@ -32,3 +33,4 @@ struct parameter_list *np_add_parameter(struct parameter_list **list, const char
32struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name); 33struct parameter_list *np_find_parameter(struct parameter_list *list, const char *name);
33int search_parameter_list (struct parameter_list *list, const char *name); 34int search_parameter_list (struct parameter_list *list, const char *name);
34void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, int exact); 35void np_set_best_match(struct parameter_list *desired, struct mount_entry *mount_list, int exact);
36int np_regex_match_mount_entry (struct mount_entry* me, regex_t* re);