aboutsummaryrefslogtreecommitdiff
path: root/parse.h
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-02-09 00:19:58 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-02-09 00:19:58 +0100
commitc374807e9d73014ce57eacbbaa56e05460288368 (patch)
treeaf9974aa6b03c9e25c9e42c108d9f25277665b41 /parse.h
parentFix minor memmory error. (diff)
downloadcalp-c374807e9d73014ce57eacbbaa56e05460288368.tar.gz
calp-c374807e9d73014ce57eacbbaa56e05460288368.tar.xz
Extend parsing to handle tree's of vcomponents.
Diffstat (limited to 'parse.h')
-rw-r--r--parse.h15
1 files changed, 10 insertions, 5 deletions
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 */