From 0f8af71f1a40e8ae960ba616cb9a5bf14f10fb13 Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Tue, 29 Jan 2013 02:29:49 +0800 Subject: cbfstool: Use cbfs_image API for "extract" command. Change the "extract" command to use cbfs_export_entry API. Nothing changed in its usage. To verify, run "cbfstool coreboot.rom extract -f blah -n blah" and check if the raw type file is correctly extracted. Change-Id: I1ed280d47a2224a9d1213709f6b459b403ce5055 Signed-off-by: Hung-Te Lin Reviewed-on: http://review.coreboot.org/2207 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/cbfstool/cbfs_image.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util/cbfstool/cbfs_image.h') diff --git a/util/cbfstool/cbfs_image.h b/util/cbfstool/cbfs_image.h index 822f6d54b433..09051c382540 100644 --- a/util/cbfstool/cbfs_image.h +++ b/util/cbfstool/cbfs_image.h @@ -38,6 +38,14 @@ 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); +/* Returns a pointer to entry by name, or NULL if name is not found. */ +struct cbfs_file *cbfs_get_entry(struct cbfs_image *image, const char *name); + +/* Exports an entry to external file. + * Returns 0 on success, otherwise (ex, not found) non-zero. */ +int cbfs_export_entry(struct cbfs_image *image, const char *entry_name, + const char *filename); + /* 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, -- cgit v1.2.3