summaryrefslogtreecommitdiff
path: root/plugins/drybuckets.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/drybuckets.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/drybuckets.cpp')
-rw-r--r--plugins/drybuckets.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/drybuckets.cpp b/plugins/drybuckets.cpp
index 23b63bb4..431edd51 100644
--- a/plugins/drybuckets.cpp
+++ b/plugins/drybuckets.cpp
@@ -19,12 +19,12 @@ using df::global::world;
DFHACK_PLUGIN("drybuckets");
-command_result df_drybuckets (Core * c, vector <string> & parameters)
+command_result df_drybuckets (color_ostream &out, vector <string> & parameters)
{
if (!parameters.empty())
return CR_WRONG_USAGE;
- CoreSuspender suspend(c);
+ CoreSuspender suspend;
int dried_total = 0;
for (size_t i = 0; i < world->items.all.size(); i++)
@@ -37,17 +37,17 @@ command_result df_drybuckets (Core * c, vector <string> & parameters)
}
}
if (dried_total)
- c->con.print("Done. %d buckets of water marked for emptying.\n", dried_total);
+ out.print("Done. %d buckets of water marked for emptying.\n", dried_total);
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("drybuckets", "Removes water from buckets.", df_drybuckets));
return CR_OK;
}
-DFhackCExport command_result plugin_shutdown ( Core * c )
+DFhackCExport command_result plugin_shutdown ( color_ostream &out )
{
return CR_OK;
}