aboutsummaryrefslogtreecommitdiff
path: root/util/cbfstool/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool/common.c')
-rw-r--r--util/cbfstool/common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index 98d9517bf4..f594e8453b 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -103,6 +103,15 @@ void buffer_delete(struct buffer *buffer) {
buffer->size = 0;
}
+void cbfs_file_get_header(struct buffer *buf, struct cbfs_file *file)
+{
+ bgets(buf, &file->magic, sizeof(file->magic));
+ file->len = xdr_be.get32(buf);
+ file->type = xdr_be.get32(buf);
+ file->checksum = xdr_be.get32(buf);
+ file->offset = xdr_be.get32(buf);
+}
+
static struct {
uint32_t arch;
const char *name;