[dovecot-cvs] dovecot/src/lib-storage mail-search.c, 1.18, 1.19 mail-search.h, 1.12, 1.13 mail-storage-private.h, 1.20, 1.21 mail-storage.c, 1.44, 1.45 mail-storage.h, 1.100, 1.101 mailbox-tree.c, 1.1, 1.2 mailbox-tree.h, 1.1, 1.2

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


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

Modified Files:
	mail-search.c mail-search.h mail-storage-private.h 
	mail-storage.c mail-storage.h mailbox-tree.c mailbox-tree.h 
Log Message:
Added "bool" type and changed all ints that were used as booleans to bool.



Index: mail-search.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-search.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- mail-search.c	17 Apr 2005 15:43:02 -0000	1.18
+++ mail-search.c	13 Jan 2006 20:26:24 -0000	1.19
@@ -4,7 +4,7 @@
 #include "buffer.h"
 #include "mail-search.h"
 
-void mail_search_args_reset(struct mail_search_arg *args, int full_reset)
+void mail_search_args_reset(struct mail_search_arg *args, bool full_reset)
 {
 	while (args != NULL) {
 		if (args->type == SEARCH_OR || args->type == SEARCH_SUB)
@@ -106,7 +106,7 @@
 
 static void
 search_arg_analyze(struct mail_search_arg *arg, buffer_t *headers,
-		   int *have_body, int *have_text)
+		   bool *have_body, bool *have_text)
 {
 	static const char *date_hdr = "Date";
 	struct mail_search_arg *subarg;
@@ -151,11 +151,11 @@
 
 const char *const *
 mail_search_args_analyze(struct mail_search_arg *args,
-			 int *have_headers, int *have_body)
+			 bool *have_headers, bool *have_body)
 {
 	const char *null = NULL;
 	buffer_t *headers;
-	int have_text;
+	bool have_text;
 
 	*have_headers = *have_body = have_text = FALSE;
 

Index: mail-search.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-search.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- mail-search.h	27 Apr 2004 20:25:54 -0000	1.12
+++ mail-search.h	13 Jan 2006 20:26:24 -0000	1.13
@@ -73,7 +73,7 @@
 
 /* Reset the results in search arguments. match_always is reset only if
    full_reset is TRUE. */
-void mail_search_args_reset(struct mail_search_arg *args, int full_reset);
+void mail_search_args_reset(struct mail_search_arg *args, bool full_reset);
 
 /* goes through arguments in list that don't have a result yet.
    Returns 1 = search matched, 0 = search unmatched, -1 = don't know yet */
@@ -86,6 +86,6 @@
    NULL if we're searching for TEXT. */
 const char *const *
 mail_search_args_analyze(struct mail_search_arg *args,
-			 int *have_headers, int *have_body);
+			 bool *have_headers, bool *have_body);
 
 #endif

Index: mail-storage-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage-private.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- mail-storage-private.h	10 Dec 2005 18:56:02 -0000	1.20
+++ mail-storage-private.h	13 Jan 2006 20:26:24 -0000	1.21
@@ -14,7 +14,7 @@
 			  enum mail_storage_lock_method lock_method);
 	void (*destroy)(struct mail_storage *storage);
 
-	int (*autodetect)(const char *data, enum mail_storage_flags flags);
+	bool (*autodetect)(const char *data, enum mail_storage_flags flags);
 
 	void (*set_callbacks)(struct mail_storage *storage,
 			      struct mail_storage_callbacks *callbacks,
@@ -26,7 +26,7 @@
 					enum mailbox_open_flags flags);
 
 	int (*mailbox_create)(struct mail_storage *storage, const char *name,
-			      int directory);
+			      bool directory);
 	int (*mailbox_delete)(struct mail_storage *storage, const char *name);
 	int (*mailbox_rename)(struct mail_storage *storage, const char *oldname,
 			      const char *newname);
