about summary refs log tree commit diff
path: root/src/libutil/aterm.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-09-04T21·06+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-09-04T21·06+0000
commit75068e7d753cf6cbe45a4bf294000dca9bd41d8b (patch)
treec6274cc10caab08349b5585206034f41ca4a575f /src/libutil/aterm.cc
parentaab88127321344d5818d823bff515d127108d058 (diff)
* Use a proper namespace.
* Optimise header file usage a bit.
* Compile the parser as C++.

Diffstat (limited to 'src/libutil/aterm.cc')
-rw-r--r--src/libutil/aterm.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libutil/aterm.cc b/src/libutil/aterm.cc
index 6ca4521909ea..bb6e33ce92c0 100644
--- a/src/libutil/aterm.cc
+++ b/src/libutil/aterm.cc
@@ -1,7 +1,9 @@
 #include "aterm.hh"
 
+using std::string;
 
-string atPrint(ATerm t)
+
+string nix::atPrint(ATerm t)
 {
     if (!t) throw Error("attempt to print null aterm");
     char * s = ATwriteToString(t);
@@ -10,13 +12,13 @@ string atPrint(ATerm t)
 }
 
 
-ostream & operator << (ostream & stream, ATerm e)
+std::ostream & operator << (std::ostream & stream, ATerm e)
 {
-    return stream << atPrint(e);
+    return stream << nix::atPrint(e);
 }
 
 
-Error badTerm(const format & f, ATerm t)
+nix::Error nix::badTerm(const format & f, ATerm t)
 {
     char * s = ATwriteToString(t);
     if (!s) throw Error("cannot print term");
@@ -29,13 +31,13 @@ Error badTerm(const format & f, ATerm t)
 }
 
 
-ATerm toATerm(const char * s)
+ATerm nix::toATerm(const char * s)
 {
     return (ATerm) ATmakeAppl0(ATmakeAFun((char *) s, 0, ATtrue));
 }
 
 
-ATerm toATerm(const string & s)
+ATerm nix::toATerm(const string & s)
 {
     return toATerm(s.c_str());
 }