Skip to content
Snippets Groups Projects
Commit e956c20c authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Added list_is_empty function to BIRD lists.

parent 1f393e76
No related branches found
No related tags found
No related merge requests found
......@@ -177,3 +177,20 @@ size_t list_size(const list *l)
return count;
}
/**
* list_is_empty - Checks whether the list is empty
* @l: list
*
* This function returns 1 if list is empty, 0 otherwise.
*/
int list_is_empty(const list *l)
{
node *n = 0;
WALK_LIST(n, *l) {
return 0;
}
return 1;
}
......@@ -82,6 +82,7 @@ void init_list(list *);
void insert_node(node *, node *);
void list_dup(list *dst, list *src, size_t itemsz);
size_t list_size(const list *);
int list_is_empty(const list *l);
/*!
* \brief List item for string lists.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment