]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Renamed imap_args_to_str() to imap_write_args() and added a new imap_args_to_str().
authorTimo Sirainen <tss@iki.fi>
Tue, 10 Feb 2009 17:01:41 +0000 (12:01 -0500)
committerTimo Sirainen <tss@iki.fi>
Tue, 10 Feb 2009 17:01:41 +0000 (12:01 -0500)
--HG--
branch : HEAD

src/imap/client.c
src/lib-imap/imap-util.c
src/lib-imap/imap-util.h

index 46f927a6a17ed845d9716a70ccc93e6816528656..ebf29844512a646a61f128a68c0aa85746bcf726 100644 (file)
@@ -314,7 +314,7 @@ bool client_read_args(struct client_command_context *cmd, unsigned int count,
                         cmd->client->input_lock == cmd);
 
                str = t_str_new(256);
-               imap_args_to_str(str, *args_r);
+               imap_write_args(str, *args_r);
                cmd->args = p_strdup(cmd->pool, str_c(str));
 
                cmd->client->input_lock = NULL;
index 62e758d1e1f661fe724fad68f70d0f08e3c37c17..a08c559ab469422c15e265d3e5dcc04f946818bd 100644 (file)
@@ -55,7 +55,7 @@ void imap_write_seq_range(string_t *dest, const ARRAY_TYPE(seq_range) *array)
        }
 }
 
-void imap_args_to_str(string_t *dest, const struct imap_arg *args)
+void imap_write_args(string_t *dest, const struct imap_arg *args)
 {
        const ARRAY_TYPE(imap_arg_list) *list;
        bool first = TRUE;
@@ -88,7 +88,7 @@ void imap_args_to_str(string_t *dest, const struct imap_arg *args)
                case IMAP_ARG_LIST:
                        str_append_c(dest, '(');
                        list = IMAP_ARG_LIST(args);
-                       imap_args_to_str(dest, array_idx(list, 0));
+                       imap_write_args(dest, array_idx(list, 0));
                        str_append_c(dest, ')');
                        break;
                case IMAP_ARG_LITERAL_SIZE:
@@ -102,3 +102,12 @@ void imap_args_to_str(string_t *dest, const struct imap_arg *args)
                }
        }
 }
+
+const char *imap_args_to_str(const struct imap_arg *args)
+{
+       string_t *str;
+
+       str = t_str_new(128);
+       imap_write_args(str, args);
+       return str_c(str);
+}
index bfb3e791184aeb98748a84e4d3dfa3bdad8ce607..33881540c7cefbce9a0fedfcb2fa0879c12ccead 100644 (file)
@@ -13,6 +13,8 @@ void imap_write_flags(string_t *dest, enum mail_flags flags,
 /* Write sequence range as IMAP sequence-set */
 void imap_write_seq_range(string_t *dest, const ARRAY_TYPE(seq_range) *array);
 /* Write IMAP args to given string. The string is mainly useful for humans. */
-void imap_args_to_str(string_t *dest, const struct imap_arg *args);
+void imap_write_args(string_t *dest, const struct imap_arg *args);
+/* Like imap_write_args(), but return the string allocated from data stack. */
+const char *imap_args_to_str(const struct imap_arg *args);
 
 #endif