From ddc60c20fe7cdbdc4f5ace0510a363d5ad1c4503 Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 30 Apr 2001 19:44:54 +0000 Subject: [PATCH] Added CollDeleteAll git-svn-id: svn://svn.cc65.org/cc65/trunk@698 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/common/coll.c | 13 ++++++++++++- src/common/coll.h | 7 ++++++- src/common/make/gcc.mak | 2 -- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/common/coll.c b/src/common/coll.c index 5d77ca2e8..6748ff12d 100644 --- a/src/common/coll.c +++ b/src/common/coll.c @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000 Ullrich von Bassewitz */ +/* (C) 2000-2001 Ullrich von Bassewitz */ /* Wacholderweg 14 */ /* D-70597 Stuttgart */ /* EMail: uz@musoftware.de */ @@ -211,6 +211,17 @@ void CollDelete (Collection* C, unsigned Index) +void CollDeleteAll (Collection* C) +/* Delete all items from the given collection. This will not free the items + * itself, it will only remove the pointers. + */ +{ + /* This one is easy... */ + C->Count = 0; +} + + + void CollReplace (Collection* C, void* Item, unsigned Index) /* Replace the item at the given position. The old item will not be freed, * just the pointer will et replaced. diff --git a/src/common/coll.h b/src/common/coll.h index ba1d4f601..37c759ba8 100644 --- a/src/common/coll.h +++ b/src/common/coll.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 2000 Ullrich von Bassewitz */ +/* (C) 2000-2001 Ullrich von Bassewitz */ /* Wacholderweg 14 */ /* D-70597 Stuttgart */ /* EMail: uz@musoftware.de */ @@ -108,6 +108,11 @@ void CollDelete (Collection* C, unsigned Index); * will get moved to a lower position. */ +void CollDeleteAll (Collection* C); +/* Delete all items from the given collection. This will not free the items + * itself, it will only remove the pointers. + */ + void CollReplace (Collection* C, void* Item, unsigned Index); /* Replace the item at the given position. The old item will not be freed, * just the pointer will et replaced. diff --git a/src/common/make/gcc.mak b/src/common/make/gcc.mak index 83b64f0c0..60933e52d 100644 --- a/src/common/make/gcc.mak +++ b/src/common/make/gcc.mak @@ -60,5 +60,3 @@ depend dep: $(OBJS:.o=.c) $(CC) -MM $^ > .depend - - -- 2.39.5