[dovecot-cvs] dovecot/src/imap client.c, 1.59, 1.60 client.h, 1.31, 1.32 cmd-append.c, 1.69, 1.70 cmd-authenticate.c, 1.3, 1.4 cmd-capability.c, 1.6, 1.7 cmd-check.c, 1.8, 1.9 cmd-close.c, 1.15, 1.16 cmd-copy.c, 1.31, 1.32 cmd-create.c, 1.13, 1.14 cmd-delete.c, 1.9, 1.10 cmd-examine.c, 1.4, 1.5 cmd-expunge.c, 1.13, 1.14 cmd-fetch.c, 1.30, 1.31 cmd-idle.c, 1.25, 1.26 cmd-list.c, 1.47, 1.48 cmd-login.c, 1.3, 1.4 cmd-logout.c, 1.9, 1.10 cmd-lsub.c, 1.4, 1.5 cmd-namespace.c, 1.4, 1.5 cmd-noop.c, 1.6, 1.7 cmd-rename.c, 1.8, 1.9 cmd-search.c, 1.26, 1.27 cmd-select.c, 1.38, 1.39 cmd-sort.c, 1.19, 1.20 cmd-status.c, 1.24, 1.25 cmd-store.c, 1.33, 1.34 cmd-subscribe.c, 1.13, 1.14 cmd-thread.c, 1.10, 1.11 cmd-uid.c, 1.6, 1.7 cmd-unselect.c, 1.6, 1.7 cmd-unsubscribe.c, 1.4, 1.5 commands-util.c, 1.46, 1.47 commands-util.h, 1.24, 1.25 commands.c, 1.14, 1.15 commands.h, 1.17, 1.18 imap-expunge.c, 1.6, 1.7 imap-expunge.h, 1.3, 1.4 imap-fetch-body.c, 1.25, 1.26 imap-fetch.c, 1.40, 1.41 imap-fetch.h, 1.16, 1.17 imap-search.c, 1.14, 1.15 imap-search.h, 1.6, 1.7 imap-sort.c, 1.24, 1.25 imap-sync.c, 1.14, 1.15 imap-sync.h, 1.4, 1.5 imap-thread.c, 1.17, 1.18 namespace.c, 1.10, 1.11

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


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

Modified Files:
	client.c client.h cmd-append.c cmd-authenticate.c 
	cmd-capability.c cmd-check.c cmd-close.c cmd-copy.c 
	cmd-create.c cmd-delete.c cmd-examine.c cmd-expunge.c 
	cmd-fetch.c cmd-idle.c cmd-list.c cmd-login.c cmd-logout.c 
	cmd-lsub.c cmd-namespace.c cmd-noop.c cmd-rename.c 
	cmd-search.c cmd-select.c cmd-sort.c cmd-status.c cmd-store.c 
	cmd-subscribe.c cmd-thread.c cmd-uid.c cmd-unselect.c 
	cmd-unsubscribe.c commands-util.c commands-util.h commands.c 
	commands.h imap-expunge.c imap-expunge.h imap-fetch-body.c 
	imap-fetch.c imap-fetch.h imap-search.c imap-search.h 
	imap-sort.c imap-sync.c imap-sync.h imap-thread.c namespace.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/imap/client.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- client.c	4 Jan 2006 21:05:30 -0000	1.59
+++ client.c	13 Jan 2006 20:25:59 -0000	1.60
@@ -149,7 +149,7 @@
 {
 	struct client *client = cmd->client;
 	const char *error, *cmd_name;
-	int fatal;
+	bool fatal;
 
 	if (msg == NULL) {
 		msg = imap_parser_get_error(client->parser, &fatal);
@@ -182,8 +182,8 @@
 	cmd->param_error = TRUE;
 }
 
-int client_read_args(struct client_command_context *cmd, unsigned int count,
-		     unsigned int flags, struct imap_arg **args)
+bool client_read_args(struct client_command_context *cmd, unsigned int count,
+		      unsigned int flags, struct imap_arg **args)
 {
 	int ret;
 
@@ -204,8 +204,8 @@
 	}
 }
 
