Clarift uc_dstr_ensure
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user