Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29123
Modified Files: Tag: desiredata builtins.c Log Message: added [parse] and [unparse]
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.29 retrieving revision 1.1.2.30 diff -C2 -d -r1.1.2.29 -r1.1.2.30 *** builtins.c 15 Jul 2007 05:39:51 -0000 1.1.2.29 --- builtins.c 15 Jul 2007 06:02:45 -0000 1.1.2.30 *************** *** 13,16 **** --- 13,17 ---- #include <stdio.h> #include <string.h> + #include <sstream> #ifdef UNISTD #include <sys/types.h> *************** *** 64,67 **** --- 65,71 ---- #undef max
+ //conflict with min,max + //using namespace std; + float mtof(float f) {return f>-1500 ? 8.17579891564 * exp(.0577622650 * min(f,1499.f)) : 0;} float ftom(float f) {return f>0 ? 17.3123405046 * log(.12231220585 * f) : -1500;} *************** *** 3116,3127 **** } void unparse_list (t_unparse *x, t_symbol *s, int argc, t_atom *argv) { ! char buf[MAXPDSTRING]; /* bugger overflow. */ ! int j=0; for (int i=0; i<argc; i++) { ! atom_string(argv+i,buf+j,MAXPDSTRING); ! j+=strlen(buf+j); ! buf[j++]=' '; } ! buf[j]=0; }
--- 3120,3129 ---- } void unparse_list (t_unparse *x, t_symbol *s, int argc, t_atom *argv) { ! std::ostringstream o; char buf[MAXPDSTRING]; /* bugger overflow. */ for (int i=0; i<argc; i++) { ! atom_string(argv+i,buf,MAXPDSTRING); ! o << ' ' << buf; } ! outlet_symbol(x->outlet,gensym(o.str().data()+1)); }
*************** *** 3160,3163 **** --- 3162,3167 ---- unpost_class = class_new2("unpost",unpost_new,0,sizeof(t_unpost),0,""); class_addanything(unpost_class, unpost_anything); + unparse_class = class_new2("unparse",unparse_new,0,sizeof(t_unparse),0,""); + class_addlist(unparse_class, unparse_list); parse_class = class_new2("parse",parse_new,0,sizeof(t_parse),0,""); class_addsymbol(parse_class, parse_symbol);