move calendar prototypes around, add more with cproto
[citadel.git] / citadel / server / modules / calendar / calendar_report.c
index 1ffe3edfc4491e631d37c86f8f71f07a7c37ed2e..a7fb8ba1d3094032a85df3365612257ad67573b3 100644 (file)
@@ -6,17 +6,21 @@
 // This program is open source software.  Use, duplication, or disclosure
 // are subject to the terms of the GNU General Public License version 3.
 
-#define PRODID "-//Citadel//NONSGML Citadel Calendar//EN"
-
-#include "../../ctdl_module.h"
 #include <libical/ical.h>
+#include "../../ctdl_module.h"
 #include "../../msgbase.h"
 #include "../../internet_addressing.h"
-#include "serv_calendar.h"
 #include "../../room_ops.h"
 #include "../../euidindex.h"
 #include "../../default_timezone.h"
 #include "../../config.h"
+#include "serv_calendar.h"
+
+
+// CtdlForEachMessage back end
+void calendar_report_backend(long msgnum, void *data) {
+       syslog(LOG_DEBUG, "%ld", msgnum);
+}
 
 
 void calendar_report(void) {
@@ -30,10 +34,21 @@ void calendar_report(void) {
                return;         // This room does not contain a calendar.
        }
 
-       cprintf("%d Send query then receive response\n", SEND_THEN_RECV);
-       while(client_getln(buf, sizeof buf) >= 0 && strcmp(buf,"000")) {
-       }
-       cprintf("000\n");
+
+       // Now go through the room encapsulating all calendar items.
+       void *foo;
+       CtdlForEachMessage(MSGS_ALL, 0, NULL,
+               NULL,
+               NULL,
+               calendar_report_backend,
+               (void *) foo
+       );
+
+       cprintf("%d Not finished\n", ERROR);
+       //cprintf("%d Send query then receive response\n", SEND_THEN_RECV);
+       //while(client_getln(buf, sizeof buf) >= 0 && strcmp(buf,"000")) {
+       //}
+       //cprintf("000\n");
 }