From 3bb5fc9c7d10f7dec32f8d2a772fce69be468b15 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 11 Nov 2008 15:03:26 +0000 Subject: * RNA: utility function to retrieve strings. It will use a fixed size buffer if it's big enough, and otherwise allocate memory. * Added BLI_dynstr_appendf() to construct strings easily in printf style, this should make it easier to construct menu strings for example. --- source/blender/blenlib/BLI_dynstr.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/BLI_dynstr.h') diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h index e5b94aecb4f..453e15a0f3b 100644 --- a/source/blender/blenlib/BLI_dynstr.h +++ b/source/blender/blenlib/BLI_dynstr.h @@ -56,7 +56,15 @@ DynStr* BLI_dynstr_new (void); * @param ds The DynStr to append to. * @param cstr The c-string to append. */ -void BLI_dynstr_append (DynStr *ds, char *cstr); +void BLI_dynstr_append (DynStr *ds, const char *cstr); + + /** + * Append a c-string to a DynStr, but with formatting like printf. + * + * @param ds The DynStr to append to. + * @param format The printf format string to use. + */ +void BLI_dynstr_appendf (DynStr *ds, const char *format, ...); /** * Find the length of a DynStr. @@ -69,7 +77,7 @@ int BLI_dynstr_get_len (DynStr *ds); /** * Get a DynStr's contents as a c-string. * The returned c-string should be free'd - * using BLI_freeN. + * using MEM_freeN. * * @param ds The DynStr of interest. * @return The contents of @a ds as a c-string. -- cgit v1.2.3