From: Huck Boles Date: Sat, 22 Oct 2022 16:00:02 +0000 (-0500) Subject: automatic backup X-Git-Url: https://git.huck.website/?a=commitdiff_plain;h=c0c1aca52592ee5f5ea21af9f4429e1285e709d5;p=odot.git automatic backup --- diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob index 8cab816..9df32ba 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob index 7d5ca10..03bbdaa 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob index a54b7dd..bb5f9fe 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob index b8a2b49..4ae1be7 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob index 9e87ac3..7870468 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob index fdf3efe..73e7ab5 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob index 6c3ea01..52d62fb 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob index 673cd05..2b84f8b 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob index dc34621..ec725de 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob differ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob index 756b69f..f7f3f3e 100644 Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob differ diff --git a/.ccls-cache/@home@huck@.repos@odot/dialogue.c b/.ccls-cache/@home@huck@.repos@odot/dialogue.c new file mode 100644 index 0000000..9e186ad --- /dev/null +++ b/.ccls-cache/@home@huck@.repos@odot/dialogue.c @@ -0,0 +1,9 @@ +#include "odot.h" + +void error(char type){ + switch (type) { + case 'f': + case 't': + case '' + } +} diff --git a/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob b/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob new file mode 100644 index 0000000..0f2a42f Binary files /dev/null and b/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob differ diff --git a/.ccls-cache/@home@huck@.repos@odot/error.c b/.ccls-cache/@home@huck@.repos@odot/error.c deleted file mode 100644 index 73d6a23..0000000 --- a/.ccls-cache/@home@huck@.repos@odot/error.c +++ /dev/null @@ -1,2 +0,0 @@ -#include "odot.h" - diff --git a/.ccls-cache/@home@huck@.repos@odot/error.c.blob b/.ccls-cache/@home@huck@.repos@odot/error.c.blob deleted file mode 100644 index 09b9088..0000000 Binary files a/.ccls-cache/@home@huck@.repos@odot/error.c.blob and /dev/null differ diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c.blob b/.ccls-cache/@home@huck@.repos@odot/file.c.blob index 9afed16..5ce3b00 100644 Binary files a/.ccls-cache/@home@huck@.repos@odot/file.c.blob and b/.ccls-cache/@home@huck@.repos@odot/file.c.blob differ diff --git a/.ccls-cache/@home@huck@.repos@odot/func.c b/.ccls-cache/@home@huck@.repos@odot/func.c index 7eed44c..e88fb54 100644 --- a/.ccls-cache/@home@huck@.repos@odot/func.c +++ b/.ccls-cache/@home@huck@.repos@odot/func.c @@ -33,3 +33,20 @@ int geturgency(int n){ } +char *gettime(void){ + char *c = malloc(64*sizeof(char)); + time_t t = time(NULL); + if (t == ((t) - 1)){ + error('t'); + } + + c = ctime(&t); + + if (c == NULL){ + error('t'); + } + + return c; + + +} diff --git a/.ccls-cache/@home@huck@.repos@odot/func.c.blob b/.ccls-cache/@home@huck@.repos@odot/func.c.blob index db3956c..1e4696f 100644 Binary files a/.ccls-cache/@home@huck@.repos@odot/func.c.blob and b/.ccls-cache/@home@huck@.repos@odot/func.c.blob differ diff --git a/.ccls-cache/@home@huck@.repos@odot/input.c.blob b/.ccls-cache/@home@huck@.repos@odot/input.c.blob index 6304dac..00881a6 100644 Binary files a/.ccls-cache/@home@huck@.repos@odot/input.c.blob and b/.ccls-cache/@home@huck@.repos@odot/input.c.blob differ diff --git a/.ccls-cache/@home@huck@.repos@odot/main.c.blob b/.ccls-cache/@home@huck@.repos@odot/main.c.blob index 95e5e2f..9ab12da 100644 Binary files a/.ccls-cache/@home@huck@.repos@odot/main.c.blob and b/.ccls-cache/@home@huck@.repos@odot/main.c.blob differ diff --git a/.ccls-cache/@home@huck@.repos@odot/odot.h b/.ccls-cache/@home@huck@.repos@odot/odot.h index 8dd58e8..d617324 100644 --- a/.ccls-cache/@home@huck@.repos@odot/odot.h +++ b/.ccls-cache/@home@huck@.repos@odot/odot.h @@ -15,7 +15,8 @@ void rem(void); void show(void); int listcheck(void); int geturgency(int); -void dialogue(char, char *); + +void error(char); char *note, *o; int urgency; diff --git a/.ccls-cache/@home@huck@.repos@odot/odot.h.blob b/.ccls-cache/@home@huck@.repos@odot/odot.h.blob index 1bf1678..7ca150a 100644 Binary files a/.ccls-cache/@home@huck@.repos@odot/odot.h.blob and b/.ccls-cache/@home@huck@.repos@odot/odot.h.blob differ diff --git a/.ccls-cache/@home@huck@.repos@odot/structure.c b/.ccls-cache/@home@huck@.repos@odot/structure.c index 2e76b77..5071761 100644 --- a/.ccls-cache/@home@huck@.repos@odot/structure.c +++ b/.ccls-cache/@home@huck@.repos@odot/structure.c @@ -3,19 +3,19 @@ extern int urgency; extern FILE *fp; -struct note { +struct task { int length; - char *note; + char *task; int date; int due; int urgency; }; -struct note makenote(int n, char **arg){ - struct note temp; +struct task maketask(int n, char **arg){ + struct task temp; - temp.note = getnote(n,arg); - temp.length = strlen(temp.note); + temp.task = getnote(n,arg); + temp.length = strlen(temp.task); temp.date = 0; temp.due = 0; temp.urgency = urgency; @@ -23,21 +23,21 @@ struct note makenote(int n, char **arg){ return temp; } -void putnote(struct note n){ +void puttask(struct task n){ fp = fopen(TODOLIST, "w"); if (fp == NULL){ - printf("ERROR: COULD NOT OPEN FILE %s\n", TODOLIST); + error('f'); } - fprintf(fp, "%i\t%s\t%i\t%i\t%i\n",n.length,n.note,n.date,n.due,n.urgency); + fprintf(fp, "%i\t%s\t%i\t%i\t%i\n",n.length,n.task,n.date,n.due,n.urgency); } -struct note findnote(char *c){ - struct note tmp; +struct task gettask(char *c){ + struct task tmp; - sscanf(c,"%i\t%s\t%i\t%i\t%i\n",&tmp.length,tmp.note,&tmp.date,&tmp.due,&tmp.urgency); + sscanf(c,"%i\t%s\t%i\t%i\t%i\n",&tmp.length,tmp.task,&tmp.date,&tmp.due,&tmp.urgency); return tmp; } diff --git a/.ccls-cache/@home@huck@.repos@odot/structure.c.blob b/.ccls-cache/@home@huck@.repos@odot/structure.c.blob index 9ef2910..72290d8 100644 Binary files a/.ccls-cache/@home@huck@.repos@odot/structure.c.blob and b/.ccls-cache/@home@huck@.repos@odot/structure.c.blob differ diff --git a/dialogue.c b/dialogue.c new file mode 100644 index 0000000..9e186ad --- /dev/null +++ b/dialogue.c @@ -0,0 +1,9 @@ +#include "odot.h" + +void error(char type){ + switch (type) { + case 'f': + case 't': + case '' + } +} diff --git a/error.c b/error.c deleted file mode 100644 index 73d6a23..0000000 --- a/error.c +++ /dev/null @@ -1,2 +0,0 @@ -#include "odot.h" - diff --git a/func.c b/func.c index 7eed44c..e88fb54 100644 --- a/func.c +++ b/func.c @@ -33,3 +33,20 @@ int geturgency(int n){ } +char *gettime(void){ + char *c = malloc(64*sizeof(char)); + time_t t = time(NULL); + if (t == ((t) - 1)){ + error('t'); + } + + c = ctime(&t); + + if (c == NULL){ + error('t'); + } + + return c; + + +} diff --git a/odot.h b/odot.h index 8dd58e8..d617324 100644 --- a/odot.h +++ b/odot.h @@ -15,7 +15,8 @@ void rem(void); void show(void); int listcheck(void); int geturgency(int); -void dialogue(char, char *); + +void error(char); char *note, *o; int urgency; diff --git a/structure.c b/structure.c index 2e76b77..5071761 100644 --- a/structure.c +++ b/structure.c @@ -3,19 +3,19 @@ extern int urgency; extern FILE *fp; -struct note { +struct task { int length; - char *note; + char *task; int date; int due; int urgency; }; -struct note makenote(int n, char **arg){ - struct note temp; +struct task maketask(int n, char **arg){ + struct task temp; - temp.note = getnote(n,arg); - temp.length = strlen(temp.note); + temp.task = getnote(n,arg); + temp.length = strlen(temp.task); temp.date = 0; temp.due = 0; temp.urgency = urgency; @@ -23,21 +23,21 @@ struct note makenote(int n, char **arg){ return temp; } -void putnote(struct note n){ +void puttask(struct task n){ fp = fopen(TODOLIST, "w"); if (fp == NULL){ - printf("ERROR: COULD NOT OPEN FILE %s\n", TODOLIST); + error('f'); } - fprintf(fp, "%i\t%s\t%i\t%i\t%i\n",n.length,n.note,n.date,n.due,n.urgency); + fprintf(fp, "%i\t%s\t%i\t%i\t%i\n",n.length,n.task,n.date,n.due,n.urgency); } -struct note findnote(char *c){ - struct note tmp; +struct task gettask(char *c){ + struct task tmp; - sscanf(c,"%i\t%s\t%i\t%i\t%i\n",&tmp.length,tmp.note,&tmp.date,&tmp.due,&tmp.urgency); + sscanf(c,"%i\t%s\t%i\t%i\t%i\n",&tmp.length,tmp.task,&tmp.date,&tmp.due,&tmp.urgency); return tmp; }