modified: src/planner.c
parent
9cc5075531
commit
67c0ea1b32
|
@ -52,6 +52,22 @@ Task *newTask(char *n, time_t c, time_t d, int p, uint64_t sp) {
|
||||||
return r;
|
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) {
|
void printTask(Task *s) {
|
||||||
printf(taskFormat, s->name, s->created, s->deadline, s->priority, s->spare);
|
printf(taskFormat, s->name, s->created, s->deadline, s->priority, s->spare);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,12 @@ char *taskToStr(Task *t);
|
||||||
*/
|
*/
|
||||||
void printTask(Task *s);
|
void printTask(Task *s);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* create deepCopy of task
|
||||||
|
* !! r->name is malloced
|
||||||
|
*/
|
||||||
|
Task *copyTask(Task *t);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Event struct contains task and planned time frame
|
* Event struct contains task and planned time frame
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue