parent
33cd1e87e3
commit
4f867b29cb
8
Makefile
8
Makefile
|
@ -8,15 +8,17 @@ UIF=src/ui.c src/ui.h #UI files
|
|||
PLF=src/planner.c src/planner.h #planner files
|
||||
DBF=src/db.c src/db.h #db files
|
||||
CALF=src/iCal.c src/iCal.h
|
||||
LLST=src/llist.c src/llist.h
|
||||
CONFIG=src/config.h #config file
|
||||
|
||||
|
||||
#targets
|
||||
debug: test ui planner db iCal config
|
||||
gcc test.o ui.o planner.o db.o iCal.o -o debugOut
|
||||
debug: test ui planner db iCal config llist
|
||||
gcc test.o ui.o planner.o db.o iCal.o llist.o -o debugOut
|
||||
|
||||
config: $(CONFIG)
|
||||
|
||||
llist: $(LLST)
|
||||
gcc -c $(CFLAGS) $(LLST)
|
||||
test: src/test.c
|
||||
gcc -c $(CFLAGS) src/test.c
|
||||
iCal: $(CALF)
|
||||
|
|
|
@ -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); }
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue