[dovecot-cvs] dovecot/src/lib-imap imap-base-subject.c, 1.10, 1.11 imap-base-subject.h, 1.4, 1.5 imap-bodystructure.c, 1.52, 1.53 imap-bodystructure.h, 1.11, 1.12 imap-date.c, 1.7, 1.8 imap-date.h, 1.3, 1.4 imap-envelope.c, 1.33, 1.34 imap-envelope.h, 1.11, 1.12 imap-match.c, 1.7, 1.8 imap-match.h, 1.5, 1.6 imap-parser.c, 1.50, 1.51 imap-parser.h, 1.20, 1.21 imap-quote.c, 1.17, 1.18 imap-quote.h, 1.7, 1.8

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


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

Modified Files:
	imap-base-subject.c imap-base-subject.h imap-bodystructure.c 
	imap-bodystructure.h imap-date.c imap-date.h imap-envelope.c 
	imap-envelope.h imap-match.c imap-match.h imap-parser.c 
	imap-parser.h imap-quote.c imap-quote.h 
Log Message:
Added "bool" type and changed all ints that were used as booleans to bool.



Index: imap-base-subject.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-base-subject.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- imap-base-subject.c	8 Oct 2004 17:51:48 -0000	1.10
+++ imap-base-subject.c	13 Jan 2006 20:26:09 -0000	1.11
@@ -9,8 +9,8 @@
 #include "message-header-decode.h"
 #include "imap-base-subject.h"
 
-static int header_decode(const unsigned char *data, size_t size,
-			 const char *charset, void *context)
+static bool header_decode(const unsigned char *data, size_t size,
+			  const char *charset, void *context)
 {
 	buffer_t *buf = context;
         struct charset_translation *t;
@@ -45,7 +45,7 @@
 static void pack_whitespace(buffer_t *buf)
 {
 	char *data, *dest;
-	int last_lwsp;
+	bool last_lwsp;
 
 	data = buffer_get_modifyable_data(buf, NULL);
 
@@ -82,7 +82,7 @@
 }
 
 static void remove_subj_trailers(buffer_t *buf, size_t start_pos,
-				 int *is_reply_or_forward_r)
+				 bool *is_reply_or_forward_r)
 {
 	const char *data;
 	size_t orig_size, size;
@@ -112,7 +112,7 @@
 	}
 }
 
-static int remove_blob(const char **datap)
+static bool remove_blob(const char **datap)
 {
 	const char *data = *datap;
 
@@ -134,11 +134,11 @@
 	return TRUE;
 }
 
-static int remove_subj_leader(buffer_t *buf, size_t *start_pos,
-			      int *is_reply_or_forward_r)
+static bool remove_subj_leader(buffer_t *buf, size_t *start_pos,
+			       bool *is_reply_or_forward_r)
 {
 	const char *data, *orig_data;
-	int ret = FALSE;
+	bool ret = FALSE;
 
 	/* subj-leader     = (*subj-blob subj-refwd) / WSP
 
@@ -188,7 +188,7 @@
 	return TRUE;
 }
 
-static int remove_blob_when_nonempty(buffer_t *buf, size_t *start_pos)
+static bool remove_blob_when_nonempty(buffer_t *buf, size_t *start_pos)
 {
 	const char *data, *orig_data;
 
@@ -203,8 +203,8 @@
 	return FALSE;
 }
 
-static int remove_subj_fwd_hdr(buffer_t *buf, size_t *start_pos,
-			       int *is_reply_or_forward_r)
+static bool remove_subj_fwd_hdr(buffer_t *buf, size_t *start_pos,
+				bool *is_reply_or_forward_r)
 {
 	const char *data;
 	size_t size;
@@ -231,11 +231,11 @@
 }
 
 const char *imap_get_base_subject_cased(pool_t pool, const char *subject,
-					int *is_reply_or_forward_r)
+					bool *is_reply_or_forward_r)
 {
 	buffer_t *buf;
 	size_t start_pos, subject_len;
-	int found;
+	bool found;
 
 	if (is_reply_or_forward_r != NULL)
 		*is_reply_or_forward_r = FALSE;

Index: imap-base-subject.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-base-subject.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- imap-base-subject.h	31 Jul 2004 20:19:39 -0000	1.4
+++ imap-base-subject.h	13 Jan 2006 20:26:09 -0000	1.5
@@ -8,6 +8,6 @@
    is_reply_or_forward is set to TRUE if message looks like reply or forward,
    according to draft-ietf-imapext-thread-12 rules. */
 const char *imap_get_base_subject_cased(pool_t pool, const char *subject,
-					int *is_reply_or_forward_r);
+					bool *is_reply_or_forward_r);
 
 #endif

