From b30cd3e1b8d1162c529bfdd602d0d56ccd2e38c7 Mon Sep 17 00:00:00 2001 From: gramanas Date: Fri, 20 May 2022 13:15:14 +0300 Subject: aha --- src/parser.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/parser.c') 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; } -- cgit v1.2.3