From 3035a6a3bff45f668d53cd94fafd44870d401c6e Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 00:34:16 -0500 Subject: 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 --- (limited to 'libopkg/active_list.c') 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; -- cgit v0.9.1