summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/message.h
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/message.h')
-rw-r--r--crawl-ref/source/message.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/crawl-ref/source/message.h b/crawl-ref/source/message.h
index 3fcf7d881e..96a2094f40 100644
--- a/crawl-ref/source/message.h
+++ b/crawl-ref/source/message.h
@@ -15,6 +15,7 @@
#define MESSAGE_H
#include <string>
+#include <streambuf>
#include "externs.h"
@@ -105,4 +106,34 @@ std::string get_last_messages(int mcount);
int channel_to_colour( int channel, int param = 0 );
+struct setchan
+{
+ setchan(msg_channel_type chan);
+ msg_channel_type m_chan;
+};
+
+struct setparam
+{
+ setparam(int param);
+ int m_param;
+};
+
+std::ostream& operator<<(std::ostream& os, const setchan& sc);
+std::ostream& operator<<(std::ostream& os, const setparam& sp);
+
+class mpr_stream_buf : public std::streambuf
+{
+public:
+ mpr_stream_buf();
+protected:
+ int overflow(int c);
+private:
+ static const int INTERNAL_LENGTH = 500;
+ char internal_buf[500]; // if your terminal is wider than this, too bad
+ int internal_count;
+};
+
+extern std::ostream mpr_stream;
+
+
#endif