diff options
author | Michael Brown <mcb30@ipxe.org> | 2011-03-07 17:10:24 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2011-03-07 19:53:58 +0000 |
commit | 7752541bb7c1c338c2390cf6e4f0c035a13515d9 (patch) | |
tree | f10088c14821d62141867a5c415923755561fa65 /src/include/ipxe/image.h | |
parent | e87fc5e74346d7dc6f164e6d6931f938aaabcdb9 (diff) | |
download | ipxe-7752541bb7c1c338c2390cf6e4f0c035a13515d9.tar.gz |
[image] Use list_first_entry() to clarify logic in main()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/image.h')
-rw-r--r-- | src/include/ipxe/image.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/ipxe/image.h b/src/include/ipxe/image.h index 2865ea057..96466ee40 100644 --- a/src/include/ipxe/image.h +++ b/src/include/ipxe/image.h @@ -124,6 +124,15 @@ static inline int have_images ( void ) { return ( ! list_empty ( &images ) ); } +/** + * Retrieve first image + * + * @ret image Image, or NULL + */ +static inline struct image * first_image ( void ) { + return list_first_entry ( &images, struct image, list ); +} + extern struct image * alloc_image ( void ); extern void image_set_uri ( struct image *image, struct uri *uri ); extern int image_set_cmdline ( struct image *image, const char *cmdline ); |