diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:34:16 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:34:16 (EST) |
commit | 3035a6a3bff45f668d53cd94fafd44870d401c6e (patch) | |
tree | b441e5bcfc4549ae2fbbf7db061e3665ae48b0cf /libopkg/active_list.c | |
parent | 4ec6ca94f200ed52f2cc00ff740bae13d7fef6be (diff) |
opkg: using active_list to list all the installed pkgs.
adding function that allows node move from one list to another
git-svn-id: http://opkg.googlecode.com/svn/trunk@178 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/active_list.c')
-rw-r--r-- | libopkg/active_list.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libopkg/active_list.c b/libopkg/active_list.c index e100101..861454e 100644 --- a/libopkg/active_list.c +++ b/libopkg/active_list.c @@ -73,6 +73,18 @@ struct active_list * active_list_prev(struct active_list *head, struct active_li return prev; } + +struct active_list *active_list_move_node(struct active_list *old_head, struct active_list *new_head, struct active_list *node) { + struct active_list *prev; + if (!old_head || !new_head || !node) + return NULL; + if (old_head == new_head) + return node; + prev = active_list_prev(old_head, node); + active_list_add(new_head, node); + return prev; +} + static void list_head_clear (struct list_head *head) { struct active_list *next; struct list_head *n, *ptr; |