|
pico-binary-info
Portable Pi Pico binary_info parser
|
Functions for initializing a pico_binary_info struct. More...
Functions | |
| int | pico_binary_info_init (struct pico_binary_info *info, const uint8_t *image, size_t len) |
| Initialize a pico_binary_info struct using a pointer to a pico binary image which is in memory, or a memory mapped file. | |
| int | pico_binary_info_init_fd (struct pico_binary_info *info, int fd, size_t len) |
| Initialize a pico_binary_info struct using a file handle. | |
Functions for initializing a pico_binary_info struct.
| int pico_binary_info_init | ( | struct pico_binary_info * | info, |
| const uint8_t * | image, | ||
| size_t | len ) |
Initialize a pico_binary_info struct using a pointer to a pico binary image which is in memory, or a memory mapped file.
Use this on systems where mmap is available, or where loading the entire binary into memory is feasible.
| info | the binary info struct to initialize |
| image | pointer to the start of the binary image |
| len | size of the binary image |
| int pico_binary_info_init_fd | ( | struct pico_binary_info * | info, |
| int | fd, | ||
| size_t | len ) |
Initialize a pico_binary_info struct using a file handle.
Use this on systems where posix/newlib open and read` are available.
| info | the binary info struct to initialize |
| fd | an open, seekable descriptor positioned anywhere |
| len | the total length of the image (e.g. from fstat/lseek) |