Recipe Collection
Task Specifications
See all Task Specifications
Compilation
To build and run the recipe collection, execute sh ./build.sh
or alternatively run:
gcc enums/menu.h structs/terminal.h structs/ingredient.h structs/recipe.h globals/menu_choices.h globals/recipe.h globals/recipe_names.h globals/recipe_states.h globals/recipes_count.h globals/terminal.h globals/window.h helpers/all.h helpers/store_recipe.c helpers/clear_recipes.c helpers/get_recipes_count.c helpers/mk_file.c helpers/new_ingredient.c helpers/new_recipe.c helpers/delete_recipe.c helpers/edit_recipe.c helpers/load_recipes.c helpers/finish_recipe.c helpers/get_terminal_size.c helpers/init_recipe.c helpers/quit.c helpers/read_recipe_ingredient.c helpers/read_recipe_instruction.c helpers/read_recipe_name.c helpers/reset_box.c ncurses/all.h ncurses/show_help_with_ncurses.c ncurses/show_main_menu_with_ncurses.c ncurses/show_search_by_recipe_name_with_ncurses.c ncurses/show_search_by_ingredient_with_ncurses.c ncurses/show_selectable_menu_with_ncurses.c ncurses/show_single_recipe_with_ncurses.c main.c -std=c99 -lncurses -Wall -Wextra -pedantic -Wno-unused-parameter
To compile it, you need the GNU compiler.
Additionally you need ncurses. An installation link can be found here.
Local header files:
enums/menu.h
globals/menu_choices.h
globals/recipe.h
globals/recipe_names.h
globals/states.h
globals/recipes_count.h
globals/terminal.h
globals/window.h
helpers/all.h
ncurses/all.h
structs/ingredient.h
structs/recipe.h
structs/terminal.h
Execution
You can execute the recipe collection with the generated *.out
file.
e.g. ./recipe_collection.out [filename]
The filename argument is required. If the file does not exist, the file will be created for you.
Optional options: -h -> help -f[filename] e.g. -fdatabase.txt
After executing the program, you will see the main menu.
Completed Tasks
- Main Task (30 pts.)
- All recipes are stored in a file and read from file. The user can list and see them through the executable.
- Task (10 pts.)
- Partially implemented. You can search for an ingredient.
- Task (15 pts.)
- Partially implemented. You can search by an ingredient / recipe name.
- Task (15 pts.)
- A user can add new recipes including new ingredients.
- Task (15 pts.)
- I began to implement this function, but I had no time left.
- Task (30 pts.)
- ncurses is used through the whole program.
- Task (10 pts.)
- Implemented. A user can filter recipes / recipes by ingredient
getopt is implemented, too.
Additionally: A user can delete a recipe.