summaryrefslogtreecommitdiff
path: root/plugins/deramp.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-10 15:55:42 +0400
committerAlexander Gavrilov2012-03-10 15:55:42 +0400
commit8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b (patch)
tree4be7625f1bbe15b81d00373316047137d3422464 /plugins/deramp.cpp
parentb2737e2bed5f013a4dfbf6e19650ca60498a9afd (diff)
downloaddfhack-8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b.tar.gz
dfhack-8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b.tar.bz2
dfhack-8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b.tar.xz
Make plugins accept explicit output stream references.
This is an incompatible change to the plugin ABI. The Console is not thread-safe unless used indirectly via color_ostream_proxy, so everything should use their per-thread stream.
Diffstat (limited to 'plugins/deramp.cpp')
-rw-r--r--plugins/deramp.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/deramp.cpp b/plugins/deramp.cpp
index 75b99cff..c872f33d 100644
--- a/plugins/deramp.cpp
+++ b/plugins/deramp.cpp
@@ -18,16 +18,16 @@ using df::global::world;
DFHACK_PLUGIN("deramp");
-command_result df_deramp (Core * c, vector <string> & parameters)
+command_result df_deramp (color_ostream &out, vector <string> & parameters)
{
if (!parameters.empty())
return CR_WRONG_USAGE;
- CoreSuspender suspend(c);
+ CoreSuspender suspend;
if (!Maps::IsValid())
{
- c->con.printerr("Map is not available!\n");
+ out.printerr("Map is not available!\n");
return CR_FAILURE;
}
@@ -75,13 +75,13 @@ command_result df_deramp (Core * c, vector <string> & parameters)
}
}
if (count)
- c->con.print("Found and changed %d tiles.\n", count);
+ out.print("Found and changed %d tiles.\n", count);
if (countbad)
- c->con.print("Fixed %d bad down ramps.\n", countbad);
+ out.print("Fixed %d bad down ramps.\n", countbad);
return CR_OK;
}
-DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands)
+DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands)
{
commands.push_back(PluginCommand(
"deramp", "De-ramp. All ramps marked for removal are replaced with floors.",
@@ -93,7 +93,7 @@ DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand>
return CR_OK;
}
-DFhackCExport command_result plugin_shutdown ( Core * c )
+DFhackCExport command_result plugin_shutdown ( color_ostream &out )
{
return CR_OK;
}