diff options
author | David Robillard <d@drobilla.net> | 2009-03-07 03:52:55 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-03-07 03:52:55 +0000 |
commit | 311e3b43b68209648fe9561d1aaff93d9a4d4f0f (patch) | |
tree | 7eeed8e2019a19c9cf42a0e3952f5f2a72d5b55c /tuplr.hpp | |
parent | 0ef506f38e4a18d11e50fb96c7d6d6c3323a76e0 (diff) | |
download | resp-311e3b43b68209648fe9561d1aaff93d9a4d4f0f.tar.gz resp-311e3b43b68209648fe9561d1aaff93d9a4d4f0f.tar.bz2 resp-311e3b43b68209648fe9561d1aaff93d9a4d4f0f.zip |
Make out and error streams fields of CEnv instead of static globals.
git-svn-id: http://svn.drobilla.net/resp/tuplr@73 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'tuplr.hpp')
-rw-r--r-- | tuplr.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -36,9 +36,6 @@ using boost::format; * Basic Utility Classes * ***************************************************************************/ -extern std::ostream& err; -extern std::ostream& out; - struct Cursor { Cursor(const string& n="", unsigned l=1, unsigned c=0) : name(n), line(l), col(c) {} operator bool() const { return !(line == 1 && col == 0); } @@ -55,6 +52,12 @@ struct Error { Cursor loc; }; +struct Log { + Log(ostream& o, ostream& e) : out(o), err(e) {} + ostream& out; + ostream& err; +}; + template<typename Atom> struct Exp { Exp(Cursor c) : type(LIST), loc(c) {} @@ -465,7 +468,7 @@ struct CEnvPimpl; /// Compile-Time Environment struct CEnv { - CEnv(PEnv& p, TEnv& t, CEngine& engine); + CEnv(PEnv& p, TEnv& t, CEngine& e, ostream& os=std::cout, ostream& es=std::cerr); ~CEnv(); typedef Env<const ASTSymbol*, AST*> Code; @@ -486,6 +489,7 @@ struct CEnv { Vals vals; unsigned symID; CFunction alloc; + Log log; private: CEnvPimpl* _pimpl; |