From c374807e9d73014ce57eacbbaa56e05460288368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 9 Feb 2019 00:19:58 +0100 Subject: Extend parsing to handle tree's of vcomponents. --- parse.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'parse.h') diff --git a/parse.h b/parse.h index ea60461f..ad1cebc2 100644 --- a/parse.h +++ b/parse.h @@ -7,6 +7,10 @@ #include "strbuf.h" #include "vcal.h" +#define TYPE vcomponent +#include "linked_list.h" +#undef TYPE + /* * Max length of a line. * TODO update this to allow longer lines, in case someone doesn't @@ -28,18 +32,19 @@ typedef enum { } scope_context; typedef struct { - scope_context scope; - strbuf* skip_to; + char* filename; + LLIST(strbuf) key_stack; + LLIST(vcomponent) comp_stack; } parse_ctx; +INIT_F(parse_ctx, char* filename); + int handle_kv( - vcomponent* cal, - vcomponent* ev, content_line* cline, int line, parse_ctx* ctx ); -int parse_file(char* fname, FILE* f, vcomponent* cal); +int parse_file(char* filename, FILE* f, vcomponent* cal); #endif /* PARSE_H */ -- cgit v1.2.3