From b590c9d28d2266cd0848e515019cf9fc95b7fd26 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Thu, 17 Nov 2022 00:00:10 -0600 Subject: [PATCH] Thu Nov 17 12:00:10 AM CST 2022 automatic backup --- .../@usr@include@bits@types.h.blob | Bin 9850 -> 9852 bytes .../@usr@include@bits@wordsize.h.blob | Bin 2620 -> 2622 bytes .../@usr@include@features-time64.h.blob | Bin 2437 -> 2439 bytes .../@usr@include@gnu@stubs.h.blob | Bin 2416 -> 2418 bytes .../@usr@include@stdc-predef.h.blob | Bin 2898 -> 2900 bytes .../@usr@include@stdio.h.blob | Bin 37510 -> 37510 bytes .ccls-cache/@home@huck@.repos@odot/file.c | 106 ++++++++++-------- .../@home@huck@.repos@odot/file.c.blob | Bin 7061 -> 7499 bytes .ccls-cache/@home@huck@.repos@odot/input.c | 52 +++++---- .../@home@huck@.repos@odot/input.c.blob | Bin 5689 -> 6005 bytes .ccls-cache/@home@huck@.repos@odot/main.c | 36 +++--- .../@home@huck@.repos@odot/main.c.blob | Bin 6168 -> 6049 bytes .ccls-cache/@home@huck@.repos@odot/odot.h | 5 +- .../@home@huck@.repos@odot/odot.h.blob | Bin 5207 -> 5107 bytes file.c | 106 ++++++++++-------- input.c | 52 +++++---- main.c | 36 +++--- odot | Bin 22016 -> 21936 bytes odot.h | 5 +- 19 files changed, 218 insertions(+), 180 deletions(-) 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 2a97e0c6792c103efdf1f87b945606b64d653ae7..80141a71c38a5ac527e7ba2689579a018c30bf41 100644 GIT binary patch delta 47 zcmez6^T%g`1Ak^-L1~FzG6QpRPGVj0Jhr_ A3;+NC delta 46 zcmez4^UG&~17BKZPO4rq19NgtVqQAK#71!zkjTdDcvj|BkDgBsWR}|eoOP-K0HR3| Az5oCK 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 bcbe4f3367d2fda0145507cf6a1fd70a8a8bbc5c..fc978a6ffba553e6d8cd73dccb85aec159536310 100644 GIT binary patch delta 48 zcmdlZvQK1!B7bIHL1~FzG6QpRPGVj*!X5K_K2))rKo|ReY`SZySnItzKXDw#|0P$cATL1t6 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 a2c8cf881cc6f6466ed35de0cf5b2dfdc2c6414f..5a61925eef691a41d868392af862afe47faf49e0 100644 GIT binary patch delta 48 zcmZn_ZWo@Q$e)>4P+Fpw%)p$SlbDyzFfl=#6)d#TE1s2^FZk8uMiz<9M_3Os0|0wJ B5EcLc delta 36 ocmZn{ZWW%O$da3wnKw}lLT~hmXJuaX==tP_Op=?AvmRgu0O-sOwg3PC 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 4d6b49e87d49560491e687f7cbaa7f8e8f93f3db..1cd7b8dc2d8a11f0e1bafa2e7c13a44e358c5694 100644 GIT binary patch delta 48 zcmew$^hs!fB7bIHL1~FzG6QpRPGVj9kPU=K82))rKo|Spkqvw+!GD&Ve&bpcz00hqtYXATM 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 b299ad6e50dc1d73c1c58b74cc2802a9f93ef4e6..bddb0b58385fc8eba96598c0c09953af190a984a 100644 GIT binary patch delta 48 zcmca4c13K0B7bIHL1~FzG6QpRPGVj*!X5K_K2))rKo|ReY`SZySnItzKXYFML0QeaVq5uE@ 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 d8ef87d5de8516970f34ab151b000c0a51f9af2f..88a88c1a441eccff981a03b978237cd27d8cde8e 100644 GIT binary patch delta 22 ecmZo$%G9=$X~TY2X1?H8lLeWiHs4`g)dK)xF9@dq delta 22 ecmZo$%G9=$X~TY2W~JxPCkrx3ZN9_0ss{jRT?tG8 diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c b/.ccls-cache/@home@huck@.repos@odot/file.c index 2d5b277..4fbcfb9 100644 --- a/.ccls-cache/@home@huck@.repos@odot/file.c +++ b/.ccls-cache/@home@huck@.repos@odot/file.c @@ -1,63 +1,71 @@ #include "odot.h" void add(struct task t, FILE *fp){ - printf("\nalloc\n"); - char *c = malloc(strlen(t.task)*sizeof(char)); - printf("\nfopen\n"); - FILE *buf = fopen("odot.tmp", "w"); + printf("\talloc\n"); + char *line = malloc(MAXLINE*sizeof(char)); + printf("\tfopen\n"); + FILE *buf = fopen("/home/huck/.local/state/odot/odot.txt", "w+"); int i = 0; - printf("\nloopstart\n"); - int j = 0; - while (fgets(c,strlen(t.task),fp) != NULL){ - printf("\n%i-nloop\n", j++); - switch (listcheck(t,fp)){ - case 3: - dialogue("Already on todo list", t.task, CYAN); - printf("Remove from list?"); - if (check() == 0){ + printf("\tNULLcheck\n"); + if (fgets(line,MAXLINE,fp) == NULL){ + puttask(t,buf); + } else { + printf("\tloopstart\n"); + int j = 0; + while (fgets(line,MAXLINE,fp) != NULL){ + printf("\t%i-nloop\n", ++j); + switch (listcheck(t,line)){ + case 3: + dialogue("Already on todo list", t.task, CYAN); + printf("Remove from list?"); + if (check() == 0){ + break; + } else { + puttask(gettask(line), buf); + break; + } + case 1: + dialogue("Already on list in a different group", gettask(line).group, YELLOW); + if (check() == 0){ + puttask(t,buf); + i++; + } + puttask(gettask(line), buf); break; - } else { - puttask(gettask(fp), buf); + default: + /* first time t.task is lexigraphically greater than a previous task */ + if (i == 0 && strcmp(line,t.task) > 0){ + puttask(t,buf); + ++i; + } + puttask(gettask(line), buf); break; - } - case 1: - dialogue("Already on list in a different group", gettask(fp).group, YELLOW); - if (check() == 0){ - puttask(t,buf); - i++; - } - puttask(gettask(fp), buf); - break; - default: - /* first time t.task is lexigraphically greater than a previous task */ - if (i == 0 && strcmp(c,t.task) > 0){ - puttask(t,buf); - ++i; - } - puttask(gettask(fp), buf); - break; + } } } - free(c); fclose(fp); fclose(buf); - remove("/home/huck/.local/state/odot/todo"); - rename("odot.tmp", "/home/huck/.local/state/odot/todo"); + remove("/home/huck/.local/state/odot/todo.txt"); + rename("/home/huck/.local/state/odot/odot.txt", "/home/huck/.local/state/odot/todo.txt"); + free(line); + fp = fopen("/home/huck/.local/state/odot/todo.txt", "w+"); + if (!fp) + error(1); return; } void rem(struct task t, FILE *fp){ char *s = malloc(MAXLINE * sizeof(char)); - FILE *buf = fopen("odot.tmp", "w"); + FILE *buf = fopen("/home/huck/.local/state/odot/odot.txt", "w+"); int i = 0; while (fgets(s, MAXLINE, fp) != NULL){ s[strlen(s) - 1] = 0; if (strcmp(t.task, s) != 0){ - fputs(strcat(s,"\n"),buf); + fputs(strcat(s,"\t"),buf); } else { i++; } @@ -66,8 +74,10 @@ void rem(struct task t, FILE *fp){ fclose(fp); fclose(buf); - remove ("/home/huck/.local/state/odot/todo"); - rename("odot.tmp", "/home/huck/.local/state/odot/todo"); + remove ("/home/huck/.local/state/odot/todo.txt"); + rename("/home/huck/.local/state/odot/odot.txt", "/home/huck/.local/state/odot/todo.txt"); + + fp = fopen("/home/huck/.local/state/odot/todo.txt", "w+"); if (i == 0){ dialogue("Task not found", t.task, YELLOW); @@ -76,18 +86,24 @@ void rem(struct task t, FILE *fp){ add(t,fp); } } - free(s); + } void show(char *group, FILE *fp){ - char *c = malloc(sizeof(char)); + char *task = malloc(MAXLINE * sizeof(char)); + struct task tmp; + + printf("\twhileloop\n"); + int j = 0; - while (fgets(c, 1, fp) != NULL ){ - if (strcmp(group, "all") == 0 || strcmp(gettask(fp).group, group) == 0){ - formattask(gettask(fp)); + while ((fgets(task, MAXLINE, fp)) != NULL ){ + printf("\t%i-nloop\n", ++j); + tmp = gettask(task); + if (strcmp(group, "all") == 0 || strcmp(tmp.group, group) == 0){ + formattask(tmp); } } - free(c); + free(task); } diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c.blob b/.ccls-cache/@home@huck@.repos@odot/file.c.blob index 6379548e81af1a96113d3e1c900b96ed4a7a847c..3d1f47fff9c181a3fe5cacd6a080fcba6cf684e1 100644 GIT binary patch literal 7499 zcmb_hYj7LY71plSvZ5%qVhdGu6=&_*LK2pxIKt!c3)zl?ZJd{ggA;5k@@i!((F^S= zjspo92vbUFp$t<}hEhT)rTx*uG^Ml*&=Mx?478~7+; z3J%RKioCE8%T>@pT;@_)ZhskfHIc!nSgKrDf|!StR)|W;&gRka;qnd%Vmz4<{qR>Q za^f{uEO25piFwEiIi4%8H6~`$NiMpOjPp@0TgZrfzWiW56Hmr68D6Lq4A?BMK@PR( zpO`K=P|jD$SDKWQ*j8SdXfy#x=nSnqvgp*ZMMx!Q0|YyP4Wag6d#76SupqJg9Qyg_ ztNZmuFDwcHF3u+^ev+5+As2niFJL*AAEwVPf}rBsLu8zP9=zc5 ze!ykEG%7VYSJn+QABd$^@B{EyDf}WM;ObObo194UL?ZLY^4$CiRs&cUl@zA3NN?G~ zEU;oJzLINP_o`9_z#`*VQURs;7fBe0?A-Z*zDTr*P0k6tSjKIPNav42x*7%1s8C4- z)}z3ufYQq=LVn3cQ_0exRJhrX-gJg4s9C{`OyMQxqn9fHL9TGZ%E@?{e9389!OewO zQcR>`m1wzuRO<&~%!o;Gv82bu6sp2)tx&q$A+MZ22OyU#W!VN9OX2QOUVRaC>4L}~ zEI+D5*_JGmiaV7YPBtGeyLpl#De1*rrVtRs!mQx0R2^D4msA4=0B$8;sTNAUy$FUC zUI&&jye?6)1AbDbil(x?RT0|;hjh=)uPnaz4dWPp5O&ZE%K@#kK3F;~CVJ$XHkQj~ z1hM$aYiMY&8puB)sG*jj;Q5v?CHajVXIx{iK7SyajI(?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2o%@1eKu5lN+Kpv`S>9AwlPsq&o>; zcS$bke+gg8bc&sRiEMCh0De}l7F!@uE*CS(Y=zyx@KK>(ZkYpCGi>Y1(xK>xor^L@&_E$ zWPV~!#)`;u7Ey%HI}%spQG+6$ID8$R4J 0){ - printf("\n%i-nloop\n",n); - if (*arg[0] != '-'){ - strcat(s, *arg); - strcat(s, (n > 1) ? " " : ""); + while(--n > 0){ + printf("\t%i-nloop\n",n); + if ((*++arg)[0] != '-'){ + strcat(note, *arg); + strcat(note, " "); } else if (strcmp(*arg,"-g") == 0){ - strcpy(group, *arg); + strcpy(group, (*++arg)); + n--; } } - strcpy(tmp.task, s); - strcpy(tmp.group, group); - free(s); + printf("\t%s %s getnote\n",note,group); + tmp = maketask(note,group); + free(note); return tmp; } @@ -32,19 +34,19 @@ struct task getnote(int n, char *arg[], char *group){ short getopt(int n, char *arg[]){ short options; - printf("\nreturn1\n"); + printf("\treturn1\n"); /* show list if no arguments given */ if (n == 1) return 1; - printf("\ncheckopt\n"); + printf("\tcheckopt\n"); while (--n > 0 && (*++arg)[0] == '-'){ /* if theres a d delete, otherwise add */ options += strchr(*arg, 's') ? 1 : 0; options += strchr(*arg, 'n') ? 2 : 0; options += strchr(*arg, 'd') ? 4 : 0; } - printf("%i", options); + printf("\t%i-optcode\n", options); if ((options - 5) > 0) error(2); return options; @@ -52,25 +54,31 @@ short getopt(int n, char *arg[]){ struct task maketask(char *task, char *group){ + printf("\tmaketask\n"); struct task tmp; + + tmp.task = malloc(strlen(task) * sizeof(char)); + tmp.group = malloc(strlen(group) * sizeof(char)); + + strcpy(tmp.task,task); + strcpy(tmp.group,(strcmp(tmp.group,"") == 0) ? "all" : group); - tmp.task = task; - tmp.date = 0; - /* add to all group if group isn't specified */ - tmp.group = (strcmp(group,"") == 0) ? "all" : group; + printf("\t%s-task %s-group\n",tmp.task,tmp.group); return tmp; } -struct task gettask(FILE *fp){ +struct task gettask(char *c){ + printf("\tgettask\n"); struct task tmp; - fscanf(fp,"%s\t%s\t%i\n",tmp.task,tmp.group,&tmp.date); + sscanf(c,"%s\t%s",tmp.task,tmp.group); return tmp; } void puttask(struct task t, FILE *fp){ - fprintf(fp,"%s\t%s\t%i\n",t.task,t.group,t.date); + printf("\t%s %s puttask\n", t.task, t.group); + fprintf(fp,"%s\t%s\n",t.task,t.group); } diff --git a/.ccls-cache/@home@huck@.repos@odot/input.c.blob b/.ccls-cache/@home@huck@.repos@odot/input.c.blob index 19f6e3c21f194716c55d991d8723341c97f3f018..a84d4ccf764a90d6d7d623fa6987359de9133c29 100644 GIT binary patch delta 2159 zcmZuyeQZ-z6o2=IaxCm&NDn zLrc{LRicqft)?l8qBT0eKW9IFwn2Nr-8y^d#GYO{BV}CL(0jLOWv8ey^R8ZqT+}d( zYLd`v=so%6cORj8h?|f~nk#RD94ZU@Q8@YUD2L!+YKGV=vG)M+Llu0tV zw1ZFn@YwIqGt0qMkOciflhV|wE&AN_$C{I;o&pcEWOixE*N?>_U%s&r4n$e>>iAhL zR+si;>-MJ~Hy&sO4~dfm?WLU`;)zDV_2~VLyWX{5J2|nfFfo^tH{}X)K0h{^n{ZCdsoIrA5fe%=h z>?+v~xuawQa-d|pq^^=*LQ0hEpfp&rP-iUh%Xvr{0OHGmR z#<{o!Pntr-uoQOFC`|POIHPsnIx~Lh$hQNUwf*8M!%^W+t$y>X#g{Ma8?T3Cbhki# zbj^==BVF3{>BH`ylus@~H=uGlkElP|qw^>NAzhDwnf`#(MkfoXrj7`Y2zLZpfE26v zciO%+m)|s%n;4h3%;cuzd|__OM6N0TN4d-%4^JS-r(|eI1fYN}-e~YLokAzxZ%8(R zh~WpKU3}T#uXpecGEojHh;7Ev;w!)2ciwgI*&EvRy~}=yUmM$}sfVtd9X)3A)`3EF zoIxtO1Fz!k)J`mI{jPYu|1Kz=Px0vw{EAF--Q|VmH|* zjY+aki7B#I-D-eE=4ue>!Pc>YTo}!7mJ3AUM0!Z=RD<(0@wKTzZP(AOpB+sU&(+S8 zey|xelVwq6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~jOe@U~h#D`E}Bz+w%~xJ7J|OY$t}=lZctb7^dsOUsGa z+JiG&DsJ0Y&8w8~?ZVvytUfDI0p+t2^|ND86k`wAgDkLZdlcLI?E6{ZjBh!1+(7}c zbFE8sNqzuLI0S(^?(V@^YS(4sbiSx)`QqmF6Sx=)aE@Rim?AlXYH*Muu~{{tru;xN zv;hdBMikqa5gUN$HL+WzJrNI%=Z$#{9JTfsR-?}1i1dvq`cLe%B^odsGfq{i#YcD* z%Za$L6*Vyifz&REIEZWAvnS5}@W|f{P0DCYG6U+5EJoWcvs{1+~W;KK zHU$Dc&LlDj3p0C;InPN$q*;?8%Qy?IDyh{<45DgSg2^}Q} z7ifZpFIQBEVjB};*v3=w5eSyGFT+RZm3lFq`ZH72u(>$1ja<7{B4UL;UJ;Sg$19bl P(>>{y6b3VyE= 4){ - printf("\nrem\n"); + printf("\trem\n"); rem(note, fp); - } else { - printf("\nadd\n"); + } else if (opt >= 2){ + printf("\tadd\n"); add(note, fp); } if (opt % 2 != 0){ - printf("\nshow\n"); + printf("\tshow\n"); show(group, fp); } - - free(group); + printf("\texiting\n"); fclose(fp); + free(group); return 0; } void error(int err){ switch (err) { case 1: - fprintf(stderr,"ERROR: COULD NOT ACCESS FILE: %s\n", "/home/huck/.local/state/odot/todo"); + fprintf(stderr,"ERROR: COULD NOT ACCESS FILE: %s\n", "/home/huck/.local/state/odot/todo.txt"); break; case 2: fprintf(stderr,"ERROR: CANT ADD AND REMOVE SAME TASK\n"); @@ -55,7 +55,7 @@ void dialogue(char *m1, char *m2, int c){ } void formattask(struct task t){ - printf("* %s\t%s\t%i", t.task, t.group, t.date); + printf("* %s\t%s\n", t.task, t.group); } /* Returns: @@ -64,17 +64,13 @@ void formattask(struct task t){ 2 - Group matches 3 - Both match */ -int listcheck(struct task t, FILE *fp){ +int listcheck(struct task t, char *c){ int i; - i += (strcmp(t.task,gettask(fp).task) == 0) ? 1 : 0; - i += (strcmp(t.group,gettask(fp).group) == 0) ? 2 : 0; + i += (strcmp(t.task,gettask(c).task) == 0) ? 1 : 0; + i += (strcmp(t.group,gettask(c).group) == 0) ? 2 : 0; return i; } -char *gettime(void){ - return NULL; -} - /* returns 0 for yes and 1 for no */ int check(void){ printf("Continue? [y/n] (y):"); diff --git a/.ccls-cache/@home@huck@.repos@odot/main.c.blob b/.ccls-cache/@home@huck@.repos@odot/main.c.blob index e10b157d58ad8b30026c94752ab9f0ab52e18939..ecc8316389674dc4b3eb6eb404078fbfff8e5d16 100644 GIT binary patch delta 684 zcmbPXuuz{(i{YO~{i}^^J6V}SLS9W4WRlu^hjl+Qqv+&0oVuDm3O;&&RU8=qOGNb+ zaozepuehYBG`U2fB(XSKAw9JOL~A5xBo<9p;j-cM;_wn;V)SD0pPb31BI3>AE%M)Y z%ReTyTCxAkKvRH*OrkjQ_oy zQT^IN%)XQNbK9_h&Hm4wDz&d?(a(*1)8l9>AOU3#Wr6=wYIjV0Ge30M z@uQbb@?t!eJr;qAfWr!8FiUlMnDWaOkXAIq}?<(7eqa0>X@wrwDFi z0U13xOwg1CWaMN&p;&&#|2KEeEk0V#q{hg`!6q>Iq)>n$%=7K`Rh!k_c0(Ekgm<9(tJimym zOfD4no_t3{U7SULLx4|&QB*)wjE7M|PC|u;QC2`!Z1Q5>ERm0 z!U&I>$w$OB;69(cUPN~?w^)LUvXHV24H+hkmFSC-E(&SHK FjsVla>zx1q delta 757 zcmX|9ZAcSw9KQeEId1NBx82KPsm*Q8W$7d`z4L9J+j7g7K~@q8&9+K{avk_3H- zFp^*Nh9Q1P>q}4uB?UrY&&$r+6d!Fa_j0UcjnToO1 z*}n^SO_N!K|HlH@aOcE_tSJHsFl;W7;;wjU#v4S+?;hdR+aq6p?mv_`;VM3uN~gPy zru-W)n$AU0I_ktx6x)tt+R#Wtm@(&*k!VvGmdw@W7OKULqZVujRAhU(R;ra#n(wdT zzJ5U=RDSggbZ6hBpVWUjxBkkvJ|t2i3|V+6x70f8f_GLVuCPI&r&o!vbVgLRj4u_+ zr`B}Bprsl{Y!u8`63$O!Ro;!8k~zwB?A|~Vd;5X%xUMRddhxyin&@R@p9tnKsK8CR z8Rb&{!=c5IonzW*59Q&M-RD0F^WQHra5{GuWkZ{_5-wR8Le&Z5)&Z*G-Mr)F=d9pF zfMF3Jdl{+GK#lDYsjWk~y`unE<|c3SPM^emh5+0|nHUnuk}SihJ#N$8DY{g^*+9Kc zZn!dZW4yA?lq9EmYC5z;^+7QqR-nGbU>Rhq{BwU6FK=cptaKeqyV8l?!;+Ltq*EBh zQQDdYNZczXX?V)|t&%9yDC7&3s@NEcLx$}&Ji;@+1RQ)(9>GvdE{AxA7ig5vhh}fuNySN8l3$>IH`YtvA?R*gv6WeGM_Jzw-jD_1s_{Dcx-FA1L z%BQ~;`Zzx@j%LCmcwnESzS_u8Ymlq>z;U%`r0PMA$gvFmKhv1fy>__c?3-=N85+az bP%soyFUa8tJm;Dzy(@5y_ftk+ZgJj!WRLbL diff --git a/.ccls-cache/@home@huck@.repos@odot/odot.h b/.ccls-cache/@home@huck@.repos@odot/odot.h index 78c3548..1cd5ff2 100644 --- a/.ccls-cache/@home@huck@.repos@odot/odot.h +++ b/.ccls-cache/@home@huck@.repos@odot/odot.h @@ -10,7 +10,6 @@ struct task { char *task; - int date; char *group; }; @@ -21,7 +20,7 @@ void add(struct task, FILE *); void rem(struct task, FILE *); void show(char *group, FILE *); -int listcheck(struct task, FILE *); +int listcheck(struct task, char *); int geturgency(int); char *gettime(void); @@ -32,6 +31,6 @@ int check(void); struct task maketask(char *, char *); void puttask(struct task n, FILE*); -struct task gettask(FILE *); +struct task gettask(char *); enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; diff --git a/.ccls-cache/@home@huck@.repos@odot/odot.h.blob b/.ccls-cache/@home@huck@.repos@odot/odot.h.blob index ee6868639ad80439d6bc0711f4fa7c5697a9d206..bbbd5b8036bf2bfa2dbc0a8f52fe01e66ab5c715 100644 GIT binary patch delta 847 zcmYjPO=uHA7@a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{Dpf>o)edk|sy^)HVDLr)Ap;DWla`7JF2OQN zKq3LKn64;{2MAA;0z`n&?S-9n{%|^+@gXIxFsqiURX(IuX*E7%t~P6Z$VyrjJ~Z+t zfjNtur(fO=SITF;1ASarIwTb^-y-K(>5Dzi@Xbm1=RWQndb73W=f%@!bAUiY00mAy zTPNQtPL|||4~20!$uhwTvsy~4^dY0%VEJGPGq0I6Stgcbv31DVmrV_tC-*+7-&NNN zKzn2{NP38!EASzP^rXBpNOqGhZ@-(+ad~-=93>~b{ZT@{%2&$rjce~}>%*!2eFp~) zfgtc~YE-PI+>@%JrXVNKbD>766;*aTT2f+yRu+82MYZfwA8(BBZz(&>? zd>(&rwQka%V{ZnWPjoC?ERa^R!{cR0kA%~$q=I-6E-nztH*&sE?_VLa(#*I#X0e%> TCqy@gONvPiY4$W2{!jTESw;>5 diff --git a/file.c b/file.c index 2d5b277..4fbcfb9 100644 --- a/file.c +++ b/file.c @@ -1,63 +1,71 @@ #include "odot.h" void add(struct task t, FILE *fp){ - printf("\nalloc\n"); - char *c = malloc(strlen(t.task)*sizeof(char)); - printf("\nfopen\n"); - FILE *buf = fopen("odot.tmp", "w"); + printf("\talloc\n"); + char *line = malloc(MAXLINE*sizeof(char)); + printf("\tfopen\n"); + FILE *buf = fopen("/home/huck/.local/state/odot/odot.txt", "w+"); int i = 0; - printf("\nloopstart\n"); - int j = 0; - while (fgets(c,strlen(t.task),fp) != NULL){ - printf("\n%i-nloop\n", j++); - switch (listcheck(t,fp)){ - case 3: - dialogue("Already on todo list", t.task, CYAN); - printf("Remove from list?"); - if (check() == 0){ + printf("\tNULLcheck\n"); + if (fgets(line,MAXLINE,fp) == NULL){ + puttask(t,buf); + } else { + printf("\tloopstart\n"); + int j = 0; + while (fgets(line,MAXLINE,fp) != NULL){ + printf("\t%i-nloop\n", ++j); + switch (listcheck(t,line)){ + case 3: + dialogue("Already on todo list", t.task, CYAN); + printf("Remove from list?"); + if (check() == 0){ + break; + } else { + puttask(gettask(line), buf); + break; + } + case 1: + dialogue("Already on list in a different group", gettask(line).group, YELLOW); + if (check() == 0){ + puttask(t,buf); + i++; + } + puttask(gettask(line), buf); break; - } else { - puttask(gettask(fp), buf); + default: + /* first time t.task is lexigraphically greater than a previous task */ + if (i == 0 && strcmp(line,t.task) > 0){ + puttask(t,buf); + ++i; + } + puttask(gettask(line), buf); break; - } - case 1: - dialogue("Already on list in a different group", gettask(fp).group, YELLOW); - if (check() == 0){ - puttask(t,buf); - i++; - } - puttask(gettask(fp), buf); - break; - default: - /* first time t.task is lexigraphically greater than a previous task */ - if (i == 0 && strcmp(c,t.task) > 0){ - puttask(t,buf); - ++i; - } - puttask(gettask(fp), buf); - break; + } } } - free(c); fclose(fp); fclose(buf); - remove("/home/huck/.local/state/odot/todo"); - rename("odot.tmp", "/home/huck/.local/state/odot/todo"); + remove("/home/huck/.local/state/odot/todo.txt"); + rename("/home/huck/.local/state/odot/odot.txt", "/home/huck/.local/state/odot/todo.txt"); + free(line); + fp = fopen("/home/huck/.local/state/odot/todo.txt", "w+"); + if (!fp) + error(1); return; } void rem(struct task t, FILE *fp){ char *s = malloc(MAXLINE * sizeof(char)); - FILE *buf = fopen("odot.tmp", "w"); + FILE *buf = fopen("/home/huck/.local/state/odot/odot.txt", "w+"); int i = 0; while (fgets(s, MAXLINE, fp) != NULL){ s[strlen(s) - 1] = 0; if (strcmp(t.task, s) != 0){ - fputs(strcat(s,"\n"),buf); + fputs(strcat(s,"\t"),buf); } else { i++; } @@ -66,8 +74,10 @@ void rem(struct task t, FILE *fp){ fclose(fp); fclose(buf); - remove ("/home/huck/.local/state/odot/todo"); - rename("odot.tmp", "/home/huck/.local/state/odot/todo"); + remove ("/home/huck/.local/state/odot/todo.txt"); + rename("/home/huck/.local/state/odot/odot.txt", "/home/huck/.local/state/odot/todo.txt"); + + fp = fopen("/home/huck/.local/state/odot/todo.txt", "w+"); if (i == 0){ dialogue("Task not found", t.task, YELLOW); @@ -76,18 +86,24 @@ void rem(struct task t, FILE *fp){ add(t,fp); } } - free(s); + } void show(char *group, FILE *fp){ - char *c = malloc(sizeof(char)); + char *task = malloc(MAXLINE * sizeof(char)); + struct task tmp; + + printf("\twhileloop\n"); + int j = 0; - while (fgets(c, 1, fp) != NULL ){ - if (strcmp(group, "all") == 0 || strcmp(gettask(fp).group, group) == 0){ - formattask(gettask(fp)); + while ((fgets(task, MAXLINE, fp)) != NULL ){ + printf("\t%i-nloop\n", ++j); + tmp = gettask(task); + if (strcmp(group, "all") == 0 || strcmp(tmp.group, group) == 0){ + formattask(tmp); } } - free(c); + free(task); } diff --git a/input.c b/input.c index 0cb2c50..4d39442 100644 --- a/input.c +++ b/input.c @@ -1,26 +1,28 @@ #include "odot.h" struct task getnote(int n, char *arg[], char *group){ - char *s = malloc(MAXLINE * sizeof(char)); + char *note = malloc(MAXLINE * sizeof(char)); struct task tmp; - if (n == 1) - printf("\nreturn from note\n"); + if (n == 1){ + printf("\t\treturn from note\n"); return tmp; + } - while(n-- > 0){ - printf("\n%i-nloop\n",n); - if (*arg[0] != '-'){ - strcat(s, *arg); - strcat(s, (n > 1) ? " " : ""); + while(--n > 0){ + printf("\t%i-nloop\n",n); + if ((*++arg)[0] != '-'){ + strcat(note, *arg); + strcat(note, " "); } else if (strcmp(*arg,"-g") == 0){ - strcpy(group, *arg); + strcpy(group, (*++arg)); + n--; } } - strcpy(tmp.task, s); - strcpy(tmp.group, group); - free(s); + printf("\t%s %s getnote\n",note,group); + tmp = maketask(note,group); + free(note); return tmp; } @@ -32,19 +34,19 @@ struct task getnote(int n, char *arg[], char *group){ short getopt(int n, char *arg[]){ short options; - printf("\nreturn1\n"); + printf("\treturn1\n"); /* show list if no arguments given */ if (n == 1) return 1; - printf("\ncheckopt\n"); + printf("\tcheckopt\n"); while (--n > 0 && (*++arg)[0] == '-'){ /* if theres a d delete, otherwise add */ options += strchr(*arg, 's') ? 1 : 0; options += strchr(*arg, 'n') ? 2 : 0; options += strchr(*arg, 'd') ? 4 : 0; } - printf("%i", options); + printf("\t%i-optcode\n", options); if ((options - 5) > 0) error(2); return options; @@ -52,25 +54,31 @@ short getopt(int n, char *arg[]){ struct task maketask(char *task, char *group){ + printf("\tmaketask\n"); struct task tmp; + + tmp.task = malloc(strlen(task) * sizeof(char)); + tmp.group = malloc(strlen(group) * sizeof(char)); + + strcpy(tmp.task,task); + strcpy(tmp.group,(strcmp(tmp.group,"") == 0) ? "all" : group); - tmp.task = task; - tmp.date = 0; - /* add to all group if group isn't specified */ - tmp.group = (strcmp(group,"") == 0) ? "all" : group; + printf("\t%s-task %s-group\n",tmp.task,tmp.group); return tmp; } -struct task gettask(FILE *fp){ +struct task gettask(char *c){ + printf("\tgettask\n"); struct task tmp; - fscanf(fp,"%s\t%s\t%i\n",tmp.task,tmp.group,&tmp.date); + sscanf(c,"%s\t%s",tmp.task,tmp.group); return tmp; } void puttask(struct task t, FILE *fp){ - fprintf(fp,"%s\t%s\t%i\n",t.task,t.group,t.date); + printf("\t%s %s puttask\n", t.task, t.group); + fprintf(fp,"%s\t%s\n",t.task,t.group); } diff --git a/main.c b/main.c index 9b86cd1..e498acf 100644 --- a/main.c +++ b/main.c @@ -1,46 +1,46 @@ #include "odot.h" int main(int argc, char *argv[]){ - printf("\nstart\n"); + printf("\tstart\n"); struct task note; short opt; FILE *fp; char *group = malloc(MAXLINE*sizeof(char)); - printf("\nfopen\n"); - fp = fopen("/home/huck/.local/state/odot/todo", "w+"); + printf("\tfopen\n"); + fp = fopen("/home/huck/.local/state/odot/todo.txt", "w+"); if (!fp){ error(1); } - printf("\ngetopt\n"); + printf("\tgetopt\n"); opt = getopt(argc, argv); - printf("\ngetnote\n"); + printf("\tgetnote\n"); note = getnote(argc, argv, group); if (opt >= 4){ - printf("\nrem\n"); + printf("\trem\n"); rem(note, fp); - } else { - printf("\nadd\n"); + } else if (opt >= 2){ + printf("\tadd\n"); add(note, fp); } if (opt % 2 != 0){ - printf("\nshow\n"); + printf("\tshow\n"); show(group, fp); } - - free(group); + printf("\texiting\n"); fclose(fp); + free(group); return 0; } void error(int err){ switch (err) { case 1: - fprintf(stderr,"ERROR: COULD NOT ACCESS FILE: %s\n", "/home/huck/.local/state/odot/todo"); + fprintf(stderr,"ERROR: COULD NOT ACCESS FILE: %s\n", "/home/huck/.local/state/odot/todo.txt"); break; case 2: fprintf(stderr,"ERROR: CANT ADD AND REMOVE SAME TASK\n"); @@ -55,7 +55,7 @@ void dialogue(char *m1, char *m2, int c){ } void formattask(struct task t){ - printf("* %s\t%s\t%i", t.task, t.group, t.date); + printf("* %s\t%s\n", t.task, t.group); } /* Returns: @@ -64,17 +64,13 @@ void formattask(struct task t){ 2 - Group matches 3 - Both match */ -int listcheck(struct task t, FILE *fp){ +int listcheck(struct task t, char *c){ int i; - i += (strcmp(t.task,gettask(fp).task) == 0) ? 1 : 0; - i += (strcmp(t.group,gettask(fp).group) == 0) ? 2 : 0; + i += (strcmp(t.task,gettask(c).task) == 0) ? 1 : 0; + i += (strcmp(t.group,gettask(c).group) == 0) ? 2 : 0; return i; } -char *gettime(void){ - return NULL; -} - /* returns 0 for yes and 1 for no */ int check(void){ printf("Continue? [y/n] (y):"); diff --git a/odot b/odot index 1c93fb8b2c1bea2ab336ac8e48fc500c0c1690f6..f13d2281af9e0bc113ccc70ba193c8e28596de48 100755 GIT binary patch delta 5393 zcmZ`-4RBP|6~1qiCA;A#*+5J-1hYwrpoRQ^6h$%1&%y&i5;6YA5+RWkNMf=fpiMTi zhWcEhfvZTJj!mi*hSDK*8A{cG2o8bP+Mv{i4nu>T>WhgA;!mi^_B;397Z#{*=iPJf z`M>9$bKbt!v|H==oz|M_Ds(Y%c_m=gn{V9VY>k(z*3Bn#;~PfEMZ*Z5q~$m-#>(YI zzCg>3@3zTRuZ?fezRA2LOD?a5nB4=3>(|<1e9gPZKK?TQ zRm{Y3sbJG^55wI=lQtHEkr6(PpNW~kkH)6*j{I0YK6Z@ed89U|tpT@nT#m#&be;l9;E6@p=BZJ(Xr#3WX6n`Qzb#u#MJgc>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UFpUDGIe@rud=6iCXw9RV+h7VzFE_UBakL@(CO)%;kw~%c6M*mt4LC2R$pdk+hstT z^1WC*A;bNck|-OM7)nbHZ!t2d6q!VChZNa|hAQTgVmS57X!E=#h3JhVyzjkySxy94 zWKT}SWY}nOcf{`Kz}n-;0ktKDcFM<853C(}&67O_zmuD1)B#%I=kyXYI#T|On6n0G zs+A#?G^9TLE9(4G-fnCwaNSVc8ejyxU#ysb`>*L*49~A|lTe+Gf8B*(Fb_7_n7G0*iFd``@VH?! zo0l|a%I%ZV!DaOA`4IkF;KOdjkL8bvdsw{Jr!PVtR?zj6TpBnG_8d&cgTv&@!tzhRUw=^?yeY|j8P!_M(~4oL4}?{dfnhJ? z^c8Y-s9%KTb0Hs%lWxXPd7Tt1Um;J2eD5${UX#8gGIkT&2tgYHQZv*5>dE-;giLoy zG)zizQ$mkNye1D-E5ABU59H~Pzcf^?+ZDz+2zd+SHw={*UhSWV@OmM~XYEx#A60U2 z+JBn#fkCtw7mW{nv4_6UVOKtfMBmg@og+mUtv~0@qRN`eX9$mV9`6*Vtf{6cVZ8@fiq5CD7r%BMKAo0z*0{Jh05*PD1{V9JaRpPK2Q2|8D$|Z!{wBEUL%|C!&;We#NTYkZcV6y?r@>S@hRYo6kV%8!-)eD)jjME%)?u-XlzO4Q;_-}(w3JA diff --git a/odot.h b/odot.h index 78c3548..1cd5ff2 100644 --- a/odot.h +++ b/odot.h @@ -10,7 +10,6 @@ struct task { char *task; - int date; char *group; }; @@ -21,7 +20,7 @@ void add(struct task, FILE *); void rem(struct task, FILE *); void show(char *group, FILE *); -int listcheck(struct task, FILE *); +int listcheck(struct task, char *); int geturgency(int); char *gettime(void); @@ -32,6 +31,6 @@ int check(void); struct task maketask(char *, char *); void puttask(struct task n, FILE*); -struct task gettask(FILE *); +struct task gettask(char *); enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; -- 2.45.2