From 9deed51aa2df7ca5979963f7452a6439ad2d3767 Mon Sep 17 00:00:00 2001 From: gramanas Date: Thu, 2 Sep 2021 17:23:42 +0300 Subject: initial --- types.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 types.h (limited to 'types.h') diff --git a/types.h b/types.h new file mode 100644 index 0000000..788a767 --- /dev/null +++ b/types.h @@ -0,0 +1,46 @@ +#ifndef __TYPES_H +#define __TYPES_H + +typedef struct item_t { + char *name; + char *qty; +} item; + +enum step_type { + PREP = 0, + COOK, +}; + +typedef struct step_t { + char *inst; + char *duration; + char *result; + enum step_type type; +} step; + +typedef struct recipe_t { + char * filename; + char * path; + char * title; + item **i; + int in; + step **s; + int sn; +} recipe; + +recipe * new_recipe(); +void new_item(recipe * r); +void new_step(recipe * r); + +void free_recipe(recipe * r); +void free_item(item * i); +void free_step(step * s); + +void show(recipe * r); +void tojson(recipe * r); +void tohtml(recipe * r); +void torcp(recipe * r); + +void copy_items(recipe * dst, recipe * src); + +#endif /* __TYPES_H */ -- cgit v1.2.3