]> git.huck.website - odot.git/commitdiff
Wed Nov 16 12:00:08 AM CST 2022 automatic backup
authorHuck Boles <huboles@protonmail.com>
Wed, 16 Nov 2022 06:00:08 +0000 (00:00 -0600)
committerHuck Boles <huboles@protonmail.com>
Wed, 16 Nov 2022 06:00:08 +0000 (00:00 -0600)
86 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@time.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_itimerspec.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@struct_tm.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@ctype.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@include@time.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/dialogue.c
.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob
.ccls-cache/@home@huck@.repos@odot/file.c
.ccls-cache/@home@huck@.repos@odot/file.c.blob
.ccls-cache/@home@huck@.repos@odot/func.c
.ccls-cache/@home@huck@.repos@odot/func.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
.ccls-cache/@home@huck@.repos@odot/test.c [new file with mode: 0644]
.ccls-cache/@home@huck@.repos@odot/test.c.blob [new file with mode: 0644]
Makefile
dialogue.c
file.c
func.c [deleted file]
input.c
main.c
odot [new file with mode: 0755]
odot.h
structure.c [deleted file]
test [new file with mode: 0755]

index cdd724622ef21737db88a7fca011a19ed06728ba..1def0cad93b1d3d4246c33aa8f09f44d7b6e80bd 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 c5182e2917b706c2f98234656978f0d35b7ea0f6..ace0daf8c35a8730420c421d1b58c901f6f190dc 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 0fd40ab904753bde210d34144ecc71c8cabfd5e1..c26ab6d101d0d6e1bf26d96cb5c8e30f94c66b6a 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 86c20b1b81e588a33076309eb09bec6d0144c12e..43b34225abd0a9a1cac449c782102e34a7fb8a60 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 22d90e1cfbd59cf1896df54f6e0d85988a795e9b..c78f2d9b284f89be3470e9c72394efd084829f9c 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 cd467e7d8d1e6e6895dcec8477d5db83c46097d7..77f1cf8106be700614fd21ba1beaa025f5b92ba2 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 c251ccda151c752747602cd96a3537d3b769e88d..514dc757d6d676cce8e95147bb4d34652147b169 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 b31f8cc06e45605d17d95ac179f730359c2fc886..c07a751fa0e65afcd394953bc59e49a8f343e0dd 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 e0febfafe261eb8c5a3d5546ab0ed0518d581df1..af735102bd98ab97840417872b01c7c39380d86f 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 f2697e178c4031869de66ef1574dbe69d1d9bc3f..5bcf91e62262ebeb05b6bcec73d21c58f2572fc8 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 6bd04ef73232f705a543c97c09c60e95beb2e736..2a8cef8fbf7754b6e5a80425cfced914aa07acff 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 ff08d561b050b16850e5a56b4901d6b8fdc5b3ad..8dc32db03e09b3e0e3410f44c45da5ab9719560e 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 51ab57bc35bb4b825c70279c1feec542adc4d908..0e6e59de5f0fe940dc550aa3ffc96512707bd8f9 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 c27d24bc86023fc6724081fd273fca2b73405c80..bbfabde44c178eb4069754b7bc61cca3868c3052 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 11b7544d38f9d14a97d809055cf4f3ce5b3a58f6..cf0a36a5c54093e57990dfca74f3b5cfcf65b5c0 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 339a19bfdca76dd3912376ba19ecc31f82deadb3..cf04c35e680feb421e1567307dfeb32fde191e0f 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 e7467aa8cd30d128eb875eb3073e55f3ad09e105..9aec1a8f9d8f0907e3998223885c855ac718840c 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 d16ea114727534ba4c7e71deecf1cc3c61ea4daa..2276a3bb940de299ec1ed314cea3e6c76eaa3e08 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 2ddde6da5c3ad731c21b6092e06032e7d533dbad..c17374491f49232184a83fea1f18c4b0fdeb0a80 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@time.h.blob differ
index 4bb5a3a70b09b22e61c71799aa712ff175ae91cf..50b0ed01782c61651dc90496307fa835d73ab1fe 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 e49fc27cce5ae97aa043504064ce9488bef755d8..8ade9085751b4364048b060f2661f4e2a6e67752 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 89b80016864c6670a5f962d35e2fc2b37f09d473..2a97e0c6792c103efdf1f87b945606b64d653ae7 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 ebaf7cfc217b0a5e74ea89d691bc9e9298f628a4..5a3bb1c671367620c45326e11c1f7aace0d5dae7 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 1cac517059529f4d6b16c6a1708b371e62ab8c2d..be64c041277013a484d25be05c5d05482a50ce0c 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 dd989fd947e430513d9014ddc1d1dc0dab290697..482f05989251a2b24a2dd55769db108164f9eefd 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 5e5869e718608bc6bf7ae39de8693e71621d4008..563cba8acd07d3430ca8ff5e37b0182d578aafb9 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 31a43799353899bc5abcc3fee43e6e6dd00f22a4..fcab531b7e173d90ba408be56ce3f248381db287 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 e3cfe5bbbf80a14b66402d0b2817c7b206778785..65988feb6736375633cec6e8cb9c48462ae7c948 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 4efe155b668048615ad8a3ad7cec606e8b851df7..d4abd4a4d25e09fd813b00c109a50bdc1bce99c4 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 fb33c85a8bd1d3735158f478654ce78ee4b90f00..28a3751df6f376178088ab958bac7f1204a7b1e0 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 66dea256e80b0c32070d4c0a3afe3297b4697a70..6fb9529c7eea36abd15bcf2034608f9ef8cdbc42 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 965dd0cd8ff953fef89c662af9bb8540412feac1..ce5c182e08e765b6939a60038aeb71849cd5e8c5 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 613e34b6e7c37cab1741d98c9c1a59d0d66a7e43..14f9b4f0feca2fd211aee01d747b396a4300a8a7 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 a03baf084650a4823cc229fc690c33805ef20cbe..be80bf813a2919cf9be61e42a92dff4d689d397a 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 5475e8f1e0d353261b7fa88b12db6e0b1e7b723b..1c8657cfadf89e0bab802e8705b8ed42e2650f47 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_itimerspec.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_itimerspec.h.blob differ
index 72af6e8e3aeb7585d588199abd9c825b8391567c..eb0337601c9c1cef62b2c906f32fa2d5fa0c613a 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 16276767eb455b87bfc1397b2ac5a5b94d697ad1..de5ad2b15460c9fb86e3bb0b859932e00c383b68 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 45efc3aac9efadf327dd35a2e104d265f487048a..38ec2d104f0f0d66ede83931b880dfba00b73418 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_tm.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@bits@types@struct_tm.h.blob differ
index 8330a3a7ef28582efd600eccbdb1383ad0cfdb17..4efdcf08901e0165f953ef2c449c01f498fd84e6 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 dce1c5443761974b1d86b8a78575cffb8e4cfac2..15f819959be03e4799aace56b17026544fc7b622 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 17aa1e89c3609c04fd15805a83f136b7e4cbc882..84ac1fca346ee360837cdf2ae1af1afc757b8f32 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 4863bc8b9bf12f0655fa19e7303f52439ca63cea..54b2159abd80f89bf293a340aa0a0390d8cba5db 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 4f7a3b7ee09966428b7b9625b3e003aa5ddfebdf..9f14f3a451e85401d485c04a87a0f08789289807 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 299f29995b4d0f5dda118b6ddf7080d7dfd0399e..5bd4035d434970d120d82bdb2b99008613e0143c 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 fa685272fa1972171792453001be2fc93bfe8799..bcbe4f3367d2fda0145507cf6a1fd70a8a8bbc5c 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 a1b995c675d04388363b9f3e3e595eb98a223a89..91092a75305b16bf8e6e1f975a222ba41386ae10 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@ctype.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@ctype.h.blob differ
index 5221da11442a302dd10b170b6585530908cbe5d9..8da2d98e4d699e3d6c68c9c424d37148d12101bd 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 2666fddb37164ad98803e56bc77399a27259b08d..a2c8cf881cc6f6466ed35de0cf5b2dfdc2c6414f 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 bfbae8f2ef01aeceeed5e30b0697d2fd6d3f511b..c2942a4fedf0b584627b714549cb4b0a52880986 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 620f2108720760773ae92c4faa829b281d5e39dc..c73356661d13c7a84616e2fef9c75ce465a817cf 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 f1eef9b40c7d7c20ea6d3589efb2afe9ceaed584..4d6b49e87d49560491e687f7cbaa7f8e8f93f3db 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 305f4ab90b493b77182755e1bbb12da54f6cdb43..b299ad6e50dc1d73c1c58b74cc2802a9f93ef4e6 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 a1526a4e7ca5be6ed9e7bd081df2f8faea2de00d..d8ef87d5de8516970f34ab151b000c0a51f9af2f 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 6fd2401e780aaccca4587d5c9cc2cb5b8a0594d1..aac09a2c05981eb2a6fb76bfa1d998ec007e1a9c 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 134b72824b80b9d3d7ca403adc880f0c2df9b835..7a245688d3b0a983c3be1191f759a0a34a1ff62e 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 4079113c90736d5b6df1f252fc6f377ac44cc048..6186c271ead815412720a19809d84b619fe0f01d 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 7ff0535051c4ad94fc98a9a7a6f8d13d5d71d8aa..7787875beb26ebd40e6b58652c9d55efb549ac01 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 31ab7cde9344b0dbe1772ebff6ef5755b0007731..6a58d20d53fe289711b6e7b024e6057e69123a34 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 765017fb834c856564260360c13ee1f8439d030e..1419156500536f5053e215954925598eb4c2c985 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 76de664a8b1276445f016e5f2f2ac05ac0da5029..ac19188d18798f37b713cc317cb853742293e89b 100644 (file)
Binary files a/.ccls-cache/@@home@huck@.repos@odot/@usr@include@time.h.blob and b/.ccls-cache/@@home@huck@.repos@odot/@usr@include@time.h.blob differ
index def439483caa8dd172dc587a0469fab280297bae..8f0232967c6a8314307112b0e59a067f502161c0 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 bc9faeeae45ff4d8d50512092d2a4fe0b6bc025e..0d5f410f71b9a95c57dd1f65e4c7e64eb8ad67cd 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 bf125b94658f83b46413e34ceff2a7b3e16d6265..7e7fdc65bf739841fbc3b6a39312555780aeea9c 100644 (file)
@@ -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);
-}
 
