1 /*  _______         ____    __         ___    ___
2  * \    _  \       \    /  \  /       \   \  /   /       '   '  '
3  *  |  | \  \       |  |    ||         |   \/   |         .      .
4  *  |  |  |  |      |  |    ||         ||\  /|  |
5  *  |  |  |  |      |  |    ||         || \/ |  |         '  '  '
6  *  |  |  |  |      |  |    ||         ||    |  |         .      .
7  *  |  |_/  /        \  \__//          ||    |  |
8  * /_______/ynamic    \____/niversal  /__\  /____\usic   /|  .  . ibliotheque
9  *                                                      /  \
10  *                                                     / .  \
11  * loadmod.c - Code to read a good old-fashioned      / / \  \
12  *             Amiga module file, opening and        | <  /   \_
13  *             closing it for you.                   |  \/ /\   /
14  *                                                    \_  /  > /
15  * By entheh.                                           | \ / /
16  *                                                      |  ' /
17  *                                                       \__/
18  */
19 
20 #include "dumb.h"
21 #include "internal/it.h"
22 
23 
24 
25 /* dumb_load_mod(): loads a MOD file into a DUH struct, returning a pointer
26  * to the DUH struct. When you have finished with it, you must pass the
27  * pointer to unload_duh() so that the memory can be freed.
28  */
dumb_load_mod(const char * filename)29 DUH *dumb_load_mod(const char *filename)
30 {
31 	DUH *duh;
32 	DUMBFILE *f = dumbfile_open(filename);
33 
34 	if (!f)
35 		return NULL;
36 
37 	duh = dumb_read_mod(f);
38 
39 	dumbfile_close(f);
40 
41 	return duh;
42 }
43