int process_required_attendees(xmlNode *xml_node);
int process_start(xmlNode *xml_node);
int process_end(xmlNode *xml_node);
+int process_location(xmlNode *xml_node);
int process_body(xmlNode *xml_node);
int process_subject(xmlNode *xml_node);
process_end(xml_node);
else if (!strcmp((char *)xml_node->name, "Body"))
process_body(xml_node);
+ else if (!strcmp((char *)xml_node->name, "Location"))
+ process_location(xml_node);
else if (!strcmp((char *)xml_node->name, "Subject"))
process_subject(xml_node);
else
return 0;
}
+int process_time(xmlNode *xml_node, char *name)
+{
+ char *tm = (char *)xmlNodeGetContent(xml_node);
+ if (!tm)
+ return -1;
+
+ fprintf(calfile, "%s:", name);
+ while (*tm) {
+ if (*tm == '-' || *tm == ':')
+ tm++;
+ fputc(*tm, calfile);
+ tm++;
+ }
+ fputc('\n', calfile);
+ return 0;
+}
int process_start(xmlNode *xml_node)
{
- return 0;
+ return process_time(xml_node, "DTSTART");
}
int process_end(xmlNode *xml_node)
{
+ return process_time(xml_node, "DTEND");
+}
+
+int process_location (xmlNode *xml_node)
+{
+ const char *dur = (char *)xmlNodeGetContent(xml_node);
+ if (!dur)
+ return -1;
+ fprintf(calfile, "LOCATION: %s\n", dur);
return 0;
}
int process_body(xmlNode *xml_node)
{
- char *body = (char *)xmlNodeGetContent(xml_node);
+ const char *body = (char *)xmlNodeGetContent(xml_node);
int col = 12;
if (!body)