aboutsummaryrefslogtreecommitdiff
path: root/backends/dc/dcloader.h
diff options
context:
space:
mode:
authorMarcus Comstedt2004-08-22 21:47:20 +0000
committerMarcus Comstedt2004-08-22 21:47:20 +0000
commit45ac190548b0b0f33c8dbc391cf14869862b1dac (patch)
treeda9142f148ae464150cd32d94655b3a259ddbc3f /backends/dc/dcloader.h
parentba39d7a3dbe8cfce4293838e87c1ff6caa1a27d6 (diff)
downloadscummvm-rg350-45ac190548b0b0f33c8dbc391cf14869862b1dac.tar.gz
scummvm-rg350-45ac190548b0b0f33c8dbc391cf14869862b1dac.tar.bz2
scummvm-rg350-45ac190548b0b0f33c8dbc391cf14869862b1dac.zip
Support dynamic plugins on Dreamcast.
svn-id: r14689
Diffstat (limited to 'backends/dc/dcloader.h')
-rw-r--r--backends/dc/dcloader.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/backends/dc/dcloader.h b/backends/dc/dcloader.h
new file mode 100644
index 0000000000..fa33475380
--- /dev/null
+++ b/backends/dc/dcloader.h
@@ -0,0 +1,64 @@
+/* ScummVM - Scumm Interpreter
+ * Dreamcast port
+ * Copyright (C) 2002-2004 Marcus Comstedt
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ *
+ */
+
+#ifndef DC_DCLOADER_H
+#define DC_DCLOADER_H
+
+#include "dc.h"
+
+#define MAXDLERRLEN 80
+
+class DLObject {
+ private:
+ char *errbuf; /* For error messages, at least MAXDLERRLEN in size */
+
+ void *segment, *symtab;
+ char *strtab;
+ int symbol_cnt;
+ void *dtors_start, *dtors_end;
+
+ void seterror(const char *fmt, ...);
+ void unload();
+ bool relocate(int fd, unsigned long offset, unsigned long size);
+ bool load(int fd);
+
+ public:
+ bool open(const char *path);
+ bool close();
+ void *symbol(const char *name);
+ void discard_symtab();
+
+ DLObject(char *_errbuf = NULL) : errbuf(_errbuf), segment(NULL),symtab(NULL),
+ strtab(NULL), symbol_cnt(0), dtors_start(NULL), dtors_end(NULL) {}
+};
+
+#define RTLD_LAZY 0
+
+extern "C" {
+ void *dlopen(const char *filename, int flags);
+ int dlclose(void *handle);
+ void *dlsym(void *handle, const char *symbol);
+ const char *dlerror();
+ void dlforgetsyms(void *handle);
+};
+
+#endif