[dovecot-cvs] dovecot/src/pop3-login client-authenticate.c, 1.44, 1.45 client-authenticate.h, 1.3, 1.4 client.c, 1.44, 1.45 client.h, 1.16, 1.17

cras at dovecot.org cras at dovecot.org
Fri Jan 13 22:26:58 EET 2006


Update of /var/lib/cvs/dovecot/src/pop3-login
In directory talvi:/tmp/cvs-serv27808/src/pop3-login

Modified Files:
	client-authenticate.c client-authenticate.h client.c client.h 
Log Message:
Added "bool" type and changed all ints that were used as booleans to bool.



Index: client-authenticate.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client-authenticate.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- client-authenticate.c	11 Sep 2005 13:23:02 -0000	1.44
+++ client-authenticate.c	13 Jan 2006 20:26:49 -0000	1.45
@@ -19,7 +19,7 @@
 
 #include <stdlib.h>
 
-int cmd_capa(struct pop3_client *client, const char *args __attr_unused__)
+bool cmd_capa(struct pop3_client *client, const char *args __attr_unused__)
 {
 	const struct auth_mech_desc *mech;
 	unsigned int i, count;
@@ -83,13 +83,13 @@
 	safe_memset(line, 0, strlen(line));
 }
 
-static int client_handle_args(struct pop3_client *client,
-			      const char *const *args, int nologin)
+static bool client_handle_args(struct pop3_client *client,
+			       const char *const *args, bool nologin)
 {
 	const char *reason = NULL, *host = NULL, *destuser = NULL, *pass = NULL;
 	string_t *reply;
 	unsigned int port = 110;
-	int proxy = FALSE, temp = FALSE;
+	bool proxy = FALSE, temp = FALSE;
 
 	for (; *args != NULL; args++) {
 		if (strcmp(*args, "nologin") == 0)
@@ -203,7 +203,7 @@
 	client_unref(client);
 }
 
-int cmd_auth(struct pop3_client *client, const char *args)
+bool cmd_auth(struct pop3_client *client, const char *args)
 {
 	const struct auth_mech_desc *mech;
 	const char *mech_name, *p;
@@ -248,7 +248,7 @@
 	return TRUE;
 }
 
-int cmd_user(struct pop3_client *client, const char *args)
+bool cmd_user(struct pop3_client *client, const char *args)
 {
 	if (!client->common.secured && disable_plaintext_auth) {
 		if (verbose_auth) {
@@ -267,7 +267,7 @@
 	return TRUE;
 }
 
-int cmd_pass(struct pop3_client *client, const char *args)
+bool cmd_pass(struct pop3_client *client, const char *args)
 {
 	string_t *plain_login, *base64;
 
@@ -304,7 +304,7 @@
 	return TRUE;
 }
 
-int cmd_apop(struct pop3_client *client, const char *args)
+bool cmd_apop(struct pop3_client *client, const char *args)
 {
 	buffer_t *apop_data, *base64;
 	const char *p;

Index: client-authenticate.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client-authenticate.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- client-authenticate.h	2 Jul 2004 22:03:37 -0000	1.3
+++ client-authenticate.h	13 Jan 2006 20:26:49 -0000	1.4
@@ -1,10 +1,10 @@
 #ifndef __CLIENT_AUTHENTICATE_H
 #define __CLIENT_AUTHENTICATE_H
 
-int cmd_capa(struct pop3_client *client, const char *args);
-int cmd_user(struct pop3_client *client, const char *args);
-int cmd_pass(struct pop3_client *client, const char *args);
-int cmd_auth(struct pop3_client *client, const char *args);
-int cmd_apop(struct pop3_client *client, const char *args);
+bool cmd_capa(struct pop3_client *client, const char *args);
+bool cmd_user(struct pop3_client *client, const char *args);
+bool cmd_pass(struct pop3_client *client, const char *args);
+bool cmd_auth(struct pop3_client *client, const char *args);
+bool cmd_apop(struct pop3_client *client, const char *args);
 
 #endif

Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- client.c	18 Sep 2005 14:43:47 -0000	1.44
+++ client.c	13 Jan 2006 20:26:49 -0000	1.45
@@ -109,7 +109,7 @@
 	return 1;
 }
 
-static int cmd_stls(struct pop3_client *client)
+static bool cmd_stls(struct pop3_client *client)
 {
 	if (client->common.tls) {
 		client_send_line(client, "-ERR TLS is already active.");
@@ -144,15 +144,15 @@
 	return TRUE;
 }
 
-static int cmd_quit(struct pop3_client *client)
+static bool cmd_quit(struct pop3_client *client)
 {
 	client_send_line(client, "+OK Logging out");
 	client_destroy(client, "Aborted login");
 	return TRUE;
 }
 
-static int client_command_execute(struct pop3_client *client, const char *cmd,
-				  const char *args)
+static bool client_command_execute(struct pop3_client *client, const char *cmd,
+				   const char *args)
 {
 	cmd = t_str_ucase(cmd);
 	if (strcmp(cmd, "CAPA") == 0)
@@ -174,7 +174,7 @@
 	return FALSE;
 }
 
-int client_read(struct pop3_client *client)
+bool client_read(struct pop3_client *client)
 {
 	switch (i_stream_read(client->input)) {
 	case -2:
@@ -298,7 +298,7 @@
 					     client->apop_challenge, NULL));
 }
 
-struct client *client_create(int fd, int ssl, const struct ip_addr *local_ip,
+struct client *client_create(int fd, bool ssl, const struct ip_addr *local_ip,
 			     const struct ip_addr *ip)
 {
 	struct pop3_client *client;
@@ -408,7 +408,7 @@
 	client->refcount++;
 }
 
-int client_unref(struct pop3_client *client)
+bool client_unref(struct pop3_client *client)
 {
 	if (--client->refcount > 0)
 		return TRUE;

Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3-login/client.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- client.h	27 Oct 2004 14:20:21 -0000	1.16
+++ client.h	13 Jan 2006 20:26:49 -0000	1.17
@@ -38,11 +38,11 @@
 
 void client_send_line(struct pop3_client *client, const char *line);
 
-int client_read(struct pop3_client *client);
+bool client_read(struct pop3_client *client);
 void client_input(void *context);
 
 void client_ref(struct pop3_client *client);
-int client_unref(struct pop3_client *client);
+bool client_unref(struct pop3_client *client);
 
 void clients_init(void);
 void clients_deinit(void);



More information about the dovecot-cvs mailing list