aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/blob.h
diff options
context:
space:
mode:
authorMark Menzynski <[email protected]>2019-12-10 11:28:11 +0100
committermmenzyns <[email protected]>2020-03-20 17:25:25 +0000
commit24e82e453370e4105d73fcdf14cfb2f8922ddb9a (patch)
tree895e90877451b8073265ee2727dfa239c0fad8fa /src/util/blob.h
parent1b49534df2197c59880ee703ff4dd813bc5f5231 (diff)
util/blob: Add overwrite function for uint8
Overwrite function for this type was missing and I needed it for my project. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Karol Herbst <[email protected]> Signed-off-by: Mark Menzynski <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3903>
Diffstat (limited to 'src/util/blob.h')
-rw-r--r--src/util/blob.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/blob.h b/src/util/blob.h
index 9113331254a..e1e156eb43f 100644
--- a/src/util/blob.h
+++ b/src/util/blob.h
@@ -184,6 +184,21 @@ bool
blob_write_uint8(struct blob *blob, uint8_t value);
/**
+ * Overwrite a uint8_t previously written to the blob.
+ *
+ * Writes a uint8_t value to an existing portion of the blob at an offset of
+ * \offset. This data range must have previously been written to the blob by
+ * one of the blob_write_* calls.
+ *
+ * \return True unless the requested position or position+to_write lie outside
+ * the current blob's size.
+ */
+bool
+blob_overwrite_uint8(struct blob *blob,
+ size_t offset,
+ uint8_t value);
+
+/**
* Add a uint16_t to a blob.
*
* \note This function will only write to a uint16_t-aligned offset from the