]> git.huck.website - odot.git/commitdiff
automatic backup
authorHuck Boles <huboles@protonmail.com>
Sat, 22 Oct 2022 16:00:02 +0000 (11:00 -0500)
committerHuck Boles <huboles@protonmail.com>
Sat, 22 Oct 2022 16:00:02 +0000 (11:00 -0500)
28 files changed:
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob
.ccls-cache/@home@huck@.repos@odot/dialogue.c [new file with mode: 0644]
.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob [new file with mode: 0644]
.ccls-cache/@home@huck@.repos@odot/error.c [deleted file]
.ccls-cache/@home@huck@.repos@odot/error.c.blob [deleted file]
.ccls-cache/@home@huck@.repos@odot/file.c.blob
.ccls-cache/@home@huck@.repos@odot/func.c
.ccls-cache/@home@huck@.repos@odot/func.c.blob
.ccls-cache/@home@huck@.repos@odot/input.c.blob
.ccls-cache/@home@huck@.repos@odot/main.c.blob
.ccls-cache/@home@huck@.repos@odot/odot.h
.ccls-cache/@home@huck@.repos@odot/odot.h.blob
.ccls-cache/@home@huck@.repos@odot/structure.c
.ccls-cache/@home@huck@.repos@odot/structure.c.blob
dialogue.c [new file with mode: 0644]
error.c [deleted file]
func.c
odot.h
structure.c

index 8cab81649e95bbbe8d5ce394c3c6ad380d1fa171..9df32ba0f23cb110fc2b42e9049b2ad2bd018ec8 100644 (file)
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
index 7d5ca101d5967f3bb034f0c8b18d3e148dbeb112..03bbdaa4431fc5e47c1a2e48e6342403c7e770b6 100644 (file)
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
index a54b7dd7ca8651e7dbbd8fdb89408c3a6e20496f..bb5f9fe493427b3885d3584bb9cc274c348c2ab0 100644 (file)
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
index b8a2b49c19b08871cc7770b5678aa101385add6f..4ae1be7db472395f78e9388bedcd07d1005cf4ba 100644 (file)
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
index 9e87ac33f27ff7bedef8a9b7b546572f4ed5b108..7870468858a26992f9438b8cd9b05d7d58c59067 100644 (file)
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
index fdf3efe9d67fd6613f898c320a8f6b641af4e500..73e7ab53df4decfa8854c6511010c9a426434244 100644 (file)
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
index 6c3ea016400393627e897a47058510c4ce4aee14..52d62fb451da5b2b24b130a954c51f783ab429df 100644 (file)
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
index 673cd05f31d934bad4ab640a17c1622c9d828cba..2b84f8b73cbc50770c60e4860c8e8f085ee3856f 100644 (file)
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
index dc3462191e7ce4c36d29c752a5e60dbc3446d263..ec725debd6f0b76f6da0e9b960661e4f4f5756d9 100644 (file)
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
index 756b69f6b3ff96178befeccfeef3958edd7ca94e..f7f3f3e2296148a69de3372ac3d3bff01ee32900 100644 (file)
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 (file)
index 0000000..9e186ad
--- /dev/null
@@ -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 (file)
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 (file)
index 73d6a23..0000000
+++ /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 (file)
index 09b9088..0000000
Binary files a/.ccls-cache/@home@huck@.repos@odot/error.c.blob and /dev/null differ
index 9afed16e2dcde405ef4d9a519e0be47e375b3c8d..5ce3b003db84050a257ec877717128e127aba895 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/file.c.blob and b/.ccls-cache/@home@huck@.repos@odot/file.c.blob differ
index 7eed44c7c7e5fe7f14dac7ceab5acaa547e16337..e88fb54dece05aaa1216d0d24790cd7aacd28747 100644 (file)
@@ -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;
+
+
+}
index db3956c63c493bbb818cf52a3650736e1cd10a62..1e4696f2b7d83d29ae6baf6e2af8e1f9e09e0991 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/func.c.blob and b/.ccls-cache/@home@huck@.repos@odot/func.c.blob differ
index 6304dac9c960d7d511b14950e0f7c84173e98bc7..00881a6334724f8758447d810cc11ba2ca18b60e 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/input.c.blob and b/.ccls-cache/@home@huck@.repos@odot/input.c.blob differ
index 95e5e2f72bcae8d90a26d6cd3d9907ec21d6d685..9ab12dad3e25b78aa864be61084cb7e7b0516721 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/main.c.blob and b/.ccls-cache/@home@huck@.repos@odot/main.c.blob differ
index 8dd58e8fe42efeed81e469919d1c1a8d422055fd..d617324d5d75f05662605793467e26ca7b738caf 100644 (file)
@@ -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;
index 1bf1678f29aefb3d05bcc5eef6ecd9ffdfe1a333..7ca150acdff257c5b8181794a9e7a17ed8463a70 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/odot.h.blob and b/.ccls-cache/@home@huck@.repos@odot/odot.h.blob differ
index 2e76b7790f926af7f7afb4d2f36eae541395c6ad..5071761120ccdc4ba3825ea0f85f4f641c027b4a 100644 (file)
@@ -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;
 }
index 9ef2910cbee46e27c00cb04fba9d551f796b4a4f..72290d822909bfa9789cb3f5cbcb2dcdbdaef6f0 100644 (file)
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 (file)
index 0000000..9e186ad
--- /dev/null
@@ -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 (file)
index 73d6a23..0000000
--- a/error.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "odot.h"
-
diff --git a/func.c b/func.c
index 7eed44c7c7e5fe7f14dac7ceab5acaa547e16337..e88fb54dece05aaa1216d0d24790cd7aacd28747 100644 (file)
--- 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 8dd58e8fe42efeed81e469919d1c1a8d422055fd..d617324d5d75f05662605793467e26ca7b738caf 100644 (file)
--- 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;
index 2e76b7790f926af7f7afb4d2f36eae541395c6ad..5071761120ccdc4ba3825ea0f85f4f641c027b4a 100644 (file)
@@ -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;
 }