summaryrefslogtreecommitdiff
path: root/include/image.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2016-06-30 10:52:16 -0600
committerTom Rini <trini@konsulko.com>2016-07-14 18:22:30 -0400
commit1426220b0e7b09ecc6a0da5f831287776a89a92c (patch)
treed428c6b3f35190b1c4222f40069cc34f857e5ad4 /include/image.h
parent30495bff35d5a5134bc182fa51728acf69420158 (diff)
downloadu-boot-1426220b0e7b09ecc6a0da5f831287776a89a92c.tar.gz
image: Add functions to obtain category information
Add generic functions which can look up information about a category: - the number of items in the category - the category description - an item long time - an item short time Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/image.h')
-rw-r--r--include/image.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/image.h b/include/image.h
index 5879ebcd7a..2a5b560575 100644
--- a/include/image.h
+++ b/include/image.h
@@ -478,6 +478,40 @@ const char *genimg_get_comp_name(uint8_t comp);
*/
const char *genimg_get_comp_short_name(uint8_t comp);
+/**
+ * genimg_get_cat_name() - Get the name of an item in a category
+ *
+ * @category: Category of item
+ * @id: Item ID
+ * @return name of item, or "Unknown ..." if unknown
+ */
+const char *genimg_get_cat_name(enum ih_category category, uint id);
+
+/**
+ * genimg_get_cat_short_name() - Get the short name of an item in a category
+ *
+ * @category: Category of item
+ * @id: Item ID
+ * @return short name of item, or "Unknown ..." if unknown
+ */
+const char *genimg_get_cat_short_name(enum ih_category category, uint id);
+
+/**
+ * genimg_get_cat_count() - Get the number of items in a category
+ *
+ * @category: Category to check
+ * @return the number of items in the category (IH_xxx_COUNT)
+ */
+int genimg_get_cat_count(enum ih_category category);
+
+/**
+ * genimg_get_cat_desc() - Get the description of a category
+ *
+ * @return the description of a category, e.g. "architecture". This
+ * effectively converts the enum to a string.
+ */
+const char *genimg_get_cat_desc(enum ih_category category);
+
int genimg_get_os_id(const char *name);
int genimg_get_arch_id(const char *name);
int genimg_get_type_id(const char *name);