diff options
Diffstat (limited to 'lib/utils_disk.c')
-rw-r--r-- | lib/utils_disk.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/utils_disk.c b/lib/utils_disk.c index 96f5a306..3f9c8a9a 100644 --- a/lib/utils_disk.c +++ b/lib/utils_disk.c | |||
@@ -74,6 +74,26 @@ np_add_parameter(struct parameter_list **list, const char *name) | |||
74 | return new_path; | 74 | return new_path; |
75 | } | 75 | } |
76 | 76 | ||
77 | /* Delete a given parameter from list and return pointer to next element*/ | ||
78 | struct parameter_list * | ||
79 | np_del_parameter(struct parameter_list *item, struct parameter_list *prev) | ||
80 | { | ||
81 | struct parameter_list *next; | ||
82 | if (item->name_next) | ||
83 | next = item->name_next; | ||
84 | else | ||
85 | next = NULL; | ||
86 | |||
87 | |||
88 | free(item); | ||
89 | if (prev) | ||
90 | prev->name_next = next; | ||
91 | |||
92 | return next; | ||
93 | |||
94 | } | ||
95 | |||
96 | |||
77 | /* returns a pointer to the struct found in the list */ | 97 | /* returns a pointer to the struct found in the list */ |
78 | struct parameter_list * | 98 | struct parameter_list * |
79 | np_find_parameter(struct parameter_list *list, const char *name) | 99 | np_find_parameter(struct parameter_list *list, const char *name) |
@@ -166,3 +186,4 @@ np_regex_match_mount_entry (struct mount_entry* me, regex_t* re) | |||
166 | return false; | 186 | return false; |
167 | } | 187 | } |
168 | } | 188 | } |
189 | |||