libsepol/cil: Add cil_list_is_empty macro
Add a macro, called cil_list_is_empty, that returns true if the list pointer or list head is NULL. Signed-off-by: James Carter <jwcart2@gmail.com> Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com> Acked-by: Petr Lautrbach <lautrbach@redhat.com>
This commit is contained in:
parent
347254695f
commit
085e330062
|
@ -44,6 +44,9 @@ struct cil_list_item {
|
|||
void *data;
|
||||
};
|
||||
|
||||
#define cil_list_is_empty(list) \
|
||||
((list) == NULL || (list)->head == NULL)
|
||||
|
||||
#define cil_list_for_each(item, list) \
|
||||
for (item = (list)->head; item != NULL; item = item->next)
|
||||
|
||||
|
|
Loading…
Reference in New Issue