Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaoticz/todoc
Simple To-Do program written in C.
https://github.com/kaoticz/todoc
c sqlite3
Last synced: about 2 months ago
JSON representation
Simple To-Do program written in C.
- Host: GitHub
- URL: https://github.com/kaoticz/todoc
- Owner: Kaoticz
- License: gpl-3.0
- Created: 2023-11-13T23:09:03.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-26T06:58:38.000Z (about 1 year ago)
- Last Synced: 2023-11-26T07:30:46.175Z (about 1 year ago)
- Topics: c, sqlite3
- Language: C
- Homepage:
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TodoC
This repository contains a university assignment for a simple "To-Do" program written in C. The program performs CRUD operations with strings in a SQLite database.
Developed on Arch Linux with GCC 13.2.1
## How to build
### Native
To build the program, navigate to the root directory and execute the following command:
```
make
```The build binaries will be located in the `obj/` directory, and the final binary can be found in the `bin/` directory. To run the program, execute the following command:
```
./bin/main
```The application connects to an SQLite database in the same location where it is being executed. If it does not find an existing database, a new one is created.
To delete all binaries and clean the project, execute:
```
make clean
```### Docker
If you're not on Arch Linux, you can alternatively run the application in a Docker container.
To create the container's image, execute:
```
docker build -t todoc ./
```To create and run the container, execute:
```
docker run -it todoc
```To run a container that already exists, execute:
```
docker start my_container_name && docker attach my_container_name
```Then type `5` and press Enter, because `stdout` of the attached container might not update right away when the connection is established.
## Details
While this program may be considered overengineered for its purpose, it effectively showcases various features of the C language, including but not limited to:
- Declaration and usage of both local and global variables.
- Implementation of control flow structures in accordance with the Structured Programming paradigm (i.e., the use of `goto` is prohibited).
- Utilization of pointers.
- Implementation of function pointers and callbacks.
- Manual memory management.
- Utilization of variadic functions and macros.
- Signal interception and handling, providing an event-like behavior.Additionally, the program demonstrates:
- Integration with a relational database (SQLite).
- Inclusion of a Makefile for streamlined compilation.
- An object-oriented-like structure for source files, with "private" members declared using the `static` modifier and "public" members declared in the header file.## License
TodoC, a terminal-based "to-do" application written in C.
Copyright (C) 2023 Kotz
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 https://www.gnu.org/licenses/.