#ifndef PLANNER #define PLANNER #include #include /* * task subject struct used to track different tasks * create new task with taskNew(name, time_t created, time_t deadline, int * priority, uint64_t spare) * * should be freed by user * * used to interface with human and store data */ typedef struct Task { char *name; time_t created; time_t deadline; int priority; uint64_t spare; } Task; /* * allocates and returns Task (free after use) * returns NULL on failure */ Task *newTask(char *n, time_t c, time_t d, int p, uint64_t sp); /* * compare function for Task */ int cmpTask(void *a, void *b); /* * prints human readable str of Task to stdout */ void printTask(Task *s); /* * Event struct contains task and planned time frame * * used to create timetable * * eventNew(task, start, end, spare) * task: pointer to task (Alloced with newTask) * plannedStartTime: time_t * plannedEndTime: time_t * uint64_t spare var * */ typedef struct Event { Task *task; time_t plannedStartTime; time_t plannedEndTime; uint64_t spare; // spare var } Event; /* * allocates and returns Event (free after use) * returns NULL on failure */ Event *newEvent(Task *t, time_t s, time_t e, uint64_t sp); /* * compare function for Event */ int cmpEvent(void *a, void *b); int genPlan(Task *head); #endif // !PLANNER