]> git.huck.website - odot.git/commitdiff
new start
authorHuck Boles <huboles@protonmail.com>
Thu, 17 Nov 2022 21:16:14 +0000 (15:16 -0600)
committerHuck Boles <huboles@protonmail.com>
Thu, 17 Nov 2022 21:16:14 +0000 (15:16 -0600)
73 files changed:
.ccls-cache/@@home@huck@.repos@odot/@usr@include@alloca.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@atomic_wide_counter.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@byteswap.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endian.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endianness.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn-common.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@long-double.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes-arch.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@select.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdint-intn.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdio_lim.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdlib-float.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_mutex.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_rwlock.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@thread-shared-types.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@timesize.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__FILE.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos64_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__locale_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__mbstate_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__sigset_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clock_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clockid_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@locale_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@sigset_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_FILE.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timespec.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timeval.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@time_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@timer_t.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@typesizes.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@uintn-identity.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitflags.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitstatus.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@endian.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@features.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdlib.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@string.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@strings.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@cdefs.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@select.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@types.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stdarg.h.blob
.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stddef.h.blob
.ccls-cache/@home@huck@.repos@odot/file.c
.ccls-cache/@home@huck@.repos@odot/file.c.blob
.ccls-cache/@home@huck@.repos@odot/input.c
.ccls-cache/@home@huck@.repos@odot/input.c.blob
.ccls-cache/@home@huck@.repos@odot/main.c
.ccls-cache/@home@huck@.repos@odot/main.c.blob
.ccls-cache/@home@huck@.repos@odot/odot.h
.ccls-cache/@home@huck@.repos@odot/odot.h.blob
Makefile [deleted file]
dialogue.c [deleted file]
file.c [deleted file]
input.c [deleted file]
main.c
odot
odot.h [deleted file]
test [deleted file]

