From 08edf9d6445f3962bf31d5f3c9fa5c9cb363c30d Mon Sep 17 00:00:00 2001 From: Dmitri Pal Date: Wed, 15 Jul 2009 15:17:53 -0400 Subject: COLLECTION Add remove item functions The remove functions extract and remove items, they act differently from the way the delete_property function works. The new functions allow deletion with the disposition while the delete_property only deletes specified property. The delete_property function is left as is since there are some use cases when it is more efficient to use it rather than new remove_item_xxx ones. --- common/elapi/elapi_event.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'common/elapi/elapi_event.c') diff --git a/common/elapi/elapi_event.c b/common/elapi/elapi_event.c index 9322f8217..fe3b3a5e3 100644 --- a/common/elapi/elapi_event.c +++ b/common/elapi/elapi_event.c @@ -732,11 +732,12 @@ static int process_arg_list(struct collection_item *col, else { /* Remove case */ while (error != ENOENT) { - error = col_delete_property(col, - propcopy, - COL_TYPE_ANY, - COL_TRAVERSE_DEFAULT); - + error = col_remove_item(col, + NULL, + COL_DSP_FIRSTDUP, + propcopy, + 0, + COL_TYPE_ANY); if ((error) && (error != ENOENT)) { TRACE_ERROR_STRING("Error deleting property", propcopy); free(propcopy); -- cgit