Coder Social home page Coder Social logo

todoc's Introduction

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/.

todoc's People

Contributors

kaoticz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.