index 1def0cad93b1d3d4246c33aa8f09f44d7b6e80bd..c1cf2b5151909bc32e11a596d1f7b9ac1c7c9f70 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@alloca.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@alloca.h.blob differ
index ace0daf8c35a8730420c421d1b58c901f6f190dc..dd4d0cccbe5fadfdb2604990d051d5a12e17306b 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@atomic_wide_counter.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@atomic_wide_counter.h.blob differ
index c26ab6d101d0d6e1bf26d96cb5c8e30f94c66b6a..ea766c9e6ca293c03b2b4630723317ff4661640b 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@byteswap.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@byteswap.h.blob differ
index 43b34225abd0a9a1cac449c782102e34a7fb8a60..39f742546ddebdc8987ce3b7cf488af6bd3e13c0 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endian.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endian.h.blob differ
index c78f2d9b284f89be3470e9c72394efd084829f9c..a1df9a1940d9404b9fc830680b4304b387074030 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endianness.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@endianness.h.blob differ
index 77f1cf8106be700614fd21ba1beaa025f5b92ba2..051dbd4981c06313382cbbc2bef01be6b2c9fa24 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn-common.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn-common.h.blob differ
index 514dc757d6d676cce8e95147bb4d34652147b169..014c36106c54c12694c7cb44e1fddb59434990b0 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@floatn.h.blob differ
index c07a751fa0e65afcd394953bc59e49a8f343e0dd..1fb990d522599a06c4886afda53b65f207b2d5e9 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@libc-header-start.h.blob differ
index af735102bd98ab97840417872b01c7c39380d86f..f7d9d9a967be8e9ab40403542217f2c6dcb67904 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@long-double.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@long-double.h.blob differ
index 5bcf91e62262ebeb05b6bcec73d21c58f2572fc8..098e8b0670f6424629f8f3c814684621a6ebe70a 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes-arch.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes-arch.h.blob differ
index 2a8cef8fbf7754b6e5a80425cfced914aa07acff..40af18dab2afefc63b2443d07ca2ce15f60414fe 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@pthreadtypes.h.blob differ
index 8dc32db03e09b3e0e3410f44c45da5ab9719560e..138b61d75d82466e697547ecdf2d55e087e9d6a3 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@select.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@select.h.blob differ
index 0e6e59de5f0fe940dc550aa3ffc96512707bd8f9..e3e2d826f8042dd88a9b4279d7c713a4abbd9046 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdint-intn.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdint-intn.h.blob differ
index bbfabde44c178eb4069754b7bc61cca3868c3052..c3547d6c00c59c676931b478fdb86d5dfff94963 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdio_lim.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdio_lim.h.blob differ
index cf0a36a5c54093e57990dfca74f3b5cfcf65b5c0..25cbb9f1f6ea12ae995f49413f91c6abd0d5ac73 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdlib-float.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@stdlib-float.h.blob differ
index cf04c35e680feb421e1567307dfeb32fde191e0f..8183433f28addf8aada484b6810cb8a65557bd3f 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_mutex.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_mutex.h.blob differ
index 9aec1a8f9d8f0907e3998223885c855ac718840c..1442e846eca9946004e9c0f461966a4fcd2900b3 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_rwlock.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@struct_rwlock.h.blob differ
index 2276a3bb940de299ec1ed314cea3e6c76eaa3e08..b229c036389cadd4043cccb2189f2d23e9b59516 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@thread-shared-types.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@thread-shared-types.h.blob differ
index 50b0ed01782c61651dc90496307fa835d73ab1fe..d2447a7074a58bac1b5e7eea3bab28a848ebb268 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time64.h.blob differ
index 8ade9085751b4364048b060f2661f4e2a6e67752..649e1d9ca2090c3d82722ff15d652c774c53ae63 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@timesize.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@timesize.h.blob differ
index 80141a71c38a5ac527e7ba2689579a018c30bf41..1257145e83312036ddf6e594dd2736af4136011e 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types.h.blob differ
index 5a3bb1c671367620c45326e11c1f7aace0d5dae7..6914df7fd0a347a733c51d04dfd76b0fb15b6c45 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@FILE.h.blob differ
index be64c041277013a484d25be05c5d05482a50ce0c..5a3fe5d8ea880e11ff33d55171c83e114c467f64 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__FILE.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__FILE.h.blob differ
index 482f05989251a2b24a2dd55769db108164f9eefd..23265896ffcfcaf6b63751ce7e7d8fb6204fb015 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos64_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos64_t.h.blob differ
index 563cba8acd07d3430ca8ff5e37b0182d578aafb9..9efadc602f60e58bb264964a54d49137cef985d0 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__fpos_t.h.blob differ
index fcab531b7e173d90ba408be56ce3f248381db287..9b7f128eccf2b43e8d593b6aaa7f3fb0b26a8e24 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__locale_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__locale_t.h.blob differ
index 65988feb6736375633cec6e8cb9c48462ae7c948..84431d791581b7dd25dbf1e351883e79f1cbc4a6 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__mbstate_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__mbstate_t.h.blob differ
index d4abd4a4d25e09fd813b00c109a50bdc1bce99c4..0cbe580a59af68c7ac25c458fc5a22695f0522b4 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__sigset_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@__sigset_t.h.blob differ
index 28a3751df6f376178088ab958bac7f1204a7b1e0..12ef7c18f24537a6d51fd5c33cd953316930c180 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clock_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clock_t.h.blob differ
index 6fb9529c7eea36abd15bcf2034608f9ef8cdbc42..ecb54838e59a9fa0ef4da0d606a796a50d9132df 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clockid_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@clockid_t.h.blob differ
index ce5c182e08e765b6939a60038aeb71849cd5e8c5..2365a2530755b6bf20022ca37083d93869c7ce06 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@locale_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@locale_t.h.blob differ
index 14f9b4f0feca2fd211aee01d747b396a4300a8a7..f2c7051d0927ec1637dc2ee7279f8018df62c0d0 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@sigset_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@sigset_t.h.blob differ
index be80bf813a2919cf9be61e42a92dff4d689d397a..46b01758961775d5e4af745b72dbdb81f8b70f91 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_FILE.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_FILE.h.blob differ
index eb0337601c9c1cef62b2c906f32fa2d5fa0c613a..e2406288f70cfb34c84e9d5e88af5dafea8841f9 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timespec.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timespec.h.blob differ
index de5ad2b15460c9fb86e3bb0b859932e00c383b68..e5101a6da0f61fd9b8317e52fb24f50da8f061ad 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timeval.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_timeval.h.blob differ
index 4efdcf08901e0165f953ef2c449c01f498fd84e6..3e8387ced2279196eb3b542f3219956cc8a95bb2 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@time_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@time_t.h.blob differ
index 15f819959be03e4799aace56b17026544fc7b622..3f5af81068937f71cdc6f5113d6d126eaca797ae 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@timer_t.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@timer_t.h.blob differ
index 84ac1fca346ee360837cdf2ae1af1afc757b8f32..a0774de8dd52bc046f18a293827eaca7309e9e49 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@typesizes.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@typesizes.h.blob differ
index 54b2159abd80f89bf293a340aa0a0390d8cba5db..f65d59741baeecf67d3b80d1eb34bffad06295dc 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@uintn-identity.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@uintn-identity.h.blob differ
index 9f14f3a451e85401d485c04a87a0f08789289807..57d797779b3a577e26f39fc3ab0a0d4e5936cd3e 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitflags.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitflags.h.blob differ
index 5bd4035d434970d120d82bdb2b99008613e0143c..d9912f63dc18a28577c74da9c7094d662b749076 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitstatus.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@waitstatus.h.blob differ
index fc978a6ffba553e6d8cd73dccb85aec159536310..544187e910efd9e86d0fbe7da403c07b6f8bf6e7 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@wordsize.h.blob differ
index 8da2d98e4d699e3d6c68c9c424d37148d12101bd..69d8b6455c6d5ed2160432c55fe77e911b74a473 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@endian.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@endian.h.blob differ
index 5a61925eef691a41d868392af862afe47faf49e0..0ce1f02b0efccd94cd713751a84945b465097965 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features-time64.h.blob differ
index c2942a4fedf0b584627b714549cb4b0a52880986..99fd8e8af5176a9037d7e76312e08b5b1172b0d6 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@features.h.blob differ
index c73356661d13c7a84616e2fef9c75ce465a817cf..223df5f99b23da77aba4a97de4d7ed06bec41c85 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs-64.h.blob differ
index 1cd7b8dc2d8a11f0e1bafa2e7c13a44e358c5694..08db844879ecf25bdb19c5736ee52c5b9c39252b 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@gnu@stubs.h.blob differ
index bddb0b58385fc8eba96598c0c09953af190a984a..1b803e5695215343a0cda5e2ee1e3effa80ce317 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdc-predef.h.blob differ
index 88a88c1a441eccff981a03b978237cd27d8cde8e..0f736953824754d2c2586775bfc2131f3bc749f7 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdio.h.blob differ
index aac09a2c05981eb2a6fb76bfa1d998ec007e1a9c..1c06855b3bb7f166554956c10724cc6225877260 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdlib.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@stdlib.h.blob differ
index 7a245688d3b0a983c3be1191f759a0a34a1ff62e..2ec97abacae3c4553cfaf8cded830e07e15fb1d3 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@string.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@string.h.blob differ
index 6186c271ead815412720a19809d84b619fe0f01d..655dfdc13a2b4a1ffa256b7c8069f7954a0b118a 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@strings.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@strings.h.blob differ
index 7787875beb26ebd40e6b58652c9d55efb549ac01..ef37d3082b7eb845482c9f7f14b8c610057b5d0c 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@cdefs.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@cdefs.h.blob differ
index 6a58d20d53fe289711b6e7b024e6057e69123a34..a81d1d013ad421389726fd8b327df325dfc1cfd6 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@select.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@select.h.blob differ
index 1419156500536f5053e215954925598eb4c2c985..679bb41165dbb02631dcbecb305c4fe2f6d2f244 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@types.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@sys@types.h.blob differ
index 8f0232967c6a8314307112b0e59a067f502161c0..516cb04a5ba9b6c256adefda1e35aa4b3430dc1e 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stdarg.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stdarg.h.blob differ
index 0d5f410f71b9a95c57dd1f65e4c7e64eb8ad67cd..f4110f0c904ecf1b2bffe564c45151854259d404 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stddef.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@lib@clang@14.0.6@include@stddef.h.blob differ
index 4fbcfb9b7850a1f884e9c2561761b6b69a890952..b35d72113cc1d6f8760bd1c81093f069e748f403 100644 (file)
@@ -1,14 +1,12 @@
 #include "odot.h"
 
