fragment: add pkg_fragment_free().
parent
ba1c41eb14
commit
81fd865a49
|
@ -111,3 +111,12 @@ pkg_fragment_delete(pkg_fragment_t *node)
|
|||
free(node->data);
|
||||
free(node);
|
||||
}
|
||||
|
||||
void
|
||||
pkg_fragment_free(pkg_fragment_t *head)
|
||||
{
|
||||
pkg_fragment_t *node, *next;
|
||||
|
||||
foreach_list_entry_safe(head, next, node)
|
||||
pkg_fragment_delete(node);
|
||||
}
|
||||
|
|
1
pkg.h
1
pkg.h
|
@ -150,6 +150,7 @@ pkg_fragment_t *pkg_fragment_add(pkg_fragment_t *head, const char *string);
|
|||
pkg_fragment_t *pkg_fragment_copy(pkg_fragment_t *head, pkg_fragment_t *base);
|
||||
void pkg_fragment_delete(pkg_fragment_t *node);
|
||||
bool pkg_fragment_exists(pkg_fragment_t *head, pkg_fragment_t *base);
|
||||
void pkg_fragment_free(pkg_fragment_t *head);
|
||||
|
||||
/* fileio.c */
|
||||
char *pkg_fgetline(char *line, size_t size, FILE *stream);
|
||||
|
|
Loading…
Reference in New Issue