aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flatom_pr.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-08-01 02:32:50 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-08-01 02:32:50 +0000
commit18dbae9c9ffe5baa09e220c9f74af2dd7c0aa3f5 (patch)
treeb3b42426bd069faf6aed68f6016bd1b4d52794a3 /externals/grill/flext/source/flatom_pr.cpp
parent694319f36d9cad2c8e48e24a7b45338a9d7004a5 (diff)
""
svn path=/trunk/; revision=810
Diffstat (limited to 'externals/grill/flext/source/flatom_pr.cpp')
-rw-r--r--externals/grill/flext/source/flatom_pr.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/externals/grill/flext/source/flatom_pr.cpp b/externals/grill/flext/source/flatom_pr.cpp
index e4989320..639bca63 100644
--- a/externals/grill/flext/source/flatom_pr.cpp
+++ b/externals/grill/flext/source/flatom_pr.cpp
@@ -18,9 +18,23 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include <string.h>
#include <stdio.h>
+// \TODO take bufsz into account!
void flext::PrintAtom(const t_atom &a,char *buf,int bufsz)
{
- GetAString(a,buf,bufsz?bufsz:100000);
+ if(IsFloat(a)) {
+ sprintf(buf,"%g",GetFloat(a));
+ }
+ else if(IsInt(a)) {
+ sprintf(buf,"%i",GetInt(a));
+ }
+ else if(IsSymbol(a)) {
+ strcpy(buf,GetString(a));
+ }
+ else if(IsPointer(a)) {
+ sprintf(buf,"%p",GetPointer(a));
+ }
+ else
+ ERRINTERNAL();
}
bool flext::ScanAtom(t_atom &a,const char *buf)