[dovecot-cvs] dovecot/src/pop3 client.c, 1.58, 1.59 commands.c, 1.50, 1.51 common.h, 1.10, 1.11 main.c, 1.37, 1.38

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


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

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



Index: client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/client.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- client.c	29 Jul 2005 08:43:05 -0000	1.58
+++ client.c	13 Jan 2006 20:26:48 -0000	1.59
@@ -57,7 +57,8 @@
         struct mailbox_status status;
 	struct mail *mail;
 	buffer_t *message_sizes_buf;
-	int i, failed;
+	int i;
+	bool failed;
 
 	message_sizes_buf = buffer_create_dynamic(default_pool, 512);
 
@@ -130,7 +131,7 @@
 {
 	struct client *client;
         enum mailbox_open_flags flags;
-	int syntax_error, temporary_error;
+	bool syntax_error, temporary_error;
 
 	/* always use nonblocking I/O */
 	net_set_nonblock(hin, TRUE);
@@ -300,7 +301,7 @@
 void client_send_storage_error(struct client *client)
 {
 	const char *error;
-	int syntax, temporary_error;
+	bool syntax, temporary_error;
 
 	if (mailbox_is_inconsistent(client->mailbox)) {
 		client_send_line(client, "-ERR Mailbox is in inconsistent "

Index: commands.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/commands.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- commands.c	6 Dec 2005 17:34:45 -0000	1.50
+++ commands.c	13 Jan 2006 20:26:48 -0000	1.51
@@ -90,7 +90,7 @@
 static int cmd_capa(struct client *client, const char *args __attr_unused__)
 {
 	client_send_line(client, "+OK\r\n"POP3_CAPABILITY_REPLY".");
-	return TRUE;
+	return 1;
 }
 
 static int cmd_dele(struct client *client, const char *args)
@@ -98,7 +98,7 @@
 	unsigned int msgnum;
 
 	if (get_msgnum(client, args, &msgnum) == NULL)
-		return FALSE;
+		return 0;
 
 	if (!client->deleted) {
 		client->deleted_bitmask = i_malloc(MSGS_BITMASK_SIZE(client));
@@ -109,7 +109,7 @@
 	client->deleted_count++;
 	client->deleted_size += client->message_sizes[msgnum];
 	client_send_line(client, "+OK Marked to be deleted.");
-	return TRUE;
+	return 1;
 }
 
 struct cmd_list_context {
@@ -161,35 +161,35 @@
 		unsigned int msgnum;
 
 		if (get_msgnum(client, args, &msgnum) == NULL)
-			return FALSE;
+			return 0;
 
 		client_send_line(client, "+OK %u %"PRIuUOFF_T, msgnum+1,
 				 client->message_sizes[msgnum]);
 	}
 
-	return TRUE;
+	return 1;
 }
 
 static int cmd_last(struct client *client, const char *args __attr_unused__)
 {
 	client_send_line(client, "+OK %u", client->last_seen);
-	return TRUE;
+	return 1;
 }
 
 static int cmd_noop(struct client *client, const char *args __attr_unused__)
 {
 	client_send_line(client, "+OK");
-	return TRUE;
+	return 1;
 }
 
-static int expunge_mails(struct client *client)
+static bool expunge_mails(struct client *client)
 {
 	struct mail_search_arg search_arg;
         struct mail_search_seqset seqset;
 	struct mail_search_context *ctx;
 	struct mail *mail;
 	uint32_t idx;
-	int ret = TRUE;
+	bool ret = TRUE;
 
 	if (client->deleted_bitmask == NULL)
 		return TRUE;
@@ -225,8 +225,9 @@
 	if (client->deleted) {
 		if (!expunge_mails(client)) {
 			client_send_storage_error(client);
-			client_disconnect(client, "Storage error during logout.");
-			return TRUE;
+			client_disconnect(client,
+				"Storage error during logout.");
+			return 1;
 		}
 	}
 
@@ -239,7 +240,7 @@
 		client_send_line(client, "+OK Logging out, messages deleted.");
 
 	client_disconnect(client, "Logout.");
-	return TRUE;
+	return 1;
 }
 
 struct fetch_context {
@@ -252,7 +253,7 @@
         struct mail_search_seqset seqset;
 
 	unsigned char last;
-	int cr_skipped, in_body;
+	bool cr_skipped, in_body;
 };
 
 static void fetch_deinit(struct fetch_context *ctx)
@@ -412,7 +413,7 @@
 	unsigned int msgnum;
 
 	if (get_msgnum(client, args, &msgnum) == NULL)
-		return FALSE;
+		return 0;
 
 	if (client->last_seen <= msgnum)
 		client->last_seen = msgnum+1;
@@ -422,7 +423,7 @@
 	client->byte_counter_offset = client->output->offset;
 
 	fetch(client, msgnum, (uoff_t)-1);
-	return TRUE;
+	return 1;
 }
 
 static int cmd_rset(struct client *client, const char *args __attr_unused__)
@@ -467,7 +468,7 @@
 	}
 
 	client_send_line(client, "+OK");
-	return TRUE;
+	return 1;
 }
 
 static int cmd_stat(struct client *client, const char *args __attr_unused__)
