1load_datafile_object(3) Allegro manual load_datafile_object(3)
2
3
4
6 load_datafile_object - Loads a specific object from a datafile. Allegro
7 game programming library.
8
10 #include <allegro.h>
11
12
13 DATAFILE *load_datafile_object(const char *filename, const char
14 *objectname);
15
17 Loads a specific object from a datafile. This won't work if you strip
18 the object names from the file, and it will be very slow if you save
19 the file with global compression. Example:
20
21 /* Load only the music from the datafile. */
22 music_object = load_datafile_object("datafile.dat",
23 "MUSIC");
24 /* Play it and wait a moment for it. */
25 play_midi(music_object->dat);
26 ...
27 /* Destroy unneeded music. */
28 unload_datafile_object(music_object);
29
31 Returns a pointer to a single DATAFILE element whose `dat' member
32 points to the object, or NULL if there was an error or there was no
33 object with the requested name. Remember to free this DATAFILE later to
34 avoid memory leaks, but use the correct unloading function!
35
36
38 unload_datafile_object(3), load_datafile(3), set_color_conversion(3),
39 find_datafile_object(3), register_datafile_object(3)
40
41
42
43Allegro version 4.4.2 load_datafile_object(3)