From bdabc372b7c88fb92bcd1d9d0f8a80a4f6511e10 Mon Sep 17 00:00:00 2001 From: ketrptr Date: Mon, 9 Dec 2024 19:27:50 +0100 Subject: [PATCH] new file: Makefile new file: src/config.h new file: src/db.c new file: src/db.h new file: src/planner.c new file: src/planner.h new file: src/ui.c new file: src/ui.h --- Makefile | 14 ++++++++++++++ src/config.h | 15 +++++++++++++++ src/db.c | 4 ++++ src/db.h | 4 ++++ src/planner.c | 7 +++++++ src/planner.h | 4 ++++ src/ui.c | 4 ++++ src/ui.h | 4 ++++ 8 files changed, 56 insertions(+) create mode 100644 Makefile create mode 100644 src/config.h create mode 100644 src/db.c create mode 100644 src/db.h create mode 100644 src/planner.c create mode 100644 src/planner.h create mode 100644 src/ui.c create mode 100644 src/ui.h diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6f143e5 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +CFLAGS=-Wall -Wetra -g +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 +CONFIG=src/config.h #config file +ui: $(UIF) + gcc -c $(CFLAGS) $(UIF) +planner: $(PLF) + gcc -c $(CFLAGS) $(PLF) +db: $(DBF) + gcc -c $(CFLAGS) $(DBF) + + + diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..532710f --- /dev/null +++ b/src/config.h @@ -0,0 +1,15 @@ +/* Global config file should be importet by all + */ +#ifndef CONFIG +#define CONFIG + +#include + +#define seconds(n) (n * CLOCKS_PER_SEC) +#define minutes(n) (n * 60 * seconds(n)) +#define hours(n) (n * 60 *(minutes(n)) + +const time_t pauseLenght = minutes(15); +const time_t minIntervalLen = minutes(30); + +#endif diff --git a/src/db.c b/src/db.c new file mode 100644 index 0000000..37c1f89 --- /dev/null +++ b/src/db.c @@ -0,0 +1,4 @@ +/* + * databse + * stores current state and reads previous + */ diff --git a/src/db.h b/src/db.h new file mode 100644 index 0000000..5db617d --- /dev/null +++ b/src/db.h @@ -0,0 +1,4 @@ +#ifndef DB +#define DB + +#endif diff --git a/src/planner.c b/src/planner.c new file mode 100644 index 0000000..ecd8c57 --- /dev/null +++ b/src/planner.c @@ -0,0 +1,7 @@ +/* + * Main Plannder + * gets data from user or db + * generates timetable + * modify data for next day and send to db + * + */ diff --git a/src/planner.h b/src/planner.h new file mode 100644 index 0000000..cdfdf7f --- /dev/null +++ b/src/planner.h @@ -0,0 +1,4 @@ +#ifndef PLANNER +#define PLANNER + +#endif // !PLANNER diff --git a/src/ui.c b/src/ui.c new file mode 100644 index 0000000..5e247da --- /dev/null +++ b/src/ui.c @@ -0,0 +1,4 @@ +/* + * command line interface for user input + * + */ diff --git a/src/ui.h b/src/ui.h new file mode 100644 index 0000000..8183b1f --- /dev/null +++ b/src/ui.h @@ -0,0 +1,4 @@ +#ifndef UI +#define UI + +#endif // !UI