Better error handling in zip.c
[cantaveria.git] / loader.h
blob02bec2c5f3e1e0e897962f7b1e6e36c29b59bd38
1 /*
2 Cantaveria - action adventure platform game
3 Copyright (C) 2009 2010 Evan Rinehart
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to
18 The Free Software Foundation, Inc.
19 51 Franklin Street, Fifth Floor
20 Boston, MA 02110-1301, USA
23 typedef struct reader reader;
25 void loader_init();
26 void loader_quit();
28 reader* data_open(char* dir, char* filename);
29 reader* loader_open(char* filename);
31 int loader_read(reader* rd, void* buf, int count);
32 int loader_scanline(reader* rd, char* format, ...);
33 unsigned char* loader_readall(char* filename, int* size);
34 void loader_close(reader* rd);
36 char** loader_readdir(char* path);
37 void loader_freedirlist(char** list);
39 /*binary i/o*/
40 int read_byte(reader* rd);
41 int read_short(reader* rd);
42 int read_int(reader* rd);
43 char* read_string(reader* rd);