dovecot-2.2: lib-imap: Added imap_append_string() and imap_appen...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Oct 24 10:14:29 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/62d36b2dcbb6
changeset: 15243:62d36b2dcbb6
user: Timo Sirainen <tss at iki.fi>
date: Wed Oct 24 09:38:06 2012 +0300
description:
lib-imap: Added imap_append_string() and imap_append_nstring()
diffstat:
src/lib-imap/imap-quote.c | 12 ++++++++++++
src/lib-imap/imap-quote.h | 6 +++++-
2 files changed, 17 insertions(+), 1 deletions(-)
diffs (38 lines):
diff -r 4137ea599dcd -r 62d36b2dcbb6 src/lib-imap/imap-quote.c
--- a/src/lib-imap/imap-quote.c Wed Oct 24 09:21:46 2012 +0300
+++ b/src/lib-imap/imap-quote.c Wed Oct 24 09:38:06 2012 +0300
@@ -123,6 +123,18 @@
return ret;
}
+void imap_append_string(string_t *dest, const char *src)
+{
+ i_assert(src != NULL);
+
+ imap_append_nstring(dest, src);
+}
+
+void imap_append_nstring(string_t *dest, const char *src)
+{
+ imap_quote_append_string(dest, src, FALSE);
+}
+
void imap_append_quoted(string_t *dest, const char *src)
{
str_append_c(dest, '"');
diff -r 4137ea599dcd -r 62d36b2dcbb6 src/lib-imap/imap-quote.h
--- a/src/lib-imap/imap-quote.h Wed Oct 24 09:21:46 2012 +0300
+++ b/src/lib-imap/imap-quote.h Wed Oct 24 09:38:06 2012 +0300
@@ -15,7 +15,11 @@
const char *imap_quote(pool_t pool, const unsigned char *value,
size_t value_len, bool fix_text);
-/* Append data to destination string quoted using "". */
+/* Append "quoted" or literal. */
+void imap_append_string(string_t *dest, const char *src);
+/* Append NIL, "quoted" or literal. */
+void imap_append_nstring(string_t *dest, const char *src);
+/* Append "quoted". If src has 8bit chars, skip over them. */
void imap_append_quoted(string_t *dest, const char *src);
#endif
More information about the dovecot-cvs
mailing list