From a9701028a26d792da58a1aaf740bce5ec36d7030 Mon Sep 17 00:00:00 2001 From: Koncord Date: Tue, 15 Jan 2019 20:26:11 +0800 Subject: [PATCH] Make API headers C compatible --- apps/openmw-mp/CMakeLists.txt | 2 +- apps/openmw-mp/Script/API/TimerAPI.hpp | 2 +- apps/openmw-mp/Script/Functions/Actors.cpp | 2 +- .../Script/Functions/{Actors.hpp => Actors.h} | 167 +++++++------ apps/openmw-mp/Script/Functions/Books.cpp | 2 +- .../Script/Functions/{Books.hpp => Books.h} | 19 +- apps/openmw-mp/Script/Functions/Cells.cpp | 2 +- .../Script/Functions/{Cells.hpp => Cells.h} | 31 ++- apps/openmw-mp/Script/Functions/CharClass.cpp | 2 +- .../Functions/{CharClass.hpp => CharClass.h} | 39 ++- apps/openmw-mp/Script/Functions/Chat.cpp | 2 +- .../Script/Functions/{Chat.hpp => Chat.h} | 13 +- apps/openmw-mp/Script/Functions/Dialogue.cpp | 2 +- .../Functions/{Dialogue.hpp => Dialogue.h} | 23 +- apps/openmw-mp/Script/Functions/Factions.cpp | 2 +- .../Functions/{Factions.hpp => Factions.h} | 37 ++- apps/openmw-mp/Script/Functions/GUI.cpp | 2 +- .../Script/Functions/{GUI.hpp => GUI.h} | 37 ++- apps/openmw-mp/Script/Functions/Items.cpp | 2 +- .../Script/Functions/{Items.hpp => Items.h} | 63 +++-- apps/openmw-mp/Script/Functions/Mechanics.cpp | 2 +- .../Functions/{Mechanics.hpp => Mechanics.h} | 59 +++-- .../Script/Functions/Miscellaneous.cpp | 2 +- .../{Miscellaneous.hpp => Miscellaneous.h} | 21 +- apps/openmw-mp/Script/Functions/Objects.cpp | 2 +- .../Functions/{Objects.hpp => Objects.h} | 233 +++++++++--------- apps/openmw-mp/Script/Functions/Positions.cpp | 2 +- .../Functions/{Positions.hpp => Positions.h} | 33 ++- apps/openmw-mp/Script/Functions/Public.cpp | 2 +- apps/openmw-mp/Script/Functions/Public.h | 16 ++ apps/openmw-mp/Script/Functions/Public.hpp | 16 -- apps/openmw-mp/Script/Functions/Quests.cpp | 2 +- .../Script/Functions/{Quests.hpp => Quests.h} | 49 ++-- .../Script/Functions/RecordsDynamic.cpp | 4 +- .../{RecordsDynamic.hpp => RecordsDynamic.h} | 177 +++++++------ apps/openmw-mp/Script/Functions/Server.cpp | 2 +- .../Script/Functions/{Server.hpp => Server.h} | 57 +++-- apps/openmw-mp/Script/Functions/Settings.cpp | 2 +- .../Functions/{Settings.hpp => Settings.h} | 23 +- .../openmw-mp/Script/Functions/Shapeshift.cpp | 2 +- .../{Shapeshift.hpp => Shapeshift.h} | 25 +- apps/openmw-mp/Script/Functions/Spells.cpp | 2 +- .../Script/Functions/{Spells.hpp => Spells.h} | 23 +- apps/openmw-mp/Script/Functions/Stats.cpp | 2 +- .../Script/Functions/{Stats.hpp => Stats.h} | 119 +++++---- apps/openmw-mp/Script/Functions/Timer.cpp | 2 + .../Script/Functions/{Timer.hpp => Timer.h} | 21 +- .../openmw-mp/Script/Functions/Worldstate.cpp | 2 +- .../{Worldstate.hpp => Worldstate.h} | 90 ++++--- apps/openmw-mp/Script/Platform.h | 58 +++++ apps/openmw-mp/Script/Platform.hpp | 28 --- apps/openmw-mp/Script/ScriptFunctions.hpp | 46 ++-- apps/openmw-mp/Script/api.h | 56 +++++ 53 files changed, 848 insertions(+), 783 deletions(-) rename apps/openmw-mp/Script/Functions/{Actors.hpp => Actors.h} (78%) rename apps/openmw-mp/Script/Functions/{Books.hpp => Books.h} (75%) rename apps/openmw-mp/Script/Functions/{Cells.hpp => Cells.h} (78%) rename apps/openmw-mp/Script/Functions/{CharClass.hpp => CharClass.h} (75%) rename apps/openmw-mp/Script/Functions/{Chat.hpp => Chat.h} (76%) rename apps/openmw-mp/Script/Functions/{Dialogue.hpp => Dialogue.h} (77%) rename apps/openmw-mp/Script/Functions/{Factions.hpp => Factions.h} (77%) rename apps/openmw-mp/Script/Functions/{GUI.hpp => GUI.h} (79%) rename apps/openmw-mp/Script/Functions/{Items.hpp => Items.h} (76%) rename apps/openmw-mp/Script/Functions/{Mechanics.hpp => Mechanics.h} (78%) rename apps/openmw-mp/Script/Functions/{Miscellaneous.hpp => Miscellaneous.h} (83%) rename apps/openmw-mp/Script/Functions/{Objects.hpp => Objects.h} (79%) rename apps/openmw-mp/Script/Functions/{Positions.hpp => Positions.h} (75%) create mode 100644 apps/openmw-mp/Script/Functions/Public.h delete mode 100644 apps/openmw-mp/Script/Functions/Public.hpp rename apps/openmw-mp/Script/Functions/{Quests.hpp => Quests.h} (78%) rename apps/openmw-mp/Script/Functions/{RecordsDynamic.hpp => RecordsDynamic.h} (80%) rename apps/openmw-mp/Script/Functions/{Server.hpp => Server.h} (75%) rename apps/openmw-mp/Script/Functions/{Settings.hpp => Settings.h} (81%) rename apps/openmw-mp/Script/Functions/{Shapeshift.hpp => Shapeshift.h} (79%) rename apps/openmw-mp/Script/Functions/{Spells.hpp => Spells.h} (76%) rename apps/openmw-mp/Script/Functions/{Stats.hpp => Stats.h} (75%) rename apps/openmw-mp/Script/Functions/{Timer.hpp => Timer.h} (73%) rename apps/openmw-mp/Script/Functions/{Worldstate.hpp => Worldstate.h} (78%) create mode 100644 apps/openmw-mp/Script/Platform.h delete mode 100644 apps/openmw-mp/Script/Platform.hpp create mode 100644 apps/openmw-mp/Script/api.h diff --git a/apps/openmw-mp/CMakeLists.txt b/apps/openmw-mp/CMakeLists.txt index 5ca39ddf6..b213a39ac 100644 --- a/apps/openmw-mp/CMakeLists.txt +++ b/apps/openmw-mp/CMakeLists.txt @@ -70,7 +70,7 @@ set(SERVER set(SERVER_HEADER Script/Types.hpp Script/Script.hpp Script/SystemInterface.hpp - Script/ScriptFunction.hpp Script/Platform.hpp Script/Language.hpp + Script/ScriptFunction.hpp Script/Platform.h Script/Language.hpp Script/ScriptFunctions.hpp Script/API/TimerAPI.hpp Script/API/PublicFnAPI.hpp ${LuaScript_Headers} ${NativeScript_Headers} diff --git a/apps/openmw-mp/Script/API/TimerAPI.hpp b/apps/openmw-mp/Script/API/TimerAPI.hpp index 4db744678..17f450c0e 100644 --- a/apps/openmw-mp/Script/API/TimerAPI.hpp +++ b/apps/openmw-mp/Script/API/TimerAPI.hpp @@ -41,7 +41,7 @@ namespace mwmp #if defined(ENABLE_LUA) static int CreateTimerLua(lua_State *lua, ScriptFuncLua callback, long msec, const std::string& def, std::vector args); #endif - static int CreateTimer(ScriptFunc callback, long msec, const std::string& def, std::vector args); + static int CreateTimer(ScriptFunc callback, long msec, const std::string& def, const std::vector &args); static void FreeTimer(int timerid); static void ResetTimer(int timerid, long msec); static void StartTimer(int timerid); diff --git a/apps/openmw-mp/Script/Functions/Actors.cpp b/apps/openmw-mp/Script/Functions/Actors.cpp index 08c014542..1b50eaadb 100644 --- a/apps/openmw-mp/Script/Functions/Actors.cpp +++ b/apps/openmw-mp/Script/Functions/Actors.cpp @@ -8,7 +8,7 @@ #include -#include "Actors.hpp" +#include "Actors.h" using namespace mwmp; diff --git a/apps/openmw-mp/Script/Functions/Actors.hpp b/apps/openmw-mp/Script/Functions/Actors.h similarity index 78% rename from apps/openmw-mp/Script/Functions/Actors.hpp rename to apps/openmw-mp/Script/Functions/Actors.h index 6915c689a..d976b06e4 100644 --- a/apps/openmw-mp/Script/Functions/Actors.hpp +++ b/apps/openmw-mp/Script/Functions/Actors.h @@ -1,7 +1,7 @@ #ifndef OPENMW_ACTORAPI_HPP #define OPENMW_ACTORAPI_HPP -#include