summaryrefslogtreecommitdiffstats
path: root/src/parser.c
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2022-05-20 13:15:14 +0300
committergramanas <anastasis.gramm2@gmail.com>2022-05-20 13:15:14 +0300
commitb30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7 (patch)
treebfae4137f78a0bf223518f6590db2bd436e82185 /src/parser.c
parent3515199c9e158d4b6fe5d064539bdf288dca7b81 (diff)
downloadfoodtools-b30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7.tar.gz
foodtools-b30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7.tar.bz2
foodtools-b30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7.zip
aha
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/parser.c b/src/parser.c
index 5009ca1..e4bffb4 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -3,12 +3,6 @@
#include "parser.h"
#include "util.h"
-typedef enum parser_type {
- TITLE = 0,
- ITEMS,
- STEPS,
-} pt;
-
static const int
parse_title(const char * s, recipe * r, pt * type)
{
@@ -24,16 +18,16 @@ parse_title(const char * s, recipe * r, pt * type)
r->title = strdup(r->filename);
rc = 1;
}
- *type = ITEMS;
+ if (type) *type = ITEMS;
return rc;
}
-static const int
+int
parse_item(const char * s, recipe * r, pt * type, char * error)
{
fdebug("^ item\n");
if (!strcmp(s, "---")) {
- *type = STEPS;
+ if (type) *type = STEPS;
return 0;
}