modified: src/ui.c
parent
2d0bd1341b
commit
60cfa51406
10
src/ui.c
10
src/ui.c
|
@ -11,6 +11,7 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -24,6 +25,7 @@ int main(void) {
|
||||||
int taskdeadline_date = 0;
|
int taskdeadline_date = 0;
|
||||||
int taskpriority = 0;
|
int taskpriority = 0;
|
||||||
int taskspare = 0;
|
int taskspare = 0;
|
||||||
|
char *taskname = NULL; // taskName Buffer
|
||||||
|
|
||||||
llist *listT = NULL;
|
llist *listT = NULL;
|
||||||
llist *listE = NULL;
|
llist *listE = NULL;
|
||||||
|
@ -44,7 +46,7 @@ int main(void) {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
|
|
||||||
char *taskname = NULL; // taskName Buffer
|
taskname = NULL;
|
||||||
size_t nameLen;
|
size_t nameLen;
|
||||||
size_t nnread;
|
size_t nnread;
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
|
@ -96,7 +98,11 @@ int main(void) {
|
||||||
scanf("%d", &taskspare);
|
scanf("%d", &taskspare);
|
||||||
// if list exists use it to generate plan
|
// if list exists use it to generate plan
|
||||||
if (listT != NULL) {
|
if (listT != NULL) {
|
||||||
listE = genPlan(listT, taskspare);
|
struct tm lc;
|
||||||
|
localtime_r(&now, &lc);
|
||||||
|
lc.tm_hour += taskspare;
|
||||||
|
time_t avail = mktime(&lc);
|
||||||
|
listE = genPlan(listT, avail);
|
||||||
write_linkedlist_to_csv(listT, dbName);
|
write_linkedlist_to_csv(listT, dbName);
|
||||||
} else {
|
} else {
|
||||||
printf("list is empty!");
|
printf("list is empty!");
|
||||||
|
|
Loading…
Reference in New Issue