Index: imap-bodystructure.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-bodystructure.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- imap-bodystructure.c	11 Sep 2005 13:23:01 -0000	1.52
+++ imap-bodystructure.c	13 Jan 2006 20:26:09 -0000	1.53
@@ -60,7 +60,7 @@
 
 static void parse_save_params_list(const unsigned char *name, size_t name_len,
 				   const unsigned char *value, size_t value_len,
-				   int value_quoted __attr_unused__,
+				   bool value_quoted __attr_unused__,
 				   void *context)
 {
         struct message_part_body_data *data = context;
@@ -220,7 +220,7 @@
 {
 	struct message_part_body_data *part_data;
 	struct message_part_envelope_data *envelope;
-	int parent_rfc822;
+	bool parent_rfc822;
 
 	if (hdr == NULL) {
 		/* If there was no Mime-Version, forget all the Content-stuff */
@@ -264,7 +264,7 @@
 }
 
 static void part_write_body_multipart(struct message_part *part,
-				      string_t *str, int extended)
+				      string_t *str, bool extended)
 {
 	struct message_part_body_data *data = part->context;
 
@@ -330,10 +330,10 @@
 }
 
 static void part_write_body(struct message_part *part,
-			    string_t *str, int extended)
+			    string_t *str, bool extended)
 {
 	struct message_part_body_data *data = part->context;
-	int text;
+	bool text;
 
 	if (data == NULL) {
 		/* there was no content headers, use an empty structure */
@@ -441,7 +441,7 @@
 	}
 }
 
-int imap_bodystructure_is_plain_7bit(struct message_part *part)
+bool imap_bodystructure_is_plain_7bit(struct message_part *part)
 {
 	struct message_part_body_data *data = part->context;
 
@@ -487,7 +487,7 @@
 }
 
 void imap_bodystructure_write(struct message_part *part,
-			      string_t *dest, int extended)
+			      string_t *dest, bool extended)
 {
 	i_assert(part->parent != NULL || part->next == NULL);
 
@@ -507,7 +507,7 @@
 	}
 }
 
