load_datafile_object(3alleg)

load_datafile_object3alleg

Loads a specific object from a datafile. allegro game programming library.

Usage

#include <allegro.h>

DATAFILE *load_datafile_object(const char *filename, const char *objectname);

Overview

Loads a specific object from a datafile. This won't work if you strip the object names from the file, and it will be very slow if you save the file with global compression. Example:

   /* Load only the music from the datafile. */
   music_object = load_datafile_object("datafile.dat",
                                       "MUSIC");
   /* Play it and wait a moment for it. */
   play_midi(music_object->dat);
   ...
   /* Destroy unneeded music. */
   unload_datafile_object(music_object);

Return value

Returns a pointer to a single DATAFILE element whose `dat' member points to the object, or NULL if there was an error or there was no object with the requested name. Remember to free this DATAFILE later to avoid memory leaks, but use the correct unloading function!

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.