logo

Grimgrains

Unnamed repository; edit this file 'description' to name the repository.
commit: 925c71f36e64a724e34adab72649e6565d06dc02
parent 7d5dc7d7911ab3932a0f31965e5639581508b426
Author: neauoire <aliceffekt@gmail.com>
Date:   Fri, 20 Dec 2019 10:26:22 -0500

Working on migrating the db

Diffstat:

Dsource/build.sh6------
Dsource/ingredient.c26--------------------------
Dsource/ingredients.c26--------------------------
Dsource/main0
Dsource/main.c15---------------
Dsource/recipe.c73-------------------------------------------------------------------------
Dsource/recipes.c85-------------------------------------------------------------------------------
7 files changed, 0 insertions(+), 231 deletions(-)

diff --git a/source/build.sh b/source/build.sh @@ -1,5 +0,0 @@ -#!/bin/bash - -cc -std=c99 -DDEBUG -Wall -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -lm -Og -fsanitize=address -fsanitize=undefined main.c -o main - -./main- \ No newline at end of file diff --git a/source/ingredient.c b/source/ingredient.c @@ -1,25 +0,0 @@ - -typedef struct { - int id; - char *name; - char *description; -} Ingredient; - -typedef struct { - Ingredient *ingredient; - char *quantity; -} Serving; - -Ingredient create_ingredient(char *name, char *description) { - Ingredient a; - a.name = name; - a.description = description; - return a; -} - -Serving create_serving(Ingredient *ingredient, char *quantity) { - Serving a; - a.ingredient = ingredient; - a.quantity = quantity; - return a; -}- \ No newline at end of file diff --git a/source/ingredients.c b/source/ingredients.c @@ -1,25 +0,0 @@ - -Ingredient black_sesame_seeds = create_ingredient("black_sesame_seeds","descr"); -Ingredient coconut_oil = create_ingredient("coconut_oil","descr"); -Ingredient brown_rice_syrup = create_ingredient("brown_rice_syrup","descr"); -Ingredient puffed_rice = create_ingredient("puffed_rice","descr"); -Ingredient kinako = create_ingredient("kinako","descr"); -Ingredient salt = create_ingredient("salt","descr"); - -Ingredient soy_sauce = create_ingredient("soy_sauce","descr"); -Ingredient japanese_rice_vinegar = create_ingredient("japanese_rice_vinegar","descr"); -Ingredient chili_pepper_flakes = create_ingredient("chili_pepper_flakes","descr"); -Ingredient peanut_butter = create_ingredient("peanut_butter","descr"); -Ingredient maple_syrup = create_ingredient("maple_syrup","descr"); -Ingredient sesame_oil = create_ingredient("sesame_oil","descr"); -Ingredient garlic = create_ingredient("garlic","descr"); -Ingredient ginger_root = create_ingredient("ginger_root","descr"); -Ingredient arrowroot_starch = create_ingredient("arrowroot_starch","descr"); - -Ingredient brown_lentils = create_ingredient("brown_lentils","descr"); -Ingredient vegetable_bouillon = create_ingredient("vegetable_bouillon","descr"); -Ingredient carrots = create_ingredient("carrots","descr"); -Ingredient daikon = create_ingredient("daikon","descr"); -Ingredient chives = create_ingredient("chives","descr"); - -// Ingredient *ingredients[] = {&pepper};- \ No newline at end of file diff --git a/source/main b/source/main Binary files differ. diff --git a/source/main.c b/source/main.c @@ -1,14 +0,0 @@ -#include "stdio.h" - -#include "ingredient.c" -#include "recipe.c" - -int main(void) { - - #include "ingredients.c" - #include "recipes.c" - - print_recipe(&sweet_sour_lentils); - - return (0); -}- \ No newline at end of file diff --git a/source/recipe.c b/source/recipe.c @@ -1,73 +0,0 @@ - -typedef struct { - char *name; - int instructions_len; - char *instructions[256]; - int servings_len; - Serving servings[10]; -} RecipePart; - -typedef struct { - char *name; - char *portions; - char *description; - int date; - int time; - int parts_len; - RecipePart *parts[10]; -} Recipe; - -Recipe create_recipe(char *name, char *portions, int date, int time) { - Recipe a; - a.name = name; - a.portions = portions; - a.date = date; - a.time = time; - a.parts_len = 0; - return a; -} - -RecipePart create_recipe_part(char *name) { - RecipePart a; - a.name = name; - a.instructions_len = 0; - a.servings_len = 0; - return a; -} - -void add_recipe_description(Recipe *r, char *description){ - r->description = description; -} - -void add_part_instruction(RecipePart *p, char *instruction){ - p->instructions[p->instructions_len] = instruction; - p->instructions_len++; -} - -void add_part_serving(RecipePart *p, Ingredient *i, char *quantity){ - p->servings[p->servings_len] = create_serving(i,quantity); - p->servings_len++; -} - -void add_part(Recipe *r, RecipePart *p){ - r->parts[r->parts_len] = p; - r->parts_len++; -} - -void print_recipe(Recipe *recipe) { - printf("name:%s, portions:%s date:%d time:%d\n",recipe->name,recipe->portions,recipe->date,recipe->time); - printf("===========\nParts:\n"); - for(int i = 0; i < recipe->parts_len; ++i) { - printf("-- %s(%d ingredients %d instructions)\n", recipe->parts[i]->name, recipe->parts[i]->servings_len, recipe->parts[i]->instructions_len); - for(int i2 = 0; i2 < recipe->parts[i]->instructions_len; ++i2) { - printf("---- %s\n", recipe->parts[i]->instructions[i2]); - } - for(int i2 = 0; i2 < recipe->parts[i]->servings_len; ++i2) { - printf("------ %s\n", recipe->parts[i]->servings[i2].ingredient->name); - } - } - // printf("===========\nIngredients:\n"); - // for(int i = 0; i < recipe.servings_len; ++i) { - // printf("%s %s\n", recipe.servings[i].ingredient->name,recipe.servings[i].quantity); - // } -} diff --git a/source/recipes.c b/source/recipes.c @@ -1,84 +0,0 @@ - -Recipe sweet_sour_lentils = create_recipe("sweet and sour lentils","2 servings",20190602,30); -add_recipe_description(&sweet_sour_lentils, "In my galley I have a few recipes that I consider staples, that I'm always in the mood to eat. I usually rotate these throughout the week, adding maybe a new recipe or two to change things up. This sweet and sour lentils recipe is one of these, a favourite of ours."); - -RecipePart sweet_sour_lentils_sauce = create_recipe_part("sauce"); -add_part_instruction(&sweet_sour_lentils_sauce, "Mix all liquid ingredients together in a bowl, add {_1 tbsp_} of {{peanut butter}} and stir until dissolved."); -add_part_instruction(&sweet_sour_lentils_sauce, "Stir in {_1 tbsp_} of {{arrowroot starch}} (to help thicken sauce)."); -add_part_instruction(&sweet_sour_lentils_sauce, "Add {_2 tsp_} of {{chili pepper flakes}}, {_3_} minced {{garlic cloves}} and roughly {_1 inch_} of minced {{ginger root}}."); -add_part_serving(&sweet_sour_lentils_sauce, &soy_sauce, "2 tbsp"); -add_part_serving(&sweet_sour_lentils_sauce, &japanese_rice_vinegar, "2 tbsp"); -add_part_serving(&sweet_sour_lentils_sauce, &chili_pepper_flakes, "2 tsp"); -add_part_serving(&sweet_sour_lentils_sauce, &peanut_butter, "1 tbsp"); -add_part_serving(&sweet_sour_lentils_sauce, &maple_syrup, "2 tbsp"); -add_part_serving(&sweet_sour_lentils_sauce, &sesame_oil, "1 tsp"); -add_part_serving(&sweet_sour_lentils_sauce, &garlic, "3 cloves, minced"); -add_part_serving(&sweet_sour_lentils_sauce, &ginger_root, "1 root minced"); -add_part_serving(&sweet_sour_lentils_sauce, &arrowroot_starch, "1 tbsp"); -add_part(&sweet_sour_lentils, &sweet_sour_lentils_sauce); - -RecipePart sweet_sour_lentils_main = create_recipe_part("main"); -add_part_instruction(&sweet_sour_lentils_main, "Rinse lentils. Transfer rinsed lentils to a pot and add {_1 1/2 cups_} of {{vegetable bouillon}}."); -add_part_instruction(&sweet_sour_lentils_main, "Bring water to a rapid simmer, then reduce heat to medium."); -add_part_instruction(&sweet_sour_lentils_main, "Simmer uncovered. After {#10 minutes#} add {_1_} cubed {{carrot}} and {_2 inches_} of cubed {{daikon}}."); -add_part_instruction(&sweet_sour_lentils_main, "Let mixture simmer for an additional {#10-20 minutes#}, add extra water as needed."); -add_part_instruction(&sweet_sour_lentils_main, "If lentils are tender, they are ready. Strain lentils and return to pot with {_1/4 tsp_} of {{salt}}."); -add_part_instruction(&sweet_sour_lentils_main, "Pour sauce onto lentils, mix well. Serve into two bowls with some {{chives}}. Eat wrapped in salad or cabbage leaves, or with {{crackers}}."); -add_part_serving(&sweet_sour_lentils_main, &brown_lentils, "1/2 cup"); -add_part_serving(&sweet_sour_lentils_main, &vegetable_bouillon, "1 1/2 cups"); -add_part_serving(&sweet_sour_lentils_main, &carrots, "1, cubed"); -add_part_serving(&sweet_sour_lentils_main, &daikon, "2 cubed"); -add_part_serving(&sweet_sour_lentils_main, &chives, "3 stalks"); -add_part_serving(&sweet_sour_lentils_main, &salt, "1/4 tsp"); -add_part(&sweet_sour_lentils, &sweet_sour_lentils_main); - -/* - -SWEET AND SOUR LENTILS - DATE : 2019-06-02 - TAGS - dinner - TIME : 30 - SERV : 2 servings - DESC - & In my galley I have a few recipes that I consider staples, that I'm always in the mood to eat. I usually rotate these throughout the week, adding maybe a new recipe or two to change things up. This sweet and sour lentils recipe is one of these, a favourite of ours. - & You can eat the lentils as is, or scoop it up with crackers. Devine & I enjoy eating it wrapped in salad or cabbage leaves. - & We've cooked sweet and sour lentils often on long passages, it's a simple one-pot meal. It's also my go-to recipe during pot lucks - even people who don't like lentils will enjoy it (I've never had any complaints, not yet). - & {*Substitutions*} - & It's a versatile recipe, so if I don't have any carrots or daikon I'll sometimes put brocoli or fresh green peas instead. For a heartier meal, adding sweet potatoes is also delicious. Sometimes, if I'm out of peanut butter I'll use tahini instead, the flavour is very similar and doesn't change much in the recipe (also nice for those with peanut allergies). This recipe only works with whole lentils, because there's still a bite to them, halved lentils will soften too much and the resulting texture won't be as pleasant. - & Enjoy this humble, but delicious recipe. - % recipes/sweet.and.sour.lentils.2.jpg - INST - SAUCE - - Mix all liquid ingredients together in a bowl, add {_1 tbsp_} of {{peanut butter}} and stir until dissolved. - - Stir in {_1 tbsp_} of {{arrowroot starch}} (to help thicken sauce). - - Add {_2 tsp_} of {{chili pepper flakes}}, {_3_} minced {{garlic cloves}} and roughly {_1 inch_} of minced {{ginger root}}. - LENTILS - - Rinse lentils. Transfer rinsed lentils to a pot and add {_1 1/2 cups_} of {{vegetable bouillon}}. - - Bring water to a rapid simmer, then reduce heat to medium. - - Simmer uncovered. After {#10 minutes#} add {_1_} cubed {{carrot}} and {_2 inches_} of cubed {{daikon}}. - - Let mixture simmer for an additional {#10-20 minutes#}, add extra water as needed. - - If lentils are tender, they are ready. Strain lentils and return to pot with {_1/4 tsp_} of {{salt}}. - - Pour sauce onto lentils, mix well. Serve into two bowls with some {{chives}}. Eat wrapped in salad or cabbage leaves, or with {{crackers}}. - INGR - Main - Brown lentils : 1/2 cup - Vegetable bouillon : 1 1/2 cups - Carrots : 1, cubed - Daikon : 2", cubed - Chives : 3 stalks - Salt : 1/4 tsp - Sauce - Soy sauce : 2 tbsp - Japanese rice vinegar : 2 tbsp - Chili pepper flakes : 2 tsp - Peanut butter : 1 tbsp - Maple syrup : 2 tbsp - Sesame oil : 1 tsp - Garlic : 3 cloves, minced - Ginger root : 1", minced - Arrowroot starch : 1 tbsp - -*/ - -// Recipe *recipes[] = {&rice_treat};- \ No newline at end of file