Wedson Almeida Filho | 987c0ff | 2018-06-20 16:34:38 +0100 | [diff] [blame^] | 1 | #ifndef _CPIO_H |
| 2 | #define _CPIO_H |
| 3 | |
| 4 | #include <stdbool.h> |
| 5 | #include <stddef.h> |
| 6 | |
| 7 | struct cpio { |
| 8 | const struct cpio_header *first; |
| 9 | size_t total_size; |
| 10 | }; |
| 11 | |
| 12 | struct cpio_iter { |
| 13 | const struct cpio_header *cur; |
| 14 | size_t size_left; |
| 15 | }; |
| 16 | |
| 17 | void cpio_init(struct cpio *c, const void *buf, size_t size); |
| 18 | void cpio_init_iter(struct cpio *c, struct cpio_iter *iter); |
| 19 | bool cpio_next(struct cpio_iter *iter, const char **name, |
| 20 | const void **contents, size_t *size); |
| 21 | |
| 22 | #endif /* _CPIO_H */ |