* calendar.c: added
[citadel.git] / webcit / calendar.c
1 /*
2  * $Id$
3  *
4  * Functions which handle calendar objects and their processing/display.
5  *
6  */
7
8 #include <ctype.h>
9 #include <stdlib.h>
10 #include <unistd.h>
11 #include <stdio.h>
12 #include <fcntl.h>
13 #include <signal.h>
14 #include <sys/types.h>
15 #include <sys/wait.h>
16 #include <sys/socket.h>
17 #include <limits.h>
18 #include <netinet/in.h>
19 #include <netdb.h>
20 #include <string.h>
21 #include <pwd.h>
22 #include <errno.h>
23 #include <stdarg.h>
24 #include <pthread.h>
25 #include <signal.h>
26 #include "webcit.h"
27 #include "webserver.h"
28
29 #ifdef HAVE_ICAL_H
30 #include <ical.h>
31 #endif
32
33
34 #ifndef HAVE_ICAL_H
35
36 /*
37  * Handler stub for builds with no calendar library available
38  */
39 void cal_process_attachment(char *part_source) {
40
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"
46         );
47
48 }
49
50 #else /* HAVE_ICAL_H */
51
52 /*
53  * Handler stub for builds with no calendar library available
54  */
55 void cal_process_attachment(char *part_source) {
56         icalcomponent *cal;
57
58         wprintf("Processing calendar attachment<BR>\n");
59         cal = icalcomponent_new_from_string(part_source);
60
61         if (cal == NULL) {
62                 wprintf("Error parsing calendar object: %s<BR>\n",
63                         icalerror_strerror(icalerrno));
64                 return;
65         }
66
67         wprintf("Parsing went well.  Cool.<BR>\n");
68
69         /* Free the memory we obtained from libical's constructor */
70         icalcomponent_free(cal);
71 }
72
73 #endif /* HAVE_ICAL_H */