GNU Info

Info Node: (mikmod.info)Loading Data from Memory

(mikmod.info)Loading Data from Memory


Prev: Modules and Player Control Up: Using the Library
Enter node , (file) or (file)node

Loading Data from Memory
========================

   If you need to load modules or sound effects from other places than
plain files, you can use the `MREADER' and `MWRITER' objects to achieve
this.

   The `MREADER' and `MWRITER' structures contain a list of function
pointers, which emulate the behaviour of a regular `FILE *' object. In
fact, all functions which take filenames or `FILE *' as arguments are
only wrappers to a real function which takes an `MREADER' or an
`MWRITER' argument.

   So, if you need to load a module from memory, or for a multi-file
archive, for example, all you need is to build an adequate `MREADER'
object, and use `Player_LoadGeneric' instead of `Player_Load' or
`Player_LoadFP'. For samples, use `Sample_LoadGeneric' instead of
`Sample_Load' or `Sample_LoadFP'.


automatically generated by info2www version 1.2.2.9