-void add(struct task t, FILE *fp){
-                    printf("\talloc\n");
-    char *line = malloc(MAXLINE*sizeof(char));
-                    printf("\tfopen\n");
-    FILE *buf = fopen("/home/huck/.local/state/odot/odot.txt", "w+");
+void add(struct task t){
+    char *line = malloc(MAXLINE*sizeof(char));  printf("\talloc\n");
+    FILE *fp = fopen("/home/huck/.local/state/odot/todo.txt", "r");
+    FILE *buf = fopen("/home/huck/.local/state/odot/odot.txt", "w+");   printf("\tfopen\n");
     int i = 0;
     
-                    printf("\tNULLcheck\n");
-    if (fgets(line,MAXLINE,fp) == NULL){
+    if (fgets(line,MAXLINE,fp) == NULL){        printf("\tNULLcheck\n");
         puttask(t,buf);
     } else {
                         printf("\tloopstart\n");
@@ -22,16 +20,16 @@ void add(struct task t, FILE *fp){
                     if (check() == 0){
                         break;
                     } else {
-                        puttask(gettask(line), buf);
+                        puttask(*gettask(line), buf);
                         break;
                     }
                 case 1:
-                    dialogue("Already on list in a different group", gettask(line).group, YELLOW);
+                    dialogue("Already on list in a different group", gettask(line)->group, YELLOW);
                     if (check() == 0){
                         puttask(t,buf);
                         i++;
                     }
-                    puttask(gettask(line), buf);
+                    puttask(*gettask(line), buf);
                     break;
                 default:
                     /* first time t.task is lexigraphically greater than a previous task */
@@ -39,7 +37,7 @@ void add(struct task t, FILE *fp){
                         puttask(t,buf);
                         ++i;
                     }
-                    puttask(gettask(line), buf);
+                    puttask(*gettask(line), buf);
                     break;
             }
         }
@@ -47,9 +45,7 @@ void add(struct task t, FILE *fp){
 
     fclose(fp);
     fclose(buf);
-    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);
@@ -57,8 +53,9 @@ void add(struct task t, FILE *fp){
 }
 
 
-void rem(struct task t, FILE *fp){
+void rem(struct task t){
     char *s = malloc(MAXLINE * sizeof(char));
+    FILE *fp = fopen("/home/huck/.local/state/odot/todo.txt", "r");
     FILE *buf = fopen("/home/huck/.local/state/odot/odot.txt", "w+");
     int i = 0;
 
@@ -73,37 +70,31 @@ void rem(struct task t, FILE *fp){
 
     fclose(fp);
     fclose(buf);
-
     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);
         printf("Add to list?");
         if(check() == 0){
-            add(t,fp);
+            add(t);
         }
     }
-    free(s);
-
 }
 
-void show(char *group, FILE *fp){
+void show(char *group){
     char *task = malloc(MAXLINE * sizeof(char));
+    FILE *f = fopen("/home/huck/.local/state/odot/todo.txt", "r");
     struct task tmp;
 
                 printf("\twhileloop\n");
                 int j = 0;
-
-    while ((fgets(task, MAXLINE, fp)) != NULL ){
-                printf("\t%i-nloop\n", ++j);
-            tmp = gettask(task);
+    while ((fgets(task, MAXLINE, f)) != NULL ){
+            tmp = *gettask(task);        printf("\t%i-nloop\n", ++j);
         if (strcmp(group, "all") == 0 || strcmp(tmp.group, group) == 0){
             formattask(tmp);
         }
     }
-    free(task);
+    fclose(f);
 }
 
index 3d1f47fff9c181a3fe5cacd6a080fcba6cf684e1..10974b9844f538ce3d5a2b06f7878b5d670f056e 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/file.c.blob and b/.ccls-cache/@home@huck@.repos@odot/file.c.blob differ
index 4d39442b6fe2e0a2ae11776d4bb679ceb228e89d..39070dd2880264fd79574b2fcb11692363cad2c3 100644 (file)
@@ -2,11 +2,11 @@
 
 struct task getnote(int n, char *arg[], char *group){
     char *note = malloc(MAXLINE * sizeof(char));
-    struct task tmp;
+    struct task *tmp;
     
     if (n == 1){
             printf("\t\treturn from note\n");
-        return tmp;
+        return *tmp;
     }
 
 
@@ -22,8 +22,7 @@ struct task getnote(int n, char *arg[], char *group){
     }
                 printf("\t%s %s getnote\n",note,group);
     tmp = maketask(note,group);
-    free(note);
-    return tmp;
+    return *tmp;
 }
 
 /* uses a 3 bit number to represent options
@@ -53,27 +52,30 @@ short getopt(int n, char *arg[]){
 }
 
 
-struct task maketask(char *task, char *group){
+struct task *maketask(char *task, char *group){
             printf("\tmaketask\n");
-    struct task tmp;
+    struct task *tmp;
     
-    tmp.task = malloc(strlen(task) * sizeof(char));
-    tmp.group = malloc(strlen(group) * sizeof(char));
+    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);
+    strcpy(tmp->task,task);
+    strcpy(tmp->group,(strcmp(tmp->group,"") == 0) ? "all" : group);
 
-            printf("\t%s-task %s-group\n",tmp.task,tmp.group);
+            printf("\t%s-task %s-group\n",tmp->task,tmp->group);
 
     return tmp;
 }
 
 
-struct task gettask(char *c){
-            printf("\tgettask\n");
-    struct task tmp;
-     
-    sscanf(c,"%s\t%s",tmp.task,tmp.group);
+struct task *gettask(char *c){
+    char *task, *group;
+    task = malloc(strlen(c) * sizeof(char));
+    group = malloc(strlen(c) * sizeof(char));
+
+    sscanf(c,"%s\t%s",task,group);
+    
+    struct task *tmp = maketask(task,group);
 
     return tmp;
 }
index a84d4ccf764a90d6d7d623fa6987359de9133c29..73f17da1ea824a9e614a6e931bb7880595f4868c 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/input.c.blob and b/.ccls-cache/@home@huck@.repos@odot/input.c.blob differ
index e498acf1b90a5d214b616d41b88aba4ffdedc692..ddb72050433e88d906bb9adb78532458cbe851ed 100644 (file)
@@ -1,80 +1,88 @@
-#include "odot.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-int main(int argc, char *argv[]){
-                printf("\tstart\n");
-    struct task note;
-    short opt;
-    FILE *fp;
-    char *group = malloc(MAXLINE*sizeof(char));
-
-                printf("\tfopen\n");
-    fp = fopen("/home/huck/.local/state/odot/todo.txt", "w+");
-    if (!fp){
-        error(1);
-    }
+#define MAXLINE 500
+#define LIST    "/home/huck/.local/state/odot/todo.txt"
+#define DONE    "/home/huck/.local/state/odot/done.txt"
+#define TMP    "/home/huck/.local/state/odot/odot.txt"
 
-                printf("\tgetopt\n");
-    opt = getopt(argc, argv);
+int getopt(int, char **);
+char *getnote(int, char **);
 
-                printf("\tgetnote\n");
-    note = getnote(argc, argv, group);
+void addnote(char *);
+void show();
 
-    if (opt >= 4){
-                printf("\trem\n");
-        rem(note, fp);
-    } else if (opt >= 2){
-                printf("\tadd\n");
-        add(note, fp);
-    }
+int main(int argc, char *argv[]){
 
-    if (opt % 2 != 0){
-                printf("\tshow\n");
-        show(group, fp); 
+    if (argc == 1){
+        show();
+    } else {
+        addnote(getnote(argc,argv));
     }
-                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.txt");
-            break;
-        case 2:
-            fprintf(stderr,"ERROR: CANT ADD AND REMOVE SAME TASK\n");
-            break;
+char *getnote(int n, char *arg[]){
+    char *s = malloc(MAXLINE * sizeof(char));
+    while (--n > 0){
+        strcat(s,*++arg);
+        strcat(s,(n > 1) ? " " : "\n");
     }
-    exit(err);
+    return s;
 }
 
-void dialogue(char *m1, char *m2, int c){
-    printf("\033[1;3%im%s\033[0m: %s\n", c, m1, m2);
+void addnote(char *note){
+    int i = 0;
+    char *buf = malloc(MAXLINE * sizeof(char));
+
+    FILE *fp = fopen(LIST,"r");
+    FILE *fdone = fopen(DONE,"a");
+    FILE *tmp = fopen(TMP,"w");
+    if(!fp || !tmp || !fdone)
+        exit(1);
+
+    while(fgets(buf, MAXLINE, fp)){
+        if (strcmp(note,buf) > 0){
+            fputs(buf,tmp);
+        } else if (strcmp(note,buf) == 0){
+            fputs(note,fdone);
+            printf("Removed from list: %s", note);
+            i++;
+        } else if (strcmp(note,buf) < 0){
+            if (i == 0){
+                fputs(note,tmp);
+                printf("Added to list: %s", note);
+                i++;
+            }
+            fputs(buf,tmp);
+        }
+    }
+    if (i == 0){
+        fputs(note,tmp);
+        printf("Added to list: %s", note);
+    }
+
+    fclose(tmp);
+    fclose(fp);
+    fclose(fdone);
+    free(buf);
+    remove(LIST);
+    rename(TMP,LIST);
     return;
 }
 
-void formattask(struct task t){
-    printf("* %s\t%s\n", t.task, t.group);
-}
+void show(void){
+    FILE *fp = fopen(LIST,"r");
+    char *buf = malloc(MAXLINE * sizeof(char));
 
-    /* Returns:
-        0 - Nothing matches
-        1 - Task matches
-        2 - Group matches
-        3 - Both match
-    */
-int listcheck(struct task t, char *c){
-    int i;
-    i += (strcmp(t.task,gettask(c).task) == 0) ? 1 : 0;
-    i += (strcmp(t.group,gettask(c).group) == 0) ? 2 : 0;
-    return i;
-}
+    printf("\033[36;1mTODO\033[0m:\n");
+    while(fgets(buf,MAXLINE,fp)){
+       printf("    \033[35;1m*\033[0m %s", buf);
+    }
 
-/* returns 0 for yes and 1 for no */
-int check(void){
-    printf("Continue? [y/n] (y):");
-    if (((char) getchar()) == 'n')
-        return 1;
-    return 0;
+    free(buf);
+    fclose(fp);
+    return;
 }
+
index ecc8316389674dc4b3eb6eb404078fbfff8e5d16..4049b12dec5f26600a0bffb9874659fe27f788a4 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/main.c.blob and b/.ccls-cache/@home@huck@.repos@odot/main.c.blob differ
index 1cd5ff272fd5d2524e0fd6be8717a24550e7d197..27623c955cf5603ce64b51d479e86cf0e78f1bbb 100644 (file)
@@ -16,9 +16,9 @@ struct task {
 struct task getnote(int, char *[], char *);
 short getopt(int, char *[]);
 
-void add(struct task, FILE *);
-void rem(struct task, FILE *);
-void show(char *group, FILE *);
+void add(struct task);
+void rem(struct task);
+void show(char *group);
 
 int listcheck(struct task, char *);
 int geturgency(int);
@@ -29,8 +29,8 @@ void formattask(struct task t);
 void error(int);
 int check(void);
 
-struct task maketask(char *, char *);
+struct task *maketask(char *, char *);
 void puttask(struct task n, FILE*);
-struct task gettask(char *);
+struct task *gettask(char *);
 
 enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE};
index bbbd5b8036bf2bfa2dbc0a8f52fe01e66ab5c715..538f23e7034ac963691e4bd2b4efaf9e550c8e9d 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/odot.h.blob and b/.ccls-cache/@home@huck@.repos@odot/odot.h.blob differ
diff --git a/Makefile b/Makefile
deleted file mode 100644 (file)
index 6ced421..0000000
--- a/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-SHELL = /bin/zsh
-PROG = odot
-PREFIX ?= /usr/local/bin
-ODOT = /home/huck/.local/share/odot
-TODOLIST = $(ODOT)/todo
-
-install : main.c input.c file.c 
-       [[ ! -d $(TODOLIST) ]] && mkdir -p $(ODOT)
-       gcc *.c -o '$(PREFIX)/$(PROG)'
-
-header : odot.h
-       gcc *.h
-
-clean : 
-       rm *.gch
-       rm "$(PREFIX)/$(PROG)"
-
diff --git a/dialogue.c b/dialogue.c
deleted file mode 100644 (file)
index 7e7fdc6..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "odot.h"
-
-
diff --git a/file.c b/file.c
deleted file mode 100644 (file)
index 4fbcfb9..0000000
--- a/file.c
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "odot.h"
-
-void add(struct task t, FILE *fp){
-                    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("\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;
-                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;
-            }
-        }
-    }
-
-    fclose(fp);
-    fclose(buf);
-    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("/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,"\t"),buf);
-        } else {
-            i++;
-        }
-    }
-
-    fclose(fp);
-    fclose(buf);
-
-    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);
-        printf("Add to list?");
-        if(check() == 0){
-            add(t,fp);
-        }
-    }
-    free(s);
-
-}
-
-void show(char *group, FILE *fp){
-    char *task = malloc(MAXLINE * sizeof(char));
-    struct task tmp;
-
-                printf("\twhileloop\n");
-                int j = 0;
-
-    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(task);
-}
-
diff --git a/input.c b/input.c
deleted file mode 100644 (file)
index 4d39442..0000000
--- a/input.c
+++ /dev/null
@@ -1,84 +0,0 @@
-#include "odot.h"
-
-struct task getnote(int n, char *arg[], char *group){
-    char *note = malloc(MAXLINE * sizeof(char));
-    struct task tmp;
-    
-    if (n == 1){
-            printf("\t\treturn from note\n");
-        return tmp;
-    }
-
-
-    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));
-            n--;
-        }
-    }
-                printf("\t%s %s getnote\n",note,group);
-    tmp = maketask(note,group);
-    free(note);
-    return tmp;
-}
-
-/* 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[]){
-    short options;
-    
-                printf("\treturn1\n");
-    /* show list if no arguments given */
-    if (n == 1)
-        return 1;
-    
-                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("\t%i-optcode\n", options);
-    if ((options - 5) > 0)
-        error(2);
-    return options;
-}
-
-
-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);
-
-            printf("\t%s-task %s-group\n",tmp.task,tmp.group);
-
-    return tmp;
-}
-
-
-struct task gettask(char *c){
-            printf("\tgettask\n");
-    struct task tmp;
-     
-    sscanf(c,"%s\t%s",tmp.task,tmp.group);
-
-    return tmp;
-}
-
-void puttask(struct task t, FILE *fp){
-            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 e498acf1b90a5d214b616d41b88aba4ffdedc692..ddb72050433e88d906bb9adb78532458cbe851ed 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,80 +1,88 @@
-#include "odot.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
-int main(int argc, char *argv[]){
-                printf("\tstart\n");
-    struct task note;
-    short opt;
-    FILE *fp;
-    char *group = malloc(MAXLINE*sizeof(char));
-
-                printf("\tfopen\n");
-    fp = fopen("/home/huck/.local/state/odot/todo.txt", "w+");
-    if (!fp){
-        error(1);
-    }
+#define MAXLINE 500
+#define LIST    "/home/huck/.local/state/odot/todo.txt"
+#define DONE    "/home/huck/.local/state/odot/done.txt"
+#define TMP    "/home/huck/.local/state/odot/odot.txt"
 
-                printf("\tgetopt\n");
-    opt = getopt(argc, argv);
+int getopt(int, char **);
+char *getnote(int, char **);
 
-                printf("\tgetnote\n");
-    note = getnote(argc, argv, group);
+void addnote(char *);
+void show();
 
-    if (opt >= 4){
-                printf("\trem\n");
-        rem(note, fp);
-    } else if (opt >= 2){
-                printf("\tadd\n");
-        add(note, fp);
-    }
+int main(int argc, char *argv[]){
 
-    if (opt % 2 != 0){
-                printf("\tshow\n");
-        show(group, fp); 
+    if (argc == 1){
+        show();
+    } else {
+        addnote(getnote(argc,argv));
     }
-                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.txt");
-            break;
-        case 2:
-            fprintf(stderr,"ERROR: CANT ADD AND REMOVE SAME TASK\n");
-            break;
+char *getnote(int n, char *arg[]){
+    char *s = malloc(MAXLINE * sizeof(char));
+    while (--n > 0){
+        strcat(s,*++arg);
+        strcat(s,(n > 1) ? " " : "\n");
     }
-    exit(err);
+    return s;
 }
 
-void dialogue(char *m1, char *m2, int c){
-    printf("\033[1;3%im%s\033[0m: %s\n", c, m1, m2);
+void addnote(char *note){
+    int i = 0;
+    char *buf = malloc(MAXLINE * sizeof(char));
+
+    FILE *fp = fopen(LIST,"r");
+    FILE *fdone = fopen(DONE,"a");
+    FILE *tmp = fopen(TMP,"w");
+    if(!fp || !tmp || !fdone)
+        exit(1);
+
+    while(fgets(buf, MAXLINE, fp)){
+        if (strcmp(note,buf) > 0){
+            fputs(buf,tmp);
+        } else if (strcmp(note,buf) == 0){
+            fputs(note,fdone);
+            printf("Removed from list: %s", note);
+            i++;
+        } else if (strcmp(note,buf) < 0){
+            if (i == 0){
+                fputs(note,tmp);
+                printf("Added to list: %s", note);
+                i++;
+            }
+            fputs(buf,tmp);
+        }
+    }
+    if (i == 0){
+        fputs(note,tmp);
+        printf("Added to list: %s", note);
+    }
+
+    fclose(tmp);
+    fclose(fp);
+    fclose(fdone);
+    free(buf);
+    remove(LIST);
+    rename(TMP,LIST);
     return;
 }
 
-void formattask(struct task t){
-    printf("* %s\t%s\n", t.task, t.group);
-}
+void show(void){
+    FILE *fp = fopen(LIST,"r");
+    char *buf = malloc(MAXLINE * sizeof(char));
 
-    /* Returns:
-        0 - Nothing matches
-        1 - Task matches
-        2 - Group matches
-        3 - Both match
-    */
-int listcheck(struct task t, char *c){
-    int i;
-    i += (strcmp(t.task,gettask(c).task) == 0) ? 1 : 0;
-    i += (strcmp(t.group,gettask(c).group) == 0) ? 2 : 0;
-    return i;
-}
+    printf("\033[36;1mTODO\033[0m:\n");
+    while(fgets(buf,MAXLINE,fp)){
+       printf("    \033[35;1m*\033[0m %s", buf);
+    }
 
-/* returns 0 for yes and 1 for no */
-int check(void){
-    printf("Continue? [y/n] (y):");
-    if (((char) getchar()) == 'n')
-        return 1;
-    return 0;
+    free(buf);
+    fclose(fp);
+    return;
 }
+
diff --git a/odot b/odot
index f13d2281af9e0bc113ccc70ba193c8e28596de48..2ef5f6aa3c2cdba0a7a6085ca2be2c9660147e57 100755 (executable)
Binary files a/odot and b/odot differ
diff --git a/odot.h b/odot.h
deleted file mode 100644 (file)
index 1cd5ff2..0000000
--- a/odot.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#define TODOLIST "/home/huck/.local/state/odot/todo"
-
-#define MAXLINE 1000
-#define TIME "%H:%M %m-%d-%y"
-
-struct task {
-    char *task;
-    char *group;
-};
-
-struct task getnote(int, char *[], char *);
-short getopt(int, char *[]);
-
-void add(struct task, FILE *);
-void rem(struct task, FILE *);
-void show(char *group, FILE *);
-
-int listcheck(struct task, char *);
-int geturgency(int);
-char *gettime(void);
-
-void dialogue(char *, char *, int);
-void formattask(struct task t);
-void error(int);
-int check(void);
-
-struct task maketask(char *, char *);
-void puttask(struct task n, FILE*);
-struct task gettask(char *);
-
-enum color {BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE};
diff --git a/test b/test
deleted file mode 100755 (executable)
index e05525d..0000000
Binary files a/test and /dev/null differ