[dovecot-cvs] dovecot/src/imap-login client-authenticate.c, 1.36, 1.37 client-authenticate.h, 1.3, 1.4 client.c, 1.45, 1.46 client.h, 1.16, 1.17

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


Update of /var/lib/cvs/dovecot/src/imap-login
In directory talvi:/tmp/cvs-serv27808/src/imap-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/imap-login/client-authenticate.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- client-authenticate.c	14 May 2005 20:32:03 -0000	1.36
+++ client-authenticate.c	13 Jan 2006 20:26:00 -0000	1.37
@@ -17,7 +17,7 @@
 
 #include <stdlib.h>
 
-const char *client_authenticate_get_capabilities(int secured)
+const char *client_authenticate_get_capabilities(bool secured)
 {
 	const struct auth_mech_desc *mech;
 	unsigned int i, count;
@@ -79,13 +79,13 @@
 	safe_memset(line, 0, strlen(line));
 }
 
-static int client_handle_args(struct imap_client *client,
-			      const char *const *args, int nologin)
+static bool client_handle_args(struct imap_client *client,
+			       const char *const *args, bool nologin)
 {
 	const char *reason = NULL, *host = NULL, *destuser = NULL, *pass = NULL;
 	string_t *reply;
 	unsigned int port = 143;
-	int proxy = FALSE, temp = FALSE;
+	bool proxy = FALSE, temp = FALSE;
 
 	for (; *args != NULL; args++) {
 		if (strcmp(*args, "nologin") == 0)
@@ -244,7 +244,7 @@
 
 	mech_name = IMAP_ARG_STR(&args[0]);
 	if (*mech_name == '\0')
-		return FALSE;
+		return 0;
 
 	client_ref(client);
 	sasl_server_auth_begin(&client->common, "IMAP", mech_name, NULL,

Index: client-authenticate.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client-authenticate.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- client-authenticate.h	24 Aug 2003 07:55:23 -0000	1.3
+++ client-authenticate.h	13 Jan 2006 20:26:00 -0000	1.4
@@ -1,7 +1,7 @@
 #ifndef __CLIENT_AUTHENTICATE_H
 #define __CLIENT_AUTHENTICATE_H
 
-const char *client_authenticate_get_capabilities(int secured);
+const char *client_authenticate_get_capabilities(bool secured);
 
 int cmd_login(struct imap_client *client, struct imap_arg *args);
 int cmd_authenticate(struct imap_client *client, struct imap_arg *args);

Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- client.c	28 Oct 2005 16:52:20 -0000	1.45
+++ client.c	13 Jan 2006 20:26:00 -0000	1.46
@@ -75,7 +75,7 @@
 
 /* Skip incoming data until newline is found,
    returns TRUE if newline was found. */
-int client_skip_line(struct imap_client *client)
+bool client_skip_line(struct imap_client *client)
 {
 	const unsigned char *data;
 	size_t i, data_size;
@@ -109,7 +109,7 @@
 	client_send_line(client, t_strconcat("* CAPABILITY ",
 					     get_capability(client), NULL));
 	client_send_tagline(client, "OK Capability completed.");
-	return TRUE;
+	return 1;
 }
 
 static void client_start_tls(struct imap_client *client)
@@ -159,12 +159,12 @@
 {
 	if (client->common.tls) {
 		client_send_tagline(client, "BAD TLS is already active.");
-		return TRUE;
+		return 1;
 	}
 
 	if (!ssl_initialized) {
 		client_send_tagline(client, "BAD TLS support isn't enabled.");
-		return TRUE;
+		return 1;
 	}
 
 	/* remove input handler, SSL proxy gives us a new fd. we also have to
@@ -187,13 +187,13 @@
 	} else {
 		client_start_tls(client);
 	}
-	return TRUE;
+	return 1;
 }
 
 static int cmd_noop(struct imap_client *client)
 {
 	client_send_tagline(client, "OK NOOP completed.");
-	return TRUE;
+	return 1;
 }
 
 static int cmd_logout(struct imap_client *client)
@@ -201,7 +201,7 @@
 	client_send_line(client, "* BYE Logging out");
 	client_send_tagline(client, "OK Logout completed.");
 	client_destroy(client, "Aborted login");
-	return TRUE;
+	return 1;
 }
 
 static int client_command_execute(struct imap_client *client, const char *cmd,
@@ -224,11 +224,12 @@
 	return -1;
 }
 
-static int client_handle_input(struct imap_client *client)
+static bool client_handle_input(struct imap_client *client)
 {
 	struct imap_arg *args;
 	const char *msg;
-	int ret, fatal;
+	int ret;
+	bool fatal;
 
 	i_assert(!client->common.authenticating);
 
@@ -307,7 +308,7 @@
 	return ret != 0;
 }
 
-int client_read(struct imap_client *client)
+bool client_read(struct imap_client *client)
 {
 	switch (i_stream_read(client->input)) {
 	case -2:
@@ -405,7 +406,7 @@
 	client->greeting_sent = TRUE;
 }
 
-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 imap_client *client;
@@ -520,7 +521,7 @@
 	client->refcount++;
 }
 
-int client_unref(struct imap_client *client)
+bool client_unref(struct imap_client *client)
 {
 	if (--client->refcount > 0)
 		return TRUE;

Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap-login/client.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- client.h	28 Oct 2005 16:52:20 -0000	1.16
+++ client.h	13 Jan 2006 20:26:00 -0000	1.17
@@ -38,12 +38,12 @@
 void client_send_line(struct imap_client *client, const char *line);
 void client_send_tagline(struct imap_client *client, const char *line);
 
-int client_read(struct imap_client *client);
-int client_skip_line(struct imap_client *client);
+bool client_read(struct imap_client *client);
+bool client_skip_line(struct imap_client *client);
 void client_input(void *context);
 
 void client_ref(struct imap_client *client);
-int client_unref(struct imap_client *client);
+bool client_unref(struct imap_client *client);
 
 void clients_init(void);
 void clients_deinit(void);



More information about the dovecot-cvs mailing list