Added entities. Rewrote stage, half 'working'.
[cantaveria.git] / loader.h
blobaf0289fa5001c4a5834b37ccab243b7a9e17a03f
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 reader* loader_open(const char* filename);
27 void loader_data_mode(int flag);
29 int loader_read(reader* rd, void* buf, int count);
30 int loader_readline(reader* rd, char* buf, int size);
31 int loader_scanline(reader* rd, const char* format, ...);
32 unsigned char* loader_readall(const char* filename, int* size);
33 void loader_close(reader* rd);
34 int loader_feof(reader* rd);
36 list* loader_readdir(const char* path);
37 void loader_freedirlist(list* dirs);
39 /*binary i/o*/
40 int read_bytes(reader* rd, unsigned char* out, int count);
41 int read_byte(reader* rd, int* out);
42 int read_short(reader* rd, int* out);
43 int read_int(reader* rd, int* out);
44 int read_string(reader* rd, char** out);