@@ -40,15 +40,15 @@
 	int (*mailbox_list_deinit)(struct mailbox_list_context *ctx);
 
 	int (*set_subscribed)(struct mail_storage *storage,
-			      const char *name, int set);
+			      const char *name, bool set);
 
 	int (*get_mailbox_name_status)(struct mail_storage *storage,
 				       const char *name,
 				       enum mailbox_name_status *status);
 
 	const char *(*get_last_error)(struct mail_storage *storage,
-				      int *syntax_error_r,
-				      int *temporary_error_r);
+				      bool *syntax_error_r,
+				      bool *temporary_error_r);
 };
 
 struct mail_storage {
@@ -75,8 +75,8 @@
 };
 
 struct mailbox_vfuncs {
-	int (*is_readonly)(struct mailbox *box);
-	int (*allow_new_keywords)(struct mailbox *box);
+	bool (*is_readonly)(struct mailbox *box);
+	bool (*allow_new_keywords)(struct mailbox *box);
 
 	int (*close)(struct mailbox *box);
 
@@ -136,7 +136,7 @@
 			     struct mail_keywords *keywords,
 			     time_t received_date, int timezone_offset,
 			     const char *from_envelope, struct istream *input,
-			     int want_mail);
+			     bool want_mail);
 	int (*save_continue)(struct mail_save_context *ctx);
 	int (*save_finish)(struct mail_save_context *ctx,
 			   struct mail *dest_mail);
@@ -146,7 +146,7 @@
 		    enum mail_flags flags, struct mail_keywords *keywords,
 		    struct mail *dest_mail);
 
-	int (*is_inconsistent)(struct mailbox *box);
+	bool (*is_inconsistent)(struct mailbox *box);
 };
 
 struct mailbox {
@@ -239,6 +239,6 @@
 void mail_storage_set_internal_error(struct mail_storage *storage);
 
 const char *mail_storage_class_get_last_error(struct mail_storage *storage,
-					      int *syntax_error_r);
+					      bool *syntax_error_r);
 
 #endif

Index: mail-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- mail-storage.c	7 Oct 2005 09:34:08 -0000	1.44
+++ mail-storage.c	13 Jan 2006 20:26:24 -0000	1.45
@@ -235,7 +235,7 @@
 }
 
 int mail_storage_mailbox_create(struct mail_storage *storage, const char *name,
-				int directory)
+				bool directory)
 {
 	return storage->v.mailbox_create(storage, name, directory);
 }
@@ -271,7 +271,7 @@
 }
 
 int mail_storage_set_subscribed(struct mail_storage *storage,
-				const char *name, int set)
+				const char *name, bool set)
 {
 	return storage->v.set_subscribed(storage, name, set);
 }
@@ -284,8 +284,8 @@
 }
 
 const char *mail_storage_get_last_error(struct mail_storage *storage,
-					int *syntax_error_r,
-					int *temporary_error_r)
+					bool *syntax_error_r,
+					bool *temporary_error_r)
 {
 	return storage->v.get_last_error(storage, syntax_error_r,
 					 temporary_error_r);
@@ -313,12 +313,12 @@
 	return box->name;
 }
 
-int mailbox_is_readonly(struct mailbox *box)
+bool mailbox_is_readonly(struct mailbox *box)
 {
 	return box->v.is_readonly(box);
 }
 
-int mailbox_allow_new_keywords(struct mailbox *box)
+bool mailbox_allow_new_keywords(struct mailbox *box)
 {
 	return box->v.allow_new_keywords(box);
 }
@@ -431,7 +431,7 @@
 		  enum mail_flags flags, struct mail_keywords *keywords,
 		  time_t received_date, int timezone_offset,
 		  const char *from_envelope, struct istream *input,
-		  int want_mail)
+		  bool want_mail)
 {
 	return t->box->v.save_init(t, flags, keywords,
 				   received_date, timezone_offset,
@@ -460,7 +460,7 @@
 	return t->box->v.copy(t, mail, flags, keywords, dest_mail);
 }
 
-int mailbox_is_inconsistent(struct mailbox *box)
+bool mailbox_is_inconsistent(struct mailbox *box)
 {
 	return box->v.is_inconsistent(box);
 }

Index: mail-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -d -r1.100 -r1.101
--- mail-storage.h	7 Oct 2005 09:34:08 -0000	1.100
+++ mail-storage.h	13 Jan 2006 20:26:24 -0000	1.101
@@ -245,7 +245,7 @@
    can contain children. The mailbox itself doesn't have to be
    created as long as it shows in LIST. */
 int mail_storage_mailbox_create(struct mail_storage *storage, const char *name,
-				int directory);
+				bool directory);
 /* Only the specified mailbox is deleted, ie. folders under the
    specified mailbox must not be deleted. */
 int mail_storage_mailbox_delete(struct mail_storage *storage, const char *name);
