Clarift uc_dstr_ensure

This commit is contained in:
Nils O. Selåsdal
2013-12-04 23:46:45 +01:00
parent b24f27ec9f
commit 9723a579cc
2 changed files with 9 additions and 5 deletions
+6 -2
View File
@@ -45,12 +45,16 @@ void uc_dstr_destroy(struct DStr *str);
*/
size_t uc_dstr_available(const struct DStr *str);
/** Ensure the DStr is of at least 'len' bytes,
/** Ensure the DStr have room for least 'len' bytes,
* allocating room if needed.
*
* This includes the length of the existing string,
* to ensure e.g an additional 10 bytes can be appended,
* one would do uc_dstr_ensure(str, str->len + 10)
*
* @return 0 on success (!= 0 if an allocation fail)
*/
int uc_dstr_ensure(struct DStr *str, size_t len);
int uc_dstr_ensure(struct DStr *str, size_t total);
/** Reset the DStr, setting its length to 0
*/