aboutsummaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-01-26 18:42:59 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2019-01-26 18:42:59 +0100
commita431bae2f1e97a3a711ea55384caa3d40343bad4 (patch)
tree8515e80a52f206fb29f7ad78d65edd647af5d9e8 /parse.c
parentAdd vim modeline to trie.inc. (diff)
downloadcalp-a431bae2f1e97a3a711ea55384caa3d40343bad4.tar.gz
calp-a431bae2f1e97a3a711ea55384caa3d40343bad4.tar.xz
Add -Wextra flag, fix resulting warnings.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/parse.c b/parse.c
index 2850a51c..6b0f835b 100644
--- a/parse.c
+++ b/parse.c
@@ -66,21 +66,15 @@ int parse_file(FILE* f, vcalendar* cal) {
++line;
- /* We just got a value */
- // LINE(line, key.mem, val.mem);
- /*
- if (strbuf_c(&cline.key, "LOCATION")) {
- if (strbuf_c(&cline.val, "")) return 1;
- LINE(line, cline.key.mem, cline.val.mem);
- }
- */
-
handle_kv(cal, ev, &cline, line, &s_ctx);
strbuf_soft_reset(&str);
p_ctx = p_key;
continue;
}
+ /*
+ * TODO context for property_{key,val}.
+ */
} else if (p_ctx == p_key && c == ':') {
/*
if (str.ptr + 1 > keylen) {
@@ -104,9 +98,11 @@ int parse_file(FILE* f, vcalendar* cal) {
ERR("Error parsing", errno);
} else {
/*
- * Close last pair if the file is lacking trailing whitespace.
- * A file with trailing whitespace would however fail.
- * TODO check the spec and adjust accordingly
+ * The standard (3.4, l. 2675) says that each icalobject must
+ * end with CRLF. My files however does not, so we also parse
+ * the end here.
+ * TODO this doesn't do anything with its read value
+ * TODO This might crash if we have the CRLF
*/
if (str.ptr + 1 > vallen) {
vallen = str.ptr + 1;
@@ -121,6 +117,9 @@ int parse_file(FILE* f, vcalendar* cal) {
return 0;
}
+/*
+ * TODO Extend this to handle properties
+ */
int handle_kv(
vcalendar* cal,
vevent* ev,