dovecot-2.1: Backported parts of normalizer_func_t changes from ...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Sep 18 20:09:09 EEST 2012
details: http://hg.dovecot.org/dovecot-2.1/rev/99305e4dd403
changeset: 14713:99305e4dd403
user: Timo Sirainen <tss at iki.fi>
date: Tue Sep 18 20:07:21 2012 +0300
description:
Backported parts of normalizer_func_t changes from v2.2 tree.
diffstat:
src/lib-storage/mail-storage-private.h | 2 ++
src/lib-storage/mail-user.c | 1 +
src/lib-storage/mail-user.h | 2 ++
src/lib/unichar.h | 6 ++++++
4 files changed, 11 insertions(+), 0 deletions(-)
diffs (65 lines):
diff -r be5b1256bf57 -r 99305e4dd403 src/lib-storage/mail-storage-private.h
--- a/src/lib-storage/mail-storage-private.h Tue Sep 18 20:06:56 2012 +0300
+++ b/src/lib-storage/mail-storage-private.h Tue Sep 18 20:07:21 2012 +0300
@@ -2,6 +2,7 @@
#define MAIL_STORAGE_PRIVATE_H
#include "module-context.h"
+#include "unichar.h"
#include "file-lock.h"
#include "mail-storage.h"
#include "mail-storage-hooks.h"
@@ -416,6 +417,7 @@
struct mail_search_sort_program *sort_program;
enum mail_fetch_field wanted_fields;
struct mailbox_header_lookup_ctx *wanted_headers;
+ normalizer_func_t *normalizer;
/* if non-NULL, specifies that a search resulting is being updated.
this can be used as a search optimization: if searched message
diff -r be5b1256bf57 -r 99305e4dd403 src/lib-storage/mail-user.c
--- a/src/lib-storage/mail-user.c Tue Sep 18 20:06:56 2012 +0300
+++ b/src/lib-storage/mail-user.c Tue Sep 18 20:07:21 2012 +0300
@@ -51,6 +51,7 @@
user->unexpanded_set = settings_dup(set_info, set, pool);
user->set = settings_dup(set_info, set, pool);
user->service = master_service_get_name(master_service);
+ user->default_normalizer = uni_utf8_to_decomposed_titlecase;
/* check settings so that the duplicated structure will again
contain the parsed fields */
diff -r be5b1256bf57 -r 99305e4dd403 src/lib-storage/mail-user.h
--- a/src/lib-storage/mail-user.h Tue Sep 18 20:06:56 2012 +0300
+++ b/src/lib-storage/mail-user.h Tue Sep 18 20:07:21 2012 +0300
@@ -1,6 +1,7 @@
#ifndef MAIL_USER_H
#define MAIL_USER_H
+#include "unichar.h"
#include "mail-storage-settings.h"
struct module;
@@ -36,6 +37,7 @@
ARRAY_DEFINE(hooks, const struct mail_storage_hooks *);
struct mountpoint_list *mountpoints;
+ normalizer_func_t *default_normalizer;
/* Module-specific contexts. See mail_storage_module_id. */
ARRAY_DEFINE(module_contexts, union mail_user_module_context *);
diff -r be5b1256bf57 -r 99305e4dd403 src/lib/unichar.h
--- a/src/lib/unichar.h Tue Sep 18 20:06:56 2012 +0300
+++ b/src/lib/unichar.h Tue Sep 18 20:07:21 2012 +0300
@@ -27,6 +27,12 @@
typedef uint32_t unichar_t;
ARRAY_DEFINE_TYPE(unichars, unichar_t);
+/* Normalize UTF8 input and append it to output buffer.
+ Returns 0 if ok, -1 if input was invalid. Even if input was invalid,
+ as much as possible should be added to output. */
+typedef int normalizer_func_t(const void *input, size_t size,
+ buffer_t *output);
+
extern const unsigned char utf8_replacement_char[UTF8_REPLACEMENT_CHAR_LEN];
extern const uint8_t *const uni_utf8_non1_bytes;
More information about the dovecot-cvs
mailing list