modified: Makefile

modified:   src/planner.c
	modified:   src/planner.h
This commit is contained in:
simon committed 2024-12-11 03:09:54 +01:00
1 parent 33cd1e87e3
commit 4f867b29cb
3 files changed
+13 -3

No files matched your search

+5
View File
@@ -9,6 +9,7 @@
#include "planner.h" // for subject and event structs
// #include "config.h"
#include <stdlib.h>
#include <string.h>
Event *newEvent(Task *t, time_t s, time_t e, uint64_t sp) {
Event *r = (Event *)malloc(sizeof(Event));
@@ -33,3 +34,7 @@ Task *newTask(char *n, time_t c, time_t d, int p, uint64_t sp) {
return r;
}
// for llist
int cmpTask(Task *a, Task *b) { return strcmp(a->name, b->name); }
int cmpEvent(Event *a, Event *b) { return cmpTask(a->task, b->task); }
+3
View File
@@ -26,6 +26,8 @@ typedef struct Task {
*/
Task *newTask(char *n, time_t c, time_t d, int p, uint64_t sp);
int cmpTask(Task *a, Task *b);
/*
* Event struct contains task and planned time frame
*
@@ -45,6 +47,7 @@ typedef struct Event {
* returns NULL on failure
*/
Event *newEvent(Task *t, time_t s, time_t e, uint64_t sp);
int cmpEvent(Event *a, Event *b);
int genPlan(Task *head);