From fc38371b29ff20b959a401222a74e6a31f1b95c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 15 Apr 2012 01:15:15 +0200 Subject: [PATCH] Clean up some chaos in old code. --- library/PlugLoad-linux.cpp | 2 +- library/PlugLoad-windows.cpp | 2 +- library/include/Core.h | 6 ------ library/include/PluginManager.h | 11 ++++++++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/library/PlugLoad-linux.cpp b/library/PlugLoad-linux.cpp index aaf7b2c33..69945c6f4 100644 --- a/library/PlugLoad-linux.cpp +++ b/library/PlugLoad-linux.cpp @@ -14,7 +14,7 @@ #include #include "DFHack.h" -#include "Core.h" +#include "PluginManager.h" #include "Hooks.h" #include diff --git a/library/PlugLoad-windows.cpp b/library/PlugLoad-windows.cpp index eadc9343d..f9a75df97 100644 --- a/library/PlugLoad-windows.cpp +++ b/library/PlugLoad-windows.cpp @@ -28,7 +28,7 @@ distribution. #include #include #include -#include "Core.h" +#include "PluginManager.h" #include "Hooks.h" #include diff --git a/library/include/Core.h b/library/include/Core.h index 8c2a284df..f8ac8e783 100644 --- a/library/include/Core.h +++ b/library/include/Core.h @@ -65,12 +65,6 @@ namespace DFHack { class df_window; } - // anon type, pretty much - struct DFLibrary; - - DFLibrary * OpenPlugin (const char * filename); - void * LookupPlugin (DFLibrary * plugin ,const char * function); - void ClosePlugin (DFLibrary * plugin); // Core is a singleton. Why? Because it is closely tied to SDL calls. It tracks the global state of DF. // There should never be more than one instance diff --git a/library/include/PluginManager.h b/library/include/PluginManager.h index 554860dee..080e66e66 100644 --- a/library/include/PluginManager.h +++ b/library/include/PluginManager.h @@ -35,7 +35,6 @@ distribution. typedef struct lua_State lua_State; -struct DFLibrary; namespace tthread { class mutex; @@ -53,6 +52,16 @@ namespace DFHack class RPCService; class function_identity_base; + // anon type, pretty much + struct DFLibrary; + + // Open a plugin library + DFLibrary * OpenPlugin (const char * filename); + // find a symbol inside plugin + void * LookupPlugin (DFLibrary * plugin ,const char * function); + // Close a plugin library + void ClosePlugin (DFLibrary * plugin); + enum state_change_event { SC_WORLD_LOADED,