diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-09-12 15:42:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-12 17:22:43 +0200 |
commit | 2dfb4028b4eb4843a3dfcf87fd9608ac04bbf622 (patch) | |
tree | 604420595251dea45e5d6b873651cf84ada7ac39 | |
parent | 09a1a28233831c0d17085472e478bca1dba3a7ef (diff) | |
download | barebox-2dfb4028b4eb4843a3dfcf87fd9608ac04bbf622.tar.gz barebox-2dfb4028b4eb4843a3dfcf87fd9608ac04bbf622.tar.xz |
filetype: add BMP support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/filetype.c | 3 | ||||
-rw-r--r-- | include/filetype.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/common/filetype.c b/common/filetype.c index e736d43efe..61fca5aaba 100644 --- a/common/filetype.c +++ b/common/filetype.c @@ -42,6 +42,7 @@ static const char *filetype_str[] = { [filetype_sh] = "Bourne Shell", [filetype_mips_barebox] = "MIPS barebox image", [filetype_fat] = "FAT filesytem", + [filetype_bmp] = "BMP image", }; const char *file_type_to_string(enum filetype f) @@ -101,6 +102,8 @@ enum filetype file_detect_type(void *_buf) return filetype_mips_barebox; if (is_fat(buf8)) return filetype_fat; + if (strncmp(buf8, "BM", 2) == 0) + return filetype_bmp; return filetype_unknown; } diff --git a/include/filetype.h b/include/filetype.h index 179ec0f5eb..6c97159aa4 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -19,6 +19,7 @@ enum filetype { filetype_sh, filetype_mips_barebox, filetype_fat, + filetype_bmp, }; const char *file_type_to_string(enum filetype f); |