.\" Generated by the Allegro makedoc utility .TH load_datafile 3alleg4 "version 4.4.3" "Allegro" "Allegro manual" .SH NAME load_datafile \- Loads a datafile into memory. Allegro game programming library.\& .SH SYNOPSIS .B #include .sp .B DATAFILE *load_datafile(const char *filename); .SH DESCRIPTION Loads a datafile into memory in one go. If the datafile has been encrypted, you must first call packfile_password() to set the appropriate key. If the datafile contains truecolor graphics, you must set the video mode or call set_color_conversion() before loading it. Example: .nf /* Load the resources for our game. */ DATAFILE *dat = load_datafile("game.dat"); if (!dat) abort_on_error("Couldn't load sound resources!"); /* Use resources. */ ... /* Destroy them when we don't need them any more. */ unload_datafile(dat); .fi .SH "RETURN VALUE" Returns a pointer to the DATAFILE, or NULL on error. Remember to free this DATAFILE later to avoid memory leaks. .SH SEE ALSO .BR load_datafile_callback (3alleg4), .BR unload_datafile (3alleg4), .BR load_datafile_object (3alleg4), .BR set_color_conversion (3alleg4), .BR fixup_datafile (3alleg4), .BR packfile_password (3alleg4), .BR find_datafile_object (3alleg4), .BR register_datafile_object (3alleg4), .BR excustom (3alleg4), .BR exdata (3alleg4), .BR exexedat (3alleg4), .BR exgui (3alleg4), .BR exsprite (3alleg4), .BR exunicod (3alleg4)