modified: src/planner.c

sql
simon 2024-12-11 14:06:29 +01:00
parent 9cc5075531
commit 67c0ea1b32
2 changed files with 22 additions and 0 deletions

View File

@ -52,6 +52,22 @@ Task *newTask(char *n, time_t c, time_t d, int p, uint64_t sp) {
return r;
}
/*
* create deepCopy of task
* !! r->name is malloced
*/
Task *copyTask(Task *t) {
Task *r = malloc(sizeof(Task));
if (r != NULL) {
r->name = strdup(t->name);
r->created = t->created;
r->deadline = t->deadline;
r->priority = t->priority;
r->spare = t->spare;
}
return r;
}
void printTask(Task *s) {
printf(taskFormat, s->name, s->created, s->deadline, s->priority, s->spare);
}

View File

@ -41,6 +41,12 @@ char *taskToStr(Task *t);
*/
void printTask(Task *s);
/*
* create deepCopy of task
* !! r->name is malloced
*/
Task *copyTask(Task *t);
/*
* Event struct contains task and planned time frame
*