hbmap: fix iterator truncation when size_t < 32bit
[rofl0r-agsutils.git] / RoomFile.h
blobe3afffeae447131950dcb1483cb15753758376dd
1 #ifndef ROOMFILE_H
2 #define ROOMFILE_H
4 #include <assert.h>
5 #include <stddef.h>
6 #include "File.h"
9 enum RoomFileBlockType {
10 BLOCKTYPE_EXT = 0,
11 BLOCKTYPE_MIN = BLOCKTYPE_EXT,
12 BLOCKTYPE_MAIN = 1,
13 BLOCKTYPE_SCRIPT = 2,
14 BLOCKTYPE_COMPSCRIPT = 3,
15 BLOCKTYPE_COMPSCRIPT2 = 4,
16 BLOCKTYPE_OBJECTNAMES = 5,
17 BLOCKTYPE_ANIMBKGRND = 6,
18 BLOCKTYPE_COMPSCRIPT3 = 7, /* only bytecode script type supported by released engine code */
19 BLOCKTYPE_PROPERTIES = 8,
20 BLOCKTYPE_OBJECTSCRIPTNAMES = 9,
21 BLOCKTYPE_MAX = BLOCKTYPE_OBJECTSCRIPTNAMES,
22 BLOCKTYPE_EOF = 0xFF
25 struct RoomFile {
26 short version;
27 off_t blockpos[BLOCKTYPE_MAX+1];
28 unsigned blocklen[BLOCKTYPE_MAX+1];
31 /* 0: error, 1: succcess. expect pointer to zero-initialized struct */
32 int RoomFile_read(AF *f, struct RoomFile *r);
33 char *RoomFile_extract_source(AF *f, struct RoomFile *r, size_t *sizep);
35 /* this function actually isn't room specific at all, it works with all
36 script containers as it looks out for the start signature. */
37 off_t ARF_find_code_start(AF* f, off_t start);
40 #pragma RcB2 DEP "RoomFile.c"
42 #endif