diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-11-15 17:24:57 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-11-15 17:24:57 +0000 |
commit | 33b9585d68e6f084b214985c2beb2887bf9d929a (patch) | |
tree | 4a9e5052536d5d80148f00aa27c87c05ba4c9bc1 /src/list.h | |
parent | 64632d6965b47ce3835f256488273d8121c2cb54 (diff) |
insert stuff in tagTracker in sorted order, hopefully this makes it faster
git-svn-id: https://svn.musicpd.org/mpd/trunk@2672 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/list.h')
-rw-r--r-- | src/list.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/list.h b/src/list.h index 6ea43fbef..9a2a07484 100644 --- a/src/list.h +++ b/src/list.h @@ -52,6 +52,8 @@ typedef struct _List { long numberOfNodes; /* array for searching when list is sorted */ ListNode ** nodesArray; + /* sorted */ + int sorted; /* weather to strdup() key's on insertion */ int strdupKeys; } List; @@ -71,8 +73,8 @@ List * makeList(ListFreeDataFunc * freeDataFunc, int strdupKeys); */ ListNode * insertInList(List * list,char * key,void * data); -int insertInListBeforeNode(List * list, ListNode * beforeNode, char * key, - void * data); +ListNode * insertInListBeforeNode(List * list, ListNode * beforeNode, + char * key, void * data); int insertInListWithoutKey(List * list,void * data); @@ -95,7 +97,9 @@ void deleteNodeFromList(List * list,ListNode * node); */ int findInList(List * list, char * key, void ** data); -ListNode * findNodeInList(List * list, char * key); +/* if _key_ is not found, *_node_ is assigned to the node before which + the info would be found */ +int findNodeInList(List * list, char * key, ListNode ** node); /* frees memory malloc'd for list and its nodes * _list_ -> List to be free'd |