load_datafile_callback man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

load_datafile_callback(3)	Allegro manual	     load_datafile_callback(3)

NAME
       load_datafile_callback  -  Loads a datafile into memory, calling a hook
       per object. Allegro game programming library.

SYNOPSIS
       #include <allegro.h>

       DATAFILE *load_datafile_callback(const  char  *filename,	 void  (*call‐
       back)(DATAFILE *d));

DESCRIPTION
       Loads  a datafile into memory, calling the specified hook function once
       for each object in the file, passing it a pointer to  the  object  just
       read.  You  can use this to implement very simple loading screens where
       every time the hook is called, the screen is updated to	let  the  user
       know your program is still loading from disk:

	  void load_callback(DATAFILE *dat_obj)
	  {
	     static const char indicator[] = "-\\|/-.oOXOo.";
	     static int current = 0;

	     /* Show a different character every time. */
	     textprintf_ex(screen, font, 0, 0, makecol(0, 0, 0),
			   makecol(255, 255, 255), "%c Loading %c",
			   indicator[current], indicator[current]);
	     /* Increase index and check if we need to reset it. */
	     current++;
	     if (!indicator[current])
		current = 0;
	  }
	     ...
	     dat = load_datafile_callback("data.dat", load_callback);

RETURN VALUE
       Returns	a  pointer  to the DATAFILE or NULL on error. Remember to free
       this DATAFILE later to avoid memory leaks.

SEE ALSO
       load_datafile(3),     unload_datafile(3),      load_datafile_object(3),
       set_color_conversion(3),	   fixup_datafile(3),	 packfile_password(3),
       find_datafile_object(3), register_datafile_object(3)

Allegro				 version 4.4.2	     load_datafile_callback(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net