ListEmpty
Description
Check whether list has no items.
Parameters
| Name | Direction | Description |
|---|---|---|
l |
in | List to query. |
Success
Returns true when the list length is 0. The list is not modified.
Failure
Returns false when the list contains at least one node. The list is not modified.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
List.Access.c:30:
static bool test_list_len_empty(void) {
WriteFmt("Testing ListLen and ListEmpty\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
List.Access.c:38:
bool result = (ListLen(&list) == 0);
result = result && ListEmpty(&list);
ListPushBackR(&list, 10);- In
List.Access.c:44:
result = result && (ListLen(&list) == 2);
result = result && !ListEmpty(&list);
ListClear(&list);- In
List.Access.c:48:
ListClear(&list);
result = result && (ListLen(&list) == 0);
result = result && ListEmpty(&list);
result = result && (ListHead(&list) == NULL) && (ListTail(&list) == NULL);
Last updated on