From 4cc7541c88e163da8eb2ae103c1c33dc6d1f98c9 Mon Sep 17 00:00:00 2001 From: Huck Boles Date: Sat, 12 Nov 2022 00:00:02 -0600 Subject: [PATCH] automatic backup --- .../@usr@include@alloca.h.blob | Bin 3021 -> 3023 bytes ...sr@include@bits@atomic_wide_counter.h.blob | Bin 3399 -> 3393 bytes .../@usr@include@bits@byteswap.h.blob | Bin 3837 -> 3831 bytes .../@usr@include@bits@endian.h.blob | Bin 2906 -> 2908 bytes .../@usr@include@bits@endianness.h.blob | Bin 2563 -> 2565 bytes .../@usr@include@bits@floatn-common.h.blob | Bin 6612 -> 6606 bytes .../@usr@include@bits@floatn.h.blob | Bin 2927 -> 2921 bytes ...@usr@include@bits@libc-header-start.h.blob | Bin 3215 -> 3205 bytes .../@usr@include@bits@long-double.h.blob | Bin 2494 -> 2492 bytes ...@usr@include@bits@pthreadtypes-arch.h.blob | Bin 3533 -> 3527 bytes .../@usr@include@bits@pthreadtypes.h.blob | Bin 7513 -> 7507 bytes .../@usr@include@bits@select.h.blob | Bin 2806 -> 2806 bytes .../@usr@include@bits@stdint-intn.h.blob | Bin 2983 -> 2985 bytes .../@usr@include@bits@stdio_lim.h.blob | Bin 2768 -> 2770 bytes .../@usr@include@bits@stdlib-float.h.blob | Bin 2379 -> 2379 bytes .../@usr@include@bits@struct_mutex.h.blob | Bin 3781 -> 3775 bytes .../@usr@include@bits@struct_rwlock.h.blob | Bin 4193 -> 4187 bytes ...sr@include@bits@thread-shared-types.h.blob | Bin 4849 -> 4843 bytes .../@usr@include@bits@time.h.blob | Bin 3518 -> 3518 bytes .../@usr@include@bits@time64.h.blob | Bin 2578 -> 2576 bytes .../@usr@include@bits@timesize.h.blob | Bin 2490 -> 2488 bytes .../@usr@include@bits@types.h.blob | Bin 9850 -> 9850 bytes .../@usr@include@bits@types@FILE.h.blob | Bin 2651 -> 2641 bytes .../@usr@include@bits@types@__FILE.h.blob | Bin 2586 -> 2586 bytes .../@usr@include@bits@types@__fpos64_t.h.blob | Bin 3377 -> 3377 bytes .../@usr@include@bits@types@__fpos_t.h.blob | Bin 3325 -> 3323 bytes .../@usr@include@bits@types@__locale_t.h.blob | Bin 3499 -> 3499 bytes ...@usr@include@bits@types@__mbstate_t.h.blob | Bin 3167 -> 3165 bytes .../@usr@include@bits@types@__sigset_t.h.blob | Bin 2785 -> 2785 bytes .../@usr@include@bits@types@clock_t.h.blob | Bin 2618 -> 2620 bytes .../@usr@include@bits@types@clockid_t.h.blob | Bin 2648 -> 2650 bytes .../@usr@include@bits@types@locale_t.h.blob | Bin 2675 -> 2675 bytes .../@usr@include@bits@types@sigset_t.h.blob | Bin 2718 -> 2718 bytes ...@usr@include@bits@types@struct_FILE.h.blob | Bin 6894 -> 6894 bytes ...nclude@bits@types@struct_itimerspec.h.blob | Bin 2881 -> 2883 bytes ...@include@bits@types@struct_timespec.h.blob | Bin 3108 -> 3108 bytes ...r@include@bits@types@struct_timeval.h.blob | Bin 2924 -> 2924 bytes .../@usr@include@bits@types@struct_tm.h.blob | Bin 3553 -> 3553 bytes .../@usr@include@bits@types@time_t.h.blob | Bin 2606 -> 2600 bytes .../@usr@include@bits@types@timer_t.h.blob | Bin 2635 -> 2637 bytes .../@usr@include@bits@typesizes.h.blob | Bin 6390 -> 6388 bytes .../@usr@include@bits@uintn-identity.h.blob | Bin 3403 -> 3397 bytes .../@usr@include@bits@waitflags.h.blob | Bin 2952 -> 2944 bytes .../@usr@include@bits@waitstatus.h.blob | Bin 3512 -> 3504 bytes .../@usr@include@bits@wordsize.h.blob | Bin 2630 -> 2620 bytes .../@usr@include@ctype.h.blob | Bin 14546 -> 14546 bytes .../@usr@include@endian.h.blob | Bin 3828 -> 3830 bytes .../@usr@include@features-time64.h.blob | Bin 2447 -> 2437 bytes .../@usr@include@features.h.blob | Bin 5477 -> 5467 bytes .../@usr@include@gnu@stubs-64.h.blob | Bin 2946 -> 2944 bytes .../@usr@include@gnu@stubs.h.blob | Bin 2416 -> 2416 bytes .../@usr@include@stdc-predef.h.blob | Bin 2908 -> 2898 bytes .../@usr@include@stdio.h.blob | Bin 37510 -> 37510 bytes .../@usr@include@stdlib.h.blob | Bin 43358 -> 43350 bytes .../@usr@include@string.h.blob | Bin 17032 -> 17032 bytes .../@usr@include@strings.h.blob | Bin 6434 -> 6434 bytes .../@usr@include@sys@cdefs.h.blob | Bin 12470 -> 12460 bytes .../@usr@include@sys@select.h.blob | Bin 6068 -> 6068 bytes .../@usr@include@sys@types.h.blob | Bin 8103 -> 8105 bytes .../@usr@include@time.h.blob | Bin 14862 -> 14862 bytes ...usr@lib@clang@14.0.6@include@stdarg.h.blob | Bin 3235 -> 3225 bytes ...usr@lib@clang@14.0.6@include@stddef.h.blob | Bin 2703 -> 2693 bytes .ccls-cache/@home@huck@.repos@odot/dialogue.c | 20 ++++---- .../@home@huck@.repos@odot/dialogue.c.blob | Bin 3357 -> 3650 bytes .ccls-cache/@home@huck@.repos@odot/file.c | 4 +- .../@home@huck@.repos@odot/file.c.blob | Bin 6757 -> 6788 bytes .ccls-cache/@home@huck@.repos@odot/func.c | 3 +- .../@home@huck@.repos@odot/func.c.blob | Bin 4774 -> 3573 bytes .ccls-cache/@home@huck@.repos@odot/input.c | 43 +++++++++++------- .../@home@huck@.repos@odot/input.c.blob | Bin 4622 -> 5048 bytes .../@home@huck@.repos@odot/main.c.blob | Bin 2774 -> 2613 bytes .ccls-cache/@home@huck@.repos@odot/odot.h | 12 ++--- .../@home@huck@.repos@odot/odot.h.blob | Bin 4588 -> 4702 bytes dialogue.c | 19 ++++---- file.c | 4 +- func.c | 3 +- input.c | 43 +++++++++++------- odot.h | 12 ++--- 78 files changed, 97 insertions(+), 66 deletions(-) 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 88468ed42116478f5d9f41702452c2989ec029eb..cdd724622ef21737db88a7fca011a19ed06728ba 100644 GIT binary patch delta 48 zcmX>reqMZnB7bIHL1~FzG6QpRPGVjvepY;fB1>9kPU=K82))rKo|U=j)zQfhnItzKXXRi60Qh4KO#lD@ 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 14fd9672b6b20df11854244c5aa02575d2c3993e..c5182e2917b706c2f98234656978f0d35b7ea0f6 100644 GIT binary patch delta 38 pcmX>ubx>-8B5P(|L21cEO(obzEwKB1cMQVorW~Y3f8Z1bd^85i4`ktD~D6Sr4!S05U%hQUCw| 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 a17c5dfc52f0eb617cbe2840abac75e2188c2827..0fd40ab904753bde210d34144ecc71c8cabfd5e1 100644 GIT binary patch delta 38 qcmew>`(1W|J!@uOL21cEcSQ(eV}UIzvz)=b$sbuIH=krR;RFCEBo0#m delta 54 zcmew^`&V{?y--SKVorW~X{uf_19NgtVqQAK#0GH=nCQkVTUO?#S4SrYvPf+{!fMP3 E04%W+xBvhE 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 57def18eeb831843483b696d995fa6aca828f9ef..86c20b1b81e588a33076309eb09bec6d0144c12e 100644 GIT binary patch delta 48 zcmca5c1LW2B7bIHL1~FzG6QpRPGVj B5Pkpv delta 36 ocmca3c1vu6B1>9kPU=K82))rKo|U=j)zQfhnItzKXPwFl0Q|-c@c;k- 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 c3c3f004482564b93bd643c88a3481a6cec27d10..22d90e1cfbd59cf1896df54f6e0d85988a795e9b 100644 GIT binary patch delta 52 zcmZn`X%(5E$e)>4P+Fpw%)p$SlbDyzFfl=#6)d#T%bJy0&fwl;Mn;jz3e0Sq7qKR? F0069_4}|~# delta 36 ncmZn_X%?BF$dZNtcffD+xH9> 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 b227f3d9ca4fe365791d1b059eb9b11f2c979e59..cd467e7d8d1e6e6895dcec8477d5db83c46097d7 100644 GIT binary patch delta 38 pcmca&e9m}+B5P(|L21cEO(V!Z 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 b861553717cde8651e1e7d2d0e7eebc452621ae8..c251ccda151c752747602cd96a3537d3b769e88d 100644 GIT binary patch delta 38 pcmaDa_EKzuB5P(|L21cEO(?h3I0 delta 50 zcmZpb?3bLNC|q1pRGM5;T9m4n%)p$SlbDyzFfl=#117xD(~Onr)6vb1tSsyRxfT&) 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 d6e61a9288a90a3cd7242f4a04326e3af59ff4f0..e0febfafe261eb8c5a3d5546ab0ed0518d581df1 100644 GIT binary patch delta 38 ncmdldyhnI~B6~_^VorW~=|oK>7;|H=H7m26!M)8BS#?reO!8iB5P(|L21cEO(ueO7vcqEJd^VorW~X{uf_19NgtVqQAKH 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 976671096d769a82f8975c192c4795c67e6e5ac7..6bd04ef73232f705a543c97c09c60e95beb2e736 100644 GIT binary patch delta 38 pcmca4Tk^# delta 44 scmca?b<=8sB1cMQVorW~Y3f8Z1bd@TJS%h4tD}=2GD&Ve&e|gm0EkTylmGw# 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 19267ed4a3da3c95dbd2587969f4a00f776f901a..ff08d561b050b16850e5a56b4901d6b8fdc5b3ad 100644 GIT binary patch delta 45 zcmew+`b~6#5^rf B52647 delta 36 ocmZ1}zFd5QB1>9nUh+gW2))tAij}$P)zQg~ERvfSv9hxP0P2toZ~y=R 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 aee14a129ee0687f39d89d3366359960ebc76b20..c27d24bc86023fc6724081fd273fca2b73405c80 100644 GIT binary patch delta 48 zcmca0dP#JGB7bIHL1~FzG6QpRPGVju8B1>9kPU=K82))rKo|U=j)zQfhnItzKXXR!E0Qj;EQ2+n{ diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdlib-float.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdlib-float.h.blob index 36b3bb6eecb042929be4b89885c581079f40d19d..11b7544d38f9d14a97d809055cf4f3ce5b3a58f6 100644 GIT binary patch delta 20 ccmX>tbXsV`N>*k$gL{)3StK?eVQpsy08_*VegFUf delta 20 ccmX>tbXsV`N>=8kS4Sr|vPf(`!rIOZ0AF|rg8%>k 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 ef55c402d68ffc9d2ba7968085aeeb808f9e602a..339a19bfdca76dd3912376ba19ecc31f82deadb3 100644 GIT binary patch delta 38 pcmX>qyI*#KB5P(|L21cEO(6y0B)ZT Axc~qF 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 f48e1e8c6e8f50cd38cc86b31b328933dbd0b055..4bb5a3a70b09b22e61c71799aa712ff175ae91cf 100644 GIT binary patch delta 42 scmbOvGC^d5B6~_^VorW~=|oK>7;|HA0xPqe!M(|htdg70vpTZ?05P!*$N&HU delta 44 tcmbOrGD&2DB1dsaQE75XY0*RtB{+LyU;-<1)2pMC8Cj$@pJR1m0RU`z5EuXe 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 8c5ac565a72ef5b0c5d0c4d097ad3ee0073f8107..e49fc27cce5ae97aa043504064ce9488bef755d8 100644 GIT binary patch delta 42 scmdlbyhC_`B6~_^VorW~=|oK>7;|H=9V@e(!M({3nWZ+bW94B1075wqdjJ3c delta 44 tcmdlXyi0h3B1dsaQE75XY0*RtB{+LypdBl7)2pMCA2Ld9Uc<`60swuF5Xk@l 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 deb361ac11e069dcd4252a8b1ac9ea7415747f17..89b80016864c6670a5f962d35e2fc2b37f09d473 100644 GIT binary patch delta 19 bcmez6^UG($30CG`w)ZA(l-&G;b(#VIYDEdp delta 19 bcmez6^UG($30CHq??)$Yl-&G;b(#VIY2FFa 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 469004ae98d3bc00cc51f6526cf97923eb9c0e61..ebaf7cfc217b0a5e74ea89d691bc9e9298f628a4 100644 GIT binary patch delta 36 ocmcaDa#3W0B1>9nUh+gO2)!{Ro|XBR?Y+s2tdg70v-Yq60QOl83;+NC delta 56 zcmca8a$97AqHu9ZQE75XX;G?PG6QpRPGVj`CD>=B6~_^VorW~=|oK>7;|H=1uL_h!M(|W?81`^SlBnOU=3vl0Fn(4$N&HU delta 44 tcmew@`B!p+B1dsaQE75XY0*RtB{+Lypam;))2pMC8Cj$@FJld52LO*j5WWBa 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 a017136385fdc52871f185609c188c2779e90a78..31a43799353899bc5abcc3fee43e6e6dd00f22a4 100644 GIT binary patch delta 20 ccmZ22y;^$1N>*k$gL{(=nI$(LWqrmD08WhuWB>pF delta 20 ccmZ22y;^$1N>=8kS4SrsGD~hg%KD5Q09ru^X#fBK 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 a898e464622bff7b19ed0bcaaf4fcd061c86351f..e3cfe5bbbf80a14b66402d0b2817c7b206778785 100644 GIT binary patch delta 46 wcmcaFaaUr3B6~_^VorW~=|oK>7;|H=DJ!#_!M({FnT03cXJy;GgmpI?0FQVOvj6}9 delta 44 tcmcaBabIGBB1dsaQE75XY0*RtB{+LypeZYJ)2pMC8(AbbFJj%z1^|g+5nTWP 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 dad179a20db26464091c2251dc8121d097f04f45..4efe155b668048615ad8a3ad7cec606e8b851df7 100644 GIT binary patch delta 45 zcmaDT`cQO&5^rf9kPU=K82))tAf|a@H)zQfhnItzaV4cGP0Pv;_WdHyG 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 a90f80551f530c6b55cae725a6244b7c1209068f..66dea256e80b0c32070d4c0a3afe3297b4697a70 100644 GIT binary patch delta 48 zcmca1a!X`_B7bIHL1~FzG6QpRPGVj9kPU=K82))rKo|U=j)zQfhnItzKXPwLf0Q;>C<^TWy 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 c2b03e665fff9f54e45e22c9c13941fbca222177..965dd0cd8ff953fef89c662af9bb8540412feac1 100644 GIT binary patch delta 20 ccmew?@>ygygr2qf` delta 41 wcmbOyI!|oc35nJB7bIHL1~FzG6QpRPGVjsc2I1BB1>9kPU=K82))rqkCnOU)zQg}%u<`Dv#wzU0PBnlmjD0& diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timespec.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timespec.h.blob index e38ab854853de872ce7f4e1bdb58368e703e72c2..72af6e8e3aeb7585d588199abd9c825b8391567c 100644 GIT binary patch delta 49 zcmZ1?u|#5m5^rf1u&`~O&f3cc E0DA`xwg3PC delta 49 zcmZ1?u|#5m5^rWss$Mb!b8=2%UOL0X1aX!$pvXoq16JmyS4Sr^GKx%2U}4)lowb(@ E0Ee>=qW}N^ 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 0a9e6028bf933f79973377f47b2364142e5905df..16276767eb455b87bfc1397b2ac5a5b94d697ad1 100644 GIT binary patch delta 49 zcmaDO_C{=i5^rfHFtTo*&U%#< E0G84ZrT_o{ delta 49 zcmaDO_C{=i5^rWss$Mb!b8=2%UOL0X1aX!$pvXoqLssUdS4Sr^GKx%YU}W7qo%Jd! E0Hb~olK=n! 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 f619ca008dcb0249e0d82b2124d0aba87f99c19a..45efc3aac9efadf327dd35a2e104d265f487048a 100644 GIT binary patch delta 47 zcmaDT{ZM*>B42J|W}aR$19NgtVqQAKB41i&PO4rq19NgtVqQAKx0|0}; B5HtV) 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 2ec699b72ee45aab90207989d5a8ff835ace13a9..8330a3a7ef28582efd600eccbdb1383ad0cfdb17 100644 GIT binary patch delta 38 pcmZ1{vO;8nB5P(|L21cEO(a#oWZ@xj4V={SFpCR0091J41oXu delta 44 scmZ1>vQA`zB1cMQVorW~Y3f8Z1bd^8B`b5&tD}=2GD&V;$lA^V0BUp)jsO4v 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 3101372e622831d19ef387d491782e7a0891a1fe..dce1c5443761974b1d86b8a78575cffb8e4cfac2 100644 GIT binary patch delta 52 zcmX>ta#m!5B7bIHL1~FzG6QpRPGVjra$019B1>9nUh+gW2))tAf|a@H)zQfhnItzaU|q`s0Qa&DumAu6 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 7dd5cffd7556758b401dfa934f632ff862e01389..17aa1e89c3609c04fd15805a83f136b7e4cbc882 100644 GIT binary patch delta 42 scmexn_{DI7B6~_^VorW~=|oK>7;|H=Ei1E}!M({3IV3i(X7v^Z0AE@Ud;kCd delta 40 pcmexj_|0&FB1dsaQE75XY0*RtB{+Lype-wN)2pMKC$c6B0{~SQ5I6t; diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@uintn-identity.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@uintn-identity.h.blob index 0bb2e607640819adde86059f0f03a6c46bd44285..4863bc8b9bf12f0655fa19e7303f52439ca63cea 100644 GIT binary patch delta 38 pcmX>tbyRACB5P(|L21cEO(qby{kIB1cMQVorW~Y3f8Z1bd@TJS%h4tD}=2GD&Ve&RWL~0C?>Y8UO$Q diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitflags.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitflags.h.blob index 0b033b2adc36deaa623b96338ee1becc683e5f6b..4f7a3b7ee09966428b7b9625b3e003aa5ddfebdf 100644 GIT binary patch delta 34 ncmeAWZxElL$efm$Gf_hcL~RUAU}cswxHp-RMQZao)?KUsxxEU^ delta 53 zcmZn=?+~A$D3p?!n3JDgnyQz~z?__un3v8lF+rRiD!S1#ft9)G)zQfx*(En0W!=pR E0OKtaMF0Q* diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitstatus.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitstatus.h.blob index 9863e92dfd520fb05b9d73e1653d5e3212ac0f21..299f29995b4d0f5dda118b6ddf7080d7dfd0399e 100644 GIT binary patch delta 34 ocmdlXy+L|{B6C`1&O{9*5VbKdft6X#;NE0L7OBnWSYNRN0LOm|W&i*H delta 53 zcmdlWy+e9}qEJd^VorW~X{uf_19NgtVqQAK!~}76sOUz|1XkvzS4Sr|vPf(`!up0C E0QCwJYXATM 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 1cb7b380dd73bf9e598ca185ed8ac3a6d2e48ed1..fa685272fa1972171792453001be2fc93bfe8799 100644 GIT binary patch delta 36 ocmX>mvPWcsB1>*!X5K_C2)!{Ro|XBR?Y+s2tdg70vzD^}0PhV9zW@LL delta 56 zcmdlZa!h1`qHu9ZQE75XX;G?PG6QpRPGVj 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 9f1400cd918abe1d47aaec3516f066d76497e21b..a1b995c675d04388363b9f3e3e595eb98a223a89 100644 GIT binary patch delta 20 ccmcaqc&Tv1QdVX;gL{)586`I#WEC_90ACjey8r+H delta 20 ccmcaqc&Tv1QdZ`sS4Ss1GD>bf$SP=7yw)ZACvPf(`!n%eT0Ay=8W??)#$vPf(`!n%eT0AvRU*#H0l 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 2d0ccd922e068b3b06b7e4ede34406dc8152d75c..305f4ab90b493b77182755e1bbb12da54f6cdb43 100644 GIT binary patch delta 36 ocmca3c1di4B1>*!X5K_C2)!{Ro|XBR?Y+s2tdg70v-YwA0QJTV1^@s6 delta 56 zcmca4c1LW2qHu9ZQE75XX;G?PG6QpRPGVjO==65VbKio|U=j)zQg{%#xcQuwD@a0N=0-`~Uy| 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 e4609bf14200bc858be9abb98e1730fb8eafa729..765017fb834c856564260360c13ee1f8439d030e 100644 GIT binary patch delta 48 zcmZ2(ztVn!B7bIHL1~FzG6QpRPGVj_O? B5X%4n delta 36 ocmZ2!zubO;B1>9kPU=K82))rKo|U=j)zQfhnItzKXMH3I0QzPQJ^%m! 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 86165996f1b9ea3ddcd6d5ba3cf50339e2f758c4..76de664a8b1276445f016e5f2f2ac05ac0da5029 100644 GIT binary patch delta 46 zcmeAx=_{F_$d{X#nWvY`z?__un3v8lF+rRKB(l*fo|Re7;NIj$7KzPASiMXDa)l3T delta 46 zcmeAx=_{F_$d{Ixld6}@z?__un3v8lF+rRKB(l*fo|U=j)zQg~EE1cKuzHyQ0DUJA AW&i*H diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stdarg.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stdarg.h.blob index fe4ca5609374d7fe0e3e40b9fa322153e22c3882..def439483caa8dd172dc587a0469fab280297bae 100644 GIT binary patch delta 36 ocmZ21Ia6|iB1>*!X5K_C2)!}Hn3Y-1;NE0I7OBlkSpTyD0NX(e{Qv*} delta 55 zcmbO!xma?7qHu9ZQE75XX;G?PG6QpRPGVj3j E03y;8-~a#s diff --git a/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stddef.h.blob b/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stddef.h.blob index a55158979fb77260141e18bafde3d3e68a137429..bc9faeeae45ff4d8d50512092d2a4fe0b6bc025e 100644 GIT binary patch delta 36 ncmeAdZ55rM$da3wnKw}jLT?N)W@VN$xHp-RRdVxU);BBw(+&%V delta 56 zcmZn_?H8S(C|q1pRGM5;T9m4n%)p$SlbDyzFfl=#6E3{b%b1n9>DAH62U#UI&t!eW F0stF|9DeW3j5{+syfx>k)27Q%vP`0tW-5c_8X;x6p>z=2L)&U8{#hNzE}?tq z5=0>k*rlLDP!J?hccx2K`8DscbtN-V{tObC5Zd)}8^x!~sIXO)&>#Z< z?~&4?p@dj*Pq{v3rnU6fmiwwy-|b<{-=V1XrOOre-NgtzkbZs7vKHEcH%+ghHbk)?G6B$ z`1HI$k|O;Yq~jair~W>?buTlRcFby?nr&ZmvQy(gGgN+19^64LGH_rq=gk0FW)4Bz ziIZDMg!l|jE^KM66X}U?a1cypFvqD!>w%_;e4qs<{DEUQ0rCTvBV0-lXkGgpdRi{anBZ%2sjdK*fD{v>0D~|S0|Nu|{|j6vKi%fPz&D z97UPgB-j-GsyHxmN^pW{9tj?W$?v&>xH%*^)Ibv465Nx0xFze8GZKq58MwH(7@4@3 zM3@+v82CW8F#ezIeQvL*qe>tfs|2gs|J}!huN`@<%)<=S3o`pZtNFRS|5~*-K>{E% zQB;6zMNt8?4OIomJs=hJa6@<)fz~oGZ3B_WfD!IHhE2%gAU4944D4`anRz7&$qXDE zKyNS#_z3v@Wny6za1rp^_Lm1JA{ZnX!ovs;IL2<0#tYygM@-aCNqoWF#8CF vOfC}p!pl$58AUZ2 zBqaEdrG!j`oF>QeUgAtGoAS5+Oy5`5$rgNOTr&S*_D$~Oa}qrM^h!p})LoqacZ>ec zc%z)NX!9Mu4@{f6g)$gbVM5F-d@N!tjNBaD0xXQC9Hu~02BCh2@P0-Pm@$)cM9d~f zOPEd$7Y&{KR5X*>LnvT!px75iuE{>)Hk13r4eemgfp{yKfrp2Qfq~Im#9NGs(VN3t sjDZ*EH5OkEUoH{G0HpvG9>&0kz$hNZAfX@;9>&T0#N#(lkodv~0G^U+_W%F@ diff --git a/.ccls-cache/@home@huck@.repos@odot/func.c b/.ccls-cache/@home@huck@.repos@odot/func.c index 577b287..30d512c 100644 --- a/.ccls-cache/@home@huck@.repos@odot/func.c +++ b/.ccls-cache/@home@huck@.repos@odot/func.c @@ -12,6 +12,7 @@ int listcheck(struct task t){ error('f'); while (fgets(s, strlen(t.task), fp) != NULL){ + /* strip newline for comparison, return 1 if string matches */ s[strlen(s) - 1] = 0; if (strcmp(t.task, s) == 0){ free(s); @@ -27,7 +28,7 @@ char *gettime(void){ return NULL; } -int linecount(void){ +int linecount(FILE *fp){ int i = 0; char c; while ((c = fgetc(fp)) != EOF){ diff --git a/.ccls-cache/@home@huck@.repos@odot/func.c.blob b/.ccls-cache/@home@huck@.repos@odot/func.c.blob index 975bcaf2de7b69c77ce700d20d1a13ad4707f001..c72c6d09c852467d318fea300a09b7ada43ca215 100644 GIT binary patch delta 991 zcmZ3c`c;}si{alln|sF?7#Sueh;LNvU}gSgdv9_hi^S$5tOuEs8UO!InXyMOo&Prj z6ma}6;Hmf(QTx{OzsjFWsqKpecK+{qH}kW1$|cwT{tJJ93>_}2GbvZZV3Dj z+RM0pg2$KB|7R-s&-|t6w&njL`?oJcw$E{bn#VjjnlFo^nLxyJ{(Yee2@Xijvf#JOwvTA6Esfv;q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$~{{tkfKKK9t diff --git a/.ccls-cache/@home@huck@.repos@odot/input.c b/.ccls-cache/@home@huck@.repos@odot/input.c index 7a7690e..0fc6eb7 100644 --- a/.ccls-cache/@home@huck@.repos@odot/input.c +++ b/.ccls-cache/@home@huck@.repos@odot/input.c @@ -1,56 +1,67 @@ #include "odot.h" -extern char *note, *o; +extern char *note, *group; extern int urgency; char *getnote(int n, char *arg[]){ char *s = malloc(MAXLINE * sizeof(char)); - while(--n > 0){ - if ((*++arg)[0] != '-'){ +/* adds word to note if it doesn't start with - */ + while(--n > 0 && (*++arg)[0] != '-'){ strcat(s, *arg); strcat(s, (n > 1) ? " " : ""); - } } return s; } -void getopt(int n, char *arg[]){ +/* uses a 3 bit number to represent options + 1 - show list + 2 - add to list + 4 - remove from list +*/ +short getopt(int n, char *arg[]){ char *c; + short options; - if (n == 1){ - o = "s"; - return; - } + /* show list if no arguments given */ + if (n == 1) + return 1; while (--n > 0 && (*++arg)[0] == '-'){ c = malloc(strlen(*arg) * sizeof(char)); c = *arg; - strcat(o,(strchr(c, 'd')) ? "d" : "n"); - if (strchr(c,'s') != NULL){ - strcat(o,"s"); + options += strchr(c, 'd') ? 4 : 2; + options += strchr(c, 's') ? 1 : 0; + + /* if theres a g then add the next argument as a group */ + if (strchr(c,'g') != NULL){ + group = *++arg; } free(c); } + + return options; } + struct task maketask(char *task, char *group){ struct task tmp; tmp.task = task; tmp.date = 0; - tmp.group = group; + /* add to all group if group isn't specified */ + tmp.group = (strcmp(group,"") == 0) ? "all" : group; return tmp; } -struct task gettask(void){ +struct task gettask(FILE *fp){ struct task tmp; - - fscanf(fp,"%s\t%i\t%s\n",tmp.task,&tmp.date,tmp.group); + + fscanf(fp,"%s\t%s\t%i\n",tmp.task,tmp.group,&tmp.date); return tmp; } diff --git a/.ccls-cache/@home@huck@.repos@odot/input.c.blob b/.ccls-cache/@home@huck@.repos@odot/input.c.blob index bd2c79821f1f19961328772050d104a513c0054b..3ed7c31c342ebfd06228b2e51eb0d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B_Fe!0 delta 1249 zcmZuxZ)h839DaXy*LuBNlDnA3%jJ5x#oL?a;^J~#Tiearb#vBDhPq8ETCudQtzx@n zsaoa?)_#}>h3!@LrRoP^PKCngoPS{W2doq3hZTmyiCFxDqPP{OPNkmjn{W}qz`eQr z?)^RYJkRfW^LBRDZgSAyC-LGUg2OjjCvwvb{QbXwM3%Ya!p9Bo^B|E!O}lwd^vG9D znYJ9#vnf5YgDR;B4pd~C*syOiVnI{=n2JEkl&b5AyPk+e@hGH20(Pu79 zeK*T*s}?A8|E;!`rOL{d>sf(HuFZ@=SK%h|IR$+Ey^ z7N!??2~Q_aL~+GY94!vsJ>CN|P@l*Ca%pm?Y?TN1KVp?1-Aj|vNPDtYmS!U>X0iX& z7cCzi-*mPyEF&c3#9TxGM|9|#7xQ#omsn@W;Qu!J(#j8y|7i`44wfuuf)Zd3Fap4} zat;88dN_w~R+?jRFigXeA&t|mwDUl@Z|+j^$HlSnvNc&6d1!oS3W;KbHlJeMe1f+D zc*NU?d>U&J1Nr2HYF0!|)C~v~LhC6|5Q-Xwp&A8<#bY!}F)@}vOhJRL=#)W9NiiO- z;mKfPlk&*u8KxsR1^;i0Yq``GS9EK(tf~9rb$LAkcssmZbbZjoFR#_Xjny>*NwIZQj!jl;rw`)(d!<_8}zyUgAmvK-A;a!QUxpx4_*_XYuC&W}^i>BK;_ z)C>bwH8pdJ0dsLB9+M%dCk+GYC$L6nurzYt0A<7yqq^!%)kdsttTN)0Ub4#oyxWB5Z7x&jx<*mFU!#{tJTG9Xj diff --git a/.ccls-cache/@home@huck@.repos@odot/main.c.blob b/.ccls-cache/@home@huck@.repos@odot/main.c.blob index f86f036a14cfa53f06ac571ab277b8bfd1dfce97..1cfe75fa10e9910c8e8e9bef4e484c5a11d7449d 100644 GIT binary patch delta 193 zcmca6x>aPuN>=7yw)ZACvPf(`!g`Roo`G>20~%obUtQuc=e^|XV+_o2W@<%AYEhm- zW?qRxX;FG=UUDUam>3^W=QdsjMn+~aW)&dGz^uaX|6AX@k1xxADL{23XCxLWXyr3V sNil)!0jXxvVA2AT3`|-Klh<%@YM`jh%P&a=8W??)#$vPf(`!g`Rop7DS2r^~kHUcYiP^GXzQ6EpKPK#atq^kf}{ zMs)uBdZ##9m8K9 zpkZ*GFc*TH1X3x*ssvUk#HzFnq7r5qNM&hJdTL&BB~URR(2#AsKpo6t%qonG%nZ!I zDh&U>_09YEviuj+xA{QpL7rm(sbkV$(qd#}Vqnr@_`gPC<RBo<6P$TABlA5plmj|jK@Io`SBAwIPzD`W&p`4aVbeKGAc1BnK3X-&g6EO{E$0KpXFy$ z`%?qisW7H4Y|mlTyImneYP3SftbfDC8+|NcYGl%FlRQDA#y zxMbuQ8D$t`Y=9=6U|W2Lv2Tke(BTR>nR%(n`K5U!8ldpeWZ>Ws0%-@kj+;@QLmub= zc?Nm4$rJce^_b;lQTzvtJtm;% zWGrN?{xSh|E67;=ue&3AXoce$w!b`+zwifes`99cFfpn!s8043I5yc!Fx*8|N>v6d iBE!JT2y`jjCCEnSL5)^2QZfMzNf?|w}f((Kt zlb7-4*DFXUXfQG=FerF1F#LbPzt;Qc&d%Lnvr>zS@{2S;rhrV~0viA}L7GcigppC2 zL0SQ*<#%RK_~8$sEwk5L$DH?) zua8YG=MPe2{0|EkR$&EU4HiamEpa0jMg=|vF&0Ke4MhVMMkPL_$^ZCG)nWQTt}QJ} zPt8lN1iBO$@QkV)s$xuxstl@P+jto#rwIgbs_>|YFfpnys7&53aLgEH1#;x&0V9nG v6ca{@CV!cLc1bCk{I9zsduWB@8MePXlN$x2c~zuTWWc7#FaXU}5V8XRJYbM< diff --git a/dialogue.c b/dialogue.c index 599408c..bf125b9 100644 --- a/dialogue.c +++ b/dialogue.c @@ -1,20 +1,23 @@ #include "odot.h" -void error(char type){ - switch (type) { - case 'f': +void error(int err){ + switch (err) { + case '1': fprintf(stderr,"ERROR: COULD NOT ACCESS FILE: %s\n", TODOLIST); - exit(1); - case 't': + case '2': fprintf(stderr,"ERROR: COULD NOT GET CURRENT TIME\n"); - exit(2); - case 'r': + case '3': fprintf(stderr,"ERROR: ARGUMENT OUT OF RANGE\n"); - exit(3); } + 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 14a07c9..b385503 100644 --- a/file.c +++ b/file.c @@ -16,7 +16,7 @@ void add(struct task t, int size){ l = 0; while (!(h == m && m == l)){ - i = strcmp(t.task,gettask().task); + i = strcmp(t.task,gettask(fp).task); if (i < 0) { h = m; @@ -79,7 +79,7 @@ void show(void){ fp = fopen(TODOLIST,"r"); while (fgets(c, MAXLINE, fp) != NULL ) - printf("\t\t\033[1;35m*\033[0m %s", c); + formattask(gettask(fp)); free(c); } diff --git a/func.c b/func.c index 577b287..30d512c 100644 --- a/func.c +++ b/func.c @@ -12,6 +12,7 @@ int listcheck(struct task t){ error('f'); while (fgets(s, strlen(t.task), fp) != NULL){ + /* strip newline for comparison, return 1 if string matches */ s[strlen(s) - 1] = 0; if (strcmp(t.task, s) == 0){ free(s); @@ -27,7 +28,7 @@ char *gettime(void){ return NULL; } -int linecount(void){ +int linecount(FILE *fp){ int i = 0; char c; while ((c = fgetc(fp)) != EOF){ diff --git a/input.c b/input.c index 7a7690e..0fc6eb7 100644 --- a/input.c +++ b/input.c @@ -1,56 +1,67 @@ #include "odot.h" -extern char *note, *o; +extern char *note, *group; extern int urgency; char *getnote(int n, char *arg[]){ char *s = malloc(MAXLINE * sizeof(char)); - while(--n > 0){ - if ((*++arg)[0] != '-'){ +/* adds word to note if it doesn't start with - */ + while(--n > 0 && (*++arg)[0] != '-'){ strcat(s, *arg); strcat(s, (n > 1) ? " " : ""); - } } return s; } -void getopt(int n, char *arg[]){ +/* uses a 3 bit number to represent options + 1 - show list + 2 - add to list + 4 - remove from list +*/ +short getopt(int n, char *arg[]){ char *c; + short options; - if (n == 1){ - o = "s"; - return; - } + /* show list if no arguments given */ + if (n == 1) + return 1; while (--n > 0 && (*++arg)[0] == '-'){ c = malloc(strlen(*arg) * sizeof(char)); c = *arg; - strcat(o,(strchr(c, 'd')) ? "d" : "n"); - if (strchr(c,'s') != NULL){ - strcat(o,"s"); + options += strchr(c, 'd') ? 4 : 2; + options += strchr(c, 's') ? 1 : 0; + + /* if theres a g then add the next argument as a group */ + if (strchr(c,'g') != NULL){ + group = *++arg; } free(c); } + + return options; } + struct task maketask(char *task, char *group){ struct task tmp; tmp.task = task; tmp.date = 0; - tmp.group = group; + /* add to all group if group isn't specified */ + tmp.group = (strcmp(group,"") == 0) ? "all" : group; return tmp; } -struct task gettask(void){ +struct task gettask(FILE *fp){ struct task tmp; - - fscanf(fp,"%s\t%i\t%s\n",tmp.task,&tmp.date,tmp.group); + + fscanf(fp,"%s\t%s\t%i\n",tmp.task,tmp.group,&tmp.date); return tmp; } diff --git a/odot.h b/odot.h index c206b4f..61544ad 100644 --- a/odot.h +++ b/odot.h @@ -15,7 +15,7 @@ struct task { }; char *getnote(int, char *[]); -void getopt(int, char *[]); +short getopt(int, char *[]); void add(struct task, int); void rem(void); @@ -25,16 +25,16 @@ int listcheck(struct task); int geturgency(int); char *gettime(void); -void error(char); - -int linecount(void); void dialogue(char *, char *, int); +void formattask(struct task t); +void error(int); + +int linecount(FILE); struct task maketask(char *, char *); void puttask(struct task n); -struct task gettask(void); +struct task gettask(FILE *); char *note, *o; -int urgency; FILE *fp; -- 2.45.2