New plugin interface

develop
Petr Mrázek 2012-02-21 18:19:17 +01:00
parent 0b9e849096
commit 2cd2ee9b0c
58 changed files with 151 additions and 306 deletions

@ -26,11 +26,14 @@ endif()
# set up versioning. # set up versioning.
set(DF_VERSION_MAJOR "0") set(DF_VERSION_MAJOR "0")
set(DF_VERSION_MINOR "31") set(DF_VERSION_MINOR "34")
set(DF_VERSION_PATCH "25") set(DF_VERSION_PATCH "02")
set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}") set(DF_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}")
set(DFHACK_RELEASE "9b") set(DFHACK_RELEASE "1")
set(DFHACK_VERSION "${DF_VERSION_MAJOR}.${DF_VERSION_MINOR}.${DF_VERSION_PATCH}-r${DFHACK_RELEASE}")
add_definitions(-DDFHACK_VERSION="${DFHACK_VERSION}")
## where to install things (after the build is done, classic 'make install' or package structure) ## where to install things (after the build is done, classic 'make install' or package structure)
# the dfhack libraries will be installed here: # the dfhack libraries will be installed here:
@ -99,5 +102,5 @@ ELSEIF(WIN32)
SET(CPACK_GENERATOR "ZIP") SET(CPACK_GENERATOR "ZIP")
ENDIF() ENDIF()
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
set(CPACK_PACKAGE_FILE_NAME "dfhack-${DF_VERSION}-r${DFHACK_RELEASE}-${CMAKE_SYSTEM_NAME}") set(CPACK_PACKAGE_FILE_NAME "dfhack-${DFHACK_VERSION}-${CMAKE_SYSTEM_NAME}")
INCLUDE(CPack) INCLUDE(CPack)

@ -385,7 +385,8 @@ static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clue
for (size_t j = 0; j < plug->size();j++) for (size_t j = 0; j < plug->size();j++)
{ {
const PluginCommand & pcmd = (plug->operator[](j)); const PluginCommand & pcmd = (plug->operator[](j));
out.insert({pcmd.isHotkeyCommand(),pcmd.name,pcmd.description}); sortable so = {pcmd.isHotkeyCommand(),pcmd.name,pcmd.description};
out.insert(so);
} }
} }
for(auto iter = out.begin();iter != out.end();iter++) for(auto iter = out.begin();iter != out.end();iter++)

