diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-08-03 02:36:46 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-08-03 02:36:46 +0000 |
commit | 810a63a522ec5c3f05df5b2bc1cf35306bf4accb (patch) | |
tree | dd716016194e96185e27f1d565e001d8cdb2391e /externals/grill/flext/source/flatom_pr.cpp | |
parent | 0dcdd827ba312d0624c9eb169d3970dd4386a4f6 (diff) |
""
svn path=/trunk/; revision=819
Diffstat (limited to 'externals/grill/flext/source/flatom_pr.cpp')
-rw-r--r-- | externals/grill/flext/source/flatom_pr.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/externals/grill/flext/source/flatom_pr.cpp b/externals/grill/flext/source/flatom_pr.cpp index 639bca63..e700df8a 100644 --- a/externals/grill/flext/source/flatom_pr.cpp +++ b/externals/grill/flext/source/flatom_pr.cpp @@ -19,7 +19,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include <stdio.h> // \TODO take bufsz into account! -void flext::PrintAtom(const t_atom &a,char *buf,int bufsz) +bool flext::PrintAtom(const t_atom &a,char *buf,int bufsz) { if(IsFloat(a)) { sprintf(buf,"%g",GetFloat(a)); @@ -35,8 +35,25 @@ void flext::PrintAtom(const t_atom &a,char *buf,int bufsz) } else ERRINTERNAL(); + return true; } +bool flext::AtomList::Print(char *buffer,int buflen) const +{ + bool ok = true; + for(int i = 0; ok && i < Count(); ++i) { + if(i) { *(buffer++) = ' '; --buflen; } // prepend space + if(PrintAtom((*this)[i],buffer,buflen)) { + int len = strlen(buffer); + buffer += len,buflen -= len; + } + else + ok = false; + } + return ok; +} + + bool flext::ScanAtom(t_atom &a,const char *buf) { // skip whitespace |