1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-22 04:49:46 +01:00
pkg-utils/main/depgraph.h
David Oberhollenzer aa6bbf2ef4 Move pkg-tool internal headers out of global include directory
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-05 12:36:47 +02:00

33 lines
757 B
C

/* SPDX-License-Identifier: ISC */
#ifndef DEPGRAPH_H
#define DEPGRAPH_H
struct pkg_dep_node {
char *name;
/* num dependencies == number of outgoing edges */
size_t num_deps;
/* direct dependencies == array of outgoing edges */
struct pkg_dep_node **deps;
/* linked list pointer */
struct pkg_dep_node *next;
};
struct pkg_dep_list {
struct pkg_dep_node *head;
struct pkg_dep_node *tail;
};
struct pkg_dep_node *append_pkg(struct pkg_dep_list *list, const char *name);
struct pkg_dep_node *find_pkg(struct pkg_dep_list *list, const char *name);
void pkg_list_cleanup(struct pkg_dep_list *list);
int collect_dependencies(int repofd, struct pkg_dep_list *list);
int sort_by_dependencies(struct pkg_dep_list *list);
#endif /* DEPGRAPH_H */