@ -46,7 +46,7 @@ namespace DFHack
} }
void * LookupPlugin (DFLibrary * plugin ,const char * function) void * LookupPlugin (DFLibrary * plugin ,const char * function)
{ {
return (DFLibrary *) GetProcAddress((HMODULE)plugin, function); return (void *) GetProcAddress((HMODULE)plugin, function);
} }
void ClosePlugin (DFLibrary * plugin) void ClosePlugin (DFLibrary * plugin)
{ {

@ -120,6 +120,14 @@ struct Plugin::RefLock
mutex * mut; mutex * mut;
int refcount; int refcount;
}; };
struct Plugin::RefAutolock
{
RefLock * lock;
RefAutolock(RefLock * lck):lock(lck){ lock->lock(); };
~RefAutolock(){ lock->unlock(); };
};
Plugin::Plugin(Core * core, const std::string & filepath, const std::string & _filename, PluginManager * pm) Plugin::Plugin(Core * core, const std::string & filepath, const std::string & _filename, PluginManager * pm)
{ {
filename = filepath; filename = filepath;
@ -154,15 +162,13 @@ Plugin::~Plugin()
bool Plugin::load() bool Plugin::load()
{ {
access->lock(); RefAutolock lock(access);
if(state == PS_BROKEN) if(state == PS_BROKEN)
{ {
access->unlock();
return false; return false;
} }
else if(state == PS_LOADED) else if(state == PS_LOADED)
{ {
access->unlock();
return true; return true;
} }
Core & c = Core::getInstance(); Core & c = Core::getInstance();
@ -172,16 +178,23 @@ bool Plugin::load()
{ {
con.printerr("Can't load plugin %s\n", filename.c_str()); con.printerr("Can't load plugin %s\n", filename.c_str());
state = PS_BROKEN; state = PS_BROKEN;
access->unlock();
return false; return false;
} }
const char * (*_PlugName)() =(const char * (*)()) LookupPlugin(plug, "plugin_name"); const char ** plug_name =(const char ** ) LookupPlugin(plug, "name");
if(!_PlugName) if(!plug_name)
{ {
con.printerr("Plugin %s has no name.\n", filename.c_str()); con.printerr("Plugin %s has no name.\n", filename.c_str());
ClosePlugin(plug); ClosePlugin(plug);
state = PS_BROKEN; state = PS_BROKEN;
access->unlock(); return false;
}
const char ** plug_version =(const char ** ) LookupPlugin(plug, "version");
if(!plug_version || strcmp(DFHACK_VERSION, *plug_version) != 0)
{
con.printerr("Plugin sx was not built for this version of DFHack.\n"
"Plugin: %s, DFHack: %s\n", *plug_name, *plug_version, DFHACK_VERSION);
ClosePlugin(plug);
state = PS_BROKEN;
return false; return false;
} }
plugin_init = (command_result (*)(Core *, std::vector <PluginCommand> &)) LookupPlugin(plug, "plugin_init"); plugin_init = (command_result (*)(Core *, std::vector <PluginCommand> &)) LookupPlugin(plug, "plugin_init");
@ -190,20 +203,18 @@ bool Plugin::load()
con.printerr("Plugin %s has no init function.\n", filename.c_str()); con.printerr("Plugin %s has no init function.\n", filename.c_str());
ClosePlugin(plug); ClosePlugin(plug);
state = PS_BROKEN; state = PS_BROKEN;
access->unlock();
return false; return false;
} }
plugin_status = (command_result (*)(Core *, std::string &)) LookupPlugin(plug, "plugin_status"); plugin_status = (command_result (*)(Core *, std::string &)) LookupPlugin(plug, "plugin_status");
plugin_onupdate = (command_result (*)(Core *)) LookupPlugin(plug, "plugin_onupdate"); plugin_onupdate = (command_result (*)(Core *)) LookupPlugin(plug, "plugin_onupdate");
plugin_shutdown = (command_result (*)(Core *)) LookupPlugin(plug, "plugin_shutdown"); plugin_shutdown = (command_result (*)(Core *)) LookupPlugin(plug, "plugin_shutdown");
plugin_onstatechange = (command_result (*)(Core *, state_change_event)) LookupPlugin(plug, "plugin_onstatechange"); plugin_onstatechange = (command_result (*)(Core *, state_change_event)) LookupPlugin(plug, "plugin_onstatechange");
//name = _PlugName(); this->name = *plug_name;
plugin_lib = plug; plugin_lib = plug;
if(plugin_init(&c,commands) == CR_OK) if(plugin_init(&c,commands) == CR_OK)
{ {
state = PS_LOADED; state = PS_LOADED;
parent->registerCommands(this); parent->registerCommands(this);
access->unlock();
return true; return true;
} }
else else
@ -211,10 +222,8 @@ bool Plugin::load()
con.printerr("Plugin %s has failed to initialize properly.\n", filename.c_str()); con.printerr("Plugin %s has failed to initialize properly.\n", filename.c_str());
ClosePlugin(plugin_lib); ClosePlugin(plugin_lib);
state = PS_BROKEN; state = PS_BROKEN;
access->unlock();
return false; return false;
} }
// not reachable
} }
bool Plugin::unload() bool Plugin::unload()

