1create_datafile_index(3) Allegro manual create_datafile_index(3)
2
3
4
6 create_datafile_index - Creates an index for a datafile. Allegro game
7 programming library.
8
10 #include <allegro.h>
11
12
13 DATAFILE_INDEX *create_datafile_index(const char *filename);
14
16 Creates an index for a datafile, to speed up loading single objects out
17 of it. This is mostly useful for big datafiles, which you don't want to
18 load as a whole. The index will store the offset of all objects inside
19 the datafile, and then you can load it quickly with
20 "load_datafile_object_indexed" later. Use destroy_datafile_index to
21 free the memory used by it again.
22
23 Note: If the datafile uses global compression, there is no performance
24 gain from using an index, because seeking to the offset still requires
25 to uncompress the whole datafile up to that offset. Example:
26
27 DATAFILE_INDEX *index = create_datafile_index("huge.dat");
28 DATAFILE *object = load_datafile_object_indexed(index, 1234);
29 ...
30 unload_datafile_object(object);
31 destroy_datafile_index(index);
32
34 A pointer value which you can pass to load_datafile_object_indexed.
35
36
38 destroy_datafile_index(3), load_datafile_object_indexed(3)
39
40
41
42Allegro version 4.2.2 create_datafile_index(3)