bootutil: add private image header accessor
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
diff --git a/boot/bootutil/src/bootutil_priv.h b/boot/bootutil/src/bootutil_priv.h
index fa50644..52abb76 100644
--- a/boot/bootutil/src/bootutil_priv.h
+++ b/boot/bootutil/src/bootutil_priv.h
@@ -127,9 +127,18 @@
int boot_write_copy_done(const struct flash_area *fap);
int boot_write_image_ok(const struct flash_area *fap);
+/*
+ * Accessors for the contents of struct boot_loader_state.
+ */
+
+static inline struct image_header*
+boot_img_hdr(struct boot_loader_state *state, size_t slot)
+{
+ return &state->imgs[slot].hdr;
+}
+
#ifdef __cplusplus
}
#endif
#endif
-