#include "webcit.h"
-/*
- * A CalDAV REPORT can only be one type. This is stored in the report_type member.
- */
+// A CalDAV REPORT can only be one type. This is stored in the report_type member.
enum cr_type {
cr_calendar_query,
cr_calendar_multiget,
};
-/*
- * Data type for CalDAV Report Parameters.
- * As we slog our way through the XML we learn what the client is asking for
- * and build up the contents of this data type.
- */
+// Data type for CalDAV Report Parameters.
+// As we slog our way through the XML we learn what the client is asking for
+// and build up the contents of this data type.
struct cr_parms {
int tag_nesting_level; // not needed, just kept for pretty-printing
enum cr_type report_type; // which RFC4791 section 7 REPORT are we generating
};
-/*
- * XML parser callback
- */
-void caldav_xml_start(void *data, const char *el, const char **attr)
-{
+// XML parser callback
+void caldav_xml_start(void *data, const char *el, const char **attr) {
struct cr_parms *crp = (struct cr_parms *) data;
int i;
}
-/*
- * XML parser callback
- */
-void caldav_xml_end(void *data, const char *el)
-{
+// XML parser callback
+void caldav_xml_end(void *data, const char *el) {
struct cr_parms *crp = (struct cr_parms *) data;
--crp->tag_nesting_level;
}
-/*
- * XML parser callback
- */
-void caldav_xml_chardata(void *data, const XML_Char * s, int len)
-{
+// XML parser callback
+void caldav_xml_chardata(void *data, const XML_Char * s, int len) {
struct cr_parms *crp = (struct cr_parms *) data;
if (crp->Chardata == NULL) {
}
-/*
- * Called by caldav_response() to fetch a message (by number) in the current room,
- * and return only the icalendar data as a StrBuf. Returns NULL if not found.
- *
- * NOTE: this function expects that "MSGP text/calendar" was issued at the beginning
- * of a REPORT operation to set our preferred MIME type to calendar data.
- */
-StrBuf *fetch_ical(struct ctdlsession * c, long msgnum)
-{
+// Called by caldav_response() to fetch a message (by number) in the current room,
+// and return only the icalendar data as a StrBuf. Returns NULL if not found.
+//
+// NOTE: this function expects that "MSGP text/calendar" was issued at the beginning
+// of a REPORT operation to set our preferred MIME type to calendar data.
+StrBuf *fetch_ical(struct ctdlsession * c, long msgnum) {
char buf[1024];
StrBuf *Buf = NULL;
}
-/*
- * Called by caldav_report() to output a single item.
- * Our policy is to throw away the list of properties the client asked for, and just send everything.
- */
-void caldav_response(struct http_transaction *h, struct ctdlsession *c, StrBuf * ReportOut, StrBuf * ThisHref)
-{
+// Called by caldav_report() to output a single item.
+// Our policy is to throw away the list of properties the client asked for, and just send everything.
+void caldav_response(struct http_transaction *h, struct ctdlsession *c, StrBuf * ReportOut, StrBuf * ThisHref) {
long msgnum;
StrBuf *Caldata = NULL;
char *euid;
}
-/*
- * Called by report_the_room_itself() in room_functions.c when a CalDAV REPORT method
- * is requested on a calendar room. We fire up an XML Parser to decode the request and
- * hopefully produce the correct output.
- */
-void caldav_report(struct http_transaction *h, struct ctdlsession *c)
-{
+// Called by report_the_room_itself() in room_functions.c when a CalDAV REPORT method
+// is requested on a calendar room. We fire up an XML Parser to decode the request and
+// hopefully produce the correct output.
+void caldav_report(struct http_transaction *h, struct ctdlsession *c) {
struct cr_parms crp;
char buf[1024];
crp.Chardata = NULL;
}
- /*
- * We're going to make a lot of MSG4 calls, and the preferred MIME type we want is "text/calendar".
- * The iCalendar standard is mature now, and we are no longer interested in text/x-vcal or application/ics.
- */
+ // We're going to make a lot of MSG4 calls, and the preferred MIME type we want is "text/calendar".
+ // The iCalendar standard is mature now, and we are no longer interested in text/x-vcal or application/ics.
ctdl_printf(c, "MSGP text/calendar");
ctdl_readline(c, buf, sizeof buf);
- /*
- * Now begin the REPORT.
- */
+ // Now begin the REPORT.
syslog(LOG_DEBUG, "CalDAV REPORT type is: %d", crp.report_type);
StrBuf *ReportOut = NewStrBuf();
StrBufAppendPrintf(ReportOut, "<?xml version=\"1.0\" encoding=\"utf-8\"?>"