@ -102,6 +102,7 @@ namespace DFHack
class Plugin class Plugin
{ {
struct RefLock; struct RefLock;
struct RefAutolock;
enum plugin_state enum plugin_state
{ {
PS_UNLOADED, PS_UNLOADED,
@ -185,5 +186,8 @@ namespace DFHack
DFHACK_EXPORT bool default_hotkey(Core *, df::viewscreen *); DFHACK_EXPORT bool default_hotkey(Core *, df::viewscreen *);
DFHACK_EXPORT bool dwarfmode_hotkey(Core *, df::viewscreen *); DFHACK_EXPORT bool dwarfmode_hotkey(Core *, df::viewscreen *);
DFHACK_EXPORT bool cursor_hotkey(Core *, df::viewscreen *); DFHACK_EXPORT bool cursor_hotkey(Core *, df::viewscreen *);
} };
/// You have to have this in every plugin you write - just once. Ideally on top of the main file.
#define DFHACK_PLUGIN(plugin_name) DFhackCExport const char * version = DFHACK_VERSION;\
DFhackCExport const char * name = plugin_name;

@ -45,39 +45,43 @@ if (BUILD_DWARFEXPORT)
add_subdirectory (dwarfexport) add_subdirectory (dwarfexport)
endif() endif()
DFHACK_PLUGIN(reveal reveal.cpp) OPTION(BUILD_SUPPORTED "Build the supported plugins (reveal, probe, etc.)." ON)
DFHACK_PLUGIN(probe probe.cpp) if (BUILD_SUPPORTED)
DFHACK_PLUGIN(drybuckets drybuckets.cpp) DFHACK_PLUGIN(reveal reveal.cpp)
DFHACK_PLUGIN(getplants getplants.cpp) DFHACK_PLUGIN(probe probe.cpp)
DFHACK_PLUGIN(plants plants.cpp) DFHACK_PLUGIN(drybuckets drybuckets.cpp)
DFHACK_PLUGIN(fastdwarf fastdwarf.cpp) DFHACK_PLUGIN(getplants getplants.cpp)
DFHACK_PLUGIN(prospector prospector.cpp) DFHACK_PLUGIN(plants plants.cpp)
DFHACK_PLUGIN(cleaners cleaners.cpp) DFHACK_PLUGIN(fastdwarf fastdwarf.cpp)
DFHACK_PLUGIN(weather weather.cpp) DFHACK_PLUGIN(prospector prospector.cpp)
DFHACK_PLUGIN(vdig vdig.cpp) DFHACK_PLUGIN(cleaners cleaners.cpp)
DFHACK_PLUGIN(colonies colonies.cpp) DFHACK_PLUGIN(weather weather.cpp)
DFHACK_PLUGIN(mode mode.cpp) DFHACK_PLUGIN(vdig vdig.cpp)
DFHACK_PLUGIN(liquids liquids.cpp) DFHACK_PLUGIN(colonies colonies.cpp)
DFHACK_PLUGIN(tiletypes tiletypes.cpp) DFHACK_PLUGIN(mode mode.cpp)
DFHACK_PLUGIN(tubefill tubefill.cpp) DFHACK_PLUGIN(liquids liquids.cpp)
DFHACK_PLUGIN(autodump autodump.cpp) DFHACK_PLUGIN(tiletypes tiletypes.cpp)
DFHACK_PLUGIN(cleanowned cleanowned.cpp) DFHACK_PLUGIN(tubefill tubefill.cpp)
DFHACK_PLUGIN(deramp deramp.cpp) DFHACK_PLUGIN(autodump autodump.cpp)
DFHACK_PLUGIN(flows flows.cpp) DFHACK_PLUGIN(cleanowned cleanowned.cpp)
DFHACK_PLUGIN(filltraffic filltraffic.cpp) DFHACK_PLUGIN(deramp deramp.cpp)
DFHACK_PLUGIN(seedwatch seedwatch.cpp) DFHACK_PLUGIN(flows flows.cpp)
DFHACK_PLUGIN(initflags initflags.cpp) DFHACK_PLUGIN(filltraffic filltraffic.cpp)
DFHACK_PLUGIN(stockpiles stockpiles.cpp) DFHACK_PLUGIN(seedwatch seedwatch.cpp)
DFHACK_PLUGIN(rename rename.cpp) DFHACK_PLUGIN(initflags initflags.cpp)
DFHACK_PLUGIN(fixwagons fixwagons.cpp) DFHACK_PLUGIN(stockpiles stockpiles.cpp)
DFHACK_PLUGIN(jobutils jobutils.cpp) DFHACK_PLUGIN(rename rename.cpp)
DFHACK_PLUGIN(regrass regrass.cpp) DFHACK_PLUGIN(fixwagons fixwagons.cpp)
DFHACK_PLUGIN(workflow workflow.cpp) DFHACK_PLUGIN(jobutils jobutils.cpp)
DFHACK_PLUGIN(showmood showmood.cpp) DFHACK_PLUGIN(regrass regrass.cpp)
DFHACK_PLUGIN(fixveins fixveins.cpp) DFHACK_PLUGIN(workflow workflow.cpp)
DFHACK_PLUGIN(fixpositions fixpositions.cpp) DFHACK_PLUGIN(showmood showmood.cpp)
DFHACK_PLUGIN(follow follow.cpp) DFHACK_PLUGIN(fixveins fixveins.cpp)
#DFHACK_PLUGIN(versionosd versionosd.cpp) DFHACK_PLUGIN(fixpositions fixpositions.cpp)
DFHACK_PLUGIN(follow follow.cpp)
#DFHACK_PLUGIN(versionosd versionosd.cpp)
endif()
# this is the skeleton plugin. If you want to make your own, make a copy and then change it # this is the skeleton plugin. If you want to make your own, make a copy and then change it
OPTION(BUILD_SKELETON "Build the skeleton plugin." OFF) OPTION(BUILD_SKELETON "Build the skeleton plugin." OFF)

@ -38,7 +38,6 @@ DFhackCExport const char * plugin_name ( void )
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
lua::state st=lua::glua::Get(); lua::state st=lua::glua::Get();
//maybe remake it to run automaticaly //maybe remake it to run automaticaly
lua::RegisterConsole(st,&c->con); lua::RegisterConsole(st,&c->con);

@ -32,18 +32,14 @@ using MapExtras::Block;
using MapExtras::MapCache; using MapExtras::MapCache;
using df::global::world; using df::global::world;
DFHACK_PLUGIN("autodump");
command_result df_autodump(Core * c, vector <string> & parameters); command_result df_autodump(Core * c, vector <string> & parameters);
command_result df_autodump_destroy_here(Core * c, vector <string> & parameters); command_result df_autodump_destroy_here(Core * c, vector <string> & parameters);
command_result df_autodump_destroy_item(Core * c, vector <string> & parameters); command_result df_autodump_destroy_item(Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void )
{
return "autodump";
}
DFhackCExport command_result plugin_init ( Core * c, vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"autodump", "Teleport items marked for dumping to the cursor.", "autodump", "Teleport items marked for dumping to the cursor.",
df_autodump, false, df_autodump, false,

@ -22,6 +22,8 @@ using namespace df::enums;
using df::global::world; using df::global::world;
using df::global::cursor; using df::global::cursor;
DFHACK_PLUGIN("cleaners");
command_result cleanmap (Core * c, bool snow, bool mud) command_result cleanmap (Core * c, bool snow, bool mud)
{ {
// Invoked from clean(), already suspended // Invoked from clean(), already suspended
@ -186,14 +188,8 @@ command_result clean (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void )
{
return "cleaners";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"clean","Removes contaminants from map tiles, items and creatures.", "clean","Removes contaminants from map tiles, items and creatures.",
clean, false, clean, false,

@ -28,14 +28,10 @@ using df::global::world;
command_result df_cleanowned (Core * c, vector <string> & parameters); command_result df_cleanowned (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("cleanowned");
{
return "cleanowned";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"cleanowned", "Confiscates and dumps garbage owned by dwarfs.", "cleanowned", "Confiscates and dumps garbage owned by dwarfs.",
df_cleanowned, false, df_cleanowned, false,

@ -14,14 +14,10 @@ using namespace DFHack::Simple;
command_result colonies (Core * c, vector <string> & parameters); command_result colonies (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("colonies");
{
return "colonies";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"colonies", "List or change wild colonies (ants hills and such)", "colonies", "List or change wild colonies (ants hills and such)",
colonies, false, colonies, false,

@ -17,6 +17,8 @@ using namespace df::enums;
using df::global::world; using df::global::world;
DFHACK_PLUGIN("deramp");
command_result df_deramp (Core * c, vector <string> & parameters) command_result df_deramp (Core * c, vector <string> & parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
@ -80,14 +82,8 @@ command_result df_deramp (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void )
{
return "deramp";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"deramp", "De-ramp. All ramps marked for removal are replaced with floors.", "deramp", "De-ramp. All ramps marked for removal are replaced with floors.",
df_deramp, false, df_deramp, false,

@ -21,14 +21,10 @@ using namespace DFHack;
command_result readFlag (Core * c, vector <string> & parameters); command_result readFlag (Core * c, vector <string> & parameters);
command_result writeFlag (Core * c, vector <string> & parameters); command_result writeFlag (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("buildprobe");
{
return "buildprobe";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("bshow","Output building occupancy value",readFlag)); commands.push_back(PluginCommand("bshow","Output building occupancy value",readFlag));
commands.push_back(PluginCommand("bset","Set building occupancy value",writeFlag)); commands.push_back(PluginCommand("bset","Set building occupancy value",writeFlag));
return CR_OK; return CR_OK;

@ -28,16 +28,12 @@ using namespace DFHack::Simple;
command_result catsplosion (Core * c, std::vector <std::string> & parameters); command_result catsplosion (Core * c, std::vector <std::string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("catsplosion");
{
return "catsplosion";
}
// Mandatory init function. If you have some global state, create it here. // Mandatory init function. If you have some global state, create it here.
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
// Fill the command list with your commands. // Fill the command list with your commands.
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"catsplosion", "Do nothing, look pretty.", "catsplosion", "Do nothing, look pretty.",
catsplosion, false, catsplosion, false,

@ -80,14 +80,10 @@ command_result df_frozenwater (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("frozen");
{
return "frozen";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("frozenlava", "Changes all ice into frozen magma.", df_frozenlava)); commands.push_back(PluginCommand("frozenlava", "Changes all ice into frozen magma.", df_frozenlava));
commands.push_back(PluginCommand("frozenwater", "Changes all ice into frozen water.", df_frozenwater)); commands.push_back(PluginCommand("frozenwater", "Changes all ice into frozen water.", df_frozenwater));
return CR_OK; return CR_OK;

@ -155,7 +155,6 @@ DFhackCExport const char * plugin_name ( void )
DFhackCExport command_result plugin_init ( Core * c, DFhackCExport command_result plugin_init ( Core * c,
std::vector <PluginCommand> &commands) std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("dumpitems", commands.push_back(PluginCommand("dumpitems",
"Dump items\ "Dump items\
\n Options:\ \n Options:\

@ -34,14 +34,10 @@ command_result trackpos (Core * c, vector <string> & parameters);
command_result colormods (Core * c, vector <string> & parameters); command_result colormods (Core * c, vector <string> & parameters);
command_result zoom (Core * c, vector <string> & parameters); command_result zoom (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("kittens");
{
return "kittens";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("nyan","NYAN CAT INVASION!",kittens, true)); commands.push_back(PluginCommand("nyan","NYAN CAT INVASION!",kittens, true));
commands.push_back(PluginCommand("ktimer","Measure time between game updates and console lag (toggle).",ktimer)); commands.push_back(PluginCommand("ktimer","Measure time between game updates and console lag (toggle).",ktimer));
commands.push_back(PluginCommand("trackmenu","Track menu ID changes (toggle).",trackmenu)); commands.push_back(PluginCommand("trackmenu","Track menu ID changes (toggle).",trackmenu));

@ -30,14 +30,10 @@ enum HEXVIEW_STATES
}; };
command_result memview (Core * c, vector <string> & parameters); command_result memview (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("memview");
{
return "memview";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("memview","Shows memory in real time. Params: adrr length refresh_rate. If addr==0 then stop viewing",memview)); commands.push_back(PluginCommand("memview","Shows memory in real time. Params: adrr length refresh_rate. If addr==0 then stop viewing",memview));
memdata.state=STATE_OFF; memdata.state=STATE_OFF;
mymutex=new tthread::mutex; mymutex=new tthread::mutex;

@ -12,14 +12,10 @@ using namespace DFHack;
command_result df_notes (Core * c, vector <string> & parameters); command_result df_notes (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("notes");
{
return "notes";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("dumpnotes", commands.push_back(PluginCommand("dumpnotes",
"Dumps in-game notes", "Dumps in-game notes",
df_notes)); df_notes));

@ -19,14 +19,10 @@ uint64_t timeLast = 0;
command_result rawdump_i (Core * c, vector <string> & parameters); command_result rawdump_i (Core * c, vector <string> & parameters);
command_result rawdump_p (Core * c, vector <string> & parameters); command_result rawdump_p (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("rawdump");
{
return "rawdump";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("dump_inorganic","Dump inorganic raws.",rawdump_i)); commands.push_back(PluginCommand("dump_inorganic","Dump inorganic raws.",rawdump_i));
commands.push_back(PluginCommand("dump_plants","Dump plant raws.",rawdump_p)); commands.push_back(PluginCommand("dump_plants","Dump plant raws.",rawdump_p));
return CR_OK; return CR_OK;

@ -199,14 +199,10 @@ struct Settings
Brush * brush; Brush * brush;
} settings; } settings;
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("tiles");
{
return "tiles";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("tiles", "A tile painter. See 'tile help' for details.", df_tiles)); commands.push_back(PluginCommand("tiles", "A tile painter. See 'tile help' for details.", df_tiles));
commands.push_back(PluginCommand("paint", "Paint with the current tiles settings.", df_paint)); commands.push_back(PluginCommand("paint", "Paint with the current tiles settings.", df_paint));
return CR_OK; return CR_OK;

@ -21,17 +21,13 @@ using df::global::world;
// mostly to allow having the mandatory stuff on top of the file and commands on the bottom // mostly to allow having the mandatory stuff on top of the file and commands on the bottom
command_result tilesieve (Core * c, std::vector <std::string> & parameters); command_result tilesieve (Core * c, std::vector <std::string> & parameters);
// A plugins must be able to return its name. This must correspond to the filename - skeleton.plug.so or skeleton.plug.dll // A plugin must be able to return its name. This must correspond to the filename - skeleton.plug.so or skeleton.plug.dll
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("tilesieve");
{
return "tilesieve";
}
// Mandatory init function. If you have some global state, create it here. // Mandatory init function. If you have some global state, create it here.
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
// Fill the command list with your commands. // Fill the command list with your commands.
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"tilesieve", "Scan map for unknown tiles.", "tilesieve", "Scan map for unknown tiles.",
tilesieve, false, /* true means that the command can't be used from non-interactive user interface */ tilesieve, false, /* true means that the command can't be used from non-interactive user interface */

@ -29,15 +29,10 @@ command_result df_vectors (Core * c,
command_result df_clearvec (Core * c, command_result df_clearvec (Core * c,
vector <string> & parameters); vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("vectors");
{
return "vectors";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("vectors", commands.push_back(PluginCommand("vectors",
"Scan memory for vectors.\ "Scan memory for vectors.\
\n 1st param: start of scan\ \n 1st param: start of scan\

@ -1 +1 @@
Subproject commit 23fbb78edaff35a62887803e178a24f9148ffc84 Subproject commit f149da6efead3c46845d7478d1ff3d11119c589d

@ -17,6 +17,8 @@ using namespace df::enums;
using df::global::world; using df::global::world;
DFHACK_PLUGIN("drybuckets");
command_result df_drybuckets (Core * c, vector <string> & parameters) command_result df_drybuckets (Core * c, vector <string> & parameters)
{ {
if (!parameters.empty()) if (!parameters.empty())
@ -39,14 +41,8 @@ command_result df_drybuckets (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void )
{
return "drybuckets";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("drybuckets", "Removes water from buckets.", df_drybuckets)); commands.push_back(PluginCommand("drybuckets", "Removes water from buckets.", df_drybuckets));
return CR_OK; return CR_OK;
} }

@ -35,17 +35,12 @@ using df::global::world;
// mostly to allow having the mandatory stuff on top of the file and commands on the bottom // mostly to allow having the mandatory stuff on top of the file and commands on the bottom
command_result export_dwarves (Core * c, std::vector <std::string> & parameters); command_result export_dwarves (Core * c, std::vector <std::string> & parameters);
// A plugins must be able to return its name. This must correspond to the filename - export.plug.so or export.plug.dll DFHACK_PLUGIN("dwarfexport");
DFhackCExport const char * plugin_name ( void )
{
return "dwarfexport";
}
// Mandatory init function. If you have some global state, create it here. // Mandatory init function. If you have some global state, create it here.
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
// Fill the command list with your commands. // Fill the command list with your commands.
commands.clear();
commands.push_back(PluginCommand("dwarfexport", commands.push_back(PluginCommand("dwarfexport",
"Export dwarves to RuneSmith-compatible XML.", "Export dwarves to RuneSmith-compatible XML.",
export_dwarves /*, export_dwarves /*,

@ -16,10 +16,7 @@ using df::global::world;
using df::global::ui; using df::global::ui;
// dfhack interface // dfhack interface
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("fastdwarf");
{
return "fastdwarf";
}
DFhackCExport command_result plugin_shutdown ( Core * c ) DFhackCExport command_result plugin_shutdown ( Core * c )
{ {
@ -68,8 +65,6 @@ static command_result fastdwarf (Core * c, vector <string> & parameters)
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("fastdwarf", commands.push_back(PluginCommand("fastdwarf",
"enable/disable fastdwarf (parameter=0/1)", "enable/disable fastdwarf (parameter=0/1)",
fastdwarf)); fastdwarf));

@ -34,14 +34,10 @@ void allNormal(DFCoord coord, MapExtras::MapCache & map);
void allLow(DFCoord coord, MapExtras::MapCache & map); void allLow(DFCoord coord, MapExtras::MapCache & map);
void allRestricted(DFCoord coord, MapExtras::MapCache & map); void allRestricted(DFCoord coord, MapExtras::MapCache & map);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("filltraffic");
{
return "filltraffic";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"filltraffic","Flood-fill with selected traffic designation from cursor", "filltraffic","Flood-fill with selected traffic designation from cursor",
filltraffic, cursor_hotkey, filltraffic, cursor_hotkey,

@ -224,14 +224,10 @@ command_result df_fixmerchants (Core *c, vector<string> &parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("fixpositions");
{
return "fixpositions";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"fixdiplomats", "Add Diplomat position to Elven civilizations for tree cap diplomacy.", "fixdiplomats", "Add Diplomat position to Elven civilizations for tree cap diplomacy.",
df_fixdiplomats, false)); df_fixdiplomats, false));

@ -97,14 +97,10 @@ command_result df_fixveins (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("fixveins");
{
return "fixveins";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("fixveins", commands.push_back(PluginCommand("fixveins",
"Remove invalid references to mineral inclusions and restore missing ones.", "Remove invalid references to mineral inclusions and restore missing ones.",
df_fixveins)); df_fixveins));

@ -84,14 +84,10 @@ command_result df_fixwagons (Core *c, vector<string> &parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("fixwagons");
{
return "fixwagons";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"fixwagons", "Fix all civilizations to be able to bring wagons.", "fixwagons", "Fix all civilizations to be able to bring wagons.",
df_fixwagons, false, df_fixwagons, false,

@ -56,14 +56,10 @@ command_result df_flows (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("flows");
{
return "flows";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand("flows", commands.push_back(PluginCommand("flows",
"Counts map blocks with flowing liquids.", "Counts map blocks with flowing liquids.",
df_flows)); df_flows));

@ -22,15 +22,10 @@ command_result follow (Core * c, std::vector <std::string> & parameters);
df::unit *followedUnit; df::unit *followedUnit;
int32_t prevX, prevY, prevZ; int32_t prevX, prevY, prevZ;
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("follow");
{
return "follow";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"follow", "Follow the selected unit until camera control is released", "follow", "Follow the selected unit until camera control is released",
follow, false, follow, false,

@ -134,14 +134,10 @@ command_result df_getplants (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("getplants");
{
return "getplants";
}
DFhackCExport command_result plugin_init ( Core * c, vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, vector <PluginCommand> &commands)
{ {
commands.clear();
commands.push_back(PluginCommand( commands.push_back(PluginCommand(
"getplants", "Cut down all of the specified trees or gather specified shrubs", "getplants", "Cut down all of the specified trees or gather specified shrubs",
df_getplants, false, df_getplants, false,

@ -17,14 +17,10 @@ using df::global::d_init;
command_result twaterlvl(Core * c, vector <string> & parameters); command_result twaterlvl(Core * c, vector <string> & parameters);
command_result tidlers(Core * c, vector <string> & parameters); command_result tidlers(Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("initflags");
{
return "initflags";
}
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
if (d_init) { if (d_init) {
commands.push_back(PluginCommand("twaterlvl", "Toggle display of water/magma depth.", commands.push_back(PluginCommand("twaterlvl", "Toggle display of water/magma depth.",
twaterlvl, dwarfmode_hotkey)); twaterlvl, dwarfmode_hotkey));

@ -45,14 +45,10 @@ static command_result job_material(Core *c, vector <string> & parameters);
static command_result job_duplicate(Core *c, vector <string> & parameters); static command_result job_duplicate(Core *c, vector <string> & parameters);
static command_result job_cmd(Core *c, vector <string> & parameters); static command_result job_cmd(Core *c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("jobutils");
{
return "jobutils";
}
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
{ {
commands.clear();
if (!world || !ui) if (!world || !ui)
return CR_FAILURE; return CR_FAILURE;

@ -24,6 +24,26 @@ using namespace DFHack;
using namespace df::enums; using namespace df::enums;
typedef vector <df::coord> coord_vec; typedef vector <df::coord> coord_vec;
CommandHistory liquids_hist;
command_result df_liquids (Core * c, vector <string> & parameters);
DFHACK_PLUGIN("liquids");
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{
liquids_hist.load("liquids.history");
commands.clear();
commands.push_back(PluginCommand("liquids", "Place magma, water or obsidian.", df_liquids, true));
return CR_OK;
}
DFhackCExport command_result plugin_shutdown ( Core * c )
{
liquids_hist.save("liquids.history");
return CR_OK;
}
class Brush class Brush
{ {
public: public:
@ -200,29 +220,6 @@ private:
Core *c_; Core *c_;
}; };
CommandHistory liquids_hist;
command_result df_liquids (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void )
{
return "liquids";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{
liquids_hist.load("liquids.history");
commands.clear();
commands.push_back(PluginCommand("liquids", "Place magma, water or obsidian.", df_liquids, true));
return CR_OK;
}
DFhackCExport command_result plugin_shutdown ( Core * c )
{
liquids_hist.save("liquids.history");
return CR_OK;
}
command_result df_liquids (Core * c, vector <string> & parameters) command_result df_liquids (Core * c, vector <string> & parameters)
{ {
int32_t x,y,z; int32_t x,y,z;

@ -25,10 +25,7 @@ typedef std::vector<df::plant *> PlantList;
command_result mapexport (Core * c, std::vector <std::string> & parameters); command_result mapexport (Core * c, std::vector <std::string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("mapexport");
{
return "mapexport";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -14,10 +14,7 @@ using namespace DFHack;
command_result mode (Core * c, vector <string> & parameters); command_result mode (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("mode");
{
return "mode";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -24,10 +24,7 @@ command_result df_grow (Core * c, vector <string> & parameters);
command_result df_immolate (Core * c, vector <string> & parameters); command_result df_immolate (Core * c, vector <string> & parameters);
command_result df_extirpate (Core * c, vector <string> & parameters); command_result df_extirpate (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("plants");
{
return "plants";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -34,10 +34,7 @@ using df::global::world;
command_result df_probe (Core * c, vector <string> & parameters); command_result df_probe (Core * c, vector <string> & parameters);
command_result df_cprobe (Core * c, vector <string> & parameters); command_result df_cprobe (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("probe");
{
return "probe";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -179,10 +179,7 @@ void printVeins(DFHack::Console & con, MatMap &mat_map,
command_result prospector (Core * c, vector <string> & parameters); command_result prospector (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("prospector");
{
return "prospector";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -4,7 +4,7 @@
#include <PluginManager.h> #include <PluginManager.h>
#include <modules/Maps.h> #include <modules/Maps.h>
#include <modules/Gui.h> #include <modules/Gui.h>
#include <extra/MapExtras.h> //#include <extra/MapExtras.h>
#include <vector> #include <vector>
#include <cstdio> #include <cstdio>
#include <stack> #include <stack>
@ -25,10 +25,7 @@ static tthread::thread * QTThread;
command_result runqt (Core * c, vector <string> & parameters); command_result runqt (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("qtplug");
{
return "Qt Test";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -52,10 +52,7 @@ command_result df_regrass (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char *plugin_name ( void ) DFHACK_PLUGIN("regrass");
{
return "regrass";
}
DFhackCExport command_result plugin_init (Core *c, std::vector<PluginCommand> &commands) DFhackCExport command_result plugin_init (Core *c, std::vector<PluginCommand> &commands)
{ {

@ -29,10 +29,7 @@ using df::global::world;
static command_result rename(Core * c, vector <string> & parameters); static command_result rename(Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("rename");
{
return "rename";
}
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
{ {

@ -64,10 +64,7 @@ command_result revtoggle(DFHack::Core * c, std::vector<std::string> & params);
command_result revflood(DFHack::Core * c, std::vector<std::string> & params); command_result revflood(DFHack::Core * c, std::vector<std::string> & params);
command_result nopause(DFHack::Core * c, std::vector<std::string> & params); command_result nopause(DFHack::Core * c, std::vector<std::string> & params);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("reveal");
{
return "reveal";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -245,10 +245,7 @@ command_result df_seedwatch(Core* pCore, vector<string>& parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char* plugin_name(void) DFHACK_PLUGIN("seedwatch");
{
return "seedwatch";
}
DFhackCExport command_result plugin_init(Core* pCore, vector<PluginCommand>& commands) DFhackCExport command_result plugin_init(Core* pCore, vector<PluginCommand>& commands)
{ {

@ -13,10 +13,7 @@ using namespace DFHack;
command_result server (Core * c, std::vector <std::string> & parameters); command_result server (Core * c, std::vector <std::string> & parameters);
// A plugins must be able to return its name. This must correspond to the filename - skeleton.plug.so or skeleton.plug.dll // A plugins must be able to return its name. This must correspond to the filename - skeleton.plug.so or skeleton.plug.dll
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("server");
{
return "server";
}
// Mandatory init function. If you have some global state, create it here. // Mandatory init function. If you have some global state, create it here.
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)

@ -266,10 +266,7 @@ command_result df_showmood (Core * c, vector <string> & parameters)
return CR_OK; return CR_OK;
} }
DFhackCExport const char *plugin_name ( void ) DFHACK_PLUGIN("showmood");
{
return "showmood";
}
DFhackCExport command_result plugin_init (Core *c, std::vector<PluginCommand> &commands) DFhackCExport command_result plugin_init (Core *c, std::vector<PluginCommand> &commands)
{ {

@ -21,11 +21,9 @@ using namespace df::enums;
// mostly to allow having the mandatory stuff on top of the file and commands on the bottom // mostly to allow having the mandatory stuff on top of the file and commands on the bottom
command_result skeleton (Core * c, std::vector <std::string> & parameters); command_result skeleton (Core * c, std::vector <std::string> & parameters);
// A plugins must be able to return its name. This must correspond to the filename - skeleton.plug.so or skeleton.plug.dll // A plugin must be able to return its name and version.
DFhackCExport const char * plugin_name ( void ) // The name string provided must correspond to the filename - skeleton.plug.so or skeleton.plug.dll in this case
{ DFHACK_PLUGIN("skeleton");
return "skeleton";
}
// Mandatory init function. If you have some global state, create it here. // Mandatory init function. If you have some global state, create it here.
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
@ -48,7 +46,7 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
DFhackCExport command_result plugin_shutdown ( Core * c ) DFhackCExport command_result plugin_shutdown ( Core * c )
{ {
// You *MUST* kill all threads you created before this returns. // You *MUST* kill all threads you created before this returns.
// If everythin fails, just return CR_FAILURE. Your plugin will be // If everything fails, just return CR_FAILURE. Your plugin will be
// in a zombie state, but things won't crash. // in a zombie state, but things won't crash.
return CR_OK; return CR_OK;
} }

@ -25,10 +25,7 @@ using df::building_stockpilest;
static command_result copystock(Core *c, vector <string> & parameters); static command_result copystock(Core *c, vector <string> & parameters);
static bool copystock_guard(Core *c, df::viewscreen *top); static bool copystock_guard(Core *c, df::viewscreen *top);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("stockpiles");
{
return "stockpiles";
}
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
{ {

@ -1 +1 @@
Subproject commit 852f0452d13578dccd9971518a3627cc29e8abf6 Subproject commit 37aaaca12d719ab47faedd1570158f37ad0362c7

@ -635,10 +635,7 @@ CommandHistory tiletypes_hist;
command_result df_tiletypes (Core * c, vector <string> & parameters); command_result df_tiletypes (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("tiletypes");
{
return "tiletypes";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -20,10 +20,7 @@ using df::global::world;
command_result tubefill(DFHack::Core * c, std::vector<std::string> & params); command_result tubefill(DFHack::Core * c, std::vector<std::string> & params);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("tubefill");
{
return "tubefill";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -23,10 +23,7 @@ command_result expdig (Core * c, vector <string> & parameters);
command_result digcircle (Core *c, vector <string> & parameters); command_result digcircle (Core *c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("vdig");
{
return "vdig";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -29,10 +29,7 @@ DFTileSurface* tiles[10];
char* file = "Cooz_curses_square_16x16.png"; char* file = "Cooz_curses_square_16x16.png";
Gui* gui; Gui* gui;
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("versionosd");
{
return "versionosd";
}
DFTileSurface* createTile(int x, int y) DFTileSurface* createTile(int x, int y)
{ {

@ -15,10 +15,7 @@ unsigned char locked_data[25];
command_result weather (Core * c, vector <string> & parameters); command_result weather (Core * c, vector <string> & parameters);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("weather");
{
return "weather";
}
DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
{ {

@ -55,10 +55,7 @@ static command_result workflow_cmd(Core *c, vector <string> & parameters);
static void init_state(Core *c); static void init_state(Core *c);
static void cleanup_state(Core *c); static void cleanup_state(Core *c);
DFhackCExport const char * plugin_name ( void ) DFHACK_PLUGIN("workflow");
{
return "workflow";
}
DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands) DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands)
{ {