mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
abuf: Add a function to copy a buffer
It is useful to be able to copy an abuf, to allow changes while preserving the original. Add a function for this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -111,6 +111,17 @@ bool abuf_realloc(struct abuf *abuf, size_t new_size);
|
||||
*/
|
||||
bool abuf_realloc_inc(struct abuf *abuf, size_t inc);
|
||||
|
||||
/**
|
||||
* abuf_copy() - Make a copy of an abuf
|
||||
*
|
||||
* Creates an allocated copy of @old in @new
|
||||
*
|
||||
* @old: abuf to copy
|
||||
* @new: new abuf to hold the copy (inited by this function)
|
||||
* Return: true if OK, false if out of memory
|
||||
*/
|
||||
bool abuf_copy(const struct abuf *old, struct abuf *new);
|
||||
|
||||
/**
|
||||
* abuf_uninit_move() - Return the allocated contents and uninit the abuf
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user