diff options
author | Michael Pavone <pavone@retrodev.com> | 2018-03-24 15:33:44 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2018-03-24 15:33:44 -0700 |
commit | 6e0a7307a3e97579a30655750aea7372115db367 (patch) | |
tree | ae61bfdaef54df7c2141b6b04d144713c8aa0a4b /zip.h | |
parent | d30df86b9188841fb04ccb6842af4bdb634badbe (diff) |
Add support for loading ROMs from zip files
Diffstat (limited to 'zip.h')
-rw-r--r-- | zip.h | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -0,0 +1,25 @@ +#ifndef ZIP_H_ +#define ZIP_H_ + +#include <stdint.h> +#include <stdio.h> + +typedef struct { + uint64_t compressed_size; + uint64_t size; + uint64_t local_header_off; + char *name; + uint16_t compression_method; +} zip_entry; + +typedef struct { + zip_entry *entries; + FILE *file; + uint32_t num_entries; +} zip_file; + +zip_file *zip_open(char *filename); +uint8_t *zip_read(zip_file *f, uint32_t index, size_t *out_size); +void zip_close(zip_file *f); + +#endif //ZIP_H_
\ No newline at end of file |