home *** CD-ROM | disk | FTP | other *** search
- ┌──────────────────────────────┐
- │MLOADER.C Module Documentation│
- └──────────────────────────────┘
-
- Date last modified: October 20, 1995
-
- MLOADER.C uses 2 routines of the MDRIVER.C module (MD_SampleLoad() &
- MD_SampleUnLoad()) so if you want to use MLOADER without using MDRIVER you'll
- have to define those two routines yourself. (see MIKCVT.C as an example on
- how to do that).
-
- ════════════════════════════════════════════════════════════════════════════════
-
- General information:
-
- When you're making a modplayer that has to support several different formats
- the best thing to do is to create your own internal module-format. In
- MikMod's case this is the 'UNI' format. The loader module takes care of
- loading any of the known module formats and converting it into a UNI format.
-
- ┌───────────────┬─────────────────────────────┐
- │LOADER BLACKBOX│ │
- ├───────────────┘ │
- │ ┌──────────┐ │
- │ ┌──┤mod loader├──┐ │
- │ │ └──────────┘ │ │
- │ │ ┌──────────┐ │ │
- │ ├──┤ult loader├──┤ │
- │ │ └──────────┘ │ │
- │ │ ┌──────────┐ │ │
- │ ╔══┤s3m loader├══╗ <- appropriate loader │
- │ ║ └──────────┘ ║ for this file │
- │ ║ ┌──────────┐ ║ │
- │ ║──┤uni loader├──║ │
- │ ║ └──────────┘ ║ │
- │ ║ ┌──────────┐ ║ │
- │ ║──┤mtm loader├──║ │
- │ ║ └──────────┘ ║ │
- │ ║ ┌──────────┐ ║ ┌─────────────────────┐ │
- modfile >════╝──┤med loader├──╚══┤LOADER GLUE FUNCTIONS├─┼──>>─ unimod *
- │ │ └──────────┘ │ └─────────────────────┘ │
- │ │ ┌──────────┐ │ │
- │ ├──┤xm loader├──┤ │
- │ │ └──────────┘ │ │
- │ │ ┌──────────┐ │ │
- │ ├──┤669 loader├──┤ - common loader │
- │ │ └──────────┘ │ routines │
- │ │ ┌──────────┐ │ │
- │ ├──┤far loader├──┤ - common loader │
- │ │ └──────────┘ │ variables │
- │ │ ┌──────────┐ │ │
- │ ├──┤dsm loader├──┤ │
- │ │ └──────────┘ │ │
- │ │ ┌──────────┐ │ │
- │ └──┤... loader├──┘ │
- │ └──────────┘ │
- │ │
- └─────────────────────────────────────────────┘
-
- To prevent having to link _all_ loaders to the loader module when you only
- wanted to use the uni-loader, for example), the first thing the main module
- has to do before using the loader module is to 'register' all loaders it
- might need. This way only the registered drivers will get linked to the
- executable.
-
- ════════════════════════════════════════════════════════════════════════════════
-
- void ML_RegisterLoader(LOADER *ldr)
- ===================================
-
- Input parms:
-
- ldr pointer to a LOADER structure
-
-
- Returns:
-
- -
-
-
- Description:
-
- Before you can load any modules (with ML_LoadFN() or ML_LoadFP()) you first
- have to register the loaders you want to use. This way only the registered
- loaders are linked to the resulting program, so if you only wanted to support
- a single format your program won't be so big.
-
-
- Example:
-
- [ at the start of the main program: ]
-
- {
- ...
-
- ML_RegisterLoader(&modload);
- ML_RegisterLoader(&uniload);
-
- ML_InfoLoader();
- ...
- ...
-
- }
-
- (if you want to keep your program as small as possible, only use the .UNI
- loader since it is the smallest loader available (go figure!) )
-
- ════════════════════════════════════════════════════════════════════════════════
-
- void ML_InfoLoader(void)
- ========================
-
- Input parms:
-
- -
-
-
- Returns:
-
- -
-
-
- Description:
-
- This function produces a list of all registered loader modules to stdout. Use
- it _after_ you've registered all loaders using ML_RegisterLoader().
-
- ════════════════════════════════════════════════════════════════════════════════
-
- UNIMOD *ML_LoadFP(FILE *fp)
- ===========================
-
- Input parms:
-
- fp filepointer to a music module
-
-
- Returns:
-
- A pointer to a UNIMOD structure
-
- or
-
- NULL if an error occured during loading.
-
-
- Description:
-
- With this routine you can load a music-module by it's file-pointer. If it
- returns NULL, print myerr (MMIO.C) to see what went wrong. This routine
- doesn't close the filepointer when it's done, but you can't rely on it still
- having the same file-position. Use ML_Free() to free the UNIMOD when you're
- done with it.
-
- ════════════════════════════════════════════════════════════════════════════════
-
- void ML_Free(UNIMOD *mf)
- ========================
-
- Input parms:
-
- mf pointer to a UNIMOD structure
-
-
- Returns:
-
- -
-
-
- Description:
-
- Use this routine to free the module you loaded with ML_LoadFN() or
- ML_LoadFP().
-
- ════════════════════════════════════════════════════════════════════════════════
-
- UNIMOD *ML_LoadFN(char *filename)
- =================================
-
- Input parms:
-
- filename The filename of the module you want to load.
-
-
- Returns:
-
- A pointer to a UNIMOD structure
-
- or
-
- NULL if an error occured during loading.
-
-
- Description:
-
- With this routine you can load a music-module by it's filename. If it returns
- NULL, print myerr (MERROR.C) to see what went wrong. Use ML_Free() to free
- the UNIMOD when you're done with it.
-
- ════════════════════════════════════════════════════════════════════════════════
-