diff options
Diffstat (limited to 'util/cbfstool/cbfs_image.h')
-rw-r--r-- | util/cbfstool/cbfs_image.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h index 9535c2d95f..822f6d54b4 100644 --- a/util/cbfstool/cbfs_image.h +++ b/util/cbfstool/cbfs_image.h @@ -38,6 +38,17 @@ int cbfs_image_write_file(struct cbfs_image *image, const char *filename); /* Releases the CBFS image. Returns 0 on success, otherwise non-zero. */ int cbfs_image_delete(struct cbfs_image *image); +/* Callback function used by cbfs_walk. + * Returns 0 on success, or non-zero to stop further iteration. */ +typedef int (*cbfs_entry_callback)(struct cbfs_image *image, + struct cbfs_file *file, + void *arg); + +/* Iterates through all entries in CBFS image, and invoke with callback. + * Stops if callback returns non-zero values. + * Returns number of entries invoked. */ +int cbfs_walk(struct cbfs_image *image, cbfs_entry_callback callback, void *arg); + /* Primitive CBFS utilities */ /* Returns a pointer to the only valid CBFS header in give buffer, otherwise @@ -62,4 +73,10 @@ uint32_t cbfs_get_entry_addr(struct cbfs_image *image, struct cbfs_file *entry); /* Returns 1 if entry has valid data (by checking magic number), otherwise 0. */ int cbfs_is_valid_entry(struct cbfs_file *entry); +/* Print CBFS component information. */ +int cbfs_print_directory(struct cbfs_image *image); +int cbfs_print_header_info(struct cbfs_image *image); +int cbfs_print_entry_info(struct cbfs_image *image, struct cbfs_file *entry, + void *arg); + #endif |