annotate zip.h @ 1868:bfacedbae5f0

Fix libretro and stateview targets
author Michael Pavone <pavone@retrodev.com>
date Mon, 24 Jun 2019 09:11:38 -0700
parents 7121daaa48c2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
1581
7121daaa48c2 Fix drag and drop when using Nuklear UI
Michael Pavone <pavone@retrodev.com>
parents: 1531
diff changeset
21 zip_file *zip_open(const char *filename);
1531
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_