index 7dffb28a7d0da606bf51954586c01a1e656e9e67..81e389a46c30fa3964de68f9216df11c216882bc 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob and b/.ccls-cache/@home@huck@.repos@odot/dialogue.c.blob differ
index 0d9dc1fcd3afb68d4748347a9051d12012a43c71..2d5b277aa4c81b4aaeff9e408788b5e8206a3033 100644 (file)
@@ -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);
 }
 
index e7c1ccb1550e08b2eeaa2f88d1e76dae42ec0122..6379548e81af1a96113d3e1c900b96ed4a7a847c 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 1991b9e6df4a15c3602b99c2c01aab52715a9e5a..73d6a231a475d3aca910abdebbfddf52c1cbaaf7 100644 (file)
@@ -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;
-}
index 4100071c98b31a5fcf860c386945402367f7e50a..806d62e2a6016aa10ee771174bfc9f922dc6173f 100644 (file)
Binary files a/.ccls-cache/@home@huck@.repos@odot/func.c.blob and b/.ccls-cache/@home@huck@.repos@odot/func.c.blob differ
index 0cc316aa78cb7d322e93486c8b2ffb6c73aa53de..0cb2c50fdce8fe65bee1228eddc35bfa4ecd470a 100644 (file)
@@ -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;
 }
 
