Mercurial > repos > blastem
annotate zip.h @ 1554:87350caf6dab
Allow double click to open ROM in file browser
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 29 Mar 2018 00:40:41 -0700 |
parents | 092675db4f37 |
children | 7121daaa48c2 |
rev | line source |
---|---|
1531
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef ZIP_H_ |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define ZIP_H_ |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include <stdint.h> |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 #include <stdio.h> |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 typedef struct { |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 uint64_t compressed_size; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 uint64_t size; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 uint64_t local_header_off; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 char *name; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 uint16_t compression_method; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 } zip_entry; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 typedef struct { |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 zip_entry *entries; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 FILE *file; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 uint32_t num_entries; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 } zip_file; |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 zip_file *zip_open(char *filename); |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 uint8_t *zip_read(zip_file *f, uint32_t index, size_t *out_size); |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 void zip_close(zip_file *f); |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 |
092675db4f37
Add support for loading ROMs from zip files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 #endif //ZIP_H_ |