-static int str_append_imap_arg(string_t *str, const struct imap_arg *arg)
+static bool str_append_imap_arg(string_t *str, const struct imap_arg *arg)
 {
 	switch (arg->type) {
 	case IMAP_ARG_NIL:
@@ -535,7 +535,7 @@
 	return TRUE;
 }
 
-static int imap_write_list(const struct imap_arg *args, string_t *str)
+static bool imap_write_list(const struct imap_arg *args, string_t *str)
 {
 	/* don't do any typechecking, just write it out */
 	str_append_c(str, '(');
@@ -556,12 +556,13 @@
 	return TRUE;
 }
 
-static int imap_parse_bodystructure_args(const struct imap_arg *args,
-					 string_t *str)
+static bool imap_parse_bodystructure_args(const struct imap_arg *args,
+					  string_t *str)
 {
 	struct imap_arg *subargs;
 	struct imap_arg_list *list;
-	int i, multipart, text, message_rfc822;
+	bool multipart, text, message_rfc822;
+	int i;
 
 	multipart = FALSE;
 	while (args->type == IMAP_ARG_LIST) {
@@ -663,8 +664,8 @@
 	return TRUE;
 }
 
-int imap_body_parse_from_bodystructure(const char *bodystructure,
-				       string_t *dest)
+bool imap_body_parse_from_bodystructure(const char *bodystructure,
+					string_t *dest)
 {
 	struct istream *input;
 	struct imap_parser *parser;

Index: imap-bodystructure.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-bodystructure.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- imap-bodystructure.h	3 Jul 2005 14:18:53 -0000	1.11
+++ imap-bodystructure.h	13 Jan 2006 20:26:09 -0000	1.12
@@ -10,13 +10,13 @@
 
 /* Returns TRUE if BODYSTRUCTURE is
    ("text" "plain" ("charset" "us-ascii") NIL NIL "7bit" n n NIL NIL NIL) */
-int imap_bodystructure_is_plain_7bit(struct message_part *part);
+bool imap_bodystructure_is_plain_7bit(struct message_part *part);
 
 void imap_bodystructure_write(struct message_part *part,
-			      string_t *dest, int extended);
+			      string_t *dest, bool extended);
 
 /* Return BODY part from BODYSTRUCTURE */
-int imap_body_parse_from_bodystructure(const char *bodystructure,
-				       string_t *dest);
+bool imap_body_parse_from_bodystructure(const char *bodystructure,
+					string_t *dest);
 
 #endif

Index: imap-date.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-date.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- imap-date.c	8 Sep 2003 00:57:36 -0000	1.7
+++ imap-date.c	13 Jan 2006 20:26:09 -0000	1.8
@@ -79,7 +79,7 @@
 	return str;
 }
 
-int imap_parse_date(const char *str, time_t *time)
+bool imap_parse_date(const char *str, time_t *time)
 {
 	struct tm tm;
 
@@ -92,7 +92,7 @@
 	return *time != (time_t)-1;
 }
 
-int imap_parse_datetime(const char *str, time_t *time, int *timezone_offset)
+bool imap_parse_datetime(const char *str, time_t *time, int *timezone_offset)
 {
 	struct tm tm;
 

Index: imap-date.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-date.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- imap-date.h	8 Sep 2003 00:57:36 -0000	1.3
+++ imap-date.h	13 Jan 2006 20:26:09 -0000	1.4
@@ -4,8 +4,8 @@
 /* Parses IMAP date/time string. time_t is filled with UTC date.
    timezone_offset is filled with parsed timezone. If no timezone is given,
    local timezone is assumed. */
-int imap_parse_date(const char *str, time_t *time);
-int imap_parse_datetime(const char *str, time_t *time, int *timezone_offset);
+bool imap_parse_date(const char *str, time_t *time);
+bool imap_parse_datetime(const char *str, time_t *time, int *timezone_offset);
 
 /* Returns given UTC time in local timezone. */
 const char *imap_to_datetime(time_t time);

Index: imap-envelope.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-envelope.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- imap-envelope.c	6 Jan 2005 18:14:28 -0000	1.33
+++ imap-envelope.c	13 Jan 2006 20:26:09 -0000	1.34
@@ -25,7 +25,7 @@
 	NULL
 };
 
-int imap_envelope_get_field(const char *name, enum imap_envelope_field *ret)
+bool imap_envelope_get_field(const char *name, enum imap_envelope_field *ret)
 {
 	*ret = (enum imap_envelope_field)-1;
 
@@ -211,8 +211,8 @@
 	str_append(str, NVL(data->message_id, "NIL"));
 }
 
-static int imap_address_arg_append(struct imap_arg *arg, string_t *str,
-				   int *in_group)
+static bool imap_address_arg_append(struct imap_arg *arg, string_t *str,
+				    bool *in_group)
 {
 	struct imap_arg_list *list;
 	const char *args[4];
@@ -293,7 +293,7 @@
 	struct imap_arg_list *list;
 	string_t *str;
 	size_t i;
-	int in_group;
+	bool in_group;
 
 	if (arg->type != IMAP_ARG_LIST)
 		return NULL;
@@ -333,11 +333,11 @@
 	return t_strdup(imap_arg_string(&list->args[2]));
 }
 
-static int imap_envelope_parse_arg(struct imap_arg *arg,
-				   enum imap_envelope_field field,
-				   const char *envelope,
-				   enum imap_envelope_result_type result_type,
-				   const char **result)
+static bool
+imap_envelope_parse_arg(struct imap_arg *arg, enum imap_envelope_field field,
+			const char *envelope,
+			enum imap_envelope_result_type result_type,
+			const char **result)
 {
 	const char *value = NULL;
 
@@ -370,9 +370,9 @@
 	}
 }
 
