dovecot-2.2: lib-index: Added mail_index_ext_register_resize_def...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 13 14:08:21 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/9c90eba19aee
changeset: 18849:9c90eba19aee
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 13 17:05:49 2015 +0300
description:
lib-index: Added mail_index_ext_register_resize_defaults()

diffstat:

 src/lib-index/mail-index.c |  14 ++++++++++++++
 src/lib-index/mail-index.h |   6 ++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diffs (40 lines):

diff -r 47fa4a6c6b9a -r 9c90eba19aee src/lib-index/mail-index.c
--- a/src/lib-index/mail-index.c	Sat Jun 13 16:46:06 2015 +0300
+++ b/src/lib-index/mail-index.c	Sat Jun 13 17:05:49 2015 +0300
@@ -159,6 +159,20 @@
 	return rext.index_idx;
 }
 
+void mail_index_ext_register_resize_defaults(struct mail_index *index,
+					     uint32_t ext_id,
+					     uint32_t default_hdr_size,
+					     uint16_t default_record_size,
+					     uint16_t default_record_align)
+{
+	struct mail_index_registered_ext *rext;
+
+	rext = array_idx_modifiable(&index->extensions, ext_id);
+	rext->hdr_size = default_hdr_size;
+	rext->record_size = default_record_size;
+	rext->record_align = default_record_align;
+}
+
 bool mail_index_ext_lookup(struct mail_index *index, const char *name,
 			   uint32_t *ext_id_r)
 {
diff -r 47fa4a6c6b9a -r 9c90eba19aee src/lib-index/mail-index.h
--- a/src/lib-index/mail-index.h	Sat Jun 13 16:46:06 2015 +0300
+++ b/src/lib-index/mail-index.h	Sat Jun 13 17:05:49 2015 +0300
@@ -562,6 +562,12 @@
 				 uint32_t default_hdr_size,
 				 uint16_t default_record_size,
 				 uint16_t default_record_align);
+/* Change an already registered extension's default sizes. */
+void mail_index_ext_register_resize_defaults(struct mail_index *index,
+					     uint32_t ext_id,
+					     uint32_t default_hdr_size,
+					     uint16_t default_record_size,
+					     uint16_t default_record_align);
 /* Returns TRUE and sets ext_id_r if extension with given name is registered. */
 bool mail_index_ext_lookup(struct mail_index *index, const char *name,
 			   uint32_t *ext_id_r);


More information about the dovecot-cvs mailing list