parse: add pkg_dependency_free().
parent
81fd865a49
commit
9b540397f0
17
parse.c
17
parse.c
|
@ -107,6 +107,23 @@ pkg_dependency_append(pkg_dependency_t *head, pkg_dependency_t *tail)
|
||||||
return head;
|
return head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
pkg_dependency_free(pkg_dependency_t *head)
|
||||||
|
{
|
||||||
|
pkg_dependency_t *node, *next;
|
||||||
|
|
||||||
|
foreach_list_entry_safe(head, next, node)
|
||||||
|
{
|
||||||
|
if (node->package != NULL)
|
||||||
|
free(node->package);
|
||||||
|
|
||||||
|
if (node->version != NULL)
|
||||||
|
free(node->version);
|
||||||
|
|
||||||
|
free(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pkg_dependency_t *
|
pkg_dependency_t *
|
||||||
parse_deplist(pkg_t *pkg, const char *depends)
|
parse_deplist(pkg_t *pkg, const char *depends)
|
||||||
{
|
{
|
||||||
|
|
1
pkg.h
1
pkg.h
|
@ -140,6 +140,7 @@ const char *pkg_get_comparator(pkg_dependency_t *pkgdep);
|
||||||
pkg_t *parse_file(const char *path, FILE *f);
|
pkg_t *parse_file(const char *path, FILE *f);
|
||||||
pkg_dependency_t *parse_deplist(pkg_t *pkg, const char *depends);
|
pkg_dependency_t *parse_deplist(pkg_t *pkg, const char *depends);
|
||||||
pkg_dependency_t *pkg_dependency_append(pkg_dependency_t *head, pkg_dependency_t *tail);
|
pkg_dependency_t *pkg_dependency_append(pkg_dependency_t *head, pkg_dependency_t *tail);
|
||||||
|
void pkg_dependency_free(pkg_dependency_t *head);
|
||||||
|
|
||||||
/* argvsplit.c */
|
/* argvsplit.c */
|
||||||
int argv_split(const char *src, int *argc, char ***argv);
|
int argv_split(const char *src, int *argc, char ***argv);
|
||||||
|
|
Loading…
Reference in New Issue