From 9d47d0d2d23f2e2578366c945ab70e5a65d7889e Mon Sep 17 00:00:00 2001 From: klein panic Date: Mon, 24 Feb 2025 15:24:50 -0500 Subject: [PATCH] added another --- todo_app/LICENSE | 674 ++++++++++++++++++++++++++++++++++++++++ todo_app/README.md | 4 + todo_app/build/Makefile | 30 ++ todo_app/build/todo | Bin 0 -> 40720 bytes todo_app/data/tasks.txt | 1 + todo_app/include/todo.h | 106 +++++++ todo_app/obj/main.o | Bin 0 -> 16704 bytes todo_app/obj/task.o | Bin 0 -> 35960 bytes todo_app/src/main.c | 82 +++++ todo_app/src/main.c.bak | 87 ++++++ todo_app/src/task.c | 405 ++++++++++++++++++++++++ todo_app/src/task.c.bak | 317 +++++++++++++++++++ 12 files changed, 1706 insertions(+) create mode 100644 todo_app/LICENSE create mode 100644 todo_app/README.md create mode 100644 todo_app/build/Makefile create mode 100755 todo_app/build/todo create mode 100644 todo_app/data/tasks.txt create mode 100644 todo_app/include/todo.h create mode 100644 todo_app/obj/main.o create mode 100644 todo_app/obj/task.o create mode 100644 todo_app/src/main.c create mode 100644 todo_app/src/main.c.bak create mode 100644 todo_app/src/task.c create mode 100644 todo_app/src/task.c.bak diff --git a/todo_app/LICENSE b/todo_app/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/todo_app/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/todo_app/README.md b/todo_app/README.md new file mode 100644 index 0000000..15a2d51 --- /dev/null +++ b/todo_app/README.md @@ -0,0 +1,4 @@ +# Todo application + +## overview +Archived, and moved to todo_task_manager. Simplier functionality, still works, does not have install script or support undo functions, reoccuring tasks, or searching very well. diff --git a/todo_app/build/Makefile b/todo_app/build/Makefile new file mode 100644 index 0000000..8c4aa9b --- /dev/null +++ b/todo_app/build/Makefile @@ -0,0 +1,30 @@ +CC = gcc +CFLAGS = -Wall -g +OBJDIR = ../obj +SRCDIR = ../src +INCDIR = ../include +BUILDDIR = . +BINDIR = . + +OBJS = $(OBJDIR)/main.o $(OBJDIR)/task.o +EXEC = $(BINDIR)/todo + +all: $(EXEC) + +$(EXEC): $(OBJS) + $(CC) $(CFLAGS) -o $@ $^ -lncurses + +$(OBJDIR)/%.o: $(SRCDIR)/%.c + $(CC) $(CFLAGS) -I $(INCDIR) -c $< -o $@ + +install: $(EXEC) + @echo "Installing $(EXEC) to /usr/local/bin/todo..." + @cp $(EXEC) /usr/local/bin/todo + @echo "Installation complete." + +clean: + @echo "Cleaning up build artifacts..." + rm -f $(OBJDIR)/*.o $(EXEC) + @echo "Clean complete." + +.PHONY: all clean install diff --git a/todo_app/build/todo b/todo_app/build/todo new file mode 100755 index 0000000000000000000000000000000000000000..6494221a1c9c7ed60c67e917146f66630f6d4ba0 GIT binary patch literal 40720 zcmb<-^>JfjWMqH=W(GS35O0AHM8p9?FI51c+@G>|ss4}Q9urV+&uztCg0KbDTy$Ciq=$il0Y;U^K`M zkWlc`k`xdd-5wYpW)F;p*%tuSH^CKT3IhW={RAS+0HZ;6fP?~{mZX5f1;i!>!=gC| zY9Fq62!Mtoj0VLw$b9{r%p@}t{hSotoXot^3f&3|GhH(iz2ba5Bak#W&4cU!r73s6 zPzI(3h65nC!t{gKA`A@RbPkgLpr)z(+n23YMdjPeXTP|QeSH!o4N?O#1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0JRY0Mo`$n^n(^4g3QeXowI`Ef7rQ6FdBAF5=bowgUkTYFkHyMzyLav2xdR*93mJE zI_nUm7Uq7KIv5Q)l>>Cf5sVKz=LklFwn&5YgWL~_8kqY*Vj$cLTB?TRe)u^{pg>_@ zfS?JN=|R`O5Imm9zyOj58v#9khyhB& z&VvHWLEQ>tgJ{rMj-W7w=~sa2gVCUKGePQL7%B}jo&hxeiL8GDw6g)DVeWj34Wbf8PXQ%5h!B`Ww;yzt zCTMXUOc`u^dV?=mIph#82op@g^uuV-@G(C$4}uiH&NZQ(u9Oz`d~sljF5w?VD`ht|D2%u89HGq zAvAh|>Wt`@W-4qXhS)E88+GcYjdp=Drn zwf<1|qlaI07046@27g$>gK#mzFA9hLQ;iS}RcIE%xX3gt??ZGzNDt6iRG{)7>VD9k zKTuf=OFy8p9HbH?4NE&9J`7ucDi#I?1|1ykhp7`pO1m&I5S;?ufe2bw3*y5t%-t|P E0EJu85&!@I literal 0 HcmV?d00001 diff --git a/todo_app/data/tasks.txt b/todo_app/data/tasks.txt new file mode 100644 index 0000000..54bdf3e --- /dev/null +++ b/todo_app/data/tasks.txt @@ -0,0 +1 @@ +1 Test Test Cat 1 0 2024-09-13 diff --git a/todo_app/include/todo.h b/todo_app/include/todo.h new file mode 100644 index 0000000..fbf877c --- /dev/null +++ b/todo_app/include/todo.h @@ -0,0 +1,106 @@ +#ifndef TODO_H +#define TODO_H + +#include +#include +#include +#include +#include +#include + +// Define necessary constants +#define MAX_TASKS 100 +#define MAX_TITLE_LEN 256 +#define MAX_CATEGORY_LEN 50 +#define MAX_DATE_LEN 12 // Adjusted to fit YYYY-MM-DD format with null terminator +#define MAX_RECURRENCE_LEN 10 // Define MAX_RECURRENCE_LEN for recurrence string length +#define LOCAL_FILE_PATH ".local/share/todo/tasks.txt" +#define NO_DUE_DATE "N/A" // Custom marker for no due date + +// Function to get the database path, either global or local +static char *get_database_path() { + static char file_path[512]; // To store the resolved path + + // Check if the program is running from a global location by checking if /usr/local/bin/todo exists + if (access("/usr/local/bin/todo", F_OK) == 0) { + // Use global path, ensure ~/.local/share/todo/tasks.txt exists + char *home = getenv("HOME"); + snprintf(file_path, sizeof(file_path), "%s/%s", home, LOCAL_FILE_PATH); + + // Ensure the directory exists, create it if not + char dir_path[512]; + snprintf(dir_path, sizeof(dir_path), "%s/.local/share/todo", home); + if (access(dir_path, F_OK) != 0) { + mkdir(dir_path, 0755); // Create the directory with appropriate permissions + } + + // Check if the tasks.txt file exists, create if not + if (access(file_path, F_OK) != 0) { + int fd = open(file_path, O_CREAT | O_RDWR, 0644); // Create file with read/write for owner, read for others + if (fd != -1) { + close(fd); // Close the file after creating it + } + } + } else { + // Local path for users without global installation + snprintf(file_path, sizeof(file_path), "%s/%s", getenv("HOME"), LOCAL_FILE_PATH); + + // Ensure the directory exists, create it if not + char dir_path[512]; + snprintf(dir_path, sizeof(dir_path), "%s/.local/share/todo", getenv("HOME")); + if (access(dir_path, F_OK) != 0) { + mkdir(dir_path, 0755); // Create directory if it doesn't exist + } + + // Create tasks.txt file if it doesn't exist + if (access(file_path, F_OK) != 0) { + int fd = open(file_path, O_CREAT | O_RDWR, 0644); // Create file + if (fd != -1) { + close(fd); // Close file after creating it + } + } + } + + return file_path; +} + +// Task structure definition +typedef struct { + int id; + char title[MAX_TITLE_LEN]; + char category[MAX_CATEGORY_LEN]; + char due_date[MAX_DATE_LEN]; + char recurrence[MAX_RECURRENCE_LEN]; // Recurrence interval (e.g., "daily", "weekly") + int priority; + int completed; +} Task; + +// Function prototypes +void add_task(Task tasks[], int *count, const char *title, const char *category, const char *due_date, const char *recurrence, int priority); +void remove_task(Task tasks[], int *count, int index); // Changed to accept index +void edit_task(Task *task); +void load_tasks(Task tasks[], int *count); +void save_tasks(Task tasks[], int count); +void display_tasks(Task tasks[], int count, int selected); +void search_task(Task tasks[], int count, int *selected_task); + +// Sorting function updated to include boolean for ascending/descending order +void sort_tasks(Task tasks[], int count, char sort_type, bool ascending); + +// Input handling +void get_input(char *buffer, int size, const char *prompt); +void get_input_and_clear(char *buffer, int size, const char *prompt); + +// ncurses management +void init_ncurses(); +void cleanup_ncurses(); + +// Task status manipulation +void toggle_task_completion(Task *task); +void update_task_recurrence(Task *task); + +// Utility functions +int is_task_overdue(Task task); +int is_task_due_soon(Task task); + +#endif diff --git a/todo_app/obj/main.o b/todo_app/obj/main.o new file mode 100644 index 0000000000000000000000000000000000000000..d3b268aad7847b610ad436d003b36e487d3e350a GIT binary patch literal 16704 zcmb<-^>JfjWMqH=Mg}_u1P><4z|dfgU^{@B4h-T9Vho`koliX)-zYFKFzf>fd-Sq` zsm|jsKy>Q?{?@k)3=C+(9-XcqJi1*!_`p;jgey3-kAVqU{SJ^ZV6!~BLqB-*wm$g# z|G!7)MUP%lkPJk1=W!%u5G4@Tz@1Sd0@b?jEh7Vi2UHxQ2<8a5lUo!R85njgVPs&~ z=Y-;Tge{$}Z<=f0{O51^%D}+T?fM34;LB$y>cQ?N&6B8(@#s7RbvJFjTw+MbyMLN% z|NJlE>URAD^(r*RP96p)f#x>~9-Xy6I!nKJbcVj@1}B2vihmy6t}i?~QDT>YfdLVW z9uSqV_yC7jx9gYQfd4R=Zr>jso#)UMc+Btst8x9|!Fb^q0|QJo%x$Q~PJlQPA_xjm zu=6}Rk3szaGrb#}q#(*H57kIQSgi-@_#v$37mS@?trKElz7|083oPpJ8H-`(OKv7m z0{YYZBB1$)GJpGhMh1q?10KC1t)S!$bznCO6UfJ4=Xo$*`2PUnp5B1}5QgO;{=P+w z3=9xn^8u(cU-rSpS`YB|HN$yukG#wW<%Z@r99axLy}TeBVW}178Kk&_ItDY`JerRP zyi{XEj@XytaLYVqcw`<30oen|vL1{VU;+N}BPjQPgA|{t(+E`%BQQg81p@;E|2D8m z{M#--!lCoxt^x)I1`Ne;bq87x@J~I^{DF~w+kxf>j2&R@$H62hC|-xbRU%AGp~ys* z39lI^ASW{n$DyU#G)nNDM^`s>KX>`FW|J;2Csy z9XkU9D+413$YEk2LKZ|If#EHq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)6IVq`0rRnjRd1?6!dJuMEQc_WB8B{G)s3RqUt|$bz6IHjZVycV8)U`Macg8DQ2!g7|0jS3 zjX~pXP=|rqS|BHZ+zQeU^FL@E49I?v7&1NsjgU>qg&r3F+dFA+J^-8jbppuP*X_ydilp+yl$JA(pfvY3H^p&w)cSOh|#al!iovFYCd Nb^lR_HaLl{9{_sLwblRt literal 0 HcmV?d00001 diff --git a/todo_app/obj/task.o b/todo_app/obj/task.o new file mode 100644 index 0000000000000000000000000000000000000000..f7ad89d7871a27d8262bdded46a808660b894c4a GIT binary patch literal 35960 zcmb<-^>JfjWMqH=Mg}_u1P><4!0@9D!FB*M9T>zIL>WRoI-hzpzENOeVAux|_UL5= zQ=P|Ofaul({H<>p7#PrmJvv=Kcyzmd@PVm52v=}u9|IGz`W+x+z-D=Lhko$rZGG_f z|9_9piypnAAQ_12&f`eRAW9&vfjgr_1gdr4TSf*352!dq5zG;AC$}gtGBE5~!pOj| z&k4ox2wOT`-!#|0`On|-m4Shw+w~39z?aWZ)PvnknkP{mTcS4xx|o=cmFik z{`p_R)$RHR>Q!irojeRq0?ls}JUVNCbe4Yc=nQ?)4Ne5T75_ZCU0--~qQou(0|O!$ z!2#6m`lUDEzXwE#;f)6O>yIp^DH-K20hdM9BLL84<*AKX^4;Z>2UdCnL4-Zx|kbRJ3 z>d|=(=A+gFrR+OES?sktC=1|K_W%F?|F0Fm%6cb&jq7%W8H_Ly>UVm&=Z6Q}Js+Sx zz~LTHlIT3q5&EIS^$q_%*ALA%J`o$v|R3Q9-=4y}5 zi@QQVp$CoL*Lj4McoS=uB0;kzK$8Vc&9PAbdNjXD@aU{v;nD570=G&0Epr(e7}EIP zAK=$?1>p<)nywGh_^*M>^c5bxJHRQm*LRCYZ|Dw>Ue`UIohLxW7pN=)7YrVq#}Gw8 z^ABeJRzF5iDZ0lto1KAyzs~`})6HRLVCZzc((SsV`2}OA>xFLDEuF4s@Vl;*uiN!Z z^8v9-%x?L~y7BF_ZUg@0x3I~WW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>h@dx7r0IcI(q5uE@ literal 0 HcmV?d00001 diff --git a/todo_app/src/main.c b/todo_app/src/main.c new file mode 100644 index 0000000..acafe6b --- /dev/null +++ b/todo_app/src/main.c @@ -0,0 +1,82 @@ +#include +#include +#include +#include +#include "todo.h" + +#define MAX_TASKS 100 + +Task tasks[MAX_TASKS]; +int task_count = 0; +int selected_task = 0; + +// Booleans to track sort order +bool priority_ascending = true; // Start with highest to lowest priority +bool date_ascending = true; // Start with closest to latest due date + +// Function to clear input prompt after getting the input +void get_input_and_clear(char *buffer, int size, const char *prompt) { + mvprintw(LINES - 2, 0, "%s", prompt); + clrtoeol(); // Clears the prompt area before input to avoid overlay + echo(); + getnstr(buffer, size - 1); // Get user input + noecho(); + buffer[size - 1] = '\0'; // Null-terminate the string + clear(); // Clear the entire screen after each input + refresh(); +} + +void delete_task_interactive() { + remove_task(tasks, &task_count, selected_task); // Pass index instead of id + if (selected_task >= task_count && task_count > 0) selected_task = task_count - 1; +} + +int main() { + init_ncurses(); + load_tasks(tasks, &task_count); + + int ch; + display_tasks(tasks, task_count, selected_task); // Initial display + while ((ch = getch()) != 'q') { + switch (ch) { + case 'j': + if (selected_task < task_count - 1) selected_task++; + break; + case 'k': + if (selected_task > 0) selected_task--; + break; + case 'a': + add_task(tasks, &task_count, "", "", "", "none", 0); + break; + case 'd': + delete_task_interactive(); + break; + case 'c': + toggle_task_completion(&tasks[selected_task]); + break; + case 'e': + edit_task(&tasks[selected_task]); + break; + case 's': // Search functionality + search_task(tasks, task_count, &selected_task); + break; + case 'P': // Toggle priority sorting + sort_tasks(tasks, task_count, 'p', priority_ascending); + priority_ascending = !priority_ascending; // Toggle the boolean + selected_task = 0; // Reset selection to the first task after sorting + break; + case 'S': // Toggle due date sorting + sort_tasks(tasks, task_count, 'd', date_ascending); + date_ascending = !date_ascending; // Toggle the boolean + selected_task = 0; // Reset selection to the first task after sorting + break; + } + + display_tasks(tasks, task_count, selected_task); + } + + save_tasks(tasks, task_count); + cleanup_ncurses(); + return 0; +} + diff --git a/todo_app/src/main.c.bak b/todo_app/src/main.c.bak new file mode 100644 index 0000000..77de450 --- /dev/null +++ b/todo_app/src/main.c.bak @@ -0,0 +1,87 @@ +#include +#include +#include +#include "todo.h" + +#define MAX_TASKS 100 + +Task tasks[MAX_TASKS]; +int task_count = 0; +int selected_task = 0; + +// Function to clear input prompt after getting the input +void get_input_and_clear(char *buffer, int size, const char *prompt) { + mvprintw(LINES - 2, 0, "%s", prompt); + clrtoeol(); // Clears the prompt area before input to avoid overlay + echo(); + getnstr(buffer, size - 1); // Get user input + noecho(); + buffer[size - 1] = '\0'; // Null-terminate the string + clear(); // Clear the entire screen after each input + refresh(); +} + +void add_task_interactive() { + char title[MAX_TITLE_LEN]; + char category[MAX_CATEGORY_LEN]; + char due_date[MAX_DATE_LEN]; + int priority; + + // Get valid inputs and clear screen after each prompt + get_input_and_clear(title, MAX_TITLE_LEN, "Enter task title: "); + get_input_and_clear(category, MAX_CATEGORY_LEN, "Enter category: "); + get_input_and_clear(due_date, MAX_DATE_LEN, "Enter due date (YYYY-MM-DD): "); + + // Enable echoing for priority input so the user can see what they type + mvprintw(LINES - 2, 0, "Enter priority (1-5): "); + clrtoeol(); + echo(); // Enable echoing so input is visible + scanw("%d", &priority); + noecho(); // Disable echoing again after input is done + + // Add the task using the gathered inputs + add_task(tasks, &task_count, title, category, due_date, "none", priority); + + // Confirmation and refresh + mvprintw(LINES - 2, 0, "Task added successfully! Press any key..."); + clrtoeol(); + refresh(); + getch(); +} + +void delete_task_interactive() { + remove_task(tasks, &task_count, tasks[selected_task].id); + if (selected_task > 0) selected_task--; +} + +int main() { + init_ncurses(); + load_tasks(tasks, &task_count); + + int ch; + while ((ch = getch()) != 'q') { + switch (ch) { + case 'j': + if (selected_task < task_count - 1) selected_task++; + break; + case 'k': + if (selected_task > 0) selected_task--; + break; + case 'a': + add_task_interactive(); + break; + case 'd': + delete_task_interactive(); + break; + case 'c': + toggle_task_completion(&tasks[selected_task]); + break; + } + + display_tasks(tasks, task_count, selected_task); + } + + save_tasks(tasks, task_count); + cleanup_ncurses(); + return 0; +} diff --git a/todo_app/src/task.c b/todo_app/src/task.c new file mode 100644 index 0000000..a4b3420 --- /dev/null +++ b/todo_app/src/task.c @@ -0,0 +1,405 @@ +#include +#include +#include +#include +#include +#include "todo.h" + +#define MAX_RECURRENCE_LEN 10 +#define MAX_DATE_LEN 12 // Adjusted to fit YYYY-MM-DD format with null terminator (12 characters including \0) + +// Function to handle getting input from the user +void get_input(char *buffer, int size, const char *prompt) { + mvprintw(LINES - 2, 0, "%s", prompt); + echo(); + getnstr(buffer, size - 1); + noecho(); + buffer[size - 1] = '\0'; + refresh(); +} + +// Comparator functions for sorting by priority, due date, and completion status +int compare_priority_desc(const void *a, const void *b) { + Task *taskA = (Task *)a; + Task *taskB = (Task *)b; + return taskB->priority - taskA->priority; // Higher priority first +} + +int compare_priority_asc(const void *a, const void *b) { + Task *taskA = (Task *)a; + Task *taskB = (Task *)b; + return taskA->priority - taskB->priority; // Lower priority first +} + +int compare_due_date_desc(const void *a, const void *b) { + Task *taskA = (Task *)a; + Task *taskB = (Task *)b; + + if (strcmp(taskA->due_date, "N/A") == 0) return 1; // Push "N/A" (no due date) to the end + if (strcmp(taskB->due_date, "N/A") == 0) return -1; + + return strcmp(taskA->due_date, taskB->due_date); // Closest date first +} + +int compare_due_date_asc(const void *a, const void *b) { + Task *taskA = (Task *)a; + Task *taskB = (Task *)b; + + if (strcmp(taskA->due_date, "N/A") == 0) return 1; // Push "N/A" (no due date) to the end + if (strcmp(taskB->due_date, "N/A") == 0) return -1; + + return strcmp(taskB->due_date, taskA->due_date); // Latest date first +} + +// Function to handle sorting with ascending/descending toggling +void sort_tasks(Task tasks[], int count, char sort_type, bool ascending) { + switch (sort_type) { + case 'p': // Sort by priority + if (ascending) { + qsort(tasks, count, sizeof(Task), compare_priority_asc); + } else { + qsort(tasks, count, sizeof(Task), compare_priority_desc); + } + break; + case 'd': // Sort by due date + if (ascending) { + qsort(tasks, count, sizeof(Task), compare_due_date_desc); + } else { + qsort(tasks, count, sizeof(Task), compare_due_date_asc); + } + break; + } +} + +void init_ncurses() { + initscr(); + noecho(); + cbreak(); + keypad(stdscr, TRUE); + curs_set(0); + refresh(); + start_color(); + init_pair(1, COLOR_RED, COLOR_BLACK); // Red for overdue tasks + init_pair(2, COLOR_YELLOW, COLOR_BLACK); // Yellow for due soon tasks +} + +void cleanup_ncurses() { + endwin(); +} + +void toggle_task_completion(Task *task) { + // Toggle the completion status (1 for completed, 0 for not completed) + task->completed = !task->completed; + + // If the task is recurring, update the due date when completed + if (task->completed && strcmp(task->recurrence, "none") != 0) { + update_task_recurrence(task); + } + + // Refresh the task display after toggling completion + refresh(); +} + +void update_task_recurrence(Task *task) { + if (strcmp(task->recurrence, "none") == 0) { + return; // No recurrence, nothing to update + } + + struct tm due_date = {0}; + int year, month, day; + + // Ensure the due date is valid + if (sscanf(task->due_date, "%d-%d-%d", &year, &month, &day) != 3 || year < 1900) { + // Invalid or uninitialized due date, do nothing + return; + } + + due_date.tm_year = year - 1900; // tm_year is years since 1900 + due_date.tm_mon = month - 1; // tm_mon is 0-based + due_date.tm_mday = day; + + // Adjust the due date based on recurrence type + if (strcmp(task->recurrence, "daily") == 0) { + due_date.tm_mday += 1; + } else if (strcmp(task->recurrence, "weekly") == 0) { + due_date.tm_mday += 7; + } else if (strcmp(task->recurrence, "biweekly") == 0) { + due_date.tm_mday += 14; + } else if (strcmp(task->recurrence, "monthly") == 0) { + due_date.tm_mon += 1; + } else if (strcmp(task->recurrence, "yearly") == 0) { + due_date.tm_year += 1; + } + + // Normalize the date + mktime(&due_date); + + // Update the due date field + snprintf(task->due_date, MAX_DATE_LEN, "%04d-%02d-%02d", + due_date.tm_year + 1900, + due_date.tm_mon + 1, + due_date.tm_mday); +} + +int is_task_overdue(Task task) { + if (strcmp(task.due_date, "N/A") == 0) { + return 0; // No due date, so not overdue + } + + // Get the current time + time_t t = time(NULL); + struct tm current_time = *localtime(&t); + struct tm due_date = {0}; + + // Parse the due date from the task + if (sscanf(task.due_date, "%d-%d-%d", &due_date.tm_year, &due_date.tm_mon, &due_date.tm_mday) != 3) { + return 0; // Invalid due date format + } + + // Adjust the year and month for struct tm format + due_date.tm_year -= 1900; + due_date.tm_mon -= 1; + + // Compare the due date with the current date + return mktime(¤t_time) > mktime(&due_date); +} + +int is_task_due_soon(Task task) { + if (strcmp(task.due_date, "N/A") == 0) return 0; + + time_t t = time(NULL); + struct tm current_time = *localtime(&t); + struct tm due_date = {0}; + + sscanf(task.due_date, "%d-%d-%d", &due_date.tm_year, &due_date.tm_mon, &due_date.tm_mday); + due_date.tm_year -= 1900; + due_date.tm_mon -= 1; + + double seconds_difference = difftime(mktime(&due_date), mktime(¤t_time)); + return (seconds_difference <= 86400 && seconds_difference >= 0); // Task due in the next 24 hours +} + +void add_task(Task tasks[], int *count, const char *title, const char *category, const char *due_date, const char *recurrence, int priority) { + if (*count >= MAX_TASKS) return; + + char temp_title[MAX_TITLE_LEN]; + char temp_category[MAX_CATEGORY_LEN]; + char temp_due_date[MAX_DATE_LEN]; + int temp_priority; + + // Title input with retry if blank + while (1) { + get_input_and_clear(temp_title, MAX_TITLE_LEN, "Enter task title (cannot be empty): "); + if (strlen(temp_title) > 0) break; + mvprintw(LINES - 2, 0, "Task title cannot be empty. Please try again."); + refresh(); + getch(); + } + + // Category input with retry if blank + while (1) { + get_input_and_clear(temp_category, MAX_CATEGORY_LEN, "Enter category (cannot be empty): "); + if (strlen(temp_category) > 0) break; + mvprintw(LINES - 2, 0, "Category cannot be empty. Please try again."); + refresh(); + getch(); + } + + // Due date input, default to current date if blank + get_input_and_clear(temp_due_date, MAX_DATE_LEN, "Enter due date (YYYY-MM-DD) or leave blank for today's date: "); + if (strlen(temp_due_date) == 0) { + // Default to current date + time_t t = time(NULL); + struct tm *current_time = localtime(&t); + snprintf(temp_due_date, MAX_DATE_LEN, "%04d-%02d-%02d", + current_time->tm_year + 1900, + current_time->tm_mon + 1, + current_time->tm_mday); + } + + // Priority input with retry if invalid + mvprintw(LINES - 2, 0, "Enter priority (1-5): "); + clrtoeol(); + echo(); + scanw("%d", &temp_priority); + noecho(); + while (temp_priority < 1 || temp_priority > 5) { + mvprintw(LINES - 2, 0, "Invalid priority. Please enter a value between 1 and 5: "); + clrtoeol(); + echo(); + scanw("%d", &temp_priority); + noecho(); + } + + // Save the task using validated inputs + tasks[*count].id = *count + 1; // Assign a unique ID + strncpy(tasks[*count].title, temp_title, MAX_TITLE_LEN - 1); + tasks[*count].title[MAX_TITLE_LEN - 1] = '\0'; + strncpy(tasks[*count].category, temp_category, MAX_CATEGORY_LEN - 1); + tasks[*count].category[MAX_CATEGORY_LEN - 1] = '\0'; + strncpy(tasks[*count].due_date, temp_due_date, MAX_DATE_LEN - 1); + tasks[*count].due_date[MAX_DATE_LEN - 1] = '\0'; + strncpy(tasks[*count].recurrence, recurrence, MAX_RECURRENCE_LEN - 1); + tasks[*count].recurrence[MAX_RECURRENCE_LEN - 1] = '\0'; + tasks[*count].priority = temp_priority; + tasks[*count].completed = 0; + + (*count)++; + + mvprintw(LINES - 2, 0, "Task added successfully! Press any key..."); + clrtoeol(); + refresh(); + getch(); +} + +void remove_task(Task tasks[], int *count, int index) { + if (index < 0 || index >= *count) { + // Index out of bounds + return; + } + + for (int i = index; i < *count - 1; i++) { + tasks[i] = tasks[i + 1]; // Shift tasks down + } + (*count)--; +} + +void edit_task(Task *task) { + char title[MAX_TITLE_LEN]; + char category[MAX_CATEGORY_LEN]; + char due_date[MAX_DATE_LEN]; + char recurrence[MAX_RECURRENCE_LEN]; + int priority; + + // Get input for task title + get_input_and_clear(title, MAX_TITLE_LEN, "Edit task title (leave blank to keep current): "); + if (strlen(title) > 0) { + strncpy(task->title, title, MAX_TITLE_LEN - 1); + task->title[MAX_TITLE_LEN - 1] = '\0'; // Ensure null termination + } + + // Get input for category + get_input_and_clear(category, MAX_CATEGORY_LEN, "Edit category (leave blank to keep current): "); + if (strlen(category) > 0) { + strncpy(task->category, category, MAX_CATEGORY_LEN - 1); + task->category[MAX_CATEGORY_LEN - 1] = '\0'; + } + + // Get input for due date + get_input_and_clear(due_date, MAX_DATE_LEN, "Edit due date (YYYY-MM-DD, leave blank to keep current): "); + if (strlen(due_date) > 0) { + strncpy(task->due_date, due_date, MAX_DATE_LEN - 1); + task->due_date[MAX_DATE_LEN - 1] = '\0'; + } + + // Get input for recurrence + get_input_and_clear(recurrence, MAX_RECURRENCE_LEN, "Edit recurrence (none, daily, weekly, biweekly, monthly, yearly): "); + if (strlen(recurrence) > 0) { + strncpy(task->recurrence, recurrence, MAX_RECURRENCE_LEN - 1); + task->recurrence[MAX_RECURRENCE_LEN - 1] = '\0'; + } + + // Get input for priority + mvprintw(LINES - 2, 0, "Edit priority (1-5, leave blank to keep current): "); + clrtoeol(); + echo(); + char priority_input[3]; // Input for priority as a string + getnstr(priority_input, sizeof(priority_input) - 1); + noecho(); + + if (strlen(priority_input) > 0) { + priority = atoi(priority_input); + if (priority >= 1 && priority <= 5) { + task->priority = priority; + } + } + + mvprintw(LINES - 2, 0, "Task edited successfully! Press any key..."); + clrtoeol(); + refresh(); + getch(); +} + +void search_task(Task tasks[], int count, int *selected_task) { + char search_query[MAX_TITLE_LEN]; + + // Prompt the user to enter the search query (event name) + get_input_and_clear(search_query, MAX_TITLE_LEN, "Enter event name to search: "); + + // Search through tasks + for (int i = 0; i < count; i++) { + if (strstr(tasks[i].title, search_query) != NULL) { + *selected_task = i; // Set selected task to the found event + return; // Exit once the event is found and selected + } + } + + // If no event is found + mvprintw(LINES - 2, 0, "Event not found. Press any key to continue."); + clrtoeol(); + refresh(); + getch(); // Wait for user to acknowledge +} + +void load_tasks(Task tasks[], int *count) { + char *file_path = get_database_path(); + FILE *file = fopen(file_path, "r"); + + if (file == NULL) return; + + while (fscanf(file, "%d\t%[^\t]\t%[^\t]\t%d\t%d\t%[^\n]\n", + &tasks[*count].id, tasks[*count].title, + tasks[*count].category, &tasks[*count].priority, + &tasks[*count].completed, tasks[*count].due_date) != EOF) { + (*count)++; + } + + fclose(file); +} + +void save_tasks(Task tasks[], int count) { + char *file_path = get_database_path(); + FILE *file = fopen(file_path, "w"); + if (file == NULL) { + // Handle file creation failure + mvprintw(LINES - 2, 0, "Error: Could not open file for saving tasks."); + return; + } + + for (int i = 0; i < count; i++) { + fprintf(file, "%d\t%s\t%s\t%d\t%d\t%s\n", tasks[i].id, tasks[i].title, tasks[i].category, + tasks[i].priority, tasks[i].completed, tasks[i].due_date); + } + + fclose(file); +} + +void display_tasks(Task tasks[], int count, int selected) { + clear(); // Clear the screen for updating + for (int i = 0; i < count; i++) { + if (i == selected) { + attron(A_REVERSE); + } + if (is_task_overdue(tasks[i])) { + attron(COLOR_PAIR(1)); // Red for overdue tasks + } else if (is_task_due_soon(tasks[i])) { + attron(COLOR_PAIR(2)); // Yellow for due soon tasks + } + + mvprintw(i, 0, "[%c] %s (%s) Priority: %d Due: %s Recurrence: %s", + tasks[i].completed ? 'X' : ' ', tasks[i].title, + tasks[i].category, tasks[i].priority, tasks[i].due_date, tasks[i].recurrence); + + if (is_task_overdue(tasks[i])) { + attroff(COLOR_PAIR(1)); // Turn off overdue color + } else if (is_task_due_soon(tasks[i])) { + attroff(COLOR_PAIR(2)); // Turn off due soon color + } + + if (i == selected) { + attroff(A_REVERSE); + } + } + mvprintw(count + 1, 0, "Press 'q' to quit, 'a' to add, 'd' to delete, 'c' to complete, 'e' to edit."); + refresh(); +} diff --git a/todo_app/src/task.c.bak b/todo_app/src/task.c.bak new file mode 100644 index 0000000..b0c0223 --- /dev/null +++ b/todo_app/src/task.c.bak @@ -0,0 +1,317 @@ +#include +#include +#include +#include +#include +#include "todo.h" + +#define MAX_RECURRENCE_LEN 10 +#define MAX_DATE_LEN 12 // Adjusted to fit YYYY-MM-DD format with null terminator (12 characters including \0) + +void get_input(char *buffer, int size, const char *prompt) { + mvprintw(LINES - 2, 0, "%s", prompt); + echo(); + getnstr(buffer, size - 1); + noecho(); + buffer[size - 1] = '\0'; + refresh(); +} + +// Comparator functions for sorting by priority, due date, and completion status +int compare_priority(const void *a, const void *b) { + Task *taskA = (Task *)a; + Task *taskB = (Task *)b; + return taskB->priority - taskA->priority; +} + +int compare_due_date(const void *a, const void *b) { + Task *taskA = (Task *)a; + Task *taskB = (Task *)b; + if (strcmp(taskA->due_date, "N/A") == 0) return 1; + if (strcmp(taskB->due_date, "N/A") == 0) return -1; + return strcmp(taskA->due_date, taskB->due_date); +} + +int compare_completion(const void *a, const void *b) { + Task *taskA = (Task *)a; + Task *taskB = (Task *)b; + return taskA->completed - taskB->completed; +} + +void sort_tasks(Task tasks[], int count, char sort_type) { + switch (sort_type) { + case 'p': + qsort(tasks, count, sizeof(Task), compare_priority); + break; + case 'd': + qsort(tasks, count, sizeof(Task), compare_due_date); + break; + case 'c': + qsort(tasks, count, sizeof(Task), compare_completion); + break; + } +} + +void init_ncurses() { + initscr(); + noecho(); + cbreak(); + keypad(stdscr, TRUE); + curs_set(0); + refresh(); + start_color(); + init_pair(1, COLOR_RED, COLOR_BLACK); // Red for overdue tasks + init_pair(2, COLOR_YELLOW, COLOR_BLACK); // Yellow for due soon tasks +} + +void cleanup_ncurses() { + endwin(); +} + +void toggle_task_completion(Task *task) { + // Toggle the completion status (1 for completed, 0 for not completed) + task->completed = !task->completed; + + // If the task is recurring, update the due date when completed + if (task->completed && strcmp(task->recurrence, "none") != 0) { + update_task_recurrence(task); + } + + // Refresh the task display after toggling completion + refresh(); +} + +void update_task_recurrence(Task *task) { + if (strcmp(task->recurrence, "none") == 0) { + return; // No recurrence, nothing to update + } + + struct tm due_date = {0}; + int year, month, day; + + // Ensure the due date is valid + if (sscanf(task->due_date, "%d-%d-%d", &year, &month, &day) != 3 || year < 1900) { + // Invalid or uninitialized due date, do nothing + return; + } + + due_date.tm_year = year - 1900; // tm_year is years since 1900 + due_date.tm_mon = month - 1; // tm_mon is 0-based + due_date.tm_mday = day; + + // Adjust the due date based on recurrence type + if (strcmp(task->recurrence, "daily") == 0) { + due_date.tm_mday += 1; + } else if (strcmp(task->recurrence, "weekly") == 0) { + due_date.tm_mday += 7; + } else if (strcmp(task->recurrence, "monthly") == 0) { + due_date.tm_mon += 1; + } + + // Normalize the date + mktime(&due_date); + + // Update the due date field + snprintf(task->due_date, MAX_DATE_LEN, "%04d-%02d-%02d", + due_date.tm_year + 1900, + due_date.tm_mon + 1, + due_date.tm_mday); +} + +int is_task_overdue(Task task) { + if (strcmp(task.due_date, "N/A") == 0) { + return 0; // No due date, so not overdue + } + + // Get the current time + time_t t = time(NULL); + struct tm current_time = *localtime(&t); + struct tm due_date = {0}; + + // Parse the due date from the task + if (sscanf(task.due_date, "%d-%d-%d", &due_date.tm_year, &due_date.tm_mon, &due_date.tm_mday) != 3) { + return 0; // Invalid due date format + } + + // Adjust the year and month for struct tm format + due_date.tm_year -= 1900; + due_date.tm_mon -= 1; + + // Compare the due date with the current date + return mktime(¤t_time) > mktime(&due_date); +} + +int is_task_due_soon(Task task) { + if (strcmp(task.due_date, "N/A") == 0) return 0; + + time_t t = time(NULL); + struct tm current_time = *localtime(&t); + struct tm due_date = {0}; + + sscanf(task.due_date, "%d-%d-%d", &due_date.tm_year, &due_date.tm_mon, &due_date.tm_mday); + due_date.tm_year -= 1900; + due_date.tm_mon -= 1; + + double seconds_difference = difftime(mktime(&due_date), mktime(¤t_time)); + return (seconds_difference <= 86400 && seconds_difference >= 0); // Task due in the next 24 hours +} + +void add_task(Task tasks[], int *count, const char *title, const char *category, const char *due_date, const char *recurrence, int priority) { + if (*count >= MAX_TASKS) return; + + tasks[*count].id = *count + 1; + strncpy(tasks[*count].title, title, MAX_TITLE_LEN - 1); // -1 to leave space for null terminator + tasks[*count].title[MAX_TITLE_LEN - 1] = '\0'; + strncpy(tasks[*count].category, category, MAX_CATEGORY_LEN - 1); + tasks[*count].category[MAX_CATEGORY_LEN - 1] = '\0'; + strncpy(tasks[*count].due_date, due_date, MAX_DATE_LEN - 1); // Avoid overflow + tasks[*count].due_date[MAX_DATE_LEN - 1] = '\0'; + strncpy(tasks[*count].recurrence, recurrence, MAX_RECURRENCE_LEN - 1); + tasks[*count].recurrence[MAX_RECURRENCE_LEN - 1] = '\0'; + tasks[*count].priority = priority; + tasks[*count].completed = 0; + (*count)++; +} + +void remove_task(Task tasks[], int *count, int id) { + int found = 0; + + for (int i = 0; i < *count; i++) { + if (tasks[i].id == id) { + found = 1; + } + if (found && i < *count - 1) { + tasks[i] = tasks[i + 1]; // Shift tasks down + } + } + + if (found) { + (*count)--; + } +} + +void edit_task(Task *task) { + char title[MAX_TITLE_LEN]; + char category[MAX_CATEGORY_LEN]; + char due_date[MAX_DATE_LEN]; + int priority; + + // Get input for task title + get_input_and_clear(title, MAX_TITLE_LEN, "Edit task title (leave blank to keep current): "); + if (strlen(title) > 0) { + strncpy(task->title, title, MAX_TITLE_LEN - 1); + task->title[MAX_TITLE_LEN - 1] = '\0'; // Ensure null termination + } + + // Get input for category + get_input_and_clear(category, MAX_CATEGORY_LEN, "Edit category (leave blank to keep current): "); + if (strlen(category) > 0) { + strncpy(task->category, category, MAX_CATEGORY_LEN - 1); + task->category[MAX_CATEGORY_LEN - 1] = '\0'; + } + + // Get input for due date + get_input_and_clear(due_date, MAX_DATE_LEN, "Edit due date (YYYY-MM-DD, leave blank to keep current): "); + if (strlen(due_date) > 0) { + strncpy(task->due_date, due_date, MAX_DATE_LEN - 1); + task->due_date[MAX_DATE_LEN - 1] = '\0'; + } + + // Get input for priority + mvprintw(LINES - 2, 0, "Edit priority (1-5, leave blank to keep current): "); + clrtoeol(); + echo(); + char priority_input[3]; // Input for priority as a string + getnstr(priority_input, sizeof(priority_input) - 1); + noecho(); + + if (strlen(priority_input) > 0) { + priority = atoi(priority_input); + if (priority >= 1 && priority <= 5) { + task->priority = priority; + } + } + + mvprintw(LINES - 2, 0, "Task edited successfully! Press any key..."); + clrtoeol(); + refresh(); + getch(); +} + +void search_task(Task tasks[], int count, int *selected_task) { + char search_query[MAX_TITLE_LEN]; + + // Prompt the user to enter the search query (event name) + get_input_and_clear(search_query, MAX_TITLE_LEN, "Enter event name to search: "); + + // Search through tasks + for (int i = 0; i < count; i++) { + if (strstr(tasks[i].title, search_query) != NULL) { + *selected_task = i; // Set selected task to the found event + return; // Exit once the event is found and selected + } + } + + // If no event is found + mvprintw(LINES - 2, 0, "Event not found. Press any key to continue."); + clrtoeol(); + refresh(); + getch(); // Wait for user to acknowledge +} + + +void load_tasks(Task tasks[], int *count) { + FILE *file = fopen(FILE_PATH, "r"); + if (file == NULL) return; + + while (fscanf(file, "%d %[^\t] %[^\t] %d %d %[^\n]\n", + &tasks[*count].id, tasks[*count].title, + tasks[*count].category, &tasks[*count].priority, + &tasks[*count].completed, tasks[*count].due_date) != EOF) { + (*count)++; + } + + fclose(file); +} + +void save_tasks(Task tasks[], int count) { + FILE *file = fopen(FILE_PATH, "w"); + if (file == NULL) return; + + for (int i = 0; i < count; i++) { + fprintf(file, "%d\t%s\t%s\t%d\t%d\t%s\n", tasks[i].id, tasks[i].title, tasks[i].category, + tasks[i].priority, tasks[i].completed, tasks[i].due_date); + } + + fclose(file); +} + +void display_tasks(Task tasks[], int count, int selected) { + clear(); // Clear the screen for updating + for (int i = 0; i < count; i++) { + if (i == selected) { + attron(A_REVERSE); + } + if (is_task_overdue(tasks[i])) { + attron(COLOR_PAIR(1)); // Red for overdue tasks + } else if (is_task_due_soon(tasks[i])) { + attron(COLOR_PAIR(2)); // Yellow for due soon tasks + } + + mvprintw(i, 0, "[%c] %s (%s) Priority: %d Due: %s", + tasks[i].completed ? 'X' : ' ', tasks[i].title, + tasks[i].category, tasks[i].priority, tasks[i].due_date); + + if (is_task_overdue(tasks[i])) { + attroff(COLOR_PAIR(1)); // Turn off overdue color + } else if (is_task_due_soon(tasks[i])) { + attroff(COLOR_PAIR(2)); // Turn off due soon color + } + + if (i == selected) { + attroff(A_REVERSE); + } + } + mvprintw(count + 1, 0, "Press 'q' to quit, 'a' to add, 'd' to delete, 'c' to complete."); + refresh(); +}