compiler/blob: Add blob_skip_bytes
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 9 Apr 2018 08:07:03 +0000 (01:07 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 10 Jul 2018 06:02:33 +0000 (23:02 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/blob.c
src/compiler/blob.h

index 5e8671b..c89092e 100644 (file)
@@ -291,6 +291,13 @@ blob_copy_bytes(struct blob_reader *blob, void *dest, size_t size)
    memcpy(dest, bytes, size);
 }
 
+void
+blob_skip_bytes(struct blob_reader *blob, size_t size)
+{
+   if (ensure_can_read (blob, size))
+      blob->current += size;
+}
+
 /* These next three read functions have identical form. If we add any beyond
  * these first three we should probably switch to generating these with a
  * preprocessor macro.
index 2b975d4..b56fa4b 100644 (file)
@@ -295,6 +295,12 @@ void
 blob_copy_bytes(struct blob_reader *blob, void *dest, size_t size);
 
 /**
+ * Skip \size bytes within the blob.
+ */
+void
+blob_skip_bytes(struct blob_reader *blob, size_t size);
+
+/**
  * Read a uint32_t from the current location, (and update the current location
  * to just past this uint32_t).
  *