Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib-charset/charset-utf8.h @ 9261:51aee73e49a5 HEAD
maildir: When UIDVALIDITY changes, don't reset uid_next to 1 in uidlist.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 26 Jul 2009 23:36:12 -0400 |
parents | 81806d402514 |
children |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
6132
diff
changeset
|
1 #ifndef CHARSET_UTF8_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
6132
diff
changeset
|
2 #define CHARSET_UTF8_H |
568
f2aa58c2afd0
SEARCH CHARSET support. Currently we do it through iconv() and only ASCII
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
3 |
6132
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
4 struct charset_translation; |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
5 |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
6 enum charset_flags { |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
7 /* Translate the output to decomposed titlecase */ |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
8 CHARSET_FLAG_DECOMP_TITLECASE = 0x01 |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
9 }; |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
10 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
792
diff
changeset
|
11 enum charset_result { |
765
553f050c8313
Added buffer API. Point is to hide all buffer writing behind this API which
Timo Sirainen <tss@iki.fi>
parents:
608
diff
changeset
|
12 CHARSET_RET_OK = 1, |
553f050c8313
Added buffer API. Point is to hide all buffer writing behind this API which
Timo Sirainen <tss@iki.fi>
parents:
608
diff
changeset
|
13 CHARSET_RET_INCOMPLETE_INPUT = -1, |
553f050c8313
Added buffer API. Point is to hide all buffer writing behind this API which
Timo Sirainen <tss@iki.fi>
parents:
608
diff
changeset
|
14 CHARSET_RET_INVALID_INPUT = -2 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
792
diff
changeset
|
15 }; |
608
debb8468514e
SEARCH CHARSET now works properly with message bodies, and in general body
Timo Sirainen <tss@iki.fi>
parents:
568
diff
changeset
|
16 |
6132
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
17 /* Begin translation to UTF-8. Returns -1 if charset is unknown. */ |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
18 int charset_to_utf8_begin(const char *charset, enum charset_flags flags, |
d01522d276f6
charset_to_utf8_begin() API change.
Timo Sirainen <tss@iki.fi>
parents:
6131
diff
changeset
|
19 struct charset_translation **t_r); |
3879
928229f8b3e6
deinit, unref, destroy, close, free, etc. functions now take a pointer to
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
20 void charset_to_utf8_end(struct charset_translation **t); |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
792
diff
changeset
|
21 void charset_to_utf8_reset(struct charset_translation *t); |
608
debb8468514e
SEARCH CHARSET now works properly with message bodies, and in general body
Timo Sirainen <tss@iki.fi>
parents:
568
diff
changeset
|
22 |
4605
e6cb9f75b76a
Added charset_is_utf8() and charset_to_ucase_utf8_full().
Timo Sirainen <tss@iki.fi>
parents:
3879
diff
changeset
|
23 /* Returns TRUE if charset is UTF-8 or ASCII */ |
7912
81806d402514
Added more consts, ATTR_CONSTs and ATTR_PUREs.
Timo Sirainen <tss@iki.fi>
parents:
6908
diff
changeset
|
24 bool charset_is_utf8(const char *charset) ATTR_PURE; |
4605
e6cb9f75b76a
Added charset_is_utf8() and charset_to_ucase_utf8_full().
Timo Sirainen <tss@iki.fi>
parents:
3879
diff
changeset
|
25 |
e6cb9f75b76a
Added charset_is_utf8() and charset_to_ucase_utf8_full().
Timo Sirainen <tss@iki.fi>
parents:
3879
diff
changeset
|
26 /* Translate src to UTF-8. src_size is updated to contain the number of |
6122
d86581f4a0c6
charset_to_utf8() isn't used anymore, so renamed charset_to_utf8_full() to it.
Timo Sirainen <tss@iki.fi>
parents:
6114
diff
changeset
|
27 characters actually translated from src. */ |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
792
diff
changeset
|
28 enum charset_result |
6112
e5451501ff2f
charset_to_utf8_begin() now takes bool ucase parameter. Changed
Timo Sirainen <tss@iki.fi>
parents:
4605
diff
changeset
|
29 charset_to_utf8(struct charset_translation *t, |
e5451501ff2f
charset_to_utf8_begin() now takes bool ucase parameter. Changed
Timo Sirainen <tss@iki.fi>
parents:
4605
diff
changeset
|
30 const unsigned char *src, size_t *src_size, buffer_t *dest); |
608
debb8468514e
SEARCH CHARSET now works properly with message bodies, and in general body
Timo Sirainen <tss@iki.fi>
parents:
568
diff
changeset
|
31 |
6908 | 32 /* Translate a single string to UTF8. */ |
33 int charset_to_utf8_str(const char *charset, enum charset_flags flags, | |
34 const char *input, string_t *output, | |
35 enum charset_result *result_r); | |
36 | |
568
f2aa58c2afd0
SEARCH CHARSET support. Currently we do it through iconv() and only ASCII
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
37 #endif |