shithub: dumb

Download patch

ref: 9d44f7d96637019c3d9ff0f2186a7886fac466b5
parent: d8680ee4bdafc15a97bab686bb61597289fedec1
author: Chris Moeller <[email protected]>
date: Mon Jan 11 04:00:01 EST 2010

{5/31/2006 8:34:58 PM}2006-05-31 23:15 UTC - kode54
- Implemented STM support.

git-tfs-id: [http://localhost:8080/tfs/DefaultCollection/]$/foobar2000/files/plugins.root;C92

--- a/dumb/include/dumb.h
+++ b/dumb/include/dumb.h
@@ -350,6 +350,7 @@
 DUH *dumb_load_it(const char *filename);
 DUH *dumb_load_xm(const char *filename);
 DUH *dumb_load_s3m(const char *filename);
+DUH *dumb_load_stm(const char *filename);
 DUH *dumb_load_mod(const char *filename, int restrict);
 DUH *dumb_load_ptm(const char *filename);
 DUH *dumb_load_669(const char *filename);
@@ -361,6 +362,7 @@
 DUH *dumb_read_it(DUMBFILE *f);
 DUH *dumb_read_xm(DUMBFILE *f);
 DUH *dumb_read_s3m(DUMBFILE *f);
+DUH *dumb_read_stm(DUMBFILE *f);
 DUH *dumb_read_mod(DUMBFILE *f, int restrict);
 DUH *dumb_read_ptm(DUMBFILE *f);
 DUH *dumb_read_669(DUMBFILE *f);
--- /dev/null
+++ b/dumb/src/it/loadstm.c
@@ -1,0 +1,42 @@
+/*  _______         ____    __         ___    ___
+ * \    _  \       \    /  \  /       \   \  /   /       '   '  '
+ *  |  | \  \       |  |    ||         |   \/   |         .      .
+ *  |  |  |  |      |  |    ||         ||\  /|  |
+ *  |  |  |  |      |  |    ||         || \/ |  |         '  '  '
+ *  |  |  |  |      |  |    ||         ||    |  |         .      .
+ *  |  |_/  /        \  \__//          ||    |  |
+ * /_______/ynamic    \____/niversal  /__\  /____\usic   /|  .  . ibliotheque
+ *                                                      /  \
+ *                                                     / .  \
+ * loadstm.c - Code to read a ScreamTracker 2         / / \  \
+ *             file, opening and closing it for      | <  /   \_
+ *             you.                                  |  \/ /\   /
+ *                                                    \_  /  > /
+ * By Chris Moeller.                                    | \ / /
+ *                                                      |  ' /
+ *                                                       \__/
+ */
+
+#include "dumb.h"
+#include "internal/it.h"
+
+
+
+/* dumb_load_stm(): loads an STM file into a DUH struct, returning a pointer
+ * to the DUH struct. When you have finished with it, you must pass the
+ * pointer to unload_duh() so that the memory can be freed.
+ */
+DUH *dumb_load_stm(const char *filename)
+{
+	DUH *duh;
+	DUMBFILE *f = dumbfile_open(filename);
+
+	if (!f)
+		return NULL;
+
+	duh = dumb_read_stm(f);
+
+	dumbfile_close(f);
+
+	return duh;
+}