@@ -277,7 +277,7 @@
    subscribing to already subscribed mailbox. Subscribing to
    unexisting mailboxes is optional. */
 int mail_storage_set_subscribed(struct mail_storage *storage,
-				const char *name, int set);
+				const char *name, bool set);
 
 /* Returns mailbox name status */
 int mail_storage_get_mailbox_name_status(struct mail_storage *storage,
@@ -286,8 +286,8 @@
 
 /* Returns the error message of last occurred error. */
 const char *mail_storage_get_last_error(struct mail_storage *storage,
-					int *syntax_error_r,
-					int *temporary_error_r);
+					bool *syntax_error_r,
+					bool *temporary_error_r);
 
 /* Open a mailbox. If input stream is given, mailbox is opened read-only
    using it as a backend. If storage doesn't support stream backends and its
@@ -298,7 +298,7 @@
 struct mailbox *mailbox_open(struct mail_storage *storage, const char *name,
 			     struct istream *input,
 			     enum mailbox_open_flags flags);
-/* Close the box. Returns FALSE if some cleanup errors occurred, but
+/* Close the box. Returns -1 if some cleanup errors occurred, but
    the mailbox was closed anyway. */
 int mailbox_close(struct mailbox *box);
 
@@ -309,10 +309,10 @@
 const char *mailbox_get_name(struct mailbox *box);
 
 /* Returns TRUE if mailbox is read-only. */
-int mailbox_is_readonly(struct mailbox *box);
+bool mailbox_is_readonly(struct mailbox *box);
 
 /* Returns TRUE if mailbox currently supports adding keywords. */
-int mailbox_allow_new_keywords(struct mailbox *box);
+bool mailbox_allow_new_keywords(struct mailbox *box);
 
 /* Gets the mailbox status information. */
 int mailbox_get_status(struct mailbox *box, enum mailbox_status_items items,
@@ -386,7 +386,7 @@
 		  enum mail_flags flags, struct mail_keywords *keywords,
 		  time_t received_date, int timezone_offset,
 		  const char *from_envelope, struct istream *input,
-		  int want_mail);
+		  bool want_mail);
 int mailbox_save_continue(struct mail_save_context *ctx);
 int mailbox_save_finish(struct mail_save_context *ctx, struct mail *dest_mail);
 void mailbox_save_cancel(struct mail_save_context *ctx);
@@ -403,7 +403,7 @@
    would be to fully close the mailbox and reopen it. With IMAP
    connection this would mean a forced disconnection since we can't
    do forced CLOSE. */
-int mailbox_is_inconsistent(struct mailbox *box);
+bool mailbox_is_inconsistent(struct mailbox *box);
 
 /* Returns message's flags */
 enum mail_flags mail_get_flags(struct mail *mail);

Index: mailbox-tree.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mailbox-tree.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mailbox-tree.c	26 Jul 2003 23:53:05 -0000	1.1
+++ mailbox-tree.c	13 Jan 2006 20:26:24 -0000	1.2
@@ -30,7 +30,7 @@
 
 static struct mailbox_node *
 mailbox_tree_traverse(struct mailbox_tree_context *ctx, const char *path,
-		      int create, int *created)
+		      bool create, bool *created)
 {
 	struct mailbox_node **node;
 	const char *name;
@@ -96,7 +96,7 @@
 
 struct mailbox_node *
 mailbox_tree_get(struct mailbox_tree_context *ctx, const char *path,
-		 int *created)
+		 bool *created)
 {
 	return mailbox_tree_traverse(ctx, path, TRUE, created);
 }

Index: mailbox-tree.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mailbox-tree.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- mailbox-tree.h	26 Jul 2003 23:53:05 -0000	1.1
+++ mailbox-tree.h	13 Jan 2006 20:26:24 -0000	1.2
@@ -16,7 +16,7 @@
 
 struct mailbox_node *
 mailbox_tree_get(struct mailbox_tree_context *ctx, const char *path,
-		 int *created);
+		 bool *created);
 
 struct mailbox_node *
 mailbox_tree_update(struct mailbox_tree_context *ctx, const char *path);



More information about the dovecot-cvs mailing list