Compare commits
5 Commits
Author | SHA1 | Date |
---|---|---|
Jürgen Büchel | 97869f4530 | |
simon | 93aa77bb5b | |
Jürgen Büchel | 59cac98023 | |
simon | 3c0f48a28d | |
simon | a4f31f9414 |
|
@ -1,116 +0,0 @@
|
|||
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/25.0.2 Chrome/128.0.6613.186 Electron/32.2.7 Safari/537.36" version="25.0.2">
|
||||
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
|
||||
<mxGraphModel dx="1527" dy="2012" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
|
||||
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-39" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-5" target="sFZgEorzihY-HOV9npow-36">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="-10" y="-10" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-5" value="ui" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="90" y="20" width="120" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-6" value="db" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="90" y="460" width="120" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-7" target="sFZgEorzihY-HOV9npow-21">
|
||||
<mxGeometry relative="1" as="geometry">
|
||||
<mxPoint x="490" y="520" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-7" value="iCal" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="430" y="360" width="120" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-8" value="planner" style="ellipse;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="430" y="30" width="120" height="80" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-10" value="" style="curved=1;endArrow=classic;html=1;rounded=0;entryX=0.025;entryY=0.313;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-5" target="sFZgEorzihY-HOV9npow-6">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="180" y="240" as="sourcePoint" />
|
||||
<mxPoint x="140" y="280" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="50" y="180" />
|
||||
<mxPoint x="30" y="370" />
|
||||
<mxPoint x="80" y="430" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-11" value="get stored subjects<div><br></div>" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="30" y="290" width="60" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-12" value="" style="curved=1;endArrow=classic;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-6" target="sFZgEorzihY-HOV9npow-5">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="290" y="310" as="sourcePoint" />
|
||||
<mxPoint x="160" y="110" as="targetPoint" />
|
||||
<Array as="points">
|
||||
<mxPoint x="130" y="320" />
|
||||
<mxPoint x="150" y="210" />
|
||||
</Array>
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-13" value="return stored data" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="130" y="280" width="60" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-14" value="" style="endArrow=classic;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-5" target="sFZgEorzihY-HOV9npow-8">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="290" y="310" as="sourcePoint" />
|
||||
<mxPoint x="340" y="260" as="targetPoint" />
|
||||
<Array as="points" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-15" value="send subjects" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="250" y="20" width="100" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-18" value="" style="endArrow=classic;html=1;rounded=0;exitX=0.45;exitY=0.988;exitDx=0;exitDy=0;exitPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-8" target="sFZgEorzihY-HOV9npow-7">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="500" y="120" as="sourcePoint" />
|
||||
<mxPoint x="340" y="260" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-19" value="send event list" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="490" y="190" width="60" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-21" value="generate and safe iCal file" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="430" y="490" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-22" value="" style="endArrow=classic;html=1;rounded=0;entryX=1;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-8" target="sFZgEorzihY-HOV9npow-6">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="290" y="310" as="sourcePoint" />
|
||||
<mxPoint x="340" y="260" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-23" value="send updated subjects" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="260" y="270" width="60" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-24" value="subject db file" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="90" y="620" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-25" value="" style="endArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-6" target="sFZgEorzihY-HOV9npow-24">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="290" y="440" as="sourcePoint" />
|
||||
<mxPoint x="340" y="390" as="targetPoint" />
|
||||
<Array as="points" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-26" value="" style="endArrow=classic;startArrow=classic;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="sFZgEorzihY-HOV9npow-6" target="sFZgEorzihY-HOV9npow-24">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="290" y="440" as="sourcePoint" />
|
||||
<mxPoint x="340" y="390" as="targetPoint" />
|
||||
<Array as="points" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-27" value="serialise/deserialise<div><br></div>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="150" y="573" width="130" height="40" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-36" value="" style="shape=actor;whiteSpace=wrap;html=1;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="-30" y="-80" width="40" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="sFZgEorzihY-HOV9npow-40" value="ask human for input" style="text;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
|
||||
<mxGeometry x="-10" y="20" width="60" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
17
src/config.h
17
src/config.h
|
@ -9,7 +9,20 @@
|
|||
#define hours(n) (60 * minutes(n))
|
||||
#define days(n) (24 * hours(n))
|
||||
|
||||
static const time_t pauseLenght = minutes(15);
|
||||
static const time_t pauseLenght = minutes(10);
|
||||
static const time_t minIntervalLen = minutes(30);
|
||||
|
||||
//
|
||||
// static const char *iCalHeader = "BEGIN:VCALENDAR"
|
||||
// "VERSION:2.0"
|
||||
// "PRODID:-//hacksw/handcal//NONSGML v1.0//EN";
|
||||
//
|
||||
// static const char *iCalEvent =
|
||||
// "BEGIN:VEVENT"
|
||||
// "UID:uid1@example.com"
|
||||
// "ORGANIZER:CN=John Doe : MAILTO: john.doe@example.com"
|
||||
// "DTSTART:19970714T170000Z"
|
||||
// "DTEND:19970715T040000Z"
|
||||
// "SUMMARY:Bastille Day Party"
|
||||
// "END:VEVENT ";
|
||||
//
|
||||
#endif
|
||||
|
|
|
@ -24,6 +24,6 @@ void llistFree(llist *head);
|
|||
int llistLen(llist *head);
|
||||
|
||||
void llistPrintT(llist *head);
|
||||
void llistPrintH(llist *head);
|
||||
void llistPrintE(llist *head);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -146,7 +146,9 @@ int cmpTaskN(const void *a, const void *b) {
|
|||
int cmpTaskP(const void *a, const void *b) {
|
||||
Task *aa = (Task *)a;
|
||||
Task *bb = (Task *)b;
|
||||
if (bb->priority - aa->priority != 0)
|
||||
return bb->priority - aa->priority;
|
||||
return aa->spare - bb->spare;
|
||||
}
|
||||
|
||||
// cmp event by task name
|
||||
|
@ -173,12 +175,14 @@ llist *genPlan(llist *head, time_t timeAvail) {
|
|||
}
|
||||
|
||||
// add Tasks from llist to arr
|
||||
// ignore tasks after deadline
|
||||
llist *c = head;
|
||||
time_t now = time(NULL);
|
||||
for (int i = 0; c != NULL; i++) {
|
||||
// sortedNames[i] = *copyTask(c->data);
|
||||
// sortedPrio[i] = *copyTask(c->data);
|
||||
// sortedNames[i] = *(Task *)c->data;
|
||||
sortedPrio[i] = *(Task *)c->data;
|
||||
if (sortedPrio[i].deadline <= now)
|
||||
sortedPrio[i].priority = 0;
|
||||
|
||||
c = c->next;
|
||||
}
|
||||
|
||||
|
@ -186,12 +190,6 @@ llist *genPlan(llist *head, time_t timeAvail) {
|
|||
// qsort(sortedNames, lLen, sizeof(Task), cmpTaskN);
|
||||
qsort(sortedPrio, lLen, sizeof(Task), cmpTaskP);
|
||||
|
||||
// // test print
|
||||
// planLog("sortendName", 0);
|
||||
// for (int i = 0; i < lLen; i++) {
|
||||
// printTask(sortedNames + i);
|
||||
// }
|
||||
|
||||
planLog("sortendPrio", 0);
|
||||
for (int i = 0; i < lLen; i++) {
|
||||
printTask(sortedPrio + i);
|
||||
|
@ -200,15 +198,12 @@ llist *genPlan(llist *head, time_t timeAvail) {
|
|||
planLog("creating eventList", false);
|
||||
|
||||
// genertate plan basen on priorities and available time
|
||||
time_t now = time(NULL);
|
||||
struct tm *lc = localtime(&now);
|
||||
llist *events_ll = llistNew(NULL, cmpEvent);
|
||||
if (events_ll == NULL) {
|
||||
exit(1);
|
||||
}
|
||||
// time_t avail = mktime(timeAvail);
|
||||
time_t start, end;
|
||||
// (mktime(lc) < mktime(timeAvail))
|
||||
do {
|
||||
start = mktime(lc); // start now
|
||||
lc->tm_min += intervalLen;
|
||||
|
@ -222,37 +217,31 @@ llist *genPlan(llist *head, time_t timeAvail) {
|
|||
}
|
||||
llistAppend(events_ll, c);
|
||||
// printEvent(c);
|
||||
// printEvent((Event *)((events_ll)->next)->data);
|
||||
|
||||
// decrement priority of first elem and resort list
|
||||
(*sortedPrio).priority -= 1;
|
||||
// increment spare(used as counter)
|
||||
// counter counts how often a task hsa been in addet to event list
|
||||
// this is used to break ties if priorites are equal
|
||||
(*sortedPrio).spare += 1;
|
||||
|
||||
// sort again
|
||||
qsort(sortedPrio, lLen, sizeof(Task), cmpTaskP);
|
||||
|
||||
planLog("sortendPrio", 0);
|
||||
for (int i = 0; i < lLen; i++) {
|
||||
printTask(sortedPrio + i);
|
||||
}
|
||||
lc->tm_min += pauseLen; // add pause
|
||||
|
||||
} while (mktime(lc) < timeAvail);
|
||||
|
||||
// for (int i = 0; i < lLen; i++) {
|
||||
// time_t start = mktime(lc);
|
||||
//
|
||||
// printf("start:: %s\n", ctime(&start));
|
||||
// lc->tm_min += 45;
|
||||
// time_t end = mktime(lc);
|
||||
// printf("end:: %s\n", ctime(&end));
|
||||
//
|
||||
// Event *c = newEvent(sortedPrio + i, start, end, 0);
|
||||
// printEvent(c);
|
||||
// lc->tm_min += 15;
|
||||
// llistAppend(events_ll, c);
|
||||
// }
|
||||
//
|
||||
} while (mktime(lc) < timeAvail && (*sortedPrio).priority > 0);
|
||||
|
||||
// free empty head
|
||||
llist *tmp = events_ll;
|
||||
events_ll = events_ll->next;
|
||||
tmp->next = NULL;
|
||||
llistFreeE(tmp);
|
||||
llistPrintE(events_ll);
|
||||
// llistPrintE(events_ll);
|
||||
|
||||
// update prioriteis in original llist
|
||||
for (int i = 0; i < lLen; i++) {
|
||||
|
@ -264,6 +253,7 @@ llist *genPlan(llist *head, time_t timeAvail) {
|
|||
free(sortedPrio);
|
||||
|
||||
planLog("END GEN PLAN", 0);
|
||||
|
||||
// llistFreeT(head);
|
||||
// send updated tasks to db for storage
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@ int main() {
|
|||
assert(t3 != NULL);
|
||||
Task *t4 = newTask("TM1", now, now + days(1), 9, 0);
|
||||
assert(t4 != NULL);
|
||||
Task *t5 = newTask("Akt1", now, now, 9, 0);
|
||||
assert(t5 != NULL);
|
||||
|
||||
printf("%s\n", ctime(&now));
|
||||
|
||||
|
@ -33,12 +35,14 @@ int main() {
|
|||
llistAppend(list1, t2);
|
||||
llistAppend(list1, t3);
|
||||
llistAppend(list1, t4);
|
||||
llistAppend(list1, t5);
|
||||
|
||||
// gnerate plan from task list in time
|
||||
struct tm *lc = localtime(&now);
|
||||
lc->tm_hour += 9; // add available time;
|
||||
lc->tm_hour += 4; // add available time;
|
||||
time_t maxTime = mktime(lc); // create timestamp
|
||||
llist *l1 = genPlan(list1, maxTime); // return inked list of event;
|
||||
llistPrintE(l1);
|
||||
llistFreeE(l1);
|
||||
|
||||
// print test tasks
|
||||
|
|
134
src/ui.c
134
src/ui.c
|
@ -2,4 +2,138 @@
|
|||
* command line interface for user input
|
||||
*
|
||||
*/
|
||||
/* Created by Juergen Buechel, 13.12.2024/
|
||||
*/
|
||||
#include "planner.h" // for subject and event structs
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "ui.h"
|
||||
#include "planner.h"
|
||||
#include "iCal.h"
|
||||
#include "db.h"
|
||||
|
||||
void dump_buffer(FILE *fp){
|
||||
int ch;
|
||||
while((ch = fgetc(fp)) != EOF && ch != '\n');
|
||||
}
|
||||
|
||||
|
||||
void insertTask(task_ptr newtask)
|
||||
{
|
||||
task_ptr TaskPointer;
|
||||
if (firsttask == NULL){
|
||||
firsttask = newtask;
|
||||
newtask->nextTask ;
|
||||
}
|
||||
else {
|
||||
TaskPointer = firsttask;
|
||||
while(TaskPointer->nextTask!=NULL)
|
||||
{
|
||||
TaskPointer = TaskPointer->nextTask;
|
||||
}
|
||||
TaskPointer->nextTask = newtask;
|
||||
newtask ->nextTask;
|
||||
}
|
||||
}
|
||||
|
||||
void newTask (void)
|
||||
{
|
||||
task_ptr new = malloc(sizeof(task_1));
|
||||
if (new == NULL){
|
||||
printf("Die Liste ist leer?!\n");
|
||||
}
|
||||
printf(" Neues Fach eigeben: ");
|
||||
if(scanf("%d", &newTask)!=1)
|
||||
{
|
||||
dump_buffer(stdin);
|
||||
printf("Fehlerhafte eingabe\n");
|
||||
free(new);
|
||||
return;
|
||||
}
|
||||
dump_buffer (stdin);
|
||||
insertTask(new);
|
||||
}
|
||||
|
||||
void inserttime(time_ptr newtime)
|
||||
{
|
||||
time_ptr TimePointer;
|
||||
if (firsttime == NULL){
|
||||
firsttime = newtime;
|
||||
newtime->nextTime =NULL;
|
||||
}
|
||||
else {
|
||||
TimePointer = firsttime;
|
||||
while(TimePointer->nextTime!=NULL)
|
||||
{
|
||||
TimePointer = TimePointer->nextTime;
|
||||
}
|
||||
TimePointer->nextTime = newtime;
|
||||
newtime ->nextTime = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void newTime(void)
|
||||
{
|
||||
time_ptr newtime = malloc(sizeof(task_1));
|
||||
if (newtime == NULL){
|
||||
printf("Die Liste ist leer?!\n");
|
||||
}
|
||||
printf(" Neue Zeit eingeben: ");
|
||||
if(scanf("%d",&newTime)!=1)
|
||||
{
|
||||
dump_buffer(stdin);
|
||||
printf("Fehlerhafte eingabe\n");
|
||||
free(newtime);
|
||||
return;
|
||||
}
|
||||
dump_buffer (stdin);
|
||||
inserttime(newtime);
|
||||
}
|
||||
|
||||
void tasklisting(void){
|
||||
task_ptr TaskPointer = firsttask;
|
||||
printf("Erfasste Fächer:\n");
|
||||
while(TaskPointer!=NULL)
|
||||
printf("\t->%d\n", TaskPointer->name);
|
||||
TaskPointer = TaskPointer->nextTask;
|
||||
}
|
||||
|
||||
void getlink (void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int choice = 0, i = 0;
|
||||
do
|
||||
{
|
||||
printf(" -1- Neues Fach eingeben\n");
|
||||
printf(" -2- Verfuegbare Zeit eingeben\n");
|
||||
printf(" -3- Alle vorhandenen Faecher aufliesten\n");
|
||||
printf(" -4- Kalenderlink ausgeben\n");
|
||||
printf(" -5- Planer beenden\n");
|
||||
if( scanf("%d", &choice) != 1){
|
||||
printf("Falsche Eingabe\n");};
|
||||
choice = 0;
|
||||
dump_buffer(stdin);
|
||||
|
||||
switch (choice)
|
||||
{
|
||||
case 1: newTask();break;
|
||||
case 2: newTime();break;
|
||||
case 3: if( firsttask == NULL){
|
||||
printf("Die Liste ist leer");
|
||||
}
|
||||
else{
|
||||
tasklisting();
|
||||
}break;
|
||||
case 4: iCAl();break;
|
||||
}
|
||||
}while (choice !=5);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue