Mercurial > dovecot > core-2.2
changeset 12316:f170b3e39a34
lib-index: Added mail_cache_register_get_field().
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 20 Oct 2010 16:01:46 +0100 |
parents | 5f9919f9e321 |
children | 8a6cdefd829a |
files | src/lib-index/mail-cache-fields.c src/lib-index/mail-cache.h |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-cache-fields.c Tue Oct 19 20:20:18 2010 +0100 +++ b/src/lib-index/mail-cache-fields.c Wed Oct 20 16:01:46 2010 +0100 @@ -154,6 +154,14 @@ } const struct mail_cache_field * +mail_cache_register_get_field(struct mail_cache *cache, unsigned int field_idx) +{ + i_assert(field_idx < cache->fields_count); + + return &cache->fields[field_idx].field; +} + +const struct mail_cache_field * mail_cache_register_get_list(struct mail_cache *cache, pool_t pool, unsigned int *count_r) {
--- a/src/lib-index/mail-cache.h Tue Oct 19 20:20:18 2010 +0100 +++ b/src/lib-index/mail-cache.h Wed Oct 20 16:01:46 2010 +0100 @@ -53,6 +53,9 @@ /* Returns registered field index, or (unsigned int)-1 if not found. */ unsigned int mail_cache_register_lookup(struct mail_cache *cache, const char *name); +/* Returns specified field */ +const struct mail_cache_field * +mail_cache_register_get_field(struct mail_cache *cache, unsigned int field_idx); /* Returns a list of all registered fields */ const struct mail_cache_field * mail_cache_register_get_list(struct mail_cache *cache, pool_t pool,