Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
blob->out_of_memory = false;
}
+void
+blob_finish_get_buffer(struct blob *blob, void **buffer, size_t *size)
+{
+ *buffer = blob->data;
+ *size = blob->size;
+ blob->data = NULL;
+
+ /* Trim the buffer. */
+ *buffer = realloc(*buffer, *size);
+}
+
bool
blob_overwrite_bytes(struct blob *blob,
size_t offset,
free(blob->data);
}
+void
+blob_finish_get_buffer(struct blob *blob, void **buffer, size_t *size);
+
/**
* Add some unstructured, fixed-size data to a blob.
*