diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-04-24 11:42:10 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-04-24 11:42:10 +0300 |
commit | 6d9a223c90c845b2cdf9f9d6a224e2609d25c32a (patch) | |
tree | c9b3795a34b88e804b9df697c511fbd73acb8ca6 /source/blender/blenlib/BLI_dynstr.h | |
parent | 5a232039d5101361ffd249d44112831ec632fc82 (diff) |
BLI_dynstr: add memarena-based version, and helper to clear without freeing.
Diffstat (limited to 'source/blender/blenlib/BLI_dynstr.h')
-rw-r--r-- | source/blender/blenlib/BLI_dynstr.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h index 7aa1c30e449..b26accc7f78 100644 --- a/source/blender/blenlib/BLI_dynstr.h +++ b/source/blender/blenlib/BLI_dynstr.h @@ -43,11 +43,14 @@ #include "BLI_compiler_attrs.h" struct DynStr; +struct MemArena; /** The abstract DynStr type */ typedef struct DynStr DynStr; DynStr *BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; +DynStr *BLI_dynstr_new_memarena(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; + void BLI_dynstr_append(DynStr *__restrict ds, const char *cstr) ATTR_NONNULL(); void BLI_dynstr_nappend(DynStr *__restrict ds, const char *cstr, int len) ATTR_NONNULL(); @@ -56,8 +59,9 @@ void BLI_dynstr_vappendf(DynStr *__restrict ds, const char *__restrict format int BLI_dynstr_get_len(DynStr *ds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); char *BLI_dynstr_get_cstring(DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); - void BLI_dynstr_get_cstring_ex(DynStr *__restrict ds, char *__restrict str) ATTR_NONNULL(); + +void BLI_dynstr_clear(DynStr *ds) ATTR_NONNULL(); void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL(); #endif /* __BLI_DYNSTR_H__ */ |