* date/time properties to UTC. It also strips out any VTIMEZONE
* subcomponents afterwards, because they're irrelevant.
*
+ * Everything here will work on both a fully encapsulated VCALENDAR component
+ * or any type of subcomponent.
+ *
*/
+#include <ctype.h>
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#include <signal.h>
#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#ifdef HAVE_LIMITS_H
#include <limits.h>
-#include <stdio.h>
+#endif
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
#include <string.h>
-#include <strings.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <signal.h>
#include "webcit.h"
+#include "webserver.h"
+
-#ifdef HAVE_ICAL_H
-#include <ical.h>
+#ifdef WEBCIT_WITH_CALENDAR_SERVICE
/*
icalcomponent *rcal,
icalproperty *prop) {
- icaltimezone *t;
+ icaltimezone *t = NULL;
icalparameter *param;
const char *tzid;
struct icaltimetype TheTime;
/* Hunt for a TZID parameter in this property. */
param = icalproperty_get_first_parameter(prop, ICAL_TZID_PARAMETER);
- if (param == NULL) return;
/* Get the stringish name of this TZID. */
- tzid = icalparameter_get_tzid(param);
- if (tzid == NULL) return;
+ if (param != NULL) {
+ tzid = icalparameter_get_tzid(param);
- /* Convert it to an icaltimezone type. */
- t = icalcomponent_get_timezone(cal, tzid);
- if (t == NULL) return;
+ /* Convert it to an icaltimezone type. */
+ if (tzid != NULL) {
+ t = icalcomponent_get_timezone(cal, tzid);
+ }
+
+ }
/* Now we know the timezone. Convert to UTC. */
}
/* Do the conversion. */
- icaltimezone_convert_time(&TheTime,
- t,
- icaltimezone_get_utc_timezone()
- );
+ if (t != NULL) {
+ icaltimezone_convert_time(&TheTime,
+ t,
+ icaltimezone_get_utc_timezone()
+ );
+ }
TheTime.is_utc = 1;
icalproperty_remove_parameter_by_kind(prop, ICAL_TZID_PARAMETER);
}
-#endif /* HAVE_ICAL_H */
+#endif /* WEBCIT_WITH_CALENDAR_SERVICE */