Added CollLast

git-svn-id: svn://svn.cc65.org/cc65/trunk@314 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2000-09-02 11:47:08 +00:00
parent 39011ef825
commit 8198af9844
2 changed files with 16 additions and 1 deletions

View File

@@ -158,6 +158,18 @@ void* CollAt (Collection* C, unsigned Index)
void* CollLast (Collection* C)
/* Return the last item in a collection */
{
/* We must have at least one entry */
PRECONDITION (C->Count > 0);
/* Return the element */
return C->Items[C->Count-1];
}
void CollDelete (Collection* C, unsigned Index)
/* Remove the item with the given index from the collection. This will not
* free the item itself, just the pointer. All items with higher indices