dovecot-1.2: Added t_str_new_const().
dovecot at dovecot.org
dovecot at dovecot.org
Sun Oct 12 00:22:42 EEST 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/c1568782774e
changeset: 8263:c1568782774e
user: Timo Sirainen <tss at iki.fi>
date: Sun Oct 12 00:22:39 2008 +0300
description:
Added t_str_new_const().
diffstat:
2 files changed, 6 insertions(+)
src/lib/str.c | 5 +++++
src/lib/str.h | 1 +
diffs (26 lines):
diff -r b51344f37d88 -r c1568782774e src/lib/str.c
--- a/src/lib/str.c Sat Oct 11 13:50:47 2008 +0300
+++ b/src/lib/str.c Sun Oct 12 00:22:39 2008 +0300
@@ -25,6 +25,11 @@ string_t *t_str_new(size_t initial_size)
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)
diff -r b51344f37d88 -r c1568782774e src/lib/str.h
--- a/src/lib/str.h Sat Oct 11 13:50:47 2008 +0300
+++ b/src/lib/str.h Sun Oct 12 00:22:39 2008 +0300
@@ -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);
More information about the dovecot-cvs
mailing list