Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17699
Modified Files: Tag: desiredata kernel.c Log Message: added atom_getstring() and atom_getstringarg().
Index: kernel.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v retrieving revision 1.1.2.69 retrieving revision 1.1.2.70 diff -C2 -d -r1.1.2.69 -r1.1.2.70 *** kernel.c 20 Jul 2007 21:23:23 -0000 1.1.2.69 --- kernel.c 30 Jul 2007 02:59:58 -0000 1.1.2.70 *************** *** 205,211 **** safe to return if there's an error. */
! t_float atom_getfloat( t_atom *a) {return a->a_type==A_FLOAT ? a->a_float : 0;} ! t_int atom_getint( t_atom *a) {return (t_int)atom_getfloat(a);} ! t_symbol *atom_getsymbol(t_atom *a) {return a->a_type==A_SYMBOL ? a->a_symbol : &s_symbol;}
t_symbol *atom_gensym(t_atom *a) { /* this works better for graph labels */ --- 205,212 ---- safe to return if there's an error. */
! t_float atom_getfloat( t_atom *a) {return a->a_type==A_FLOAT ? a->a_float : 0;} ! t_int atom_getint( t_atom *a) {return (t_int)atom_getfloat(a);} ! t_symbol * atom_getsymbol(t_atom *a) {return a->a_type==A_SYMBOL ? a->a_symbol : &s_symbol;} ! const char *atom_getstring(t_atom *a) {return atom_getsymbol(a)->name;}
t_symbol *atom_gensym(t_atom *a) { /* this works better for graph labels */ *************** *** 230,233 **** --- 231,238 ---- }
+ const char *atom_getstringarg(int which, int argc, t_atom *argv) { + return atom_getsymbolarg(which,argc,argv)->name; + } + /* convert an atom into a string, in the reverse sense of binbuf_text (q.v.) * special attention is paid to symbols containing the special characters *************** *** 2226,2236 **** for (i = 0; i < natom; i++) { if (nextmess[i].a_type == A_DOLLAR) { ! char buf[100]; ! sprintf(buf, "$%ld", nextmess[i].a_index); ! SETSYMBOL(nextmess+i, gensym(buf)); } else if (nextmess[i].a_type == A_DOLLSYM) { ! char buf[100]; ! sprintf(buf, "%s", nextmess[i].a_symbol->name); ! SETSYMBOL(nextmess+i, gensym(buf)); } } --- 2231,2237 ---- for (i = 0; i < natom; i++) { if (nextmess[i].a_type == A_DOLLAR) { ! SETSYMBOL(nextmess+i, symprintf("$%ld",nextmess[i].a_index)); } else if (nextmess[i].a_type == A_DOLLSYM) { ! SETSYMBOL(nextmess+i, gensym(nextmess[i].a_symbol->name)); } }