diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-09 00:19:58 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-09 00:19:58 +0100 |
commit | c374807e9d73014ce57eacbbaa56e05460288368 (patch) | |
tree | af9974aa6b03c9e25c9e42c108d9f25277665b41 /parse.h | |
parent | Fix minor memmory error. (diff) | |
download | calp-c374807e9d73014ce57eacbbaa56e05460288368.tar.gz calp-c374807e9d73014ce57eacbbaa56e05460288368.tar.xz |
Extend parsing to handle tree's of vcomponents.
Diffstat (limited to 'parse.h')
-rw-r--r-- | parse.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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 */ |