summaryrefslogtreecommitdiffstats
path: root/types.h
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2021-09-02 17:23:42 +0300
committergramanas <anastasis.gramm2@gmail.com>2021-09-02 17:23:42 +0300
commit9deed51aa2df7ca5979963f7452a6439ad2d3767 (patch)
tree7ceea0494c01eeff7e7fdaaa8b1bfc7e5adf62c1 /types.h
downloadfoodtools-9deed51aa2df7ca5979963f7452a6439ad2d3767.tar.gz
foodtools-9deed51aa2df7ca5979963f7452a6439ad2d3767.tar.bz2
foodtools-9deed51aa2df7ca5979963f7452a6439ad2d3767.zip
initial
Diffstat (limited to 'types.h')
-rw-r--r--types.h46
1 files changed, 46 insertions, 0 deletions
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 */