[dovecot-cvs] dovecot/src/lib-auth auth-client.c, 1.11, 1.12 auth-client.h, 1.13, 1.14 auth-server-request.c, 1.26, 1.27

tss at dovecot.org tss at dovecot.org
Fri Dec 15 16:55:37 UTC 2006


Update of /var/lib/cvs/dovecot/src/lib-auth
In directory talvi:/tmp/cvs-serv346/lib-auth

Modified Files:
	auth-client.c auth-client.h auth-server-request.c 
Log Message:
Added context parameter type safety checks for most callback APIs.



Index: auth-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-client.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- auth-client.c	28 Jun 2006 13:10:34 -0000	1.11
+++ auth-client.c	15 Dec 2006 16:55:35 -0000	1.12
@@ -113,6 +113,7 @@
 		client->connections != NULL;
 }
 
+#undef auth_client_set_connect_notify
 void auth_client_set_connect_notify(struct auth_client *client,
 				    auth_connect_notify_callback_t *callback,
 				    void *context)

Index: auth-client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-client.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- auth-client.h	24 Feb 2006 10:24:11 -0000	1.13
+++ auth-client.h	15 Dec 2006 16:55:35 -0000	1.14
@@ -48,6 +48,10 @@
 void auth_client_set_connect_notify(struct auth_client *client,
 				    auth_connect_notify_callback_t *callback,
 				    void *context);
+#define auth_client_set_connect_notify(client, callback, context) \
+	CONTEXT_CALLBACK3(auth_client_set_connect_notify, \
+			  auth_connect_notify_callback_t, \
+			  callback, context, client)
 const struct auth_mech_desc *
 auth_client_get_available_mechs(struct auth_client *client,
 				unsigned int *mech_count);
@@ -69,6 +73,13 @@
 			const struct auth_request_info *request_info,
 			auth_request_callback_t *callback, void *context,
 			const char **error_r);
+#ifdef CONTEXT_TYPE_SAFETY
+#  define auth_client_request_new(client, id, request_info, \
+				  callback, context, error_r) \
+	({(void)(1 ? 0 : callback(0, 0, 0, 0, context)); \
+	  auth_client_request_new(client, id, request_info, \
+		(auth_request_callback_t *)callback, context, error_r); })
+#endif
 
 /* Continue authentication. Call when
    reply->result == AUTH_CLIENT_REQUEST_CONTINUE */

Index: auth-server-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-auth/auth-server-request.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- auth-server-request.c	17 Jun 2006 14:45:54 -0000	1.26
+++ auth-server-request.c	15 Dec 2006 16:55:35 -0000	1.27
@@ -311,6 +311,7 @@
 	hash_iterate_deinit(iter);
 }
 
+#undef auth_client_request_new
 struct auth_request *
 auth_client_request_new(struct auth_client *client, struct auth_connect_id *id,
 			const struct auth_request_info *request_info,



More information about the dovecot-cvs mailing list