modified: src/llist.c

modified:   src/llist.h
This commit is contained in:
simon committed 2024-12-11 11:01:37 +01:00
1 parent 9b98291c1e
commit ca5065d569
2 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -26,7 +26,7 @@ llist *llistTail(llist *l) {
return tail;
}
/* creates new node from data and appends it to head
/* creates new node from data and appends it to tail
*
*/
llist *llistAppend(llist *head, void *data) {
@@ -41,7 +41,10 @@ llist *llistAppend(llist *head, void *data) {
return new;
}
void *llistGet(llist *head, void *key) {
/*
* return Node containing key or NULL
*/
llist *llistGet(llist *head, void *key) {
llist *c = head;
while (c != NULL) {
if (key == c) {
@@ -51,6 +54,7 @@ void *llistGet(llist *head, void *key) {
}
return NULL;
}
bool llistContains(llist *head, void *key) {
return llistGet(head, key) != NULL;
}