From: Art Cancro Date: Wed, 10 Jan 2024 22:20:09 +0000 (-0500) Subject: move calendar prototypes around, add more with cproto X-Git-Tag: v997~19 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=47638e6a9b3f0c9cac3bdeee4ff214023b23c9d1 move calendar prototypes around, add more with cproto --- diff --git a/citadel/server/modules/calendar/calendar_report.c b/citadel/server/modules/calendar/calendar_report.c index 1ffe3edfc..a7fb8ba1d 100644 --- a/citadel/server/modules/calendar/calendar_report.c +++ b/citadel/server/modules/calendar/calendar_report.c @@ -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 +#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"); } diff --git a/citadel/server/modules/calendar/serv_calendar.c b/citadel/server/modules/calendar/serv_calendar.c index ac9d74465..4d8605827 100644 --- a/citadel/server/modules/calendar/serv_calendar.c +++ b/citadel/server/modules/calendar/serv_calendar.c @@ -7,23 +7,15 @@ // 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 +#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" - -struct ical_respond_data { - char desired_partnum[SIZ]; - icalcomponent *cal; -}; - +#include "serv_calendar.h" // Utility function to create a new VCALENDAR component with some of the // required fields already set the way we like them. @@ -1523,8 +1515,7 @@ void ical_getics_backend(long msgnum, void *data) { if (p) { const char *tzid = icalproperty_get_tzid(p); if (!icalcomponent_get_timezone(encaps, tzid)) { - icalcomponent_add_component(encaps, - icalcomponent_new_clone(c)); + icalcomponent_add_component(encaps, icalcomponent_new_clone(c)); } } } diff --git a/citadel/server/modules/calendar/serv_calendar.h b/citadel/server/modules/calendar/serv_calendar.h index 93d6ee86e..784c10b7a 100644 --- a/citadel/server/modules/calendar/serv_calendar.h +++ b/citadel/server/modules/calendar/serv_calendar.h @@ -5,6 +5,8 @@ // This program is open source software. Use, duplication, or disclosure // is subject to the terms of the GNU General Public License version 3. +#define PRODID "-//Citadel//NONSGML Citadel Calendar//EN" + // "server_generated_invitations" tells the Citadel server that the // client wants invitations to be generated and sent out by the // server. Set to 1 to enable this functionality. @@ -21,4 +23,58 @@ struct cit_ical { #define CIT_ICAL CC->CIT_ICAL #define MAX_RECUR 1000 + +// This is a structure to pass data back and forth between callbacks. +struct ical_respond_data { + char desired_partnum[SIZ]; + icalcomponent *cal; +}; + + +// Everything below was generated by `cproto *.c 2>/dev/null` + +// calendar_report.c +void calendar_report_backend(long msgnum, void *data); void calendar_report(void); + +// serv_calendar.c +icalcomponent *icalcomponent_new_citadel_vcalendar(void); +icalcomponent *ical_encapsulate_subcomponent(icalcomponent *subcomp); +void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal); +void ical_send_a_reply(icalcomponent *request, char *action); +void ical_locate_part(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, size_t length, char *encoding, char *cbid, void *cbuserdata); +void ical_respond(long msgnum, char *partnum, char *action); +void ical_learn_uid_of_reply(char *uidbuf, icalcomponent *cal); +void ical_hunt_for_event_to_update(long msgnum, void *data); +void ical_locate_original_event(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, size_t length, char *encoding, char *cbid, void *cbuserdata); +void ical_merge_attendee_reply(icalcomponent *event, icalcomponent *reply); +int ical_update_my_calendar_with_reply(icalcomponent *cal); +void ical_handle_rsvp(long msgnum, char *partnum, char *action); +icalproperty *ical_ctdl_get_subprop(icalcomponent *cal, icalproperty_kind which_prop); +int ical_ctdl_is_overlap(struct icaltimetype t1start, struct icaltimetype t1end, struct icaltimetype t2start, struct icaltimetype t2end); +int ical_conflicts_phase6(struct icaltimetype t1start, struct icaltimetype t1end, struct icaltimetype t2start, struct icaltimetype t2end, long existing_msgnum, char *conflict_event_uid, char *conflict_event_summary, char *compare_uid); +void ical_conflicts_phase5(struct icaltimetype t1start, struct icaltimetype t1end, icalcomponent *existing_event, long existing_msgnum, char *compare_uid); +void ical_conflicts_phase4(icalcomponent *proposed_event, icalcomponent *existing_event, long existing_msgnum); +void ical_hunt_for_conflicts_backend(long msgnum, void *data); +void ical_hunt_for_conflicts(icalcomponent *cal); +void ical_conflicts(long msgnum, char *partnum); +void ical_add_to_freebusy(icalcomponent *fb, icalcomponent *top_level_cal); +void ical_freebusy_backend(long msgnum, void *data); +void ical_freebusy(char *who); +void ical_getics_backend(long msgnum, void *data); +void ical_getics(void); +void ical_putics_grabtzids(icalparameter *param, void *data); +void ical_putics(void); +void ical_CtdlCreateRoom(void); +void ical_send_out_invitations(icalcomponent *top_level_cal, icalcomponent *cal); +void ical_saving_vevent(icalcomponent *top_level_cal, icalcomponent *cal); +void ical_obj_beforesave_backend(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, size_t length, char *encoding, char *cbid, void *cbuserdata); +int ical_obj_beforesave(struct CtdlMessage *msg, struct recptypes *recp); +void ical_obj_aftersave_backend(char *name, char *filename, char *partnum, char *disp, void *content, char *cbtype, char *cbcharset, size_t length, char *encoding, char *cbid, void *cbuserdata); +int ical_obj_aftersave(struct CtdlMessage *msg, struct recptypes *recp); +void ical_session_startup(void); +void ical_session_shutdown(void); +void ical_fixed_output_backend(icalcomponent *cal, int recursion_level); +void ical_fixed_output(char *ptr, int len); +void cmd_ical(char *argbuf); +char *ctdl_module_init_calendar(void);