diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2012-08-07 14:00:50 +0200 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2012-08-07 14:00:50 +0200 |
commit | 48fc14c9130e40ccd0e64acd8183c6803541270b (patch) | |
tree | 37172a402695b48a6198e9455f4f3441ce40c94d /src/image.h | |
parent | 37f5d069739fdc1d7db9eb7caac816cae0d69b9c (diff) | |
download | 0xFFFF-48fc14c9130e40ccd0e64acd8183c6803541270b.tar.bz2 |
Implement image functions
Diffstat (limited to 'src/image.h')
-rw-r--r-- | src/image.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/image.h b/src/image.h index 60bcd58..24b29dc 100644 --- a/src/image.h +++ b/src/image.h @@ -1,4 +1,10 @@ + +#ifndef IMAGE_H +#define IMAGE_H + +#include <stdint.h> + enum image_type { IMAGE_UNKNOWN = 0, IMAGE_XLOADER, @@ -7,7 +13,7 @@ enum image_type { IMAGE_KERNEL, IMAGE_INITFS, IMAGE_ROOTFS, - IMAGE_OMAPNAND, + IMAGE_OMAP_NAND, IMAGE_MMC, IMAGE_CMT_2ND, IMAGE_CMT_ALGO, @@ -16,6 +22,7 @@ enum image_type { enum device { DEVICE_UNKNOWN = 0, + DEVICE_ANY, /* Unspecified / Any device */ DEVICE_SU_18, /* Nokia 770 */ DEVICE_RX_34, /* Nokia N800 */ DEVICE_RX_44, /* Nokia N810 */ @@ -45,10 +52,17 @@ struct image_list { } struct image * image_alloc_from_file(const char * file, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout); -struct image * image_alloc_from_fiasco(struct image * image, int fd, size_t size, size_t offset, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout); +struct image * image_alloc_from_fiasco(struct fiasco * fiasco, size_t size, size_t offset, uint16_t hash, const char * type, const char * device, const char * hwrevs, const char * version, const char * layout); void image_free(struct image * image); void image_seek(struct image * image, whence); size_t image_read(struct image * image, void * buf, size_t count); -size_t image_write(struct image * image, void * buf, size_t count); +/*size_t image_write(struct image * image, void * buf, size_t count);*/ void image_list_add(struct image_list ** list, struct image * image); void image_list_del(struct image_list * list); + +uint16_t image_hash_from_data(struct image * image); +enum image_type image_type_from_data(struct image * image); +enum image_type image_type_from_string(const char * type); +const char * image_type_to_string(enum image_type type); + +#endif |