diff options
Diffstat (limited to 'apps/codecs/dumb/src/core/loadduh.c')
-rw-r--r-- | apps/codecs/dumb/src/core/loadduh.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/apps/codecs/dumb/src/core/loadduh.c b/apps/codecs/dumb/src/core/loadduh.c new file mode 100644 index 0000000000..7dfe5cc100 --- /dev/null +++ b/apps/codecs/dumb/src/core/loadduh.c | |||
@@ -0,0 +1,42 @@ | |||
1 | /* _______ ____ __ ___ ___ | ||
2 | * \ _ \ \ / \ / \ \ / / ' ' ' | ||
3 | * | | \ \ | | || | \/ | . . | ||
4 | * | | | | | | || ||\ /| | | ||
5 | * | | | | | | || || \/ | | ' ' ' | ||
6 | * | | | | | | || || | | . . | ||
7 | * | |_/ / \ \__// || | | | ||
8 | * /_______/ynamic \____/niversal /__\ /____\usic /| . . ibliotheque | ||
9 | * / \ | ||
10 | * / . \ | ||
11 | * loadduh.c - Code to read a DUH from a file, / / \ \ | ||
12 | * opening and closing the file for | < / \_ | ||
13 | * you. | \/ /\ / | ||
14 | * \_ / > / | ||
15 | * By entheh. | \ / / | ||
16 | * | ' / | ||
17 | * \__/ | ||
18 | */ | ||
19 | |||
20 | #include "dumb.h" | ||
21 | #include "internal/dumb.h" | ||
22 | |||
23 | |||
24 | |||
25 | /* load_duh(): loads a .duh file, returning a pointer to a DUH struct. | ||
26 | * When you have finished with it, you must pass the pointer to unload_duh() | ||
27 | * so that the memory can be freed. | ||
28 | */ | ||
29 | DUH *load_duh(const char *filename) | ||
30 | { | ||
31 | DUH *duh; | ||
32 | DUMBFILE *f = dumbfile_open(filename); | ||
33 | |||
34 | if (!f) | ||
35 | return NULL; | ||
36 | |||
37 | duh = read_duh(f); | ||
38 | |||
39 | dumbfile_close(f); | ||
40 | |||
41 | return duh; | ||
42 | } | ||