[dovecot-cvs] dovecot/src/lib-storage mail-storage.c, 1.66, 1.67 mail-storage.h, 1.121, 1.122

tss at dovecot.org tss at dovecot.org
Fri Dec 15 18:38:21 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-storage
In directory talvi:/tmp/cvs-serv3614/lib-storage

Modified Files:
	mail-storage.c mail-storage.h 
Log Message:
Replaced void *context from a lot of callbacks with the actual context
type. Also added/fixed some context type checks.



Index: mail-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- mail-storage.c	6 Dec 2006 15:08:24 -0000	1.66
+++ mail-storage.c	15 Dec 2006 18:38:19 -0000	1.67
@@ -475,12 +475,18 @@
 	return ctx->box->v.sync_deinit(ctx, status_items, status_r);
 }
 
+#undef mailbox_notify_changes
 void mailbox_notify_changes(struct mailbox *box, unsigned int min_interval,
 			    mailbox_notify_callback_t *callback, void *context)
 {
 	box->v.notify_changes(box, min_interval, callback, context);
 }
 
+void mailbox_notify_changes_stop(struct mailbox *box)
+{
+	box->v.notify_changes(box, 0, NULL, NULL);
+}
+
 struct mail_keywords *
 mailbox_keywords_create(struct mailbox_transaction_context *t,
 			const char *const keywords[])

Index: mail-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- mail-storage.h	6 Dec 2006 15:08:24 -0000	1.121
+++ mail-storage.h	15 Dec 2006 18:38:19 -0000	1.122
@@ -303,10 +303,20 @@
 			enum mailbox_status_items status_items,
 			struct mailbox_status *status_r);
 
-/* Call given callback function when something changes in the mailbox.
-   It's done until this function is called with callback = NULL. */
+/* Call given callback function when something changes in the mailbox. */
 void mailbox_notify_changes(struct mailbox *box, unsigned int min_interval,
 			    mailbox_notify_callback_t *callback, void *context);
+#ifdef CONTEXT_TYPE_SAFETY
+#  define mailbox_notify_changes(box, min_interval, callback, context) \
+	({(void)(1 ? 0 : callback((struct mailbox *)NULL, context)); \
+	  mailbox_notify_changes(box, min_interval, \
+		(mailbox_notify_callback_t *)callback, context); })
+#else
+#  define mailbox_notify_changes(box, min_interval, callback, context) \
+	  mailbox_notify_changes(box, min_interval, \
+		(mailbox_notify_callback_t *)callback, context)
+#endif
+void mailbox_notify_changes_stop(struct mailbox *box);
 
 struct mailbox_transaction_context *
 mailbox_transaction_begin(struct mailbox *box,



More information about the dovecot-cvs mailing list