- message encryption verification fully changed

This commit is contained in:
Jan Hutter
2005-11-30 08:32:23 +00:00
parent f890d8fe62
commit d440fe6d0b
4 changed files with 265 additions and 80 deletions
+15
View File
@@ -75,6 +75,21 @@ struct iterator_t {
* @param[in] item value to insert in list
*/
void (*insert_after) (iterator_t *this, void *item);
/**
* @brief Replace the current item at current iterator position.
*
* The iterator position is not changed after replacing.
*
* @param this calling iterator
* @param[out]old_item old value will be written here(can be NULL)
* @param[in] new_item new value
*
* @return
* - SUCCESS
* - FAILED if iterator is on an invalid position
*/
status_t (*replace) (iterator_t *this, void **old_item, void *new_item);
/**
* @brief removes an element from list at the given iterator position.
+19
View File
@@ -292,6 +292,24 @@ static void insert_before(private_iterator_t * iterator, void *item)
iterator->list->count++;
}
/**
* Implementation of iterator_t.replace.
*/
status_t replace (private_iterator_t *this, void **old_item, void *new_item)
{
if (this->current == NULL)
{
return NOT_FOUND;
}
if (old_item != NULL)
{
*old_item = this->current->value;
}
this->current->value = new_item;
return SUCCESS;
}
/**
* Implementation of iterator_t.insert_after.
*/
@@ -490,6 +508,7 @@ static iterator_t *create_iterator (private_linked_list_t *linked_list,bool forw
this->public.current = (status_t (*) (iterator_t *this, void **value)) iterator_current;
this->public.insert_before = (void (*) (iterator_t *this, void *item)) insert_before;
this->public.insert_after = (void (*) (iterator_t *this, void *item)) insert_after;
this->public.replace = (status_t (*) (iterator_t *, void **, void *)) replace;
this->public.remove = (status_t (*) (iterator_t *this)) remove;
this->public.reset = (void (*) (iterator_t *this)) iterator_reset;
this->public.destroy = (void (*) (iterator_t *this)) iterator_destroy;