From 3cee1f6a2ce66f4bb3b04db5ebb00b1dce9d6c25 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Sun, 19 Aug 2007 14:46:00 +0000 Subject: Queue patch git-svn-id: https://svn.musicpd.org/mpd/branches/q-mpd@6757 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/list.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/list.c') diff --git a/src/list.c b/src/list.c index 71c30f7b6..14832adb7 100644 --- a/src/list.c +++ b/src/list.c @@ -287,6 +287,21 @@ int findInList(List * list, char *key, void **data) return 0; } +ListNode *getNodeByPosition(List *list, int pos) +{ + ListNode *tmpNode; + + assert(list != NULL); + if (pos < 0 || pos >= list->numberOfNodes) + return NULL; + + tmpNode = list->firstNode; + while (pos-- > 0) + tmpNode = tmpNode->nextNode; + + return tmpNode; +} + int deleteFromList(List * list, char *key) { ListNode *tmpNode; -- cgit v1.2.3