-int imap_envelope_parse(const char *envelope, enum imap_envelope_field field,
-			enum imap_envelope_result_type result_type,
-			const char **result)
+bool imap_envelope_parse(const char *envelope, enum imap_envelope_field field,
+			 enum imap_envelope_result_type result_type,
+			 const char **result)
 {
 	struct istream *input;
 	struct imap_parser *parser;

Index: imap-envelope.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-envelope.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- imap-envelope.h	6 Aug 2003 20:15:31 -0000	1.11
+++ imap-envelope.h	13 Jan 2006 20:26:09 -0000	1.12
@@ -28,7 +28,7 @@
 
 extern const char *imap_envelope_headers[];
 
-int imap_envelope_get_field(const char *name, enum imap_envelope_field *ret);
+bool imap_envelope_get_field(const char *name, enum imap_envelope_field *ret);
 
 /* Update envelope data based from given header field */
 void imap_envelope_parse_header(pool_t pool,
@@ -41,8 +41,8 @@
 
 /* Parse envelope and store specified field to result. NIL is stored as NULL.
    Returns TRUE if successful. */
-int imap_envelope_parse(const char *envelope, enum imap_envelope_field field,
-			enum imap_envelope_result_type result_type,
-			const char **result);
+bool imap_envelope_parse(const char *envelope, enum imap_envelope_field field,
+			 enum imap_envelope_result_type result_type,
+			 const char **result);
 
 #endif

Index: imap-match.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-match.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- imap-match.c	26 Jul 2003 23:28:05 -0000	1.7
+++ imap-match.c	13 Jan 2006 20:26:09 -0000	1.8
@@ -12,7 +12,7 @@
 struct imap_match_glob {
 	pool_t pool;
 
-	int inboxcase;
+	bool inboxcase;
 	const char *inboxcase_end;
 
 	char sep_char;
@@ -24,7 +24,7 @@
 #define INBOXLEN (sizeof(inbox) - 1)
 
 struct imap_match_glob *
-imap_match_init(pool_t pool, const char *mask, int inboxcase, char separator)
+imap_match_init(pool_t pool, const char *mask, bool inboxcase, char separator)
 {
 	struct imap_match_glob *glob;
 	const char *p, *inboxp;
@@ -91,8 +91,8 @@
 	p_free(glob->pool, glob);
 }
 
-static inline int cmp_chr(const struct imap_match_glob *glob,
-			  const char *data, char maskchr)
+static inline bool cmp_chr(const struct imap_match_glob *glob,
+			   const char *data, char maskchr)
 {
 	return *data == maskchr ||
 		(glob->inboxcase_end != NULL && data < glob->inboxcase_end &&

Index: imap-match.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-match.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- imap-match.h	19 Feb 2003 19:55:28 -0000	1.5
+++ imap-match.h	13 Jan 2006 20:26:09 -0000	1.6
@@ -14,7 +14,7 @@
 /* If inboxcase is TRUE, the "INBOX" string at the beginning of line is
    compared case-insensitively */
 struct imap_match_glob *
-imap_match_init(pool_t pool, const char *mask, int inboxcase, char separator);
+imap_match_init(pool_t pool, const char *mask, bool inboxcase, char separator);
 
 void imap_match_deinit(struct imap_match_glob *glob);
 

Index: imap-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-parser.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- imap-parser.c	12 Jul 2005 14:43:44 -0000	1.50
+++ imap-parser.c	13 Jan 2006 20:26:09 -0000	1.51
@@ -112,7 +112,7 @@
 	imap_args_realloc(parser, LIST_ALLOC_SIZE);
 }
 
-const char *imap_parser_get_error(struct imap_parser *parser, int *fatal)
+const char *imap_parser_get_error(struct imap_parser *parser, bool *fatal)
 {
         *fatal = parser->fatal_error;
 	return parser->error;

Index: imap-parser.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-parser.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- imap-parser.h	11 Sep 2005 13:23:01 -0000	1.20
+++ imap-parser.h	13 Jan 2006 20:26:09 -0000	1.21
@@ -94,7 +94,7 @@
 /* Return the last error in parser. fatal is set to TRUE if there's no way to
    continue parsing, currently only if too large non-sync literal size was
    given. */
-const char *imap_parser_get_error(struct imap_parser *parser, int *fatal);
+const char *imap_parser_get_error(struct imap_parser *parser, bool *fatal);
 
 /* Read a number of arguments. This function doesn't call i_stream_read(), you
    need to do that. Returns number of arguments read (may be less than count

Index: imap-quote.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-quote.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- imap-quote.c	21 Sep 2003 16:21:37 -0000	1.17
+++ imap-quote.c	13 Jan 2006 20:26:09 -0000	1.18
@@ -5,10 +5,10 @@
 #include "imap-quote.h"
 
 void imap_quote_append(string_t *str, const unsigned char *value,
-		       size_t value_len, int compress_lwsp)
+		       size_t value_len, bool compress_lwsp)
 {
 	size_t i, extra = 0;
-	int last_lwsp = TRUE, literal = FALSE, modify = FALSE;
+	bool last_lwsp = TRUE, literal = FALSE, modify = FALSE;
 
 	if (value == NULL) {
 		str_append(str, "NIL");

Index: imap-quote.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-imap/imap-quote.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- imap-quote.h	23 Jun 2003 18:22:48 -0000	1.7
+++ imap-quote.h	13 Jan 2006 20:26:09 -0000	1.8
@@ -8,7 +8,7 @@
 
 /* Append to existing string. */
 void imap_quote_append(string_t *str, const unsigned char *value,
-		       size_t value_len, int compress_lwsp);
+		       size_t value_len, bool compress_lwsp);
 
 #define imap_quote_append_string(str, value, compress_lwsp) \
 	imap_quote_append(str, (const unsigned char *) value, \



More information about the dovecot-cvs mailing list