diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-01-26 18:42:59 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-01-26 18:42:59 +0100 |
commit | a431bae2f1e97a3a711ea55384caa3d40343bad4 (patch) | |
tree | 8515e80a52f206fb29f7ad78d65edd647af5d9e8 /parse.c | |
parent | Add vim modeline to trie.inc. (diff) | |
download | calp-a431bae2f1e97a3a711ea55384caa3d40343bad4.tar.gz calp-a431bae2f1e97a3a711ea55384caa3d40343bad4.tar.xz |
Add -Wextra flag, fix resulting warnings.
Diffstat (limited to '')
-rw-r--r-- | parse.c | 23 |
1 files changed, 11 insertions, 12 deletions
@@ -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, |