Added entities. Rewrote stage, half 'working'.
[cantaveria.git] / zip.h
bloba285b8fd7baf08eef82fd430b3736c6eaebd6b55
1 /*
2 zip
3 read from a zip file
5 Copyright (C) 2009 Evan Rinehart
7 This software comes with no warranty.
8 1. This software can be used for any purpose, good or evil.
9 2. Modifications must retain this license, at least in spirit.
12 typedef struct zip_archive zip_archive;
13 typedef struct zip_file zip_file;
14 typedef struct zip_dir zip_dir;
15 typedef unsigned char byte;
17 typedef struct {
18 int (*read)(void* userdata, byte buf[], int count);
19 int (*seek)(void* userdata, int offset, int whence);
20 void (*close)(void* userdata);
21 void* userdata;
22 } zip_reader;
24 zip_archive* zip_aropenf(const char* filename);
25 zip_archive* zip_aropen(zip_reader* rd);
26 void zip_arclose(zip_archive* arc);
28 zip_file* zip_fopen(zip_archive* arc, const char* path);
29 void zip_fclose(zip_file* f);
30 int zip_fread(zip_file* f, byte buf[], int count);
31 int zip_feof(zip_file* f);
33 zip_dir* zip_opendir(zip_archive* arc, const char* path);
34 char* zip_readdir(zip_dir* dir);
35 void zip_closedir(zip_dir* dir);
37 char* zip_geterror(void);