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