Change-Id: Id41135a151fcc354dbe6d7556ddb2cd98eb5f581
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
void list_clear(list_head *head)
{
+ if (!head)
+ return;
+
while (*head)
*head = list_remove_at(*head);
}
void list_clear_free_contents(list_head *head)
{
+ if (!head)
+ return;
+
while (*head) {
free(list_at(*head));
*head = list_remove_at(*head);
void list_clear_custom(list_head *head, void *user_data, apply_cb clear)
{
+ if (!head)
+ return;
+
while (*head) {
clear(list_at(*head), user_data);
*head = list_remove_at(*head);