]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added t_str_new_const().
authorTimo Sirainen <tss@iki.fi>
Sat, 11 Oct 2008 21:22:39 +0000 (00:22 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 11 Oct 2008 21:22:39 +0000 (00:22 +0300)
--HG--
branch : HEAD

src/lib/str.c
src/lib/str.h

index 7d9eead730915215d9e483ccb01a75bbfa37a84a..e12757947b2f11c6aee36829ba2eba645ad5b71b 100644 (file)
@@ -27,6 +27,11 @@ string_t *t_str_new(size_t initial_size)
        return str_new(pool_datastack_create(), initial_size);
 }
 
+string_t *t_str_new_const(const char *str, size_t len)
+{
+       return str_new_const(pool_datastack_create(), str, len);
+}
+
 void str_free(string_t **str)
 {
        buffer_free(str);
index 2e225f78eb88bf721ade236b346f4fad16ab7034..7cb0065664e60b66e118f1ae7f8c6c79f85fef9f 100644 (file)
@@ -7,6 +7,7 @@ string_t *t_str_new(size_t initial_size);
    str pointer is saved directly, so it must not be freed until the returned
    string is no longer used. len must contain strlen(str). */
 string_t *str_new_const(pool_t pool, const char *str, size_t len);
+string_t *t_str_new_const(const char *str, size_t len);
 void str_free(string_t **str);
 char *str_free_without_data(string_t **str);