-int client_read_string_args(struct client_command_context *cmd,
-			    unsigned int count, ...)
+bool client_read_string_args(struct client_command_context *cmd,
+			     unsigned int count, ...)
 {
 	struct imap_arg *imap_args;
 	va_list va;
@@ -273,7 +273,7 @@
 
 /* Skip incoming data until newline is found,
    returns TRUE if newline was found. */
-static int client_skip_line(struct client *client)
+static bool client_skip_line(struct client *client)
 {
 	const unsigned char *data;
 	size_t i, data_size;
@@ -292,7 +292,7 @@
 	return !client->input_skip_line;
 }
 
-static int client_handle_input(struct client_command_context *cmd)
+static bool client_handle_input(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 
@@ -414,7 +414,8 @@
 {
 	struct client *client = context;
 	struct client_command_context *cmd = &client->cmd;
-	int ret, finished;
+	int ret;
+	bool finished;
 
 	client->last_output = ioloop_time;
 

Index: client.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/client.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- client.h	4 Jan 2006 21:05:30 -0000	1.31
+++ client.h	13 Jan 2006 20:25:59 -0000	1.32
@@ -75,12 +75,12 @@
 
 /* Read a number of arguments. Returns TRUE if everything was read or
    FALSE if either needs more data or error occurred. */
-int client_read_args(struct client_command_context *cmd, unsigned int count,
-		     unsigned int flags, struct imap_arg **args);
+bool client_read_args(struct client_command_context *cmd, unsigned int count,
+		      unsigned int flags, struct imap_arg **args);
 /* Reads a number of string arguments. ... is a list of pointers where to
    store the arguments. */
-int client_read_string_args(struct client_command_context *cmd,
-			    unsigned int count, ...);
+bool client_read_string_args(struct client_command_context *cmd,
+			     unsigned int count, ...);
 
 void clients_init(void);
 void clients_deinit(void);

Index: cmd-append.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-append.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- cmd-append.c	4 Jan 2006 21:05:30 -0000	1.69
+++ cmd-append.c	13 Jan 2006 20:25:59 -0000	1.70
@@ -26,7 +26,7 @@
 	struct mail_save_context *save_ctx;
 };
 
-static int cmd_append_continue_message(struct client_command_context *cmd);
+static bool cmd_append_continue_message(struct client_command_context *cmd);
 
 static void client_input(void *context)
 {
@@ -72,7 +72,7 @@
    set when successful. */
 static int validate_args(struct imap_arg *args, struct imap_arg_list **flags,
 			 const char **internal_date, uoff_t *msg_size,
-			 int *nonsync)
+			 bool *nonsync)
 {
 	/* [<flags>] */
 	if (args->type != IMAP_ARG_LIST)
@@ -123,7 +123,7 @@
 		mailbox_close(ctx->box);
 }
 
-static int cmd_append_continue_cancel(struct client_command_context *cmd)
+static bool cmd_append_continue_cancel(struct client_command_context *cmd)
 {
 	struct cmd_append_context *ctx = cmd->context;
 	size_t size;
@@ -139,7 +139,7 @@
 	return FALSE;
 }
 
-static int cmd_append_cancel(struct cmd_append_context *ctx, int nonsync)
+static bool cmd_append_cancel(struct cmd_append_context *ctx, bool nonsync)
 {
 	if (!nonsync) {
 		cmd_append_finish(ctx);
@@ -158,7 +158,7 @@
 	return cmd_append_continue_cancel(ctx->cmd);
 }
 
-static int cmd_append_continue_parsing(struct client_command_context *cmd)
+static bool cmd_append_continue_parsing(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct cmd_append_context *ctx = cmd->context;
@@ -169,7 +169,8 @@
 	struct mail_keywords *keywords;
 	const char *internal_date_str;
 	time_t internal_date;
-	int ret, timezone_offset, nonsync;
+	int ret, timezone_offset;
+	bool nonsync;
 
 	/* if error occurs, the CRLF is already read. */
 	client->input_skip_line = FALSE;
@@ -278,12 +279,12 @@
 	return cmd_append_continue_message(cmd);
 }
 
-static int cmd_append_continue_message(struct client_command_context *cmd)
+static bool cmd_append_continue_message(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct cmd_append_context *ctx = cmd->context;
 	size_t size;
-	int failed;
+	bool failed;
 
 	if (ctx->save_ctx != NULL) {
 		if (mailbox_save_continue(ctx->save_ctx) < 0) {
@@ -302,7 +303,7 @@
 
 	if (ctx->input->eof || client->input->closed) {
 		/* finished */
-		int all_written = ctx->input->v_offset == ctx->msg_size;
+		bool all_written = ctx->input->v_offset == ctx->msg_size;
 
 		i_stream_unref(ctx->input);
 		ctx->input = NULL;
@@ -365,7 +366,7 @@
 	return box;
 }
 
-int cmd_append(struct client_command_context *cmd)
+bool cmd_append(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
         struct cmd_append_context *ctx;

Index: cmd-authenticate.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-authenticate.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cmd-authenticate.c	5 Feb 2005 18:07:26 -0000	1.3
+++ cmd-authenticate.c	13 Jan 2006 20:25:59 -0000	1.4
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_authenticate(struct client_command_context *cmd)
+bool cmd_authenticate(struct client_command_context *cmd)
 {
 	client_send_tagline(cmd, "OK Already authenticated.");
 	return TRUE;

Index: cmd-capability.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-capability.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cmd-capability.c	5 Feb 2005 18:07:26 -0000	1.6
+++ cmd-capability.c	13 Jan 2006 20:25:59 -0000	1.7
@@ -4,7 +4,7 @@
 #include "commands.h"
 #include "str.h"
 
-int cmd_capability(struct client_command_context *cmd)
+bool cmd_capability(struct client_command_context *cmd)
 {
 	client_send_line(cmd->client,
 			 t_strconcat("* CAPABILITY ",

Index: cmd-check.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-check.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmd-check.c	25 Dec 2005 11:24:45 -0000	1.8
+++ cmd-check.c	13 Jan 2006 20:25:59 -0000	1.9
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_check(struct client_command_context *cmd)
+bool cmd_check(struct client_command_context *cmd)
 {
 	if (!client_verify_open_mailbox(cmd))
 		return TRUE;

Index: cmd-close.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-close.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cmd-close.c	5 Feb 2005 18:07:26 -0000	1.15
+++ cmd-close.c	13 Jan 2006 20:25:59 -0000	1.16
@@ -4,7 +4,7 @@
 #include "commands.h"
 #include "imap-expunge.h"
 
-int cmd_close(struct client_command_context *cmd)
+bool cmd_close(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct mailbox *mailbox = client->mailbox;

Index: cmd-copy.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-copy.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- cmd-copy.c	25 Dec 2005 11:24:45 -0000	1.31
+++ cmd-copy.c	13 Jan 2006 20:25:59 -0000	1.32
@@ -47,7 +47,7 @@
 	return ret;
 }
 
-int cmd_copy(struct client_command_context *cmd)
+bool cmd_copy(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct mail_storage *storage;

Index: cmd-create.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-create.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cmd-create.c	23 Apr 2005 19:56:51 -0000	1.13
+++ cmd-create.c	13 Jan 2006 20:25:59 -0000	1.14
@@ -3,11 +3,11 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_create(struct client_command_context *cmd)
+bool cmd_create(struct client_command_context *cmd)
 {
 	struct mail_storage *storage;
 	const char *mailbox, *full_mailbox;
-	int directory;
+	bool directory;
 	size_t len;
 
 	/* <mailbox> */

Index: cmd-delete.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-delete.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmd-delete.c	22 Jul 2005 14:20:44 -0000	1.9
+++ cmd-delete.c	13 Jan 2006 20:25:59 -0000	1.10
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_delete(struct client_command_context *cmd)
+bool cmd_delete(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct mail_storage *storage;

Index: cmd-examine.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-examine.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmd-examine.c	5 Feb 2005 18:07:26 -0000	1.4
+++ cmd-examine.c	13 Jan 2006 20:25:59 -0000	1.5
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_examine(struct client_command_context *cmd)
+bool cmd_examine(struct client_command_context *cmd)
 {
 	return _cmd_select_full(cmd, TRUE);
 }

Index: cmd-expunge.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-expunge.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cmd-expunge.c	25 Dec 2005 11:24:45 -0000	1.13
+++ cmd-expunge.c	13 Jan 2006 20:25:59 -0000	1.14
@@ -5,7 +5,7 @@
 #include "imap-search.h"
 #include "imap-expunge.h"
 
-int cmd_uid_expunge(struct client_command_context *cmd)
+bool cmd_uid_expunge(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct imap_arg *args;
@@ -37,7 +37,7 @@
 	}
 }
 
-int cmd_expunge(struct client_command_context *cmd)
+bool cmd_expunge(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 

Index: cmd-fetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-fetch.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- cmd-fetch.c	25 Dec 2005 11:24:45 -0000	1.30
+++ cmd-fetch.c	13 Jan 2006 20:25:59 -0000	1.31
@@ -17,7 +17,7 @@
 	"FLAGS", "INTERNALDATE", "RFC822.SIZE", "ENVELOPE", "BODY", NULL
 };
 
-static int
+static bool
 fetch_parse_args(struct imap_fetch_context *ctx, struct imap_arg *arg)
 {
 	const char *str, *const *macro;
@@ -68,11 +68,11 @@
 	return TRUE;
 }
 
-static int cmd_fetch_finish(struct imap_fetch_context *ctx)
+static bool cmd_fetch_finish(struct imap_fetch_context *ctx)
 {
 	struct client_command_context *cmd = ctx->cmd;
 	static const char *ok_message = "OK Fetch completed.";
-	int failed, partial;
+	bool failed, partial;
 
 	partial = ctx->partial_fetch;
 	failed = ctx->failed;
@@ -83,7 +83,7 @@
 	if (failed || (partial && !cmd->uid)) {
 		struct mail_storage *storage;
 		const char *error;
-		int syntax, temporary_error;
+		bool syntax, temporary_error;
 
                 storage = mailbox_get_storage(cmd->client->mailbox);
 		error = mail_storage_get_last_error(storage, &syntax,
@@ -108,7 +108,7 @@
 			ok_message);
 }
 
-static int cmd_fetch_continue(struct client_command_context *cmd)
+static bool cmd_fetch_continue(struct client_command_context *cmd)
 {
         struct imap_fetch_context *ctx = cmd->context;
 	int ret;
@@ -127,7 +127,7 @@
 	return cmd_fetch_finish(ctx);
 }
 
-int cmd_fetch(struct client_command_context *cmd)
+bool cmd_fetch(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct imap_fetch_context *ctx;

Index: cmd-idle.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-idle.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cmd-idle.c	7 Jan 2006 00:53:14 -0000	1.25
+++ cmd-idle.c	13 Jan 2006 20:25:59 -0000	1.26
@@ -26,9 +26,9 @@
 	unsigned int sync_pending:1;
 };
 
-static int cmd_idle_continue(struct client_command_context *cmd);
+static bool cmd_idle_continue(struct client_command_context *cmd);
 
-static void idle_finish(struct cmd_idle_context *ctx, int done_ok)
+static void idle_finish(struct cmd_idle_context *ctx, bool done_ok)
 {
 	struct client *client = ctx->client;
 
@@ -173,7 +173,7 @@
                 idle_sync_now(box, ctx);
 }
 
-static int cmd_idle_continue(struct client_command_context *cmd)
+static bool cmd_idle_continue(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct cmd_idle_context *ctx = cmd->context;
@@ -216,7 +216,7 @@
 	return FALSE;
 }
 
-int cmd_idle(struct client_command_context *cmd)
+bool cmd_idle(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct cmd_idle_context *ctx;

Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- cmd-list.c	12 Jan 2006 19:43:30 -0000	1.47
+++ cmd-list.c	13 Jan 2006 20:25:59 -0000	1.48
@@ -63,7 +63,7 @@
 	return *str == '\0' ? "" : str+1;
 }
 
-static int
+static bool
 parse_list_flags(struct client_command_context *cmd, struct imap_arg *args,
 		 enum mailbox_list_flags *list_flags)
 {
@@ -171,10 +171,10 @@
 	return ret < 0 ? -1 : 1;
 }
 
-static void skip_prefix(const char **prefix, const char **mask, int inbox)
+static void skip_prefix(const char **prefix, const char **mask, bool inbox)
 {
 	size_t mask_len, prefix_len;
-	int match;
+	bool match;
 
 	prefix_len = strlen(*prefix);
 	mask_len = strlen(*mask);
@@ -323,7 +323,7 @@
 						       list_flags);
 }
 
-static int cmd_list_continue(struct client_command_context *cmd)
+static bool cmd_list_continue(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
         struct cmd_list_context *ctx = cmd->context;
@@ -347,7 +347,7 @@
 	return TRUE;
 }
 
-int _cmd_list_full(struct client_command_context *cmd, int lsub)
+bool _cmd_list_full(struct client_command_context *cmd, bool lsub)
 {
 	struct client *client = cmd->client;
 	struct namespace *ns;
@@ -453,7 +453,7 @@
 	return TRUE;
 }
 
-int cmd_list(struct client_command_context *cmd)
+bool cmd_list(struct client_command_context *cmd)
 {
 	return _cmd_list_full(cmd, FALSE);
 }

Index: cmd-login.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-login.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cmd-login.c	5 Feb 2005 18:07:26 -0000	1.3
+++ cmd-login.c	13 Jan 2006 20:25:59 -0000	1.4
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_login(struct client_command_context *cmd)
+bool cmd_login(struct client_command_context *cmd)
 {
 	client_send_tagline(cmd, "OK Already logged in.");
 	return TRUE;

Index: cmd-logout.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-logout.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cmd-logout.c	5 Feb 2005 18:07:26 -0000	1.9
+++ cmd-logout.c	13 Jan 2006 20:25:59 -0000	1.10
@@ -4,7 +4,7 @@
 #include "ostream.h"
 #include "commands.h"
 
-int cmd_logout(struct client_command_context *cmd)
+bool cmd_logout(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 

Index: cmd-lsub.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-lsub.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmd-lsub.c	5 Feb 2005 18:07:26 -0000	1.4
+++ cmd-lsub.c	13 Jan 2006 20:25:59 -0000	1.5
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_lsub(struct client_command_context *cmd)
+bool cmd_lsub(struct client_command_context *cmd)
 {
 	return _cmd_list_full(cmd, TRUE);
 }

Index: cmd-namespace.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-namespace.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmd-namespace.c	5 Feb 2005 18:07:26 -0000	1.4
+++ cmd-namespace.c	13 Jan 2006 20:25:59 -0000	1.5
@@ -9,7 +9,7 @@
 static void list_namespaces(struct namespace *ns, enum namespace_type type,
 			    string_t *str)
 {
-	int found = FALSE;
+	bool found = FALSE;
 
 	while (ns != NULL) {
 		if (ns->type == type && !ns->hidden) {
@@ -33,7 +33,7 @@
 		str_append(str, "NIL");
 }
 
-int cmd_namespace(struct client_command_context *cmd)
+bool cmd_namespace(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	string_t *str;

Index: cmd-noop.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-noop.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cmd-noop.c	25 Dec 2005 11:24:45 -0000	1.6
+++ cmd-noop.c	13 Jan 2006 20:25:59 -0000	1.7
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_noop(struct client_command_context *cmd)
+bool cmd_noop(struct client_command_context *cmd)
 {
 	return cmd_sync(cmd, 0, 0, "OK NOOP completed.");
 }

Index: cmd-rename.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-rename.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cmd-rename.c	5 Feb 2005 18:07:26 -0000	1.8
+++ cmd-rename.c	13 Jan 2006 20:25:59 -0000	1.9
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_rename(struct client_command_context *cmd)
+bool cmd_rename(struct client_command_context *cmd)
 {
 	struct mail_storage *old_storage, *new_storage;
 	const char *oldname, *newname;

Index: cmd-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-search.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- cmd-search.c	25 Dec 2005 11:24:45 -0000	1.26
+++ cmd-search.c	13 Jan 2006 20:25:59 -0000	1.27
@@ -8,15 +8,16 @@
 
 #define STRBUF_SIZE 1024
 
-static int imap_search(struct client_command_context *cmd, const char *charset,
-		       struct mail_search_arg *sargs)
+static bool imap_search(struct client_command_context *cmd, const char *charset,
+			struct mail_search_arg *sargs)
 {
 	struct client *client = cmd->client;
         struct mail_search_context *ctx;
         struct mailbox_transaction_context *trans;
 	struct mail *mail;
 	string_t *str;
-	int ret, uid, first = TRUE;
+	int ret;
+	bool uid, first = TRUE;
 
 	str = t_str_new(STRBUF_SIZE);
 	uid = cmd->uid;
@@ -55,7 +56,7 @@
 	return ret == 0;
 }
 
-int cmd_search(struct client_command_context *cmd)
+bool cmd_search(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct mail_search_arg *sargs;

Index: cmd-select.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-select.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cmd-select.c	12 Jul 2005 13:40:06 -0000	1.38
+++ cmd-select.c	13 Jan 2006 20:25:59 -0000	1.39
@@ -4,7 +4,7 @@
 #include "commands.h"
 #include "imap-sync.h"
 
-int _cmd_select_full(struct client_command_context *cmd, int readonly)
+bool _cmd_select_full(struct client_command_context *cmd, bool readonly)
 {
 	struct client *client = cmd->client;
 	struct mail_storage *storage;
@@ -87,7 +87,7 @@
 	return TRUE;
 }
 
-int cmd_select(struct client_command_context *cmd)
+bool cmd_select(struct client_command_context *cmd)
 {
 	return _cmd_select_full(cmd, FALSE);
 }

Index: cmd-sort.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-sort.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- cmd-sort.c	25 Dec 2005 11:24:45 -0000	1.19
+++ cmd-sort.c	13 Jan 2006 20:25:59 -0000	1.20
@@ -71,7 +71,7 @@
 	return buffer_free_without_data(buf);
 }
 
-int cmd_sort(struct client_command_context *cmd)
+bool cmd_sort(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct mail_search_arg *sargs;

Index: cmd-status.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-status.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmd-status.c	7 Apr 2005 23:19:18 -0000	1.24
+++ cmd-status.c	13 Jan 2006 20:25:59 -0000	1.25
@@ -44,13 +44,13 @@
 	return items;
 }
 
-static int get_mailbox_status(struct client *client,
-			      struct mail_storage *storage, const char *mailbox,
-			      enum mailbox_status_items items,
-			      struct mailbox_status *status)
+static bool
+get_mailbox_status(struct client *client, struct mail_storage *storage,
+		   const char *mailbox, enum mailbox_status_items items,
+		   struct mailbox_status *status)
 {
 	struct mailbox *box;
-	int failed;
+	bool failed;
 
 	if (client->mailbox != NULL &&
 	    mailbox_equals(client->mailbox, storage, mailbox)) {
@@ -76,7 +76,7 @@
 	return !failed;
 }
 
-int cmd_status(struct client_command_context *cmd)
+bool cmd_status(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct imap_arg *args;

Index: cmd-store.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-store.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- cmd-store.c	25 Dec 2005 11:24:45 -0000	1.33
+++ cmd-store.c	13 Jan 2006 20:25:59 -0000	1.34
@@ -6,8 +6,9 @@
 #include "imap-search.h"
 #include "imap-util.h"
 
-static int get_modify_type(struct client_command_context *cmd, const char *item,
-			   enum modify_type *modify_type, int *silent)
+static bool
+get_modify_type(struct client_command_context *cmd, const char *item,
+		enum modify_type *modify_type, bool *silent)
 {
 	if (*item == '+') {
 		*modify_type = MODIFY_ADD;
@@ -35,7 +36,7 @@
 	return TRUE;
 }
 
-int cmd_store(struct client_command_context *cmd)
+bool cmd_store(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct imap_arg *args;
@@ -49,7 +50,7 @@
         struct mailbox_transaction_context *t;
 	struct mail *mail;
 	const char *messageset, *item;
-	int silent, failed;
+	bool silent, failed;
 
 	if (!client_read_args(cmd, 0, 0, &args))
 		return FALSE;

Index: cmd-subscribe.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-subscribe.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- cmd-subscribe.c	22 Jul 2005 17:50:15 -0000	1.13
+++ cmd-subscribe.c	13 Jan 2006 20:25:59 -0000	1.14
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int _cmd_subscribe_full(struct client_command_context *cmd, int subscribe)
+bool _cmd_subscribe_full(struct client_command_context *cmd, bool subscribe)
 {
         struct mail_storage *storage;
 	const char *mailbox, *verify_name;
@@ -42,7 +42,7 @@
 	return TRUE;
 }
 
-int cmd_subscribe(struct client_command_context *cmd)
+bool cmd_subscribe(struct client_command_context *cmd)
 {
 	return _cmd_subscribe_full(cmd, TRUE);
 }

Index: cmd-thread.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-thread.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cmd-thread.c	25 Dec 2005 11:24:45 -0000	1.10
+++ cmd-thread.c	13 Jan 2006 20:25:59 -0000	1.11
@@ -6,7 +6,7 @@
 #include "imap-search.h"
 #include "imap-thread.h"
 
-int cmd_thread(struct client_command_context *cmd)
+bool cmd_thread(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	enum mail_thread_type threading;

Index: cmd-uid.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-uid.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cmd-uid.c	5 Feb 2005 18:07:26 -0000	1.6
+++ cmd-uid.c	13 Jan 2006 20:25:59 -0000	1.7
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_uid(struct client_command_context *cmd)
+bool cmd_uid(struct client_command_context *cmd)
 {
 	const char *cmd_name;
 

Index: cmd-unselect.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-unselect.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cmd-unselect.c	8 Feb 2005 11:16:52 -0000	1.6
+++ cmd-unselect.c	13 Jan 2006 20:25:59 -0000	1.7
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_unselect(struct client_command_context *cmd)
+bool cmd_unselect(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
 	struct mailbox *mailbox = client->mailbox;

Index: cmd-unsubscribe.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-unsubscribe.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cmd-unsubscribe.c	5 Feb 2005 18:07:26 -0000	1.4
+++ cmd-unsubscribe.c	13 Jan 2006 20:25:59 -0000	1.5
@@ -3,7 +3,7 @@
 #include "common.h"
 #include "commands.h"
 
-int cmd_unsubscribe(struct client_command_context *cmd)
+bool cmd_unsubscribe(struct client_command_context *cmd)
 {
 	return _cmd_subscribe_full(cmd, FALSE);
 }

Index: commands-util.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands-util.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- commands-util.c	29 Jul 2005 08:43:04 -0000	1.46
+++ commands-util.c	13 Jan 2006 20:25:59 -0000	1.47
@@ -30,9 +30,9 @@
 	return NULL;
 }
 
-int client_verify_mailbox_name(struct client_command_context *cmd,
-			       const char *mailbox,
-			       int should_exist, int should_not_exist)
+bool client_verify_mailbox_name(struct client_command_context *cmd,
+				const char *mailbox,
+				bool should_exist, bool should_not_exist)
 {
 	struct mail_storage *storage;
 	enum mailbox_name_status mailbox_status;
@@ -104,7 +104,7 @@
 	return FALSE;
 }
 
-int client_verify_open_mailbox(struct client_command_context *cmd)
+bool client_verify_open_mailbox(struct client_command_context *cmd)
 {
 	if (cmd->client->mailbox != NULL)
 		return TRUE;
@@ -118,7 +118,7 @@
 			       struct mail_storage *storage)
 {
 	const char *error;
-	int syntax, temporary_error;
+	bool syntax, temporary_error;
 
 	if (cmd->client->mailbox != NULL &&
 	    mailbox_is_inconsistent(cmd->client->mailbox)) {
@@ -137,7 +137,7 @@
 					struct mail_storage *storage)
 {
 	const char *error;
-	int syntax, temporary_error;
+	bool syntax, temporary_error;
 
 	if (client->mailbox != NULL &&
 	    mailbox_is_inconsistent(client->mailbox)) {
@@ -152,8 +152,8 @@
 			 t_strconcat(syntax ? "* BAD " : "* NO ", error, NULL));
 }
 
-static int is_valid_keyword(struct client_command_context *cmd,
-			    const char *keyword)
+static bool is_valid_keyword(struct client_command_context *cmd,
+			     const char *keyword)
 {
 	const char *const *names;
 	unsigned int i, count;
@@ -178,9 +178,9 @@
 	return TRUE;
 }
 
-int client_parse_mail_flags(struct client_command_context *cmd,
-			    struct imap_arg *args, enum mail_flags *flags_r,
-			    const char *const **keywords_r)
+bool client_parse_mail_flags(struct client_command_context *cmd,
+			     struct imap_arg *args, enum mail_flags *flags_r,
+			     const char *const **keywords_r)
 {
 	const char *const *keywords;
 	char *atom;
@@ -285,13 +285,13 @@
 	}
 }
 
-int client_save_keywords(struct mailbox_keywords *dest,
-			 const array_t *keywords)
+bool client_save_keywords(struct mailbox_keywords *dest,
+			  const array_t *keywords)
 {
 	ARRAY_SET_TYPE(keywords, const char *);
 	const char *const *names, *const *old_names;
 	unsigned int i, count, old_count;
-	int changed;
+	bool changed;
 
 	names = array_get(keywords, &count);
 
@@ -328,8 +328,8 @@
 	return TRUE;
 }
 
-int mailbox_equals(struct mailbox *box1, struct mail_storage *storage2,
-		   const char *name2)
+bool mailbox_equals(struct mailbox *box1, struct mail_storage *storage2,
+		    const char *name2)
 {
 	struct mail_storage *storage1 = mailbox_get_storage(box1);
 	const char *name1;

Index: commands-util.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands-util.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- commands-util.h	23 Jul 2005 10:13:54 -0000	1.24
+++ commands-util.h	13 Jan 2006 20:25:59 -0000	1.25
@@ -20,13 +20,13 @@
 
    If should_exist is FALSE, the should_not_exist specifies if we should
    return TRUE or FALSE if mailbox doesn't exist. */
-int client_verify_mailbox_name(struct client_command_context *cmd,
-			       const char *mailbox,
-			       int should_exist, int should_not_exist);
+bool client_verify_mailbox_name(struct client_command_context *cmd,
+				const char *mailbox,
+				bool should_exist, bool should_not_exist);
 
 /* Returns TRUE if mailbox is selected. If not, sends "No mailbox selected"
    error message to client. */
-int client_verify_open_mailbox(struct client_command_context *cmd);
+bool client_verify_open_mailbox(struct client_command_context *cmd);
 
 /* Send last mail storage error message to client. */
 void client_send_storage_error(struct client_command_context *cmd,
@@ -38,9 +38,9 @@
 
 /* Parse flags. Returns TRUE if successful, if not sends an error message to
    client. */
-int client_parse_mail_flags(struct client_command_context *cmd,
-			    struct imap_arg *args, enum mail_flags *flags_r,
-			    const char *const **keywords_r);
+bool client_parse_mail_flags(struct client_command_context *cmd,
+			     struct imap_arg *args, enum mail_flags *flags_r,
+			     const char *const **keywords_r);
 
 /* Send FLAGS + PERMANENTFLAGS to client. */
 void client_send_mailbox_flags(struct client *client, struct mailbox *box,
@@ -48,11 +48,11 @@
 
 /* Copy keywords into dest. dest must have been initialized. Returns TRUE if
    keywords changed. */
-int client_save_keywords(struct mailbox_keywords *dest,
-			 const array_t *keywords);
+bool client_save_keywords(struct mailbox_keywords *dest,
+			  const array_t *keywords);
 
-int mailbox_equals(struct mailbox *box1, struct mail_storage *storage2,
-		   const char *name2);
+bool mailbox_equals(struct mailbox *box1, struct mail_storage *storage2,
+		    const char *name2);
 
 void msgset_generator_init(struct msgset_generator_context *ctx, string_t *str);
 void msgset_generator_next(struct msgset_generator_context *ctx, uint32_t uid);

Index: commands.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- commands.c	8 Oct 2004 17:51:47 -0000	1.14
+++ commands.c	13 Jan 2006 20:25:59 -0000	1.15
@@ -55,7 +55,7 @@
 	(sizeof(imap_ext_commands) / sizeof(imap_ext_commands[0]))
 
 static buffer_t *cmdbuf;
-static int cmdbuf_unsorted;
+static bool cmdbuf_unsorted;
 
 void command_register(const char *name, command_func_t *func)
 {

Index: commands.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/commands.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- commands.h	5 Feb 2005 18:07:26 -0000	1.17
+++ commands.h	13 Jan 2006 20:25:59 -0000	1.18
@@ -8,7 +8,7 @@
 #include "imap-sync.h"
 #include "commands-util.h"
 
-typedef int command_func_t(struct client_command_context *cmd);
+typedef bool command_func_t(struct client_command_context *cmd);
 
 struct command {
 	const char *name;
@@ -32,51 +32,51 @@
 /* IMAP4rev1 commands: */
 
 /* Non-Authenticated State */
-int cmd_authenticate(struct client_command_context *cmd);
-int cmd_login(struct client_command_context *cmd);
-int cmd_logout(struct client_command_context *cmd);
+bool cmd_authenticate(struct client_command_context *cmd);
+bool cmd_login(struct client_command_context *cmd);
+bool cmd_logout(struct client_command_context *cmd);
 
-int cmd_capability(struct client_command_context *cmd);
-int cmd_noop(struct client_command_context *cmd);
+bool cmd_capability(struct client_command_context *cmd);
+bool cmd_noop(struct client_command_context *cmd);
 
 /* Authenticated State */
-int cmd_select(struct client_command_context *cmd);
-int cmd_examine(struct client_command_context *cmd);
+bool cmd_select(struct client_command_context *cmd);
+bool cmd_examine(struct client_command_context *cmd);
 
-int cmd_create(struct client_command_context *cmd);
-int cmd_delete(struct client_command_context *cmd);
-int cmd_rename(struct client_command_context *cmd);
+bool cmd_create(struct client_command_context *cmd);
+bool cmd_delete(struct client_command_context *cmd);
+bool cmd_rename(struct client_command_context *cmd);
 
-int cmd_subscribe(struct client_command_context *cmd);
-int cmd_unsubscribe(struct client_command_context *cmd);
+bool cmd_subscribe(struct client_command_context *cmd);
+bool cmd_unsubscribe(struct client_command_context *cmd);
 
-int cmd_list(struct client_command_context *cmd);
-int cmd_lsub(struct client_command_context *cmd);
+bool cmd_list(struct client_command_context *cmd);
+bool cmd_lsub(struct client_command_context *cmd);
 
-int cmd_status(struct client_command_context *cmd);
-int cmd_append(struct client_command_context *cmd);
+bool cmd_status(struct client_command_context *cmd);
+bool cmd_append(struct client_command_context *cmd);
 
 /* Selected state */
-int cmd_check(struct client_command_context *cmd);
-int cmd_close(struct client_command_context *cmd);
-int cmd_expunge(struct client_command_context *cmd);
-int cmd_search(struct client_command_context *cmd);
-int cmd_fetch(struct client_command_context *cmd);
-int cmd_store(struct client_command_context *cmd);
-int cmd_copy(struct client_command_context *cmd);
-int cmd_uid(struct client_command_context *cmd);
+bool cmd_check(struct client_command_context *cmd);
+bool cmd_close(struct client_command_context *cmd);
+bool cmd_expunge(struct client_command_context *cmd);
+bool cmd_search(struct client_command_context *cmd);
+bool cmd_fetch(struct client_command_context *cmd);
+bool cmd_store(struct client_command_context *cmd);
+bool cmd_copy(struct client_command_context *cmd);
+bool cmd_uid(struct client_command_context *cmd);
 
 /* IMAP extensions: */
-int cmd_idle(struct client_command_context *cmd);
-int cmd_namespace(struct client_command_context *cmd);
-int cmd_sort(struct client_command_context *cmd);
-int cmd_thread(struct client_command_context *cmd);
-int cmd_uid_expunge(struct client_command_context *cmd);
-int cmd_unselect(struct client_command_context *cmd);
+bool cmd_idle(struct client_command_context *cmd);
+bool cmd_namespace(struct client_command_context *cmd);
+bool cmd_sort(struct client_command_context *cmd);
+bool cmd_thread(struct client_command_context *cmd);
+bool cmd_uid_expunge(struct client_command_context *cmd);
+bool cmd_unselect(struct client_command_context *cmd);
 
 /* private: */
-int _cmd_list_full(struct client_command_context *cmd, int lsub);
-int _cmd_select_full(struct client_command_context *cmd, int readonly);
-int _cmd_subscribe_full(struct client_command_context *cmd, int subscribe);
+bool _cmd_list_full(struct client_command_context *cmd, bool lsub);
+bool _cmd_select_full(struct client_command_context *cmd, bool readonly);
+bool _cmd_subscribe_full(struct client_command_context *cmd, bool subscribe);
 
 #endif

Index: imap-expunge.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-expunge.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- imap-expunge.c	15 Mar 2005 19:01:51 -0000	1.6
+++ imap-expunge.c	13 Jan 2006 20:25:59 -0000	1.7
@@ -5,14 +5,14 @@
 #include "mail-search.h"
 #include "imap-expunge.h"
 
-int imap_expunge(struct mailbox *box, struct mail_search_arg *next_search_arg)
+bool imap_expunge(struct mailbox *box, struct mail_search_arg *next_search_arg)
 {
 	struct mail_search_context *ctx;
         struct mailbox_transaction_context *t;
 	struct mail *mail;
 	struct mail_search_arg search_arg;
         enum mailbox_sync_flags flags;
-	int failed = FALSE;
+	bool failed = FALSE;
 
 	memset(&search_arg, 0, sizeof(search_arg));
 	search_arg.type = SEARCH_DELETED;

Index: imap-expunge.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-expunge.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- imap-expunge.h	20 Jun 2004 03:25:33 -0000	1.3
+++ imap-expunge.h	13 Jan 2006 20:25:59 -0000	1.4
@@ -1,6 +1,6 @@
 #ifndef __IMAP_EXPUNGE_H
 #define __IMAP_EXPUNGE_H
 
-int imap_expunge(struct mailbox *box, struct mail_search_arg *next_search_arg);
+bool imap_expunge(struct mailbox *box, struct mail_search_arg *next_search_arg);
 
 #endif

Index: imap-fetch-body.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch-body.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- imap-fetch-body.c	18 Sep 2005 17:36:51 -0000	1.25
+++ imap-fetch-body.c	13 Jan 2006 20:25:59 -0000	1.26
@@ -37,17 +37,17 @@
 	unsigned int uid;
 
 	uoff_t physical_start;
-	int cr_skipped;
+	bool cr_skipped;
 	struct message_size pos;
 };
 
 static struct partial_cache partial = { 0, 0, 0, 0, { 0, 0, 0 } };
 
-static int seek_partial(unsigned int select_counter, unsigned int uid,
-			struct partial_cache *partial, struct istream *stream,
-			uoff_t virtual_skip)
+static bool seek_partial(unsigned int select_counter, unsigned int uid,
+			 struct partial_cache *partial, struct istream *stream,
+			 uoff_t virtual_skip)
 {
-	int cr_skipped;
+	bool cr_skipped;
 
 	if (select_counter == partial->select_counter && uid == partial->uid &&
 	    stream->v_offset == partial->physical_start &&
@@ -107,15 +107,15 @@
 }
 
 static off_t imap_fetch_send(struct ostream *output, struct istream *input,
-			     int cr_skipped, uoff_t virtual_size,
-			     int add_missing_eoh, int *last_cr)
+			     bool cr_skipped, uoff_t virtual_size,
+			     bool add_missing_eoh, bool *last_cr)
 {
 	const unsigned char *msg;
 	size_t i, size;
 	uoff_t vsize_left, sent;
 	off_t ret;
 	unsigned char add;
-	int blocks = FALSE;
+	bool blocks = FALSE;
 
 	/* go through the message data and insert CRs where needed.  */
 	sent = 0; vsize_left = virtual_size;
@@ -335,7 +335,7 @@
 }
 
 static void header_filter_eoh(struct message_header_line *hdr,
-			      int *matched __attr_unused__, void *context)
+			      bool *matched __attr_unused__, void *context)
 {
 	struct imap_fetch_context *ctx = context;
 
@@ -555,7 +555,7 @@
 	return 1;
 }
 
-static int fetch_body_header_fields_check(const char *section)
+static bool fetch_body_header_fields_check(const char *section)
 {
 	if (*section++ != '(')
 		return FALSE;
@@ -577,9 +577,9 @@
 	return TRUE;
 }
 
-static int fetch_body_header_fields_init(struct imap_fetch_context *ctx,
-					 struct imap_fetch_body_data *body,
-					 const char *section)
+static bool fetch_body_header_fields_init(struct imap_fetch_context *ctx,
+					  struct imap_fetch_body_data *body,
+					  const char *section)
 {
 	const char *const *arr;
 
@@ -608,8 +608,8 @@
 	return TRUE;
 }
 
-static int fetch_body_section_name_init(struct imap_fetch_context *ctx,
-					struct imap_fetch_body_data *body)
+static bool fetch_body_section_name_init(struct imap_fetch_context *ctx,
+					 struct imap_fetch_body_data *body)
 {
 	const char *section = body->section;
 
@@ -672,7 +672,7 @@
 
 /* Parse next digits in string into integer. Returns FALSE if the integer
    becomes too big and wraps. */
-static int read_uoff_t(const char **p, uoff_t *value)
+static bool read_uoff_t(const char **p, uoff_t *value)
 {
 	uoff_t prev;
 
@@ -690,10 +690,10 @@
 	return TRUE;
 }
 
-static int body_section_build(struct imap_fetch_context *ctx,
-			      struct imap_fetch_body_data *body,
-			      const char *prefix,
-			      const struct imap_arg_list *list)
+static bool body_section_build(struct imap_fetch_context *ctx,
+			       struct imap_fetch_body_data *body,
+			       const char *prefix,
+			       const struct imap_arg_list *list)
 {
 	string_t *str;
 	const char **arr;
@@ -736,8 +736,8 @@
 	return TRUE;
 }
   
-int fetch_body_section_init(struct imap_fetch_context *ctx, const char *name,
-			    struct imap_arg **args)
+bool fetch_body_section_init(struct imap_fetch_context *ctx, const char *name,
+			     struct imap_arg **args)
 {
 	struct imap_fetch_body_data *body;
 	const char *partial;
@@ -916,8 +916,8 @@
 	return fetch_stream(ctx, &body_size);
 }
 
-int fetch_rfc822_init(struct imap_fetch_context *ctx, const char *name,
-		      struct imap_arg **args __attr_unused__)
+bool fetch_rfc822_init(struct imap_fetch_context *ctx, const char *name,
+		       struct imap_arg **args __attr_unused__)
 {
 	if (name[6] == '\0') {
 		ctx->fetch_data |= MAIL_FETCH_STREAM_HEADER |

Index: imap-fetch.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- imap-fetch.c	4 Jul 2005 11:32:19 -0000	1.40
+++ imap-fetch.c	13 Jan 2006 20:25:59 -0000	1.41
@@ -57,8 +57,8 @@
 	return name[i] < 'A' || name[i] >= 'Z' ? 0 : -1;
 }
 
-int imap_fetch_init_handler(struct imap_fetch_context *ctx, const char *name,
-			    struct imap_arg **args)
+bool imap_fetch_init_handler(struct imap_fetch_context *ctx, const char *name,
+			     struct imap_arg **args)
 {
 	const struct imap_fetch_handler *handler;
 
@@ -100,7 +100,7 @@
 	return ctx;
 }
 
-void imap_fetch_add_handler(struct imap_fetch_context *ctx, int buffered,
+void imap_fetch_add_handler(struct imap_fetch_context *ctx, bool buffered,
 			    imap_fetch_handler_t *handler, void *context)
 {
 	/* partially because of broken clients, but also partially because
@@ -360,8 +360,8 @@
 	return 1;
 }
 
-static int fetch_body_init(struct imap_fetch_context *ctx, const char *name,
-			   struct imap_arg **args)
+static bool fetch_body_init(struct imap_fetch_context *ctx, const char *name,
+			    struct imap_arg **args)
 {
 	if (name[4] == '\0') {
 		ctx->fetch_data |= MAIL_FETCH_IMAP_BODY;
@@ -395,9 +395,9 @@
 	return 1;
 }
 
-static int fetch_bodystructure_init(struct imap_fetch_context *ctx,
-				    const char *name __attr_unused__,
-				    struct imap_arg **args __attr_unused__)
+static bool fetch_bodystructure_init(struct imap_fetch_context *ctx,
+				     const char *name __attr_unused__,
+				     struct imap_arg **args __attr_unused__)
 {
 	ctx->fetch_data |= MAIL_FETCH_IMAP_BODYSTRUCTURE;
 	imap_fetch_add_handler(ctx, FALSE, fetch_bodystructure, NULL);
@@ -427,9 +427,9 @@
 	return 1;
 }
 
-static int fetch_envelope_init(struct imap_fetch_context *ctx,
-			       const char *name __attr_unused__,
-			       struct imap_arg **args __attr_unused__)
+static bool fetch_envelope_init(struct imap_fetch_context *ctx,
+				const char *name __attr_unused__,
+				struct imap_arg **args __attr_unused__)
 {
 	ctx->fetch_data |= MAIL_FETCH_IMAP_ENVELOPE;
 	imap_fetch_add_handler(ctx, FALSE, fetch_envelope, NULL);
@@ -460,9 +460,9 @@
 	return 1;
 }
 
-static int fetch_flags_init(struct imap_fetch_context *ctx,
-			    const char *name __attr_unused__,
-			    struct imap_arg **args __attr_unused__)
+static bool fetch_flags_init(struct imap_fetch_context *ctx,
+			     const char *name __attr_unused__,
+			     struct imap_arg **args __attr_unused__)
 {
 	ctx->flags_have_handler = TRUE;
 	ctx->fetch_data |= MAIL_FETCH_FLAGS;
@@ -485,9 +485,9 @@
 }
 
 
-static int fetch_internaldate_init(struct imap_fetch_context *ctx,
-				   const char *name __attr_unused__,
-				   struct imap_arg **args __attr_unused__)
+static bool fetch_internaldate_init(struct imap_fetch_context *ctx,
+				    const char *name __attr_unused__,
+				    struct imap_arg **args __attr_unused__)
 {
 	ctx->fetch_data |= MAIL_FETCH_RECEIVED_DATE;
 	imap_fetch_add_handler(ctx, TRUE, fetch_internaldate, NULL);
@@ -501,9 +501,9 @@
 	return 1;
 }
 
-static int fetch_uid_init(struct imap_fetch_context *ctx __attr_unused__,
-			  const char *name __attr_unused__,
-			  struct imap_arg **args __attr_unused__)
+static bool fetch_uid_init(struct imap_fetch_context *ctx __attr_unused__,
+			   const char *name __attr_unused__,
+			   struct imap_arg **args __attr_unused__)
 {
 	imap_fetch_add_handler(ctx, TRUE, fetch_uid, NULL);
 	return TRUE;

Index: imap-fetch.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-fetch.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- imap-fetch.h	18 Mar 2005 18:49:54 -0000	1.16
+++ imap-fetch.h	13 Jan 2006 20:25:59 -0000	1.17
@@ -12,14 +12,14 @@
 	const char *name;
 
 	/* Returns FALSE if arg is invalid. */
-	int (*init)(struct imap_fetch_context *ctx, const char *name,
-		    struct imap_arg **args);
+	bool (*init)(struct imap_fetch_context *ctx, const char *name,
+		     struct imap_arg **args);
 };
 
 struct imap_fetch_context_handler {
 	imap_fetch_handler_t *handler;
 	void *context;
-	int buffered;
+	bool buffered;
 };
 
 struct imap_fetch_context {
@@ -43,7 +43,7 @@
 	uoff_t cur_size, cur_offset;
 	string_t *cur_str;
 	struct istream *cur_input;
-	int skip_cr;
+	bool skip_cr;
 	int (*cont_handler)(struct imap_fetch_context *ctx);
 
 	unsigned int select_counter;
@@ -63,21 +63,21 @@
 void imap_fetch_handlers_register(const struct imap_fetch_handler *handlers,
 				  size_t count);
 
-void imap_fetch_add_handler(struct imap_fetch_context *ctx, int buffered,
+void imap_fetch_add_handler(struct imap_fetch_context *ctx, bool buffered,
 			    imap_fetch_handler_t *handler, void *context);
 
 struct imap_fetch_context *imap_fetch_init(struct client_command_context *cmd);
 int imap_fetch_deinit(struct imap_fetch_context *ctx);
-int imap_fetch_init_handler(struct imap_fetch_context *ctx, const char *name,
-			    struct imap_arg **args);
+bool imap_fetch_init_handler(struct imap_fetch_context *ctx, const char *name,
+			     struct imap_arg **args);
 
 void imap_fetch_begin(struct imap_fetch_context *ctx,
 		      struct mail_search_arg *search_arg);
 int imap_fetch(struct imap_fetch_context *ctx);
 
-int fetch_body_section_init(struct imap_fetch_context *ctx, const char *name,
-			    struct imap_arg **args);
-int fetch_rfc822_init(struct imap_fetch_context *ctx, const char *name,
-		      struct imap_arg **args);
+bool fetch_body_section_init(struct imap_fetch_context *ctx, const char *name,
+			     struct imap_arg **args);
+bool fetch_rfc822_init(struct imap_fetch_context *ctx, const char *name,
+		       struct imap_arg **args);
 
 #endif

Index: imap-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-search.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- imap-search.c	18 Sep 2005 17:36:51 -0000	1.14
+++ imap-search.c	13 Jan 2006 20:25:59 -0000	1.15
@@ -18,7 +18,7 @@
 		  struct mail_search_seqset **seqset_r, const char **error_r)
 {
 	struct mail_search_seqset *seqset, **p;
-	int syntax, temporary, last;
+	bool syntax, temporary, last;
 
 	*seqset_r = imap_messageset_parse(pool, uidset);
 	if (*seqset_r == NULL) {
@@ -78,10 +78,10 @@
 #define ARG_NEW_HEADER(type, hdr_name) \
 	arg_new(data, args, next_sarg, type, TRUE, hdr_name)
 
-static int arg_new(struct search_build_data *data, struct imap_arg **args,
-		   struct mail_search_arg **next_sarg,
-		   enum mail_search_arg_type type, int have_value,
-		   const char *hdr_name)
+static bool arg_new(struct search_build_data *data, struct imap_arg **args,
+		    struct mail_search_arg **next_sarg,
+		    enum mail_search_arg_type type, bool have_value,
+		    const char *hdr_name)
 {
 	struct mail_search_arg *sarg;
 
@@ -109,9 +109,9 @@
 	return TRUE;
 }
 
-static int search_arg_build(struct search_build_data *data,
-			    struct imap_arg **args,
-			    struct mail_search_arg **next_sarg)
+static bool search_arg_build(struct search_build_data *data,
+			     struct imap_arg **args,
+			     struct mail_search_arg **next_sarg)
 {
         struct mail_search_seqset *seqset;
 	struct mail_search_arg **subargs;
@@ -450,7 +450,7 @@
 
 struct mail_search_arg *
 imap_search_get_arg(struct client_command_context *cmd,
-		    const char *set, int uid)
+		    const char *set, bool uid)
 {
 	struct mail_search_arg *search_arg;
 	const char *error;

Index: imap-search.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-search.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- imap-search.h	5 Feb 2005 18:07:26 -0000	1.6
+++ imap-search.h	13 Jan 2006 20:25:59 -0000	1.7
@@ -12,6 +12,6 @@
 
 struct mail_search_arg *
 imap_search_get_arg(struct client_command_context *cmd,
-		    const char *set, int uid);
+		    const char *set, bool uid);
 
 #endif

Index: imap-sort.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-sort.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- imap-sort.c	14 Aug 2005 22:30:55 -0000	1.24
+++ imap-sort.c	13 Jan 2006 20:25:59 -0000	1.25
@@ -49,7 +49,7 @@
 	uoff_t last_size;
 	char *last_cc, *last_from, *last_subject, *last_to;
 
-	int written, id_is_uid;
+	bool written, id_is_uid;
 };
 
 static void mail_sort_input(struct sort_context *ctx, struct mail *mail);
@@ -59,10 +59,10 @@
 mail_sort_normalize(const enum mail_sort_type *input, buffer_t *output)
 {
         enum mail_sort_type type, mask = 0;
-	int pos, reverse;
+	bool reverse;
 
 	reverse = FALSE;
-	for (pos = 0; *input != MAIL_SORT_END; input++) {
+	for (; *input != MAIL_SORT_END; input++) {
 		if (*input == MAIL_SORT_REVERSE)
 			reverse = !reverse;
 		else {
@@ -306,7 +306,7 @@
 	const char *str;
 	time_t t;
 	uoff_t size;
-	int changed = FALSE;
+	bool changed = FALSE;
 
 	if (ctx->common_mask & MAIL_SORT_ARRIVAL) {
 		t = mail_get_received_date(mail);
@@ -633,7 +633,8 @@
 static int mail_sort_qsort_func(const void *p1, const void *p2)
 {
 	enum mail_sort_type *sorting;
-	int ret, reverse = FALSE;
+	int ret;
+	bool reverse = FALSE;
 
 	sorting = qsort_context->sort_program;
 

Index: imap-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-sync.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- imap-sync.c	25 Dec 2005 11:24:45 -0000	1.14
+++ imap-sync.c	13 Jan 2006 20:25:59 -0000	1.15
@@ -26,7 +26,7 @@
 
 	unsigned int messages_count;
 
-	int failed;
+	bool failed;
 };
 
 struct imap_sync_context *
@@ -186,7 +186,7 @@
 	return mailbox_sync_deinit(ctx, &status);
 }
 
-static int cmd_sync_continue(struct client_command_context *cmd)
+static bool cmd_sync_continue(struct client_command_context *cmd)
 {
 	struct cmd_sync_context *ctx = cmd->context;
 	int ret;
@@ -206,8 +206,8 @@
 	return TRUE;
 }
 
-int cmd_sync(struct client_command_context *cmd, enum mailbox_sync_flags flags,
-	     enum imap_sync_flags imap_flags, const char *tagline)
+bool cmd_sync(struct client_command_context *cmd, enum mailbox_sync_flags flags,
+	      enum imap_sync_flags imap_flags, const char *tagline)
 {
         struct cmd_sync_context *ctx;
 

Index: imap-sync.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-sync.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- imap-sync.h	25 Dec 2005 11:24:45 -0000	1.4
+++ imap-sync.h	13 Jan 2006 20:25:59 -0000	1.5
@@ -15,7 +15,7 @@
 
 int imap_sync_nonselected(struct mailbox *box, enum mailbox_sync_flags flags);
 
-int cmd_sync(struct client_command_context *cmd, enum mailbox_sync_flags flags,
-	     enum imap_sync_flags imap_flags, const char *tagline);
+bool cmd_sync(struct client_command_context *cmd, enum mailbox_sync_flags flags,
+	      enum imap_sync_flags imap_flags, const char *tagline);
 
 #endif

Index: imap-thread.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/imap-thread.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- imap-thread.c	5 Jun 2005 20:37:49 -0000	1.17
+++ imap-thread.c	13 Jan 2006 20:25:59 -0000	1.18
@@ -84,7 +84,7 @@
 	struct node root_node;
 	size_t root_count; /* not exact after prune_dummy_messages() */
 
-	int id_is_uid;
+	bool id_is_uid;
 };
 
 static void mail_thread_input(struct thread_context *ctx, struct mail *mail);
@@ -220,7 +220,7 @@
 	return node;
 }
 
-static int get_untokenized_msgid(const char **msgid_p, string_t *msgid)
+static bool get_untokenized_msgid(const char **msgid_p, string_t *msgid)
 {
 	struct rfc822_parser_context parser;
 
@@ -279,7 +279,7 @@
 	const char *msgid = *msgid_p;
 	const char *p;
 	string_t *str = NULL;
-	int found_at;
+	bool found_at;
 
 	if (*msgid_p == NULL)
 		return NULL;
@@ -341,7 +341,7 @@
 }
 
 static void unlink_child(struct thread_context *ctx,
-			 struct node *child, int add_to_root)
+			 struct node *child, bool add_to_root)
 {
 	struct node **node;
 
@@ -360,7 +360,7 @@
 		add_root(ctx, child);
 }
 
-static int find_child(struct node *node, struct node *child)
+static bool find_child(struct node *node, struct node *child)
 {
 	do {
 		if (node == child)
@@ -378,7 +378,7 @@
 }
 
 static void link_node(struct thread_context *ctx, const char *parent_msgid,
-		      struct node *child, int replace)
+		      struct node *child, bool replace)
 {
 	struct node *parent, **node;
 
@@ -415,7 +415,7 @@
 
 static void link_message(struct thread_context *ctx,
 			 const char *parent_msgid, const char *child_msgid,
-			 int replace)
+			 bool replace)
 {
 	struct node *child;
 
@@ -426,8 +426,8 @@
 	link_node(ctx, parent_msgid, child, replace);
 }
 
-static int link_references(struct thread_context *ctx,
-			   struct node *node, const char *references)
+static bool link_references(struct thread_context *ctx,
+			    struct node *node, const char *references)
 {
 	const char *parent_id, *child_id;
 
@@ -638,7 +638,7 @@
 	struct node *hash_node;
 	char *hash_subject;
 	void *key, *value;
-	int is_reply_or_forward;
+	bool is_reply_or_forward;
 
 	if (subject == NULL)
 		return;
@@ -845,8 +845,8 @@
 	ctx->root_node.first_child = sort_nodes(ctx->root_node.first_child);
 }
 
-static int send_nodes(struct thread_context *ctx,
-		      string_t *str, struct node *node)
+static bool send_nodes(struct thread_context *ctx,
+		       string_t *str, struct node *node)
 {
 	if (node->next == NULL && NODE_HAS_PARENT(ctx, node)) {
 		/* no siblings - special case to avoid extra paranthesis */

Index: namespace.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/namespace.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- namespace.c	3 Oct 2005 21:25:04 -0000	1.10
+++ namespace.c	13 Jan 2006 20:25:59 -0000	1.11
@@ -32,7 +32,7 @@
 {
         struct namespace *ns;
         const char *sep, *type, *prefix;
-	int inbox, hidden, subscriptions;
+	bool inbox, hidden, subscriptions;
 
 	ns = p_new(pool, struct namespace, 1);
 
@@ -200,7 +200,7 @@
 	const char *box = *mailbox;
 	struct namespace *best = NULL;
 	size_t best_len = 0;
-	int inbox;
+	bool inbox;
 
 	inbox = strncasecmp(box, "INBOX", 5) == 0;
 	if (inbox && box[5] == '\0') {



More information about the dovecot-cvs mailing list