Menustuff added/modified!

This commit is contained in:
robijn
2002-05-26 19:21:23 +00:00
parent dc4c049721
commit 3168d4cafc
27 changed files with 2304 additions and 584 deletions
+24
View File
@@ -743,6 +743,30 @@ LL_Find (LinkedList * list, int compare (void *, void *), void *value)
return NULL;
}
//////////////////////////////////////////////////////////////////////
// Array like...
// Goes to the nth list item, and returns the
// data found there.
//
void *
LL_GetByIndex (LinkedList * list, int index)
{
LL_node *node;
int num = 0;
if (!list)
return NULL;
if (index<0)
return NULL;
for (node = list->head.next; node != &list->tail; node = node->next) {
if (num == index)
return node->data;
num ++;
}
return NULL; // got past the end
}
//////////////////////////////////////////////////////////////////////
// Sorts the list, then rewinds it...
//