summaryrefslogtreecommitdiffstats
path: root/lib/utils_disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils_disk.c')
-rw-r--r--lib/utils_disk.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/utils_disk.c b/lib/utils_disk.c
index 582d3ea..ce02fdf 100644
--- a/lib/utils_disk.c
+++ b/lib/utils_disk.c
@@ -40,6 +40,17 @@ np_add_name (struct name_list **list, const char *name)
40 *list = new_entry; 40 *list = new_entry;
41} 41}
42 42
43/* Initialises a new regex at the begin of list via regcomp(3) */
44int
45np_add_regex (struct regex_list **list, const char *regex, int cflags)
46{
47 struct regex_list *new_entry = (struct regex_list *) malloc (sizeof *new_entry);
48 new_entry->next = *list;
49 *list = new_entry;
50
51 return regcomp(&new_entry->regex, regex, cflags);
52}
53
43/* Initialises a new parameter at the end of list */ 54/* Initialises a new parameter at the end of list */
44struct parameter_list * 55struct parameter_list *
45np_add_parameter(struct parameter_list **list, const char *name) 56np_add_parameter(struct parameter_list **list, const char *name)