#include <libical/ical.h>
#include <string.h>
+#include <syslog.h>
// Check to see if two events overlap. Returns nonzero if they do.
int ical_ctdl_is_overlap(
}
}
+#ifdef DEBUG_ICAL_OVERLAP
+ syslog(LOG_DEBUG, "Comparing t1start=%s,t1end=%s to t2start=%s,t2end=%s",
+ icaltime_as_ical_string_r(t1start),
+ icaltime_as_ical_string_r(t1end),
+ icaltime_as_ical_string_r(t2start),
+ icaltime_as_ical_string_r(t2end)
+ );
+#endif
+
+
if (icaltime_is_null_time(t2end)) {
memcpy(&t2end, &t2start, sizeof(struct icaltimetype));
}
return(1);
}
-#ifdef DEBUG_ICAL_OVERLAP
- syslog(LOG_DEBUG, "Comparing t1start %d:%d t1end %d:%d t2start %d:%d t2end %d:%d",
- t1start.hour, t1start.minute, t1end.hour, t1end.minute,
- t2start.hour, t2start.minute, t2end.hour, t2end.minute
- );
-#endif
-
// Now check for overlaps using date *and* time.
// If event 1 ends before event 2 starts, there is no match.