From a2ae00b8925b9ab12090ee78c97010ed2c889857 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Wed, 16 Nov 2022 00:00:08 -0600 Subject: [PATCH] Wed Nov 16 12:00:08 AM CST 2022 automatic backup --- .../@usr@include@alloca.h.blob | Bin 3023 -> 3023 bytes ...sr@include@bits@atomic_wide_counter.h.blob | Bin 3393 -> 3393 bytes .../@usr@include@bits@byteswap.h.blob | Bin 3831 -> 3831 bytes .../@usr@include@bits@endian.h.blob | Bin 2908 -> 2908 bytes .../@usr@include@bits@endianness.h.blob | Bin 2565 -> 2565 bytes .../@usr@include@bits@floatn-common.h.blob | Bin 6606 -> 6606 bytes .../@usr@include@bits@floatn.h.blob | Bin 2921 -> 2921 bytes ...@usr@include@bits@libc-header-start.h.blob | Bin 3205 -> 3205 bytes .../@usr@include@bits@long-double.h.blob | Bin 2492 -> 2484 bytes ...@usr@include@bits@pthreadtypes-arch.h.blob | Bin 3527 -> 3527 bytes .../@usr@include@bits@pthreadtypes.h.blob | Bin 7507 -> 7507 bytes .../@usr@include@bits@select.h.blob | Bin 2806 -> 2808 bytes .../@usr@include@bits@stdint-intn.h.blob | Bin 2985 -> 2985 bytes .../@usr@include@bits@stdio_lim.h.blob | Bin 2770 -> 2768 bytes .../@usr@include@bits@stdlib-float.h.blob | Bin 2379 -> 2379 bytes .../@usr@include@bits@struct_mutex.h.blob | Bin 3775 -> 3775 bytes .../@usr@include@bits@struct_rwlock.h.blob | Bin 4187 -> 4187 bytes ...sr@include@bits@thread-shared-types.h.blob | Bin 4843 -> 4843 bytes .../@usr@include@bits@time.h.blob | Bin 3518 -> 3520 bytes .../@usr@include@bits@time64.h.blob | Bin 2576 -> 2568 bytes .../@usr@include@bits@timesize.h.blob | Bin 2488 -> 2480 bytes .../@usr@include@bits@types.h.blob | Bin 9850 -> 9850 bytes .../@usr@include@bits@types@FILE.h.blob | Bin 2641 -> 2641 bytes .../@usr@include@bits@types@__FILE.h.blob | Bin 2586 -> 2578 bytes .../@usr@include@bits@types@__fpos64_t.h.blob | Bin 3377 -> 3369 bytes .../@usr@include@bits@types@__fpos_t.h.blob | Bin 3323 -> 3315 bytes .../@usr@include@bits@types@__locale_t.h.blob | Bin 3499 -> 3501 bytes ...@usr@include@bits@types@__mbstate_t.h.blob | Bin 3165 -> 3157 bytes .../@usr@include@bits@types@__sigset_t.h.blob | Bin 2785 -> 2787 bytes .../@usr@include@bits@types@clock_t.h.blob | Bin 2620 -> 2620 bytes .../@usr@include@bits@types@clockid_t.h.blob | Bin 2650 -> 2650 bytes .../@usr@include@bits@types@locale_t.h.blob | Bin 2675 -> 2677 bytes .../@usr@include@bits@types@sigset_t.h.blob | Bin 2718 -> 2720 bytes ...@usr@include@bits@types@struct_FILE.h.blob | Bin 6894 -> 6886 bytes ...nclude@bits@types@struct_itimerspec.h.blob | Bin 2883 -> 2883 bytes ...@include@bits@types@struct_timespec.h.blob | Bin 3108 -> 3110 bytes ...r@include@bits@types@struct_timeval.h.blob | Bin 2924 -> 2926 bytes .../@usr@include@bits@types@struct_tm.h.blob | Bin 3553 -> 3555 bytes .../@usr@include@bits@types@time_t.h.blob | Bin 2600 -> 2600 bytes .../@usr@include@bits@types@timer_t.h.blob | Bin 2637 -> 2637 bytes .../@usr@include@bits@typesizes.h.blob | Bin 6388 -> 6380 bytes .../@usr@include@bits@uintn-identity.h.blob | Bin 3397 -> 3397 bytes .../@usr@include@bits@waitflags.h.blob | Bin 2944 -> 2946 bytes .../@usr@include@bits@waitstatus.h.blob | Bin 3504 -> 3506 bytes .../@usr@include@bits@wordsize.h.blob | Bin 2620 -> 2620 bytes .../@usr@include@ctype.h.blob | Bin 14546 -> 14548 bytes .../@usr@include@endian.h.blob | Bin 3830 -> 3830 bytes .../@usr@include@features-time64.h.blob | Bin 2437 -> 2437 bytes .../@usr@include@features.h.blob | Bin 5467 -> 5467 bytes .../@usr@include@gnu@stubs-64.h.blob | Bin 2944 -> 2936 bytes .../@usr@include@gnu@stubs.h.blob | Bin 2416 -> 2416 bytes .../@usr@include@stdc-predef.h.blob | Bin 2898 -> 2898 bytes .../@usr@include@stdio.h.blob | Bin 37510 -> 37510 bytes .../@usr@include@stdlib.h.blob | Bin 43350 -> 43352 bytes .../@usr@include@string.h.blob | Bin 17032 -> 17032 bytes .../@usr@include@strings.h.blob | Bin 6434 -> 6436 bytes .../@usr@include@sys@cdefs.h.blob | Bin 12460 -> 12460 bytes .../@usr@include@sys@select.h.blob | Bin 6068 -> 6070 bytes .../@usr@include@sys@types.h.blob | Bin 8105 -> 8105 bytes .../@usr@include@time.h.blob | Bin 14862 -> 14864 bytes ...usr@lib@clang@14.0.6@include@stdarg.h.blob | Bin 3225 -> 3225 bytes ...usr@lib@clang@14.0.6@include@stddef.h.blob | Bin 2693 -> 2693 bytes .ccls-cache/@home@huck@.repos@odot/dialogue.c | 20 ----- .../@home@huck@.repos@odot/dialogue.c.blob | Bin 3650 -> 2448 bytes .ccls-cache/@home@huck@.repos@odot/file.c | 72 +++++++++++----- .../@home@huck@.repos@odot/file.c.blob | Bin 6599 -> 7061 bytes .ccls-cache/@home@huck@.repos@odot/func.c | 30 ------- .../@home@huck@.repos@odot/func.c.blob | Bin 4375 -> 2440 bytes .ccls-cache/@home@huck@.repos@odot/input.c | 40 +++++---- .../@home@huck@.repos@odot/input.c.blob | Bin 5279 -> 5689 bytes .ccls-cache/@home@huck@.repos@odot/main.c | 80 +++++++++++++++++- .../@home@huck@.repos@odot/main.c.blob | Bin 2781 -> 6168 bytes .ccls-cache/@home@huck@.repos@odot/odot.h | 15 ++-- .../@home@huck@.repos@odot/odot.h.blob | Bin 4765 -> 5207 bytes .ccls-cache/@home@huck@.repos@odot/test.c | 9 ++ .../@home@huck@.repos@odot/test.c.blob | Bin 0 -> 1670 bytes Makefile | 11 +-- dialogue.c | 20 ----- file.c | 72 +++++++++++----- func.c | 32 ------- input.c | 40 +++++---- main.c | 80 +++++++++++++++++- odot | Bin 0 -> 22016 bytes odot.h | 15 ++-- structure.c | 5 -- test | Bin 0 -> 20608 bytes 86 files changed, 329 insertions(+), 212 deletions(-) create mode 100644 .ccls-cache/@home@huck@.repos@odot/test.c create mode 100644 .ccls-cache/@home@huck@.repos@odot/test.c.blob delete mode 100644 func.c create mode 100755 odot delete mode 100644 structure.c create mode 100755 test diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@alloca.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@alloca.h.blob index cdd724622ef21737db88a7fca011a19ed06728ba..1def0cad93b1d3d4246c33aa8f09f44d7b6e80bd 100644 GIT binary patch delta 20 ccmX>veqMaTYF6e|kDgC{$RxS>I4cJm0AveqMaTYF1`BgL{)7GD&Ve&dR|C09Q8$cmMzZ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@atomic_wide_counter.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@atomic_wide_counter.h.blob index c5182e2917b706c2f98234656978f0d35b7ea0f6..ace0daf8c35a8730420c421d1b58c901f6f190dc 100644 GIT binary patch delta 16 YcmX>obx>+U9V_#yN6$AmvL0Xu06%^QU;qFB delta 16 XcmX>obx>+U9V@e(!M)9mtOwWuHVOtA diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@byteswap.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@byteswap.h.blob index 0fd40ab904753bde210d34144ecc71c8cabfd5e1..c26ab6d101d0d6e1bf26d96cb5c8e30f94c66b6a 100644 GIT binary patch delta 20 ccmew^`(1X!a#rS5kDgBsWRco@gw>c60BAG_wEzGB delta 20 ccmew^`(1X!a#m(JgL{($S)?`}VKwFi09m95ZU6uP diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endian.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endian.h.blob index 86c20b1b81e588a33076309eb09bec6d0144c12e..43b34225abd0a9a1cac449c782102e34a7fb8a60 100644 GIT binary patch delta 20 ccmca3c1LW(YF6e|kDgC{$RxS>IO|ka0BEWSV*mgE delta 20 ccmca3c1LW(YF1`BgL{)7GD&Ve&N`J909qOd8~^|S diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endianness.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endianness.h.blob index 22d90e1cfbd59cf1896df54f6e0d85988a795e9b..c78f2d9b284f89be3470e9c72394efd084829f9c 100644 GIT binary patch delta 20 ccmZn_X%*Sf&dR*%(eufMEK-}7uqLtq08;x0hyVZp delta 20 bcmZn_X%*Sf&dMxjaBs39i`3>NtcffDL~8~? diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn-common.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn-common.h.blob index cd467e7d8d1e6e6895dcec8477d5db83c46097d7..77f1cf8106be700614fd21ba1beaa025f5b92ba2 100644 GIT binary patch delta 20 ccmX?Se9m}73oG-gN6#leWRl#xfK^Wf0A~gW+W-In delta 20 ccmX?Se9m}73oEmn!M({3nItzaVAT@=09bYhlmGw# diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn.h.blob index c251ccda151c752747602cd96a3537d3b769e88d..514dc757d6d676cce8e95147bb4d34652147b169 100644 GIT binary patch delta 20 ccmaDU_EK!aYF6e|kDgC{$RxS>IO`%-0BW)ciU0rr delta 20 ccmaDU_EK!aYF1`BgL{)7GD&Ve&bo*d09+ynLjV8( 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 b31f8cc06e45605d17d95ac179f730359c2fc886..c07a751fa0e65afcd394953bc59e49a8f343e0dd 100644 GIT binary patch delta 16 XcmZpbY?a(l$I86w(eurXtSsyRHsS^< delta 16 XcmZpbY?a(l$I2XFc5ibdD+@aSFDL~Y diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@long-double.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@long-double.h.blob index e0febfafe261eb8c5a3d5546ab0ed0518d581df1..af735102bd98ab97840417872b01c7c39380d86f 100644 GIT binary patch delta 34 ocmdlZyhV6|B6C`1&O{9*5VbMTnw5Fgqvw+uS)?|vWEExs0MMrkfdBvi delta 53 zcmdlYyhnI~qEJd^VorW~X{uf_19NgtVqQAK!~}76sOUydYgT4CgL{)3StK^kXBA}u E0OM8>IsgCw diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes-arch.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes-arch.h.blob index f2697e178c4031869de66ef1574dbe69d1d9bc3f..5bcf91e62262ebeb05b6bcec73d21c58f2572fc8 100644 GIT binary patch delta 20 ccmX>ueO!7&11s~YN6#leWRl!GhgF*c0AfA}h5!Hn delta 20 ccmX>ueO!7&11qzf!M({3nIt#QVb$gU08_39KL7v# diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes.h.blob index 6bd04ef73232f705a543c97c09c60e95beb2e736..2a8cef8fbf7754b6e5a80425cfced914aa07acff 100644 GIT binary patch delta 20 ccmca?b=hjeYF6e|kDgC{$RxS>IBSnM0BmFlq5uE@ delta 20 ccmca?b=hjeYF1`BgL{)7GD&Ve&e|gm0A17wTL1t6 diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@select.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@select.h.blob index ff08d561b050b16850e5a56b4901d6b8fdc5b3ad..8dc32db03e09b3e0e3410f44c45da5ab9719560e 100644 GIT binary patch delta 48 zcmew+`a^VrB7bIHL1~FzG6QpRPGVj9nUh+gW2))rKo|Re7;NIkiOp=?Avl_Aj0QvF^)&Kwi diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdint-intn.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdint-intn.h.blob index 51ab57bc35bb4b825c70279c1feec542adc4d908..0e6e59de5f0fe940dc550aa3ffc96512707bd8f9 100644 GIT binary patch delta 20 ccmZ1}zEXTc8!PjwN6#lWvPf=T#LCVF09tSd$^ZZW delta 20 ccmZ1}zEXTc8!NM%!M(|iERvfSv9hxP088Kog8%>k diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdio_lim.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdio_lim.h.blob index c27d24bc86023fc6724081fd273fca2b73405c80..bbfabde44c178eb4069754b7bc61cca3868c3052 100644 GIT binary patch delta 36 ocmca4dO>u8B1>9kPU=K82))rKo|Spkqvw+!GD&Ve&dSXS0Q-&&lK=n! delta 48 zcmca0dP#JGB7bIHL1~FzG6QpRPGVjtbXsVFB42J|W}aR$19NgtVqQAK!~}5`kjO@_cvj|BkDgC%WRci>gteU+0CgY` AbN~PV delta 46 zcmX>tbXsVFB41i*Ub0>?19NgtVqQAK!~}5`kjO@_cvfaPgL{)3StK?eVQpsy0BAZ7 AI{*Lx diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_mutex.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_mutex.h.blob index 339a19bfdca76dd3912376ba19ecc31f82deadb3..cf04c35e680feb421e1567307dfeb32fde191e0f 100644 GIT binary patch delta 20 ccmdllyI*$0YF6e|kDgC{$RxS>IO`7%0A?Wxod5s; delta 20 ccmdllyI*$0YF1`BgL{)7GD&Ve&iaD`09TO+RsaA1 diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_rwlock.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_rwlock.h.blob index e7467aa8cd30d128eb875eb3073e55f3ad09e105..9aec1a8f9d8f0907e3998223885c855ac718840c 100644 GIT binary patch delta 20 ccmcbua9d$R3oG-gN6#leWRl#xfOR()0B2YUQUCw| delta 20 ccmcbua9d$R3oEmn!M({3nItzaVBO6H09eQf3jhEB diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@thread-shared-types.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@thread-shared-types.h.blob index d16ea114727534ba4c7e71deecf1cc3c61ea4daa..2276a3bb940de299ec1ed314cea3e6c76eaa3e08 100644 GIT binary patch delta 16 YcmaE@`dW2E9V_#yN6$AmvS#rD07Uo)dH?_b delta 16 XcmaE@`dW2E9V@e(!M)9mtXaGOJA?)^ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time.h.blob index 2ddde6da5c3ad731c21b6092e06032e7d533dbad..c17374491f49232184a83fea1f18c4b0fdeb0a80 100644 GIT binary patch delta 48 zcmdldeL#AGB7bIHL1~FzG6QpRPGVjgy-#|AB1>*!X5K_K2))tAk(F7_;NIkmtdg5ovWjy60O$Y=1ONa4 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 4bb5a3a70b09b22e61c71799aa712ff175ae91cf..50b0ed01782c61651dc90496307fa835d73ab1fe 100644 GIT binary patch delta 34 ocmbOr(jhWIkvT0hXQGA@h}syKz{t<8 diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@timesize.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@timesize.h.blob index e49fc27cce5ae97aa043504064ce9488bef755d8..8ade9085751b4364048b060f2661f4e2a6e67752 100644 GIT binary patch delta 34 ocmdlXyg_(^B6C`1&O{9*5VbMTj+J@Uqvw+!GD>Y;!^*<~0M@k(RR910 delta 53 zcmdlWyhC_`qEJd^VorW~X{uf_19NgtVqQAK!~}76sOUydJ62{ngL{(=S)?{EVdY@~ E0N-&C;{X5v 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 89b80016864c6670a5f962d35e2fc2b37f09d473..2a97e0c6792c103efdf1f87b945606b64d653ae7 100644 GIT binary patch delta 45 zcmez6^UG&~17BKZPO4rq19NgtVqQAK#CmZSkjTc&cvj|BkDgE5D7pCw>of%bl)(}Z delta 45 zcmez6^UG&~17B`pW}aR$19NgtVqQAK#CmZSkjTc&cvj|Lw)ZA(l-&G;b(#VIl6Dci 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 ebaf7cfc217b0a5e74ea89d691bc9e9298f628a4..5a3bb1c671367620c45326e11c1f7aace0d5dae7 100644 GIT binary patch delta 46 zcmca8a#3W0B42J|W}aR$19NgtVqQAK!~}5`kjO@_cvj|BkDgC%WRci>gteCi0C)Ki AivR!s delta 46 zcmca8a#3W0B41i*Ub0>?19NgtVqQAK!~}5`kjO@_cvj|Lw)ZACvPf(`!rIFM0Cn;Z AI{*Lx 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 1cac517059529f4d6b16c6a1708b371e62ab8c2d..be64c041277013a484d25be05c5d05482a50ce0c 100644 GIT binary patch delta 34 ocmbOwGD&2DB6C`1&O{9*5VbMTij{fQqvw+unWQ$aU@c++0LZ`#ng9R* delta 53 zcmbOvGD~EFqEJd^VorW~X{uf_19NgtVqQAK!~}76sOUydD^_MXgL{)NvPf>8&sxj^ E0NEcArT_o{ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos64_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos64_t.h.blob index dd989fd947e430513d9014ddc1d1dc0dab290697..482f05989251a2b24a2dd55769db108164f9eefd 100644 GIT binary patch delta 34 ocmdlewNh$=B6C`1&O{9*5VbMTjFoxSqvw+iS)?{EVeMrH0MV%o8~^|S delta 53 zcmZ1}wNYw=qEJd^VorW~X{uf_19NgtVqQAK!~}76sOUyd3sz=1gL{)da!78T%NoWG E00UDJcmMzZ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__locale_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__locale_t.h.blob index 31a43799353899bc5abcc3fee43e6e6dd00f22a4..fcab531b7e173d90ba408be56ce3f248381db287 100644 GIT binary patch delta 48 zcmZ22y;gdHB7bIHL1~FzG6QpRPGVj9nUh+gW2))rKo|Re7;NIkiOp=?Avp!=70O)iL0{{R3 diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__mbstate_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__mbstate_t.h.blob index e3cfe5bbbf80a14b66402d0b2817c7b206778785..65988feb6736375633cec6e8cb9c48462ae7c948 100644 GIT binary patch delta 34 ocmcaBaaCf1B6C`1&O{9*5VbMTl$Ckaqvw+wStK_vV%^OK0N+0h=>Px# delta 49 zcmcaAaaUr3qEJd^VorW~X{uf_19NgtVqQAK!~}76sOUydQ&wg9nUh+gW2))rKo|Re7;NIkiOp=?Av&ygn0Q3qBmjD0& diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clock_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clock_t.h.blob index fb33c85a8bd1d3735158f478654ce78ee4b90f00..28a3751df6f376178088ab958bac7f1204a7b1e0 100644 GIT binary patch delta 20 ccmdlZvPWb?3oG-gN6#leWRl#xfOQTF0AR`p*8l(j delta 20 ccmdlZvPWb?3oEmn!M({3nItzaV4cGP08%;!kN^Mx diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clockid_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clockid_t.h.blob index 66dea256e80b0c32070d4c0a3afe3297b4697a70..6fb9529c7eea36abd15bcf2034608f9ef8cdbc42 100644 GIT binary patch delta 20 ccmca5a!X{xYF6e|kDgC{$RxS>IO}8<0B8{jSO5S3 delta 20 ccmca5a!X{xYF1`BgL{)7GD&Ve&N`U|09kOJlB7bIHL1~FzG6QpRPGVjOk767pn B5;On+ delta 36 ocmew=@>yhpB1>9nUh+gW2))tAoRwM5;NIkmERvh&vtDBX0QS2L6aWAK diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@sigset_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@sigset_t.h.blob index 613e34b6e7c37cab1741d98c9c1a59d0d66a7e43..14f9b4f0feca2fd211aee01d747b396a4300a8a7 100644 GIT binary patch delta 44 xcmbOyxr{1prWx5MBTP delta 32 jcmZ1=I!|9nUh+gW2))rKo|Re7;NIqSte;o_vY-n- diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_FILE.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_FILE.h.blob index a03baf084650a4823cc229fc690c33805ef20cbe..be80bf813a2919cf9be61e42a92dff4d689d397a 100644 GIT binary patch delta 36 ocmaE7`pk5KB1>*!X5K_i2)!}Lgq3;Kqvw+wStK_vV)YRP00#&Sy8r+H delta 50 zcmaE6`p$HMqEJd^VorW~X{uf_19NgtVqQAK!~}5;nCM0?6INz9gL|7BSyM#;(6|v* diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_itimerspec.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_itimerspec.h.blob index 5475e8f1e0d353261b7fa88b12db6e0b1e7b723b..1c8657cfadf89e0bab802e8705b8ed42e2650f47 100644 GIT binary patch delta 20 ccmX>sc35mf6)W?qN6#lSGD~fq&bo#b09ud;2><{9 delta 20 ccmX>sc35mf6)Urx!M(|h%u<`Dv#wzU089V|!T9nUh+gW2))tAfR$O!;NIkiOp=>tu=cS50O61fH~;_u diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timeval.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timeval.h.blob index 16276767eb455b87bfc1397b2ac5a5b94d697ad1..de5ad2b15460c9fb86e3bb0b859932e00c383b68 100644 GIT binary patch delta 52 zcmaDO_D*bqB7bIHL1~FzG6QpRPGVj9nUh+gW2))tAkd;}^;NIkiOp=>tvR-8c0QFc63;+NC diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_tm.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_tm.h.blob index 45efc3aac9efadf327dd35a2e104d265f487048a..38ec2d104f0f0d66ede83931b880dfba00b73418 100644 GIT binary patch delta 49 zcmaDT{aAW}B7bIHL1~FzG6QpRPGVjB1>*!X5K_K2))tAjFnl=;NE0L7U9VPOzfNIv$}8q02l@gHvj+t diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@time_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@time_t.h.blob index 8330a3a7ef28582efd600eccbdb1383ad0cfdb17..4efdcf08901e0165f953ef2c449c01f498fd84e6 100644 GIT binary patch delta 20 ccmZ1>vO;7-D=YJ=N6#leWRl#xkhPr!0A0HXoB#j- delta 20 ccmZ1>vO;7-D=V{{!M({3nItzaWNl{w08c9iRR910 diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@timer_t.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@timer_t.h.blob index dce1c5443761974b1d86b8a78575cffb8e4cfac2..15f819959be03e4799aace56b17026544fc7b622 100644 GIT binary patch delta 20 ccmX>ra#mzR3oG-gN6#leWRl#xfORbk0Aq3q3IG5A delta 20 ccmX>ra#mzR3oEmn!M({3nItzaU|q`s094`!!vFvP diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@typesizes.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@typesizes.h.blob index 17aa1e89c3609c04fd15805a83f136b7e4cbc882..84ac1fca346ee360837cdf2ae1af1afc757b8f32 100644 GIT binary patch delta 32 kcmexj_{MO8B1>*!X5K_i2)!}LhLw5Mqvx9^vL*`y0MeWcng9R* delta 54 zcmaE3_{DI7qEJd^VorW~X{uf_19NgtVqQAK!~}5;nCM0?8&+mHgL{)3StK_vV)YUR E02qbyRA@YF6e|kDgC{$RxS>IBOj{0A-{JC;$Ke delta 20 ccmX>qbyRA@YF1`BgL{)7GD&Ve&RWL~09O4P+Fpw%)p$SlbDyzFfl=#6)d#TE1s2k)uZQ=Ke9`1KFYeA6#$FH B5v>3K delta 36 ncmZn?ZxElL$dZ(th-qO*#-9kPU=K82))rKo|Re7;NIkiOp=?Av%Y2r0Oyzt`Tzg` 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 fa685272fa1972171792453001be2fc93bfe8799..bcbe4f3367d2fda0145507cf6a1fd70a8a8bbc5c 100644 GIT binary patch delta 20 ccmdlZvPWdYN>*m2=g%iMvPf(`!dk%s09qUf8UO$Q delta 20 ccmdlZvPWdYN>=7yw)ZACvPf(`!dk%s09=#^KL7v# diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@ctype.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@ctype.h.blob index a1b995c675d04388363b9f3e3e595eb98a223a89..91092a75305b16bf8e6e1f975a222ba41386ae10 100644 GIT binary patch delta 38 qcmcaqc%^WHIcsKKL21cEYefiSV}dIy^QuSBCp$7qZa&B=Xbb>4at|W_ delta 36 ocmcaoc&TuLIZIk;Uh+g6MKHZF$(5B^&fwnUKo+UZM_2`n0SKWC>i_@% diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@endian.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@endian.h.blob index 5221da11442a302dd10b170b6585530908cbe5d9..8da2d98e4d699e3d6c68c9c424d37148d12101bd 100644 GIT binary patch delta 20 ccmew+`%QMk1Xku%kDgC{$RxRW4XYO?0BY|EC;$Ke delta 20 ccmew+`%QMk1XgA_gL{)7GD&V;!|KHe09;=O;Q#;t 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 2666fddb37164ad98803e56bc77399a27259b08d..a2c8cf881cc6f6466ed35de0cf5b2dfdc2c6414f 100644 GIT binary patch delta 20 ccmZn_ZWZ3Jl9hSYqvw+wStK?eVLiwU09c3!bpQYW delta 20 ccmZn_ZWZ3Jl9lgmn!w0D)Q% A*#H0l delta 46 zcmew$^g(EXB42J|W}aR$19NgtVqQAK!~}5`kjO@_cvj|Lw)ZACvPf(`!n%eT0Dij= Ag#Z8m 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 305f4ab90b493b77182755e1bbb12da54f6cdb43..b299ad6e50dc1d73c1c58b74cc2802a9f93ef4e6 100644 GIT binary patch delta 20 ccmca4c1di*N>*m2=g%iMvPf(`!rI3Q0A1AxVE_OC delta 20 ccmca4c1di*N>=7yw)ZACvPf(`!rI3Q0ANiBh5!Hn 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 a1526a4e7ca5be6ed9e7bd081df2f8faea2de00d..d8ef87d5de8516970f34ab151b000c0a51f9af2f 100644 GIT binary patch delta 38 rcmZo$%G9=$X@WURZenKML~BJby)hx4m09We^T~otQk(CvuId2*4W15D delta 38 rcmZo$%G9=$X@WURT4qk_L~BJby)hx4mDz;p*k@1GNox diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdlib.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdlib.h.blob index 6fd2401e780aaccca4587d5c9cc2cb5b8a0594d1..aac09a2c05981eb2a6fb76bfa1d998ec007e1a9c 100644 GIT binary patch delta 50 zcmcb1iRs2ArU{DtnRx}JC3?vW%*i>4dFc!j6U14;LL0r}S(#TodOo?4MPl<2)=7&2 D@bDAU delta 38 qcmca{iRs!UrU{BHX_+~x6V)K}MxS_AW;ug9nUh+gW2))tAnUz`2;NIj$CaKM9SSy49=0FT5 diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@cdefs.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@cdefs.h.blob index 7ff0535051c4ad94fc98a9a7a6f8d13d5d71d8aa..7787875beb26ebd40e6b58652c9d55efb549ac01 100644 GIT binary patch delta 50 zcmZ3JxF&IeB42J|W}aR$19NgtVqQAK!~}5`kjO?aM^@%lkDgCvWE7d)z{t9JIV-C+ E0KgXz(EtDd delta 50 zcmZ3JxF&IeB41i&PO4rq19NgtVqQAK!~}5`kjO?aM^@$lvwM>n8AT>HFtTo5&dRC{ E0IsVKxBvhE diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@select.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@select.h.blob index 31ab7cde9344b0dbe1772ebff6ef5755b0007731..6a58d20d53fe289711b6e7b024e6057e69123a34 100644 GIT binary patch delta 38 qcmdm@zfFIF4QpmzL21cE2So^DV`@Ar^QuSBCo3{bZhpXeMGycZ91ku4 delta 40 tcmdm{zeRt74NF>SUh+goMKHZFJ)V_W&fwnUgDjGh&v0^Ye#?4N5CAV&4)y>5 diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@types.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@types.h.blob index 765017fb834c856564260360c13ee1f8439d030e..1419156500536f5053e215954925598eb4c2c985 100644 GIT binary patch delta 20 ccmZ2!ztVogYF6e|kDgC{$RxS>IO`)x0B4E`umAu6 delta 20 ccmZ2!ztVogYF1`BgL{)7GD&Ve&iY6a09g76X#fBK diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@time.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@time.h.blob index 76de664a8b1276445f016e5f2f2ac05ac0da5029..ac19188d18798f37b713cc317cb853742293e89b 100644 GIT binary patch delta 48 zcmeAxnNTu8kv}u9ptM9UnSnVuCowObVPb+fD_CfwS3E28sz=W!H?l}6%gVg!(eud%StU2mWPQT|09W(~kN^Mx delta 20 ccmZn_Z57>6%gQWgaBuQKR>{pXS>Lb#07+yANdN!< diff --git a/.ccls-cache/@home@huck@.repos@odot/dialogue.c b/.ccls-cache/@home@huck@.repos@odot/dialogue.c index bf125b9..7e7fdc6 100644 --- a/.ccls-cache/@home@huck@.repos@odot/dialogue.c +++ b/.ccls-cache/@home@huck@.repos@odot/dialogue.c @@ -1,23 +1,3 @@ #include "odot.h" -void error(int err){ - switch (err) { - case '1': - fprintf(stderr,"ERROR: COULD NOT ACCESS FILE: %s\n", TODOLIST); - case '2': - fprintf(stderr,"ERROR: COULD NOT GET CURRENT TIME\n"); - case '3': - fprintf(stderr,"ERROR: ARGUMENT OUT OF RANGE\n"); - } - exit(err); -} - -void dialogue(char *m1, char *m2, int c){ - printf("\033[1;3%im%s\033[0m: %s\n", c, m1, m2); - return; -} - -void formattask(struct task t){ - printf("* %s\t%s\t%i", t.task, t.group, t.date); -} diff --git a/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob b/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob index 7dffb28a7d0da606bf51954586c01a1e656e9e67..81e389a46c30fa3964de68f9216df11c216882bc 100644 GIT binary patch delta 35 rcmX>kGeMYBi{W3}p6ACH7&pqVU}X;3{d{sEi`3>Ptoxan85kG<`fd!I delta 1253 zcmY*YU2F_d7`^w-PP;ohX3LCrtZFAzO`F<R;yYa^w0)}Wn0Vrn(QRA+Job713*SSUCrR(0wZqy@qkkEfG%1_d=v4-3}%w6u)r$ouZqzb_xZ=#JjS?zQs8 z5hUvp)N#Qb+I9wpX+s5|O`%|rIfRu?N9md(0j#W7y6#M|+~G)11khecTS0`Nb%BD!Y}slrqaUkwMt6~-y7*;cyBTe$jMk16I8+YNgZhbJgFuP zTn`a+p-#r(8DX8h>iBu}+nT|q9i?QsX<|Pd2%=H`ZKffN0-`A{mGSwy^UVoVX;!jx z$PBTSejoXAc-w+Y&&xw_z)taqc$WRImyNG?(F-@8`t1Z$nVUZA1( diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c b/.ccls-cache/@home@huck@.repos@odot/file.c index 0d9dc1f..2d5b277 100644 --- a/.ccls-cache/@home@huck@.repos@odot/file.c +++ b/.ccls-cache/@home@huck@.repos@odot/file.c @@ -1,67 +1,93 @@ #include "odot.h" - -extern FILE *fp; - -enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; - void add(struct task t, FILE *fp){ + printf("\nalloc\n"); char *c = malloc(strlen(t.task)*sizeof(char)); - FILE *fc = fopen("/tmp/odot", "w"); + printf("\nfopen\n"); + FILE *buf = fopen("odot.tmp", "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); - break; + printf("Remove from list?"); + if (check() == 0){ + break; + } else { + puttask(gettask(fp), buf); + break; + } case 1: dialogue("Already on list in a different group", gettask(fp).group, YELLOW); - /* confirm(); */ + 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,fc); + puttask(t,buf); ++i; } + puttask(gettask(fp), buf); + break; } - puttask(gettask(fp), fc); } free(c); fclose(fp); - fclose(fc); - remove(TODOLIST); - rename("/tmp/odot", TODOLIST); + fclose(buf); + remove("/home/huck/.local/state/odot/todo"); + rename("odot.tmp", "/home/huck/.local/state/odot/todo"); return; } -void rem(FILE *fp){ +void rem(struct task t, FILE *fp){ char *s = malloc(MAXLINE * sizeof(char)); - FILE *fc = fopen("/tmp/odot", "w"); + FILE *buf = fopen("odot.tmp", "w"); + int i = 0; while (fgets(s, MAXLINE, fp) != NULL){ s[strlen(s) - 1] = 0; - if (strcmp(note, s) != 0){ - fputs(strcat(s,"\n"),fc); + if (strcmp(t.task, s) != 0){ + fputs(strcat(s,"\n"),buf); + } else { + i++; } } fclose(fp); - fclose(fc); + fclose(buf); + + remove ("/home/huck/.local/state/odot/todo"); + rename("odot.tmp", "/home/huck/.local/state/odot/todo"); - remove (TODOLIST); - rename("/tmp/odot", TODOLIST); + if (i == 0){ + dialogue("Task not found", t.task, YELLOW); + printf("Add to list?"); + if(check() == 0){ + add(t,fp); + } + } free(s); } -void show(FILE *fp){ +void show(char *group, FILE *fp){ char *c = malloc(sizeof(char)); - while (fgets(c, 1, fp) != NULL ) - formattask(gettask(fp)); + while (fgets(c, 1, fp) != NULL ){ + if (strcmp(group, "all") == 0 || strcmp(gettask(fp).group, group) == 0){ + formattask(gettask(fp)); + } + } free(c); } diff --git a/.ccls-cache/@home@huck@.repos@odot/file.c.blob b/.ccls-cache/@home@huck@.repos@odot/file.c.blob index e7c1ccb1550e08b2eeaa2f88d1e76dae42ec0122..6379548e81af1a96113d3e1c900b96ed4a7a847c 100644 GIT binary patch literal 7061 zcma)A4Qw0b8NNGT9XGx-Au^t8l5sIja9sa{#`Rn$>6(zXPEwlARh*IvT<3gFOl_a* zJ2!;Ut}1k6+7GOn%CsRiSU1?D{h%=fng&~`s%gO3kH%;PhzUkFm|%#FF-CiP-_Jhh zF0q{<;qUt0_r1T*`@HYPLtQ@o;l*0fVnOuJQIjXWn- zgT|7eBr+I>qFfM#`cjjMl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889js;IirVT z=NeWQ=I)+9mCJW_4FYw7zJSVNs5=+$#onQvlSvVtvkRyH{gd;ze0FNMryG8n!GQA` zboTQR-5D%6qwkMhKYZl(&A0bY?A|e>g!WApb^(19o^Uq!BTfFMD5Si-J#?_~@U}O* z#yW=prf4B%0%Pvs3wlhj5R+(bcYSfJC!fD|6g*ncBf}5q9$@uTiF8K#IW(>$`ckw0 z@5TikL1-LILS^F&(Oh(cNLu7#OC2O#dO_GeikmkTawVhLGvCM=RA z!VbQB%?oEbUo)fR%`{2dO+;)J6DDG7wI!h0H&*X75qU`7Xd=#}6Gx#mx0Nj<0Z%}0 zMiEBUTkfYmN#XV|s3|VTF|%KV7Uqxt@w&HrhkJUEPeES*U2&u<#<%Nqfn93SC)b^O z-!W$!&*evYkbbn_-HP5r{AS%7?2`ATdyAjH5dBwnmb4{{u5hPhE0W{IZm~}!wxlgB z66u)qO%Q*~4P)CNH(?ewHW6%epZhIcBz<8r$0V) gec(F_;9CBe8s$cRmUv^{EL`ZWHWgkQVhLFP2iDX2$N&HU diff --git a/.ccls-cache/@home@huck@.repos@odot/func.c b/.ccls-cache/@home@huck@.repos@odot/func.c index 1991b9e..73d6a23 100644 --- a/.ccls-cache/@home@huck@.repos@odot/func.c +++ b/.ccls-cache/@home@huck@.repos@odot/func.c @@ -1,32 +1,2 @@ #include "odot.h" -enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; - - /* Returns: - 0 - Nothing matches - 1 - Task matches - 2 - Group matches - 3 - Both match - */ -int listcheck(struct task t, FILE *fp){ - int i; - i += (strcmp(t.task,gettask(fp).task) == 0) ? 1 : 0; - i += (strcmp(t.group,gettask(fp).group) == 0) ? 2 : 0; - return i; -} - - -char *gettime(void){ - return NULL; -} - -int linecount(FILE *fp){ - int i = 0; - char c; - while ((c = fgetc(fp)) != EOF){ - if (c == '\n') - i++; - } - fseek(fp,0,SEEK_SET); - return i; -} diff --git a/.ccls-cache/@home@huck@.repos@odot/func.c.blob b/.ccls-cache/@home@huck@.repos@odot/func.c.blob index 4100071c98b31a5fcf860c386945402367f7e50a..806d62e2a6016aa10ee771174bfc9f922dc6173f 100644 GIT binary patch delta 39 vcmbQP)FI5J#qh6f&+}spj0_VK#5XE-uri12em=R8MPl<2)`QH<3=9kaAPo&l literal 4375 zcmai0Z*1J;8Mob2IXS+gN}|hM+N5q^T^jD6bm_QG(8SLVl3$+0EfRE<(rlT@-$)Oz#G_v!sloT)jP z)`=tGsUyj9VcH=I(PR>6n$r|gvNb30kow6PmO{*oY848W8E!`Og68Ol>HwNvAeu9$ z6zlk)kX6G{XG7ptWd>G?5tf!iY@oDGR%Ld!@0=J52jq~fZjucAtCu-N4G~K!k#*$3 zc8Z!B?o}aHL09EDJ*&y8RWgZYhZ}2VR#!|@bLu4nF~dE0srvXxA<)p{EAXg_a++J? z%E)pKI$?02v84~{rXm>nv_yMH+BneL*E?9zJQPH+XAtLW7iMck?<_cyn$>dkc*@(F zlFc}I#n!SJ%1e04J~n#}O%PuxS-P%KDY9Mq-X23`fcZBoBk_|n$Da*4tgJ=c^ z>bPkT#v9>*_Yq}-M(`9)r?Q?6;mf0?0n9l?Cpkl@Hw@4`1J^P?>AkcM6~&Es{q*s%B1d>%1g(xv!NePDw04HGiFJ0 zNNL*1)Kf=wI|sUf0MKrMN0kVHr_0UI;8?n8!q*Vx0mx99mOX|3w(@(Mxy8L(I&_C~ zcCt;IhcBopf^@{3qiM6<7)|Vf{v$h)V-McQHK7NI7c^Q2gx~b96wC{HV6OA^riD;soV-w6;4lb^65B*^GpN>WU zaMC>>JoEdr``NKaT=4M9C1RQuo>^h`eR$Dk2~JJ^}qL@ICZ271h`WR#ctIy z9U^+^q{Zt0AtLGyQbFgO&?<=3Yio?I?w1!g?Yf%S_PJL9hp2f?o$ao|nHIe=d*$Gx zJn+Law{py04Svy@&JZv5i5YRyB6;{JC>9iS;qc-{*qp*VD?9zLGj3a@;_}ue*cyeK z-VPS{&2|5od}-jD&)n4cSN~}r9ysd$=-Sge7O$QAID**SG7GexK#^Of7B^y$RgDFb zS7YH7bmei6>E$O|(Gjz>yz9Mj6$lm8G42zYD{qhM?_ayo81!YWKKk&He~f>L105!# z=#we$+$~co@xk=Ks4Bk4D(Un#Ao9)_we=j+1{Jd2eM^g~Uf6 zW8(3$JEjfXKsr8;EZ@WT!@XDk_P+=39De5>%`6o_B8Fw-HJ*pQWI3K|2;b)N6#h0)B`GbSsF76%M24^c_0el-Vr}bR=Iv1hqQUWt_pSqg<<=^MuJ^#Rt zol|45!P6J8zYFc>xnEIxSbh7oE3=We4h%mGrj#$20bQayK{){_rEAfp(y2ay?P%@5 z>P606y6~^x{$=c;v5AS@4*)*Fdjo`<5aDKy=7_70@NCcd6EFOG&xP^5V`G>QPhY^k zAMN|NA(|1azWo<_&VAat6x%mCaUT{UiYr(Tp!FnoKedL{x8Az(eBt`&50CzIWPEIL zY6LFC{a3hiC*Ik|<>?(*%bfZ0uWl20k*z<$r05HTMEP?`u8W3*)el*oQS`%GtsL6 diff --git a/.ccls-cache/@home@huck@.repos@odot/input.c b/.ccls-cache/@home@huck@.repos@odot/input.c index 0cc316a..0cb2c50 100644 --- a/.ccls-cache/@home@huck@.repos@odot/input.c +++ b/.ccls-cache/@home@huck@.repos@odot/input.c @@ -1,17 +1,27 @@ #include "odot.h" -extern char *note, *group; -extern int urgency; - -char *getnote(int n, char *arg[]){ +struct task getnote(int n, char *arg[], char *group){ char *s = malloc(MAXLINE * sizeof(char)); + struct task tmp; + + if (n == 1) + printf("\nreturn from note\n"); + return tmp; + -/* adds word to note if it doesn't start with - */ - while(--n > 0 && (*++arg)[0] != '-'){ + while(n-- > 0){ + printf("\n%i-nloop\n",n); + if (*arg[0] != '-'){ strcat(s, *arg); strcat(s, (n > 1) ? " " : ""); + } else if (strcmp(*arg,"-g") == 0){ + strcpy(group, *arg); + } } - return s; + strcpy(tmp.task, s); + strcpy(tmp.group, group); + free(s); + return tmp; } /* uses a 3 bit number to represent options @@ -20,23 +30,23 @@ char *getnote(int n, char *arg[]){ 4 - remove from list */ short getopt(int n, char *arg[]){ - char *c; short options; - + + printf("\nreturn1\n"); /* show list if no arguments given */ if (n == 1) return 1; + printf("\ncheckopt\n"); while (--n > 0 && (*++arg)[0] == '-'){ /* if theres a d delete, otherwise add */ - options += strchr(*arg, 'd') ? 4 : 2; options += strchr(*arg, 's') ? 1 : 0; - /* if theres a g then add the next argument as a group */ - if (strchr(*arg,'g') != NULL){ - strcpy(group,*++arg); - } + options += strchr(*arg, 'n') ? 2 : 0; + options += strchr(*arg, 'd') ? 4 : 0; } - + printf("%i", options); + if ((options - 5) > 0) + error(2); return options; } diff --git a/.ccls-cache/@home@huck@.repos@odot/input.c.blob b/.ccls-cache/@home@huck@.repos@odot/input.c.blob index 3ae02cf4b95f0e223a8d1351de4984bcf3098b00..19f6e3c21f194716c55d991d8723341c97f3f018 100644 GIT binary patch delta 2352 zcmZuzZ)_7~7{B+u+ji@2?QOKjIm&vDrn~-G+3H%mbyvd*p} zEQ*Z?i7{$`lcyxu(CuwBUYOA{$l~o08 zmnED_T9P70NopmgC<^OS2Y!6*$ZVIQhrL_w-uvL`NknGqC(bVT<;>g?j-GdSaR_Eo z`kS7Ed$%U~DyOrVnUSoN9iDz%+BBA(OlQaBiOFn08W|tXNWQ_L!pKXBq7`8gdoaS3 zNcJn!a|08{j_bP;qxv6nq+m+!;If_97Cnvvzw)z`;670|G1X`YYQ$+x^$R z{&x%@dD;r-$F^q2GLw>as@k6;RX|c?0>AkYXq2WhU{mr)dU85@lhS|`3wMJTWfB&Hq%xK?Qq_B!z-|;No z^U(Ek>$FtW%H=d+nCwc3C7$qUplG5)b58ZQ^TwuQnM^uEy30#hESBQUoB8HCZGClj z6_J-L1W`4P3s$-~7xcG_3TgLq8*{YY|AKYf`Ni2zean|EYohY_Q+g&kbSd>glT<+% zGbJFB5$Z|;K94V?e;QtVG53$Mgv{`J{H1|_Cr}z7w3|7M-XT!+LRq&uL;JkyK9Oud z(38BxlXS#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pmt8;AtbHBw1 z9ND2ScaB`R|h>pT98v ztlqY3XWJ;Zih{cJk{dB=f03YheLPhZ}4ZP>Dyq!4gZ z4sMx1aj$BqTE^6x%Eq$IG|tI6mB!ki?&!Uis)AKt>83>($tCeLPVk8a8fRTu_$~7? z{LaO4&DyBjTQ(IzW5jrqKNkIoQpbVo)5p*1Rl=sUh_7BTP%3WeE{UbJ1CNR&BnU7f zoJ;326BOLy%VqQ(SL#o`HTQybf&>4lt!f*M)y3)(h!3l)F|D2PMDMbs+$o<2D=U;W z99Ea9om%6xh`Y(%B*5V&rMMfbYt;4HGoEPKl5{7@X}hu*QdPBs!&Tl>ux#!JG*&<( zi!!`InUy0|EKa~eD~bX$RF){qA+A$4(72Uv^+P*z=nEDtnJ>oI_k#y$=#$N4<%u%T z0tsZjFylbi;5Q3z5L#H_6(1BH5e|=h-L!p?;U3~9C}qh|osdNNs367^qJpUE93yjW zv2Rruq!P4D3)4zw$HW;Gk>->wZIk`jp0sD+3f8omcD%NwZ1q@q3R_ugCnA(A_J}>k zVMoLP(aAdnC@@7do`(qT7Pl1pdh^}e5YM{++L#kzY~d|oh{zH~RkcZK9wi^qPOLckig z%0R%}e0R$0&3KgxjhNS%2UDM^SNu585@_YH*djs<#)3%>hvZNj@G{r)|9QKNa6(Lg zxf5*SHghN0q>IK)Y!k#3n}Rr#pGo+ddw()fjsv1tS|)W?q-vKs4d;`?Q= 4){ + printf("\nrem\n"); + rem(note, fp); + } else { + printf("\nadd\n"); + add(note, fp); + } + if (opt % 2 != 0){ + printf("\nshow\n"); + show(group, fp); + } + + free(group); + fclose(fp); 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"); + break; + case 2: + fprintf(stderr,"ERROR: CANT ADD AND REMOVE SAME TASK\n"); + break; + } + exit(err); +} + +void dialogue(char *m1, char *m2, int c){ + printf("\033[1;3%im%s\033[0m: %s\n", c, m1, m2); + return; +} + +void formattask(struct task t){ + printf("* %s\t%s\t%i", t.task, t.group, t.date); +} + + /* Returns: + 0 - Nothing matches + 1 - Task matches + 2 - Group matches + 3 - Both match + */ +int listcheck(struct task t, FILE *fp){ + int i; + i += (strcmp(t.task,gettask(fp).task) == 0) ? 1 : 0; + i += (strcmp(t.group,gettask(fp).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):"); + if (((char) getchar()) == 'n') + return 1; + return 0; +} diff --git a/.ccls-cache/@home@huck@.repos@odot/main.c.blob b/.ccls-cache/@home@huck@.repos@odot/main.c.blob index eaa9588029e6420eb3fb1e2003579e452cfbe936..e10b157d58ad8b30026c94752ab9f0ab52e18939 100644 GIT binary patch literal 6168 zcma)Ae{37|6~FJ7IsFHkOT^*^+28#_D^*~7k z8!q;L<+f9nH`6&)3E^8Mlu8w*6*aAjDYYi)jF?u-vZ&O2N#)GsrLw{$ETl^fWKfecc_}kr$6S+VK$Xtdb4yWW2x$YajOdI{Y)RHP2-93t z1Mshr=hSM@Sk9=a9L7ObN@AwI)U+xUa+%aZE-R)oQn{##a(!a4n9Ze&MNw(w4Ct&c zL3g!cpIWF%sK=}3D^tj+Z%bz;m6`!03`LiwtQd7!67sp}5XDYtAQ}t@hs?N3%d=?b z&(F?Vi(WaPgfdxircs>cWHFr$D0699%m!#&>bqRAO)0k!)tHen?3oqNk#B<8^8W))GbV>WtZvBzlqCIP9G(nti> zqax;^rPmik$4Dxls|`w{HwVy~p=bj!OQ_LXcujt^atR>l6;8WyE?XyFdRUe)b0M8m zXY%PrZMlrCHUN#WsOHoIH7%y9P!x`}a_w@5xMl(+0J&Z%mkr2t9;Zir@fFY&%Br}( zK2?pftyv}wCzbAwBxmamPh;1(e9q4n%dm-*rM+B(rZb=b;8ychRYT3Um%y;Z z>(FH#-V!L?fB-F1LlP`p4YAF*wTE3lJimfW@DpB^Ofc88Iw!$P^W5|u+41s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5E~(Qf_g>L>2sc)Hn){I4ElR;(~oG3~%%yVSvrkzSo%HoM#2VJE}E;UUoI zj}O|($;BG&mu7+ijOwVa4n1b2*4do3KYsJNy=Hzg>7MKWEF06(Y^e(S7vPP=qw%3n zSx~&>9lwUH;a>*{!36 zbn|4jb2XgRg|1c-hKGl#sl&qXh$RWO*idZPPGaM+&2a9D-2{P}{OG~+8|M3VS~@d) z4xkg2DYcv-jLq-!M|pC%p7i_?chnWCmDuwGPwgxH8vETvBJVTOn(aN zU`N6)OWzF}cWs%NO8W7ePJ)pKt5RPd*w^A}fxWneYuUq4``XsGZRSa*x3ilkU9DZK zz&>M{)#VljASrg>jQAq`n9InjNIxwA65SQu1N6oQRT*lf3VpMy*~1dRzo*(%P-C-$ zbMP*5Me7xi#`f-ZA5Xm9UN}2_o&7vn<6h$hnOA)2+mD_3L;gJr{#piGMgf0a-n=$? z*XpwQ9gFFK)((jQ3ZwfhvM4?tpF|I!8%P(V&&t6nz{JSPz`?}8 zz`*ohhOJA#Wjf!2|1nm!MZHBAN*H(;ff5Xi+dw2TVESKO;xXsFhkhSQXvk8DwSeV J0xMNw002UOSbqQj diff --git a/.ccls-cache/@home@huck@.repos@odot/odot.h b/.ccls-cache/@home@huck@.repos@odot/odot.h index b881802..78c3548 100644 --- a/.ccls-cache/@home@huck@.repos@odot/odot.h +++ b/.ccls-cache/@home@huck@.repos@odot/odot.h @@ -3,10 +3,10 @@ #include #include #include +#define TODOLIST "/home/huck/.local/state/odot/todo" #define MAXLINE 1000 #define TIME "%H:%M %m-%d-%y" -#define TODOLIST "/home/huck/.local/state/odot/todo" struct task { char *task; @@ -14,12 +14,12 @@ struct task { char *group; }; -char *getnote(int, char *[]); +struct task getnote(int, char *[], char *); short getopt(int, char *[]); void add(struct task, FILE *); -void rem(FILE *); -void show(FILE *); +void rem(struct task, FILE *); +void show(char *group, FILE *); int listcheck(struct task, FILE *); int geturgency(int); @@ -28,13 +28,10 @@ char *gettime(void); void dialogue(char *, char *, int); void formattask(struct task t); void error(int); - -int linecount(FILE *); +int check(void); struct task maketask(char *, char *); void puttask(struct task n, FILE*); struct task gettask(FILE *); -char *note, *o; -FILE *fp; - +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 54cbfa50ccc19c4afc0f3e61052966ed92d4e893..ee6868639ad80439d6bc0711f4fa7c5697a9d206 100644 GIT binary patch delta 1126 zcmZ9LTWkzb7{|}qY}c6Xj%mBo4%Rxe2Ghx^YPXBkO1HJzvg%gq5~^vJm1>vm7Kuwm zM0k*h6G9XZJa}cUx z>Br0>xw-4k;ZN%APg@fkn@KX(O8cD?s3eWVA-YCtui9fSY6zAG75=(Cp4evmZm}Vm z=-BKhb8DgzV&)@J6j&2%#lK#AcJIveQ{1~ED%lt-NGYYKU1cIsiGeXeq?)QyHSKa< z>%3gvA@nNhG5)zn^msA$AWtc5_0W-#<9GDkx&+&TUB#MOjC>>rBHs%C+ADaWxEFc7 z2xV9oZ+=-(QucUOtgWM!G$l4Al4Qp&umu3tMcr+~I@0%XTEtAOJyX6uq^?m*b>ztL z=LGE7?RP^|3Y4H7=LPd-+p#u7E4O2x;VYykMr|1~Yo!lJkR>_Sj&n$k0XT6(%ro|BTTlgrFn zmD74!2U{v8cP$84MQZE9uqORU0WM+iDm~6&&|&a_@BYpg+n@B*SJ%`U`kNclXft*hE(-oqatgzx% zOf=}E2eSe$K^9aSh8SW62jpOJ_xK5^>-+DYt%!yz=QD3S0dIxOo2vV`H_*S{=u^3b zCgtMNcjtaw=-oPSc1Z+A135r|o5r|Fx}S5Pe>v_qecxyxdunI@;_lb(>#kK5(Piwv z2uz_wfR(7#m-7;!!%93gd+winyST4vNhHFKP~-`4MT{%dL!1L0#-%UK(CjwA@V3Ex z+JMuFv;gC@F+^U= I(EmIB0>8&FPXGV_ delta 703 zcmYLHO=uHQ5T03H-BbHx5;MLjoT0#32ALh6$7<4L@#<#Y7U`|O{ivTvTZJ+ zCqY3x_$UZg4;4y2`Es$QCKgL})v`-wrD`YDZfdSD41(Z+&Jh4m z5~MJq1kyNZ2%}`nJ(|Cyd~V&F`rd-}yXMklL=CiQN}t=9yT3hi_0g(TSy1a`t6|RM z&Yx8i!{Bo9hnzuI(1#d=phi-j*P#pBdmE>I9Zz-m6qgb~R6v;`Sz&@~ij$F;95WGP z5SyhfhK&4&EBzwZX;CZPFv&Y1f-3nc&XRA!^0-r2%0JoJ?Wda5>y>J0-dd^J2V?NO z?{JJLAEnZw5KREEq&RSS0-ZM_I}?M=SI>EW(w|{5;0uIV377dS_3y1dODn*L7ZRpn-rJ`rCC%)lra`#p4brzH#G{>JvzO+4|;aJ zy0%Ogz*1-9LR@0n?2=;*t{3j^ock#vY5GnY+wzOGkEvU^?#kLLq!8*a8iEmE&;TO< zBH8qflB_RHro4HPmw1&y8q44y+4E-Z^htd(gEUUk4E4nM{qWh3-Nv8)|G=V*Oq(%m zC>=%x#7YOTg)Q(}R(V T{$u2^Hz9En7h#Y_vpdH>mHe=U diff --git a/.ccls-cache/@home@huck@.repos@odot/test.c b/.ccls-cache/@home@huck@.repos@odot/test.c new file mode 100644 index 0000000..f1e123c --- /dev/null +++ b/.ccls-cache/@home@huck@.repos@odot/test.c @@ -0,0 +1,9 @@ +#include + +int main(int argc, char *argv[]){ + FILE *fp = fopen("/home/huck/.local/state/odot/todo", "w+"); + + fclose(fp); + return 0; +} + diff --git a/.ccls-cache/@home@huck@.repos@odot/test.c.blob b/.ccls-cache/@home@huck@.repos@odot/test.c.blob new file mode 100644 index 0000000000000000000000000000000000000000..a89433e1928be5dc8dcdaa1bafb7528254fdd6fb GIT binary patch literal 1670 zcmah}L2J}N7@bMF7-hvGWziKSE+V^Yvr|i{AXL0)sfZpuNQv3W>~3t5SuzuAJ(N=P zqz5k^3SRsL_S8Qh^e$?_i#HW|5%i?k#+hUj7IqW&usfT1dEfiq`(~QpaC86rE`R{_ zs7FvQ#4D&3kUnLI+LR+s7;j;qV%PG!{{b1RG+1%`u3nW@wGl-$TYn+;}$0-m(b~l8)Kjy zms;F6F!em@kA-!J#lwKGv71Rb$0N*nLh=zputQDP@y0^Z3I-QM^K)Y{aiK(P{(jo` z&86En3Q+k~gidVq12S-T#4@(V5Eh$7X2jkz9)y^iBSMNIwSuk`T^wmgjNbfQQKDkX z?BX<1nq7Wa}xNv<8!@(UCKyZ((6sr6zLPo zYk*3n4B}7x14~+I>fpk47``O*KyAZ^yaia{I3D3)nmhS z>N&L@)3Ki)7Ovd-<4Gl+<@j~E5YvPOK};mpkM1uwfTn3s(UeIAD&UABxYTH`adh3= za?eL+Uu?at%r>{96A!i=`tg;oO8!i$Dk_aUkPT&aNJJS*foim2{CKzM?EOyU4u41V z%7c-R5f*S0`3e`%Qegz5-QS8 z2LARzxjd1s^#wgKyf%CXyA)fl7)Wtx4(@kx%h#s$+UliRL$Iq;>M2FmUeEeCF0zHC wN~v0gnTNx!i=v_zsLU!?50nY0TvV=s133?w(ljj@k3?3LT8uoY)OKRzKXVdBlK=n! literal 0 HcmV?d00001 diff --git a/Makefile b/Makefile index 722a5a5..6ced421 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ SHELL = /bin/zsh -PROG = todo +PROG = odot PREFIX ?= /usr/local/bin -TODOLIST = $(HOME)/.local/share/odot/todo +ODOT = /home/huck/.local/share/odot +TODOLIST = $(ODOT)/todo -install : main.c input.c file.c dialogue.c func.c +install : main.c input.c file.c + [[ ! -d $(TODOLIST) ]] && mkdir -p $(ODOT) gcc *.c -o '$(PREFIX)/$(PROG)' - [[ ! -d $(TODOLIST) ]] && mkdir -p $(TODOLIST) -header : todo.h +header : odot.h gcc *.h clean : diff --git a/dialogue.c b/dialogue.c index bf125b9..7e7fdc6 100644 --- a/dialogue.c +++ b/dialogue.c @@ -1,23 +1,3 @@ #include "odot.h" -void error(int err){ - switch (err) { - case '1': - fprintf(stderr,"ERROR: COULD NOT ACCESS FILE: %s\n", TODOLIST); - case '2': - fprintf(stderr,"ERROR: COULD NOT GET CURRENT TIME\n"); - case '3': - fprintf(stderr,"ERROR: ARGUMENT OUT OF RANGE\n"); - } - exit(err); -} - -void dialogue(char *m1, char *m2, int c){ - printf("\033[1;3%im%s\033[0m: %s\n", c, m1, m2); - return; -} - -void formattask(struct task t){ - printf("* %s\t%s\t%i", t.task, t.group, t.date); -} diff --git a/file.c b/file.c index 0d9dc1f..2d5b277 100644 --- a/file.c +++ b/file.c @@ -1,67 +1,93 @@ #include "odot.h" - -extern FILE *fp; - -enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; - void add(struct task t, FILE *fp){ + printf("\nalloc\n"); char *c = malloc(strlen(t.task)*sizeof(char)); - FILE *fc = fopen("/tmp/odot", "w"); + printf("\nfopen\n"); + FILE *buf = fopen("odot.tmp", "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); - break; + printf("Remove from list?"); + if (check() == 0){ + break; + } else { + puttask(gettask(fp), buf); + break; + } case 1: dialogue("Already on list in a different group", gettask(fp).group, YELLOW); - /* confirm(); */ + 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,fc); + puttask(t,buf); ++i; } + puttask(gettask(fp), buf); + break; } - puttask(gettask(fp), fc); } free(c); fclose(fp); - fclose(fc); - remove(TODOLIST); - rename("/tmp/odot", TODOLIST); + fclose(buf); + remove("/home/huck/.local/state/odot/todo"); + rename("odot.tmp", "/home/huck/.local/state/odot/todo"); return; } -void rem(FILE *fp){ +void rem(struct task t, FILE *fp){ char *s = malloc(MAXLINE * sizeof(char)); - FILE *fc = fopen("/tmp/odot", "w"); + FILE *buf = fopen("odot.tmp", "w"); + int i = 0; while (fgets(s, MAXLINE, fp) != NULL){ s[strlen(s) - 1] = 0; - if (strcmp(note, s) != 0){ - fputs(strcat(s,"\n"),fc); + if (strcmp(t.task, s) != 0){ + fputs(strcat(s,"\n"),buf); + } else { + i++; } } fclose(fp); - fclose(fc); + fclose(buf); + + remove ("/home/huck/.local/state/odot/todo"); + rename("odot.tmp", "/home/huck/.local/state/odot/todo"); - remove (TODOLIST); - rename("/tmp/odot", TODOLIST); + if (i == 0){ + dialogue("Task not found", t.task, YELLOW); + printf("Add to list?"); + if(check() == 0){ + add(t,fp); + } + } free(s); } -void show(FILE *fp){ +void show(char *group, FILE *fp){ char *c = malloc(sizeof(char)); - while (fgets(c, 1, fp) != NULL ) - formattask(gettask(fp)); + while (fgets(c, 1, fp) != NULL ){ + if (strcmp(group, "all") == 0 || strcmp(gettask(fp).group, group) == 0){ + formattask(gettask(fp)); + } + } free(c); } diff --git a/func.c b/func.c deleted file mode 100644 index 1991b9e..0000000 --- a/func.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "odot.h" - -enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; - - /* Returns: - 0 - Nothing matches - 1 - Task matches - 2 - Group matches - 3 - Both match - */ -int listcheck(struct task t, FILE *fp){ - int i; - i += (strcmp(t.task,gettask(fp).task) == 0) ? 1 : 0; - i += (strcmp(t.group,gettask(fp).group) == 0) ? 2 : 0; - return i; -} - - -char *gettime(void){ - return NULL; -} - -int linecount(FILE *fp){ - int i = 0; - char c; - while ((c = fgetc(fp)) != EOF){ - if (c == '\n') - i++; - } - fseek(fp,0,SEEK_SET); - return i; -} diff --git a/input.c b/input.c index 0cc316a..0cb2c50 100644 --- a/input.c +++ b/input.c @@ -1,17 +1,27 @@ #include "odot.h" -extern char *note, *group; -extern int urgency; - -char *getnote(int n, char *arg[]){ +struct task getnote(int n, char *arg[], char *group){ char *s = malloc(MAXLINE * sizeof(char)); + struct task tmp; + + if (n == 1) + printf("\nreturn from note\n"); + return tmp; + -/* adds word to note if it doesn't start with - */ - while(--n > 0 && (*++arg)[0] != '-'){ + while(n-- > 0){ + printf("\n%i-nloop\n",n); + if (*arg[0] != '-'){ strcat(s, *arg); strcat(s, (n > 1) ? " " : ""); + } else if (strcmp(*arg,"-g") == 0){ + strcpy(group, *arg); + } } - return s; + strcpy(tmp.task, s); + strcpy(tmp.group, group); + free(s); + return tmp; } /* uses a 3 bit number to represent options @@ -20,23 +30,23 @@ char *getnote(int n, char *arg[]){ 4 - remove from list */ short getopt(int n, char *arg[]){ - char *c; short options; - + + printf("\nreturn1\n"); /* show list if no arguments given */ if (n == 1) return 1; + printf("\ncheckopt\n"); while (--n > 0 && (*++arg)[0] == '-'){ /* if theres a d delete, otherwise add */ - options += strchr(*arg, 'd') ? 4 : 2; options += strchr(*arg, 's') ? 1 : 0; - /* if theres a g then add the next argument as a group */ - if (strchr(*arg,'g') != NULL){ - strcpy(group,*++arg); - } + options += strchr(*arg, 'n') ? 2 : 0; + options += strchr(*arg, 'd') ? 4 : 0; } - + printf("%i", options); + if ((options - 5) > 0) + error(2); return options; } diff --git a/main.c b/main.c index a1134e2..9b86cd1 100644 --- a/main.c +++ b/main.c @@ -1,10 +1,84 @@ #include "odot.h" -extern char *note, *o; -extern int urgency; - int main(int argc, char *argv[]){ + printf("\nstart\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+"); + if (!fp){ + error(1); + } + + printf("\ngetopt\n"); + opt = getopt(argc, argv); + + printf("\ngetnote\n"); + note = getnote(argc, argv, group); + + if (opt >= 4){ + printf("\nrem\n"); + rem(note, fp); + } else { + printf("\nadd\n"); + add(note, fp); + } + if (opt % 2 != 0){ + printf("\nshow\n"); + show(group, fp); + } + + free(group); + fclose(fp); 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"); + break; + case 2: + fprintf(stderr,"ERROR: CANT ADD AND REMOVE SAME TASK\n"); + break; + } + exit(err); +} + +void dialogue(char *m1, char *m2, int c){ + printf("\033[1;3%im%s\033[0m: %s\n", c, m1, m2); + return; +} + +void formattask(struct task t){ + printf("* %s\t%s\t%i", t.task, t.group, t.date); +} + + /* Returns: + 0 - Nothing matches + 1 - Task matches + 2 - Group matches + 3 - Both match + */ +int listcheck(struct task t, FILE *fp){ + int i; + i += (strcmp(t.task,gettask(fp).task) == 0) ? 1 : 0; + i += (strcmp(t.group,gettask(fp).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):"); + if (((char) getchar()) == 'n') + return 1; + return 0; +} diff --git a/odot b/odot new file mode 100755 index 0000000000000000000000000000000000000000..1c93fb8b2c1bea2ab336ac8e48fc500c0c1690f6 GIT binary patch literal 22016 zcmeHPdvx4Yoxi_%WF|?Qr0*wmS_rmalBO-Cr4605opvgH*(Ufv9H#R~MkX_19wkLu z3ZY7j*{ukO%JEe9u%ZIi1r$**SfoW=w&)(s`XcyDY{ANkMr51)eC}g1Gt8jw*|TT= z=uPH+@ArAX_kHj0b+d2lCYxmm6YSy&LG0QoisIFb!L2$0;1#RHWW@F2LQw(SA!&;5 zRRCNShHQndj`N1e~wP!a(C8A@$0IGgXRXpr}(g^_)y z#TP~JsCLG{d_C69$p)o&vZWB3dJ($(Mvv7+y|dT!|q>Y!vB-}c51y}E>w1k;hl;s3^e(@9eS*nzcrX<-lg*^ z*A7c{|1?lnt7wYH_N-jd6c0DVV~K1}L(i&}4J%hPrjw1!qzm+GDSqrzo42b^uedXR&HxFIYz4XvLXH|>ui5CY zA1OmWuMGXcGW2<6{ON`KBK(R&9E7Q&Mm)!kgfNE{hHwpjQ_w>Py~HNw9onG${d$5= zNG_siMU24is%O+_Li(i6*wNGg>~iDdZP-ieD zx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R|^k zO40af%ox2K4t>&c{(BYY{xbR=#m>c(b^cmBM>qP#XA_o{!N8eXUr{IGL2dBN1WBgq zitzd}`bV3U;GIQR$xOb+Omi9ijryR;>j?Rw2o>wf=#T1&_eVtvMX0z^>lfGGvCCDi zHx>;zqi^6 #include #include +#define TODOLIST "/home/huck/.local/state/odot/todo" #define MAXLINE 1000 #define TIME "%H:%M %m-%d-%y" -#define TODOLIST "/home/huck/.local/state/odot/todo" struct task { char *task; @@ -14,12 +14,12 @@ struct task { char *group; }; -char *getnote(int, char *[]); +struct task getnote(int, char *[], char *); short getopt(int, char *[]); void add(struct task, FILE *); -void rem(FILE *); -void show(FILE *); +void rem(struct task, FILE *); +void show(char *group, FILE *); int listcheck(struct task, FILE *); int geturgency(int); @@ -28,13 +28,10 @@ char *gettime(void); void dialogue(char *, char *, int); void formattask(struct task t); void error(int); - -int linecount(FILE *); +int check(void); struct task maketask(char *, char *); void puttask(struct task n, FILE*); struct task gettask(FILE *); -char *note, *o; -FILE *fp; - +enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE}; diff --git a/structure.c b/structure.c deleted file mode 100644 index 65828eb..0000000 --- a/structure.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "odot.h" - -extern FILE *fp; - - diff --git a/test b/test new file mode 100755 index 0000000000000000000000000000000000000000..e05525dea9eba7a515fdeedb7b3e42fb8c85f010 GIT binary patch literal 20608 zcmeHPeUMw#b-(XPT4^osuI%+E7%YSB7^o!g+FsU}wRgQjB39nk|?XCu` zv`9~Q?Iev;Cz*I$I*^8BXqguNU{WTNCKNhN!qA$U0n?9(fllKgP1rC^YYL$z39Si~ z?eF*AJz7b~lzvR7Gu54W_nh;)=bU@*x%a(y-{)tBMs}Nqp(Od#c17tx#6$XZLH{1j zfb^?g)rNeXTB}+h`(4Z{@An8wy>!m3r6G;`KxwyvOar>ggOyNeAt~)Hl_uFBB%w<8 zgLVNHXt|!=rz;RD<(2xPG)9WLd4>Ls7KK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