diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-15 23:03:10 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-02-15 23:03:10 +0100 |
commit | 377ccdb9f2e2c13c371c78f4c1ca261908a656de (patch) | |
tree | fa0789a6e6c5413249cf277e7954e2c20113f6a4 /calendar.h | |
parent | Move fold function. (diff) | |
download | calp-377ccdb9f2e2c13c371c78f4c1ca261908a656de.tar.gz calp-377ccdb9f2e2c13c371c78f4c1ca261908a656de.tar.xz |
Fix pending fixes in calendar.c.
Diffstat (limited to '')
-rw-r--r-- | calendar.h | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -3,6 +3,39 @@ #include "vcal.h" +/* + * Reads all ics flies in path into the given vcomponent. The + * component is assumed to be a abstract ROOT element, whose first + * component will most likely become a VCALENDAR. + * + * path should either be a single .ics file (vcalendar), or a + * directory directly containing .ics files (vdir). + */ int read_vcalendar(vcomponent* cal, char* path); +/* + * Gets extension from filename. Writes output to ext. + * Assumes that the extension is the text between the last dot and + * the end of the string, and that no slashes can occur between the + * dot and the end. + * + * Returns the length of the extension, 0 if no extension. + */ +int get_extension(const char* filename, char* ext, ssize_t max_len); + +/* Returns 1 if path has extension ext, 0 otherwise */ +int check_ext (const char* path, const char* ext); + +/* Handle a lone ics file */ +int handle_file(vcomponent* cal, char* path); + +/* Handle a directory of ics files */ +int handle_dir(vcomponent* cal, char* path); + +/* + * Helper for opening a single ICS file. Handles file internally, and + * writes output to cal. + */ +int open_ics (char* resolved_path, vcomponent* cal); + #endif /* CALENDAR_H */ |