active_list.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* active_list.h - the opkg package management system
  2. Tick Chen <tick@openmoko.com>
  3. Copyright (C) 2008 Openmoko Inc.
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License as
  6. published by the Free Software Foundation; either version 2, or (at
  7. your option) any later version.
  8. This program is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. */
  13. #ifndef ACTIVE_LIST_H
  14. #define ACTIVE_LIST_H
  15. #include "list.h"
  16. #include "pkg.h"
  17. struct active_list {
  18. struct list_head node;
  19. struct list_head depend;
  20. struct active_list *depended;
  21. pkg_t *pkg;
  22. };
  23. struct active_list *active_list_head_new(void);
  24. void active_list_head_delete(struct active_list *);
  25. void active_list_init(struct active_list *ptr);
  26. void active_list_clear(struct active_list *head);
  27. void active_list_add_depend(struct active_list *node,
  28. struct active_list *depend);
  29. void active_list_add(struct active_list *head, struct active_list *node);
  30. struct active_list *active_list_move_node(struct active_list *old_head,
  31. struct active_list *new_head,
  32. struct active_list *node);
  33. struct active_list *active_list_sort(struct active_list *head,
  34. int (*compare_fcn_t) (const void *,
  35. const void *));
  36. struct active_list *active_list_next(struct active_list *head,
  37. struct active_list *ptr);
  38. struct active_list *active_list_prev(struct active_list *head,
  39. struct active_list *ptr);
  40. #endif