aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flattr.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2002-11-25 22:27:34 +0000
committerThomas Grill <xovo@users.sourceforge.net>2002-11-25 22:27:34 +0000
commita55a5773570e56a1fb59887f1215f3d05a055700 (patch)
tree507e32ac5b202cb99366bc416d74fff105aa6711 /externals/grill/flext/source/flattr.cpp
parent286c5cf7f627308f56b94289a8a05ed653923c07 (diff)
""
svn path=/trunk/; revision=243
Diffstat (limited to 'externals/grill/flext/source/flattr.cpp')
-rw-r--r--externals/grill/flext/source/flattr.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/externals/grill/flext/source/flattr.cpp b/externals/grill/flext/source/flattr.cpp
index 20b06e41..2739ae11 100644
--- a/externals/grill/flext/source/flattr.cpp
+++ b/externals/grill/flext/source/flattr.cpp
@@ -14,7 +14,12 @@ WARRANTIES, see the file, "license.txt," in this distribution.
#include "flext.h"
#include <string.h>
-#include <stdio.h>
+
+#ifdef MAXMSP
+#define STD std
+#else
+#define STD
+#endif
flext_base::attritem::attritem(const t_symbol *t,const t_symbol *gt,metharg tp,methfun gf,methfun sf):
tag(t),gtag(gt),argtp(tp),gfun(gf),sfun(sf),nxt(NULL)
@@ -40,8 +45,8 @@ void flext_base::AddAttrItem(attritem *m)
void flext_base::AddAttrib(const char *attr,metharg tp,methfun gfun,methfun sfun)
{
if(procattr) {
- char tmp[1024];
- sprintf(tmp,"get%s",attr);
+ char tmp[256] = "get";
+ strcpy(tmp+3,attr);
AddAttrItem(new attritem(MakeSymbol(attr),MakeSymbol(tmp),tp,gfun,sfun));
AddMethod(0,attr,(methfun)cb_SetAttrib,a_any,a_null);
@@ -80,7 +85,7 @@ bool flext_base::ListAttrib()
attritem *a = attrhead;
for(int i = 0; i < attrcnt; ++i,a = a->nxt) SetSymbol(la[i],a->tag);
- ToOutAnything(outattr,thisTag(),la.Count(),la.Atoms());
+ ToOutAnything(outattr,MakeSymbol("attributes"),la.Count(),la.Atoms());
return true;
}
else
@@ -135,7 +140,7 @@ bool flext_base::SetAttrib(const t_symbol *tag,int argc,const t_atom *argv)
post("%s - attribute %s has no get method",thisName(),GetString(tag));
}
else
- error("%s - %s: attribute not found",thisName(),tag);
+ error("%s - %s: attribute not found",thisName(),GetString(tag));
return true;
}
@@ -184,7 +189,7 @@ bool flext_base::GetAttrib(const t_symbol *tag,int argc,const t_atom *argv)
post("%s - attribute %s has no set method",thisName(),GetString(tag));
}
else
- error("%s - %s: attribute not found",thisName(),tag);
+ error("%s - %s: attribute not found",thisName(),GetString(tag));
return true;
}