From 738c6113940f6ec5b0ec40082ee3fb889a155798 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Mon, 31 Oct 2022 22:00:01 -0500 Subject: [PATCH] automatic backup --- .../@usr@include@bits@wordsize.h.blob | Bin 2628 -> 2622 bytes .../@usr@include@features-time64.h.blob | Bin 2445 -> 2439 bytes .../@usr@include@gnu@stubs.h.blob | Bin 2424 -> 2424 bytes .../@usr@include@stdc-predef.h.blob | Bin 2906 -> 2900 bytes .../@usr@include@stdio.h.blob | Bin 37518 -> 37512 bytes .../@home@huck@.repos@odot/dialogue.c.blob | Bin 3363 -> 3363 bytes .ccls-cache/@home@huck@.repos@odot/file.c | 35 +++++++++++++----- .../@home@huck@.repos@odot/file.c.blob | Bin 5438 -> 5525 bytes .../@home@huck@.repos@odot/func.c.blob | Bin 5777 -> 5779 bytes .../@home@huck@.repos@odot/input.c.blob | Bin 4247 -> 4240 bytes .../@home@huck@.repos@odot/main.c.blob | Bin 4283 -> 4264 bytes .ccls-cache/@home@huck@.repos@odot/odot.h | 6 +-- .../@home@huck@.repos@odot/odot.h.blob | Bin 4430 -> 4677 bytes .../@home@huck@.repos@odot/structure.c | 6 +-- .../@home@huck@.repos@odot/structure.c.blob | Bin 4296 -> 4130 bytes file.c | 35 +++++++++++++----- odot.h | 6 +-- structure.c | 6 +-- 18 files changed, 60 insertions(+), 34 deletions(-) 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 83d7c432e54ad466b9bc83ad31a6c6f26837ac7e..8bb53e8d03d484d6629c01395c89174588923faa 100644 GIT binary patch delta 38 pcmX>ivQK1!B5P(|L21cEO( 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 234c447338a2159482b629834242ee78fc7399ac..dde057a9c04c2487e37f6fb2c2ba2d53f4c4f6b2 100644 GIT binary patch delta 20 ccmew%^h0RFMpotr%m*hkvPf+{$GVCc09|Vc2LJ#7 delta 20 ccmew%^h0RFMpotmhZU0pF 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 46791e7a1dd387ae708dabac96d02e756a46033b..cfe8c8ed7a8da9f95028bc605be30b733cd7e2b3 100644 GIT binary patch delta 40 scmeBM%G9xxX@WUxW?n&Q$wYfa2xDVLJS+19=7W<9S)?{UVO`Y&05${omodt*{OD|3Oviphd3Qk(CwuId2*j_VN~ diff --git a/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob b/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob index 47b96a61e7a5bd33321c2efc01050e5c3048afd8..a2f65019331cc2bce42652b881a2711193624f5f 100644 GIT binary patch delta 20 ccmZ21wODGyaaQIB%m*hIvPf-y!fMYB09HK*q5uE@ delta 20 ccmZ21wODGyaaQI6hZU0xS)?{UVYO!m08*j{RsaA1 diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c b/.ccls-cache/@home@huck@.repos@odot/file.c index 9449bae..ddf96f1 100644 --- a/.ccls-cache/@home@huck@.repos@odot/file.c +++ b/.ccls-cache/@home@huck@.repos@odot/file.c @@ -6,12 +6,13 @@ extern FILE *fp; enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; + void add(void){ fp = fopen(TODOLIST, "a"); - if (fp == NULL) - error('f'); - fputs(strcat(note,"\n"),fp); - fclose(fp); + if (fp != NULL){ + fputs(strcat(note,"\n"),fp); + fclose(fp); + } } void rem(void){ @@ -19,8 +20,6 @@ void rem(void){ FILE *tmp = fopen("temp", "w"); fp = fopen(TODOLIST, "r"); - if (fp == NULL) - error('f'); while (fgets(s, MAXLINE, fp) != NULL){ @@ -40,14 +39,30 @@ void rem(void){ } void show(void){ - char *c = (char *) malloc(MAXLINE * sizeof(int)); + char *c; - if (fp == NULL) - error('f'); + c = (char *) malloc(MAXLINE * sizeof(int)); + fp = fopen(TODOLIST,"r"); while (fgets(c, MAXLINE, fp) != NULL ) - printf("\t\t\033[1;3%im*\033[0m %s",geturgency(urgency), c); + printf("\t\t\033[1;35m*\033[0m %s", c); fclose(fp); free(c); } +int listcheck(void){ + char *s; + + fp = fopen(TODOLIST, "r"); + s = (char *) malloc(MAXLINE * sizeof(char)); + + while (fgets(s, MAXLINE, fp) != NULL){ + s[strlen(s) - 1] = 0; + if (strcmp(note, s) == 0){ + free(s); + return 1; + } + } + free(s); + return 0; +} diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c.blob b/.ccls-cache/@home@huck@.repos@odot/file.c.blob index 2417fd5da138f7aec64cbb69479606626eb329e3..77dfd271ad9e7f1719619c6be98d6d505c7ece45 100644 GIT binary patch delta 1455 zcmZWpYiJx*6rMY?+1$+D&CbrwPG%q7jFap-yX#Ii>!!QRCLyVzjZup~Y%P^QLQ+h8 zr8Tiwuxxz<3gV+)MbLt@SOo>KR7D6@qCupHr9YJ7kD}BTQ4zHwJ}~1si75{KbI-Zo z%sum+?>l!+7hWjJ1!479Y55a@2uCJ5PF{DoMfzG==8p!9Q!6dYQd9A+T)c7Y4}Ik4 z*#{QP`)21Cre^j`-D~FsN>x&&)uc$O!cC$e2*i8p;lF8e^}`dbHMN%Zj^($Xd+hQP ziu6zSP~ECK9(n6^I)3rfM-Xsz*YrNxzhm^|Vf7FK4Xt5%zswx9zsh}Z0fBy_zuPm5 zA4h)JxxBK7$bd0mde0wx|HzN8?05}En1kGxZc z2e2in?i4>GZ;^VG9v%tZl5N47_#kG+3K-*Rd~IJ+OKTB@;BSZSkh*9WZ)KULE!(O{ zY@xEQ*h}v&RldCc%)VgJD*6S&3O)%P-SI01B+}k(@2rZsgSv-o%e1U{cRqPRzx4gH zYpVCsUd1OE<8$pn{uy(V&=~UVq@5Z@lbUN0N^mp0sTq}{AYD|*Ax+Wy{O*CX>f+ov zuX-u??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}eV%ie(WGUH2kX^Dx%xYOSs(E;g01L-EGn%eh zGLYECr;`hNPyYD$A8?gy@3hMVrHqtK5S!Nu1CcNe6CEj3bRi-=WCuY}BWe+(V_o2J z8W*_PYd%VlV>kkDr|kkM^cDnCG>R6(oAxL&NfTGl$|kSOZ0bd=!SLpAr)b#Cx`=Iw zwp>5TWHa6DJH7R>kYX#s$+#UC(JY(K_M>*Y9lR|U#JtgK(9w=NDiI>zpE`Yx-{+2- zXH+wX;jb+(Jalze_~l}E!uKmsNEd`h-kf)WppsS+ba~{(*B8I}`oJCVeeDaXuG%9g R=6v%m*hovPf(`!kWRtq)@V1hbxr_0Gf>ni~s-t delta 25 hcmbQNJ5hJTN>=6qhZU0>StK?eVa;IKtjCqg0|0vl2&@1A diff --git a/.ccls-cache/@home@huck@.repos@odot/input.c.blob b/.ccls-cache/@home@huck@.repos@odot/input.c.blob index 36a66b37cd105299ef78c2657e5ac9148384f029..f93f99de33954d4cc5a86ceefb3c4289c133f751 100644 GIT binary patch delta 42 vcmbQPI6-m4LssSo%m*hMvPf=6v%m*hovPf(`!n&13Mw5YqLx=$kct9kRkcN;I3!{vNj1|k~C0q?m ej4YGYd6OAgHuv&IF|q??Y-H?MHoxOL%Lo7fdl9Sv delta 99 zcmZ3XxLa|=6qhZU0>StK?eVcp82U0hOBnp~n#l31Lr$-u!O!~h07Ad*Q)L&)l{ siUXsJh75?_Je8|~i5bY4EXJD*qBmFZMlrJUFv{4-*zs(>&3Bd&0Fc!iDF6Tf diff --git a/.ccls-cache/@home@huck@.repos@odot/odot.h b/.ccls-cache/@home@huck@.repos@odot/odot.h index 81a5ea9..c465e23 100644 --- a/.ccls-cache/@home@huck@.repos@odot/odot.h +++ b/.ccls-cache/@home@huck@.repos@odot/odot.h @@ -23,15 +23,15 @@ void add(void); void rem(void); void show(void); -int listcheck(struct task); +int listcheck(void); int geturgency(int); char *gettime(void); void error(char); struct task maketask(int n, char **arg); -void puttask(struct task n, FILE *fp); -struct task gettask(FILE *fp); +void puttask(struct task n); +struct task gettask(void); 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 e61d6f5a9eda9f9d45ccaf5ee0d3e515d8358d04..4fa2ad9dbc59c2db9cf83154730769908a7536d7 100644 GIT binary patch delta 1074 zcma)(TWAwO6oz+_O}cKHq)=^En>L%&)->s6YtT^dN~I#+eNjP3)6F)SCfzOB-C9Ku z713h7#G^<-1@T2iK@isJK()1izn) zi;<|9`iGWVA*T{pig8h#(zSAG<&?Zxx}&7AiPw}Ak0l|gMMYkx@?(R6V4$AwY6yix ztJ#3t;dYS&u9~jtiK<|ixjfqi5B1tvR0ZG6EKDozy}BJUji|DtiLqzkr9`?^<{j!`<#akemzbU69jTG zE-ykZ!Zn{DGOz7N=M0?gJ_|h-|MYpM;DV)w+Hn7TeEp?+dm(J8rnZZ_0Lw(4Eilj_2BPs~Q(!vMPi?!~q%pPAlU(WfR^ZWh&uk#>g)L3FB zetL3lj1Y*h)wt^`Z8bi=&Sq_@^thXC?h3cpR^fEG+||BHD^Eyxm!qNj|HMw-f;M%I z?ST$t01qjJdSvX9$>24rg|`wJ43h@Plo;UzC51T>gO7|A@2!*^A|$LRDIk-ePq;6Y zltGR>42Gy>{Zq*M&NqAZXhO#-zv0S2Y5f)4|=(siPTNtP)39+yRmc&`jY zugnec@`oZ`O-I7KJX+*r(b3RGV<;2$%k-l7KBeddtx^GfN)}p`YnSs-9)PH@Vp?B% zu1Wdw%Oya}nzsBMMcc5s%9B9o^=d*`C~$UM@#Nz`?hL^Qh|_a%2yq0rfgl2t?OXc~ z`4#+Ox3dC!d|t1kxz5z=ZSwJ696aL&3;u1WREmaVVDp^GiW)P@14E77`Bi;Av!XLr zVm;C#OyEMnddhJ0^htHM0h+>663_1{f8Sx>-4mE@yScb?G5wn;VD+pCA(mi^1^(y8 z@X<-v^a5ltW^UY5RvL zx(n(UD}5#IdUwl~5(T_bb(kb8<*jruFl3#`ik!TCRf02d4uv=qmrOy6+Cqmagh92> z80rrdVUDmw&RcE>M# h0%B!?fOIzK)nuoHCizb&oQDg7QlZ>}KSBu>zW`tdJpup# diff --git a/.ccls-cache/@home@huck@.repos@odot/structure.c b/.ccls-cache/@home@huck@.repos@odot/structure.c index ecdfb7f..3f75b10 100644 --- a/.ccls-cache/@home@huck@.repos@odot/structure.c +++ b/.ccls-cache/@home@huck@.repos@odot/structure.c @@ -16,13 +16,11 @@ struct task maketask(int n, char **arg){ return temp; } -void puttask(struct task n, FILE *fp){ - +void puttask(struct task n){ fprintf(fp, "%i\t%s\t%s\t%s\t%i\n",n.length,n.task,n.date,n.due,n.urgency); - } -struct task gettask(FILE *fp){ +struct task gettask(void){ struct task tmp; fscanf(fp,"%i\t%s\t%s\t%s\t%i\n",&tmp.length,tmp.task,tmp.date,tmp.due,&tmp.urgency); diff --git a/.ccls-cache/@home@huck@.repos@odot/structure.c.blob b/.ccls-cache/@home@huck@.repos@odot/structure.c.blob index c697e642af4be7b917743e35bbb7edce88afc1f0..d15481269b3f266ab5235d93b5f9305f100e2cf5 100644 GIT binary patch delta 411 zcmX@1xJZFRi{YOg>%n6Tlk+$wCwlX2)NNyBp2Bi)G9#Dk*9* zNJ#K8ib;s6F)@lU$S^T5Ffjg~zqI4mvslX@Mvy8St|(?<4&li&xuybDb8+!83ULWZ zFfj@-h(J^a?+gsb-9FlglF+EN-mIGH~A319=C9j za21eSBiX_;xtm{CR5(aD4#*FYOlUzkce0&;n3cGKIM6HN9O7#K>+Z-NTH$zxjhBak zflbm!GKhsyGD$K6NR~)e0m(MW9w0eGavlq#w3xKaWK(`iSz$ln02W5!1mPqgnI~KT zBx{80fMkbo7t7=ye8ybDDZ)8GtFt7FCin80PLAZ$;u3BUZUYMSNluykg*SEbDPG;l Yvv~D*nS>>TWq{&hl2Sa3lQVb?0j(2bp#T5? delta 597 zcmZ8eOK1~O6n%GQGEK)f6BsVTo4%%uB58~!)>=!7AQ68Rt7z>?X{k{}{M49EH>E@u zH3Th!yegt1qMNJ)Dc$IzC@3OAS4D&_3%XQXx8tpnh;9zNd*3;nbMCX?!^U`qt@Re_ z@0l8F_3s|xFSFH{UMkcT#QeF%m}lrRF4eczP2C3%4;%p)tm^ zX!koMZoio*M_=vO@}tF%*I=Et)jFkP997M_*Rw77D_~g;xRxt4aGCc<;N-&4%05{6 z5~Zx8BW))ZA|T@2o(z)ibd1_(#c#P@tP%TH(Z=v8j1Pkx?% z-c)HC({)FuuWsHg5G^gb)Ee&uNBv0bQ1glHz*H@fQ=N&T`tD>byn$5?@{XKUubo}J z4Nr{(jB|rAaQD0YtJ-hT{^+WFJbZKM(9cy)8x+{iRmIt9;W@laN*85WrJcSc9>e1X z;3yUe$FM{=g%!dY-ZIpEJ8R(}ju2r;j;dih$FYo)^qi8@98}8AUdI`HNQ0;H#WXbA z9uLbCXTu;oGkz%uuaxLQCb{qfpKj#G{Zv$0PQI=0{bbtY&Xfak&;VJK7YIW+Nm!LL igb(Bs1Cm~{okO#@|1t-nN95N-Q-}F~LrYJ#argxaN1fyV diff --git a/file.c b/file.c index 9449bae..ddf96f1 100644 --- a/file.c +++ b/file.c @@ -6,12 +6,13 @@ extern FILE *fp; enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; + void add(void){ fp = fopen(TODOLIST, "a"); - if (fp == NULL) - error('f'); - fputs(strcat(note,"\n"),fp); - fclose(fp); + if (fp != NULL){ + fputs(strcat(note,"\n"),fp); + fclose(fp); + } } void rem(void){ @@ -19,8 +20,6 @@ void rem(void){ FILE *tmp = fopen("temp", "w"); fp = fopen(TODOLIST, "r"); - if (fp == NULL) - error('f'); while (fgets(s, MAXLINE, fp) != NULL){ @@ -40,14 +39,30 @@ void rem(void){ } void show(void){ - char *c = (char *) malloc(MAXLINE * sizeof(int)); + char *c; - if (fp == NULL) - error('f'); + c = (char *) malloc(MAXLINE * sizeof(int)); + fp = fopen(TODOLIST,"r"); while (fgets(c, MAXLINE, fp) != NULL ) - printf("\t\t\033[1;3%im*\033[0m %s",geturgency(urgency), c); + printf("\t\t\033[1;35m*\033[0m %s", c); fclose(fp); free(c); } +int listcheck(void){ + char *s; + + fp = fopen(TODOLIST, "r"); + s = (char *) malloc(MAXLINE * sizeof(char)); + + while (fgets(s, MAXLINE, fp) != NULL){ + s[strlen(s) - 1] = 0; + if (strcmp(note, s) == 0){ + free(s); + return 1; + } + } + free(s); + return 0; +} diff --git a/odot.h b/odot.h index 81a5ea9..c465e23 100644 --- a/odot.h +++ b/odot.h @@ -23,15 +23,15 @@ void add(void); void rem(void); void show(void); -int listcheck(struct task); +int listcheck(void); int geturgency(int); char *gettime(void); void error(char); struct task maketask(int n, char **arg); -void puttask(struct task n, FILE *fp); -struct task gettask(FILE *fp); +void puttask(struct task n); +struct task gettask(void); char *note, *o; int urgency; diff --git a/structure.c b/structure.c index ecdfb7f..3f75b10 100644 --- a/structure.c +++ b/structure.c @@ -16,13 +16,11 @@ struct task maketask(int n, char **arg){ return temp; } -void puttask(struct task n, FILE *fp){ - +void puttask(struct task n){ fprintf(fp, "%i\t%s\t%s\t%s\t%i\n",n.length,n.task,n.date,n.due,n.urgency); - } -struct task gettask(FILE *fp){ +struct task gettask(void){ struct task tmp; fscanf(fp,"%i\t%s\t%s\t%s\t%i\n",&tmp.length,tmp.task,tmp.date,tmp.due,&tmp.urgency); -- 2.45.2