diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-11-03 18:12:03 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-11-03 18:12:03 +0000 |
commit | cb7ccb528bbaeb30d09fbb41e57ab75d3121e1bc (patch) | |
tree | d27270a2b3c6abc86f56956d906899374778f028 /src/libutil | |
parent | 4cbd845aa491b5cf534f8c031d285fc454933868 (diff) | |
download | guix-cb7ccb528bbaeb30d09fbb41e57ab75d3121e1bc.tar.gz |
* string2ATerm -> overloaded toATerm.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/aterm.cc | 12 | ||||
-rw-r--r-- | src/libutil/aterm.hh | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/libutil/aterm.cc b/src/libutil/aterm.cc index 77bf8dab4c..6ca4521909 100644 --- a/src/libutil/aterm.cc +++ b/src/libutil/aterm.cc @@ -27,3 +27,15 @@ Error badTerm(const format & f, ATerm t) } return Error(format("%1%, in `%2%'") % f.str() % (string) s); } + + +ATerm toATerm(const char * s) +{ + return (ATerm) ATmakeAppl0(ATmakeAFun((char *) s, 0, ATtrue)); +} + + +ATerm toATerm(const string & s) +{ + return toATerm(s.c_str()); +} diff --git a/src/libutil/aterm.hh b/src/libutil/aterm.hh index 883d20c63a..22364ba011 100644 --- a/src/libutil/aterm.hh +++ b/src/libutil/aterm.hh @@ -41,4 +41,9 @@ public: Error badTerm(const format & f, ATerm t); +/* Convert strings to ATerms. */ +ATerm toATerm(const char * s); +ATerm toATerm(const string & s); + + #endif /* !__ATERM_H */ |