4 * Functions which handle calendar objects and their processing/display.
14 #include <sys/types.h>
16 #include <sys/socket.h>
18 #include <netinet/in.h>
27 #include "webserver.h"
37 * Handler stub for builds with no calendar library available
39 void cal_process_attachment(char *part_source) {
41 wprintf("<I>This message contains calendaring/scheduling information,"
42 " but support for calendars is not available on this "
43 "particular system. Please ask your system administrator to "
44 "install a new version of the Citadel web service with "
45 "calendaring enabled.</I><BR>\n"
50 #else /* HAVE_ICAL_H */
55 * Process a single calendar component.
56 * It won't be a compound component at this point because those have
57 * already been broken down by cal_process_object().
59 void cal_process_subcomponent(icalcomponent *cal) {
61 wprintf("cal_process_subcomponent() called<BR>\n");
62 wprintf("cal_process_subcomponent() exiting<BR>\n");
70 * Process a calendar object
71 * ...at this point it's already been deserialized by cal_process_attachment()
73 void cal_process_object(icalcomponent *cal) {
76 wprintf("cal_process_object() called<BR>\n");
78 /* Iterate through all subcomponents */
79 for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
81 c = icalcomponent_get_next_component(cal, ICAL_ANY_COMPONENT)) {
83 cal_process_subcomponent(c);
87 wprintf("cal_process_object() exiting<BR>\n");
93 * Deserialize a calendar object in a message so it can be processed.
94 * (This is the main entry point for these things)
96 void cal_process_attachment(char *part_source) {
99 wprintf("Processing calendar attachment<BR>\n");
100 cal = icalcomponent_new_from_string(part_source);
103 wprintf("Error parsing calendar object: %s<BR>\n",
104 icalerror_strerror(icalerrno));
108 cal_process_object(cal);
110 /* Free the memory we obtained from libical's constructor */
111 icalcomponent_free(cal);
114 #endif /* HAVE_ICAL_H */