index 3ae02cf4b95f0e223a8d1351de4984bcf3098b00..19f6e3c21f194716c55d991d8723341c97f3f018 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 a1134e29feb5eb56a0b7b122a6baf3fc2287abec..9b86cd1c8add3ed3142b12fb6bbaa49ca25a34dc 100644 (file)
@@ -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;
+}
index eaa9588029e6420eb3fb1e2003579e452cfbe936..e10b157d58ad8b30026c94752ab9f0ab52e18939 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 b88180215904110325b878771b7b5c0e8e12d7d7..78c35483c1f0e31e17590d60e9f3be440b89271b 100644 (file)
@@ -3,10 +3,10 @@
 #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"
-#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};
index 54cbfa50ccc19c4afc0f3e61052966ed92d4e893..ee6868639ad80439d6bc0711f4fa7c5697a9d206 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/.ccls-cache/@home@huck@.repos@odot/test.c b/.ccls-cache/@home@huck@.repos@odot/test.c
new file mode 100644 (file)
index 0000000..f1e123c
--- /dev/null
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+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 (file)
index 0000000..a89433e
Binary files /dev/null and b/.ccls-cache/@home@huck@.repos@odot/test.c.blob differ
index 722a5a53faabbf6a7241bc851c78d8201189d8c9..6ced421fd6011431be42dbc474b250f8d769484a 100644 (file)
--- 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 : 
index bf125b94658f83b46413e34ceff2a7b3e16d6265..7e7fdc65bf739841fbc3b6a39312555780aeea9c 100644 (file)
@@ -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 0d9dc1fcd3afb68d4748347a9051d12012a43c71..2d5b277aa4c81b4aaeff9e408788b5e8206a3033 100644 (file)
--- 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 (file)
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 0cc316aa78cb7d322e93486c8b2ffb6c73aa53de..0cb2c50fdce8fe65bee1228eddc35bfa4ecd470a 100644 (file)
--- 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 a1134e29feb5eb56a0b7b122a6baf3fc2287abec..9b86cd1c8add3ed3142b12fb6bbaa49ca25a34dc 100644 (file)
--- 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 (executable)
index 0000000..1c93fb8
Binary files /dev/null and b/odot differ
diff --git a/odot.h b/odot.h
index b88180215904110325b878771b7b5c0e8e12d7d7..78c35483c1f0e31e17590d60e9f3be440b89271b 100644 (file)
--- a/odot.h
+++ b/odot.h
@@ -3,10 +3,10 @@
 #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"
-#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 (file)
index 65828eb..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "odot.h"
-
-extern FILE *fp;
-
-
diff --git a/test b/test
new file mode 100755 (executable)
index 0000000..e05525d
Binary files /dev/null and b/test differ