dovecot-2.0: lib-index: Added mail_cache_field_exists_any()

dovecot at dovecot.org dovecot at dovecot.org
Thu May 5 19:14:20 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/45f6d523b1a1
changeset: 12771:45f6d523b1a1
user:      Timo Sirainen <tss at iki.fi>
date:      Thu May 05 17:47:58 2011 +0200
description:
lib-index: Added mail_cache_field_exists_any()

diffstat:

 src/lib-index/mail-cache-lookup.c |  7 +++++++
 src/lib-index/mail-cache.h        |  4 +++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 23b6234ce0ae -r 45f6d523b1a1 src/lib-index/mail-cache-lookup.c
--- a/src/lib-index/mail-cache-lookup.c	Wed May 04 15:03:14 2011 +0200
+++ b/src/lib-index/mail-cache-lookup.c	Thu May 05 17:47:58 2011 +0200
@@ -328,6 +328,13 @@
 		data[field] == view->cached_exists_value) ? 1 : 0;
 }
 
+bool mail_cache_field_exists_any(struct mail_cache_view *view, uint32_t seq)
+{
+	uint32_t reset_id;
+
+	return mail_cache_lookup_cur_offset(view->view, seq, &reset_id) != 0;
+}
+
 enum mail_cache_decision_type
 mail_cache_field_get_decision(struct mail_cache *cache, unsigned int field_idx)
 {
diff -r 23b6234ce0ae -r 45f6d523b1a1 src/lib-index/mail-cache.h
--- a/src/lib-index/mail-cache.h	Wed May 04 15:03:14 2011 +0200
+++ b/src/lib-index/mail-cache.h	Thu May 05 17:47:58 2011 +0200
@@ -94,9 +94,11 @@
 bool mail_cache_field_can_add(struct mail_cache_transaction_ctx *ctx,
 			      uint32_t seq, unsigned int field_idx);
 
-/* Retursn 1 if field exists, 0 if not, -1 if error. */
+/* Returns 1 if field exists, 0 if not, -1 if error. */
 int mail_cache_field_exists(struct mail_cache_view *view, uint32_t seq,
 			    unsigned int field_idx);
+/* Returns TRUE if something is cached for the message, FALSE if not. */
+bool mail_cache_field_exists_any(struct mail_cache_view *view, uint32_t seq);
 /* Returns current caching decision for given field. */
 enum mail_cache_decision_type
 mail_cache_field_get_decision(struct mail_cache *cache, unsigned int field_idx);


More information about the dovecot-cvs mailing list