1 /* _______ ____ __ ___ ___
2 * \ _ \ \ / \ / \ \ / / ' ' '
3 * | | \ \ | | || | \/ | . .
4 * | | | | | | || ||\ /| |
5 * | | | | | | || || \/ | | ' ' '
6 * | | | | | | || || | | . .
7 * | |_/ / \ \__// || | |
8 * /_______/ynamic \____/niversal /__\ /____\usic /| . . ibliotheque
9 * / \
10 * / . \
11 * loads3m.c - Code to read a ScreamTracker 3 / / \ \
12 * file, opening and closing it for | < / \_
13 * you. | \/ /\ /
14 * \_ / > /
15 * By entheh. | \ / /
16 * | ' /
17 * \__/
18 */
19
20 #include "dumb.h"
21 #include "internal/it.h"
22
23
24
25 /* dumb_load_s3m(): loads an S3M 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_s3m(const char * filename)29 DUH *dumb_load_s3m(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_s3m(f);
38
39 dumbfile_close(f);
40
41 return duh;
42 }
43