Re: [strongSwan] Remove all elements from a hashtable_t

2010-06-09 Thread Graham Hudspith
Martin, Tobias, Thanks for the info. I'm glad you confirmed there was no secret method of emptying the hashtable that I'd missed. Also that my suspicions about invalidating the enumerator if I enumerated-and-removed were correct. In the end (a Friday afternoon deadline approaching) I decided to

Re: [strongSwan] Remove all elements from a hashtable_t

2010-06-09 Thread Tobias Brunner
Hi Graham, If I get a chance, I'll try out your patch, this may take some weeks to getting around to though. Unfortunately, the patch contained a small bug. But I commited a proper version to master on Monday (see [1]). Regards, Tobias

Re: [strongSwan] Remove all elements from a hashtable_t

2010-06-05 Thread Martin Willi
Hi Graham, It seems to me that the only way to delete all elements in the hashtable_t is to create an enumerator, enumerate over the elements and call remove for each element found. Yes. Does the hashtable_t+enumerator_t support this mode of operation ? I think so. The hashtable is based

Re: [strongSwan] Remove all elements from a hashtable_t

2010-06-05 Thread Tobias Brunner
Does the hashtable_t+enumerator_t support this mode of operation ? I think so. The hashtable is based on many linked_lists, and the remove function from list can handle this. @Tobias: Please correct me if I'm wrong. That wouldn't work. For the linked list you also can't just call remove,

[strongSwan] Remove all elements from a hashtable_t

2010-06-04 Thread Graham Hudspith
Hello All, Quick development question for you (nice on a Friday afternoon). I've a hashtable_t containing elements and I want to delete all elements from that hashtable_t. And use the hashtable_t again afterwards. I can see that hashtable_t supports getting, setting and removing of elements.