new file: doc/formatSpecifier.md

modified:   src/llist.c
	modified:   src/test.c
This commit is contained in:
simon committed 2024-12-11 12:33:50 +01:00
1 parent f90377d34a
commit 8e233caf99
3 files changed
+130 -7

No files matched your search

+1
View File
@@ -48,6 +48,7 @@ llist *llistGet(llist *head, void *key) {
llist *c = head;
while (c != NULL) {
if (head->cmpFn(c->data, key) == 0) {
return c;
}
c = c->next;
+11 -7
View File
@@ -16,20 +16,24 @@ int main() {
Task t2 = {
.name = "Phys", .created = now, .deadline = now + days(2), .priority = 7};
// create plan
// planner([t1,t2])
//
printf("%s\n", ctime(&now));
// new llist test
llist *list1 = llistNew(t1, cmpTask);
llistAppend(list1, &t2);
llist *found = llistGet(list1, &t2);
// print test tasks
serialize(t1);
serialize(&t2);
serialize(found->data);
// find in list & modify
Task search = {.name = "Phys"};
llist *found = llistGet(list1, &search);
if (found != NULL) {
((Task *)found->data)->deadline = time(NULL) + days(10);
serialize(found->data);
}
serialize(&t2);
free(t1);
return 0;