@@ -475,7 +476,7 @@
 	client_send_line(client, "+OK %u %"PRIuUOFF_T, client->
 			 messages_count - client->deleted_count,
 			 client->total_size - client->deleted_size);
-	return TRUE;
+	return 1;
 }
 
 static int cmd_top(struct client *client, const char *args)
@@ -485,16 +486,16 @@
 
 	args = get_msgnum(client, args, &msgnum);
 	if (args == NULL)
-		return FALSE;
+		return 0;
 	if (get_size(client, args, &max_lines) == NULL)
-		return FALSE;
+		return 0;
 
 	client->top_count++;
 	client->byte_counter = &client->top_bytes;
 	client->byte_counter_offset = client->output->offset;
 
 	fetch(client, msgnum, max_lines);
-	return TRUE;
+	return 1;
 }
 
 struct cmd_uidl_context {
@@ -506,7 +507,7 @@
 	struct mail_search_seqset seqset;
 };
 
-static int list_uids_iter(struct client *client, struct cmd_uidl_context *ctx)
+static bool list_uids_iter(struct client *client, struct cmd_uidl_context *ctx)
 {
 	static struct var_expand_table static_tab[] = {
 		{ 'v', NULL },
@@ -518,7 +519,8 @@
 	struct var_expand_table *tab;
 	string_t *str;
 	const char *uidl;
-	int ret, found = FALSE;
+	int ret;
+	bool found = FALSE;
 
 	tab = t_malloc(sizeof(static_tab));
 	memcpy(tab, static_tab, sizeof(static_tab));
@@ -646,14 +648,14 @@
 		unsigned int msgnum;
 
 		if (get_msgnum(client, args, &msgnum) == NULL)
-			return FALSE;
+			return 0;
 
 		ctx = cmd_uidl_init(client, msgnum+1);
 		if (!list_uids_iter(client, ctx))
 			client_send_line(client, "-ERR Message not found.");
 	}
 
-	return TRUE;
+	return 1;
 }
 
 int client_command_execute(struct client *client,

Index: common.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/common.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- common.h	11 Sep 2005 10:52:02 -0000	1.10
+++ common.h	13 Jan 2006 20:26:48 -0000	1.11
@@ -18,7 +18,7 @@
 
 extern struct ioloop *ioloop;
 extern enum client_workarounds client_workarounds;
-extern int enable_last_command, no_flag_updates, reuse_xuidl;
+extern bool enable_last_command, no_flag_updates, reuse_xuidl;
 extern const char *uidl_format, *logout_format;
 extern enum uidl_keys uidl_keymask;
 

Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/pop3/main.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- main.c	30 Dec 2005 22:16:36 -0000	1.37
+++ main.c	13 Jan 2006 20:26:48 -0000	1.38
@@ -40,9 +40,9 @@
 static struct module *modules;
 static char log_prefix[128]; /* syslog() needs this to be permanent */
 enum client_workarounds client_workarounds = 0;
-int enable_last_command = FALSE;
-int no_flag_updates = FALSE;
-int reuse_xuidl = FALSE;
+bool enable_last_command = FALSE;
+bool no_flag_updates = FALSE;
+bool reuse_xuidl = FALSE;
 const char *uidl_format, *logout_format;
 enum uidl_keys uidl_keymask;
 



More information about the dovecot-cvs mailing list