Update of /cvsroot/pure-data/externals/k_cext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14041
Modified Files: k_cext.c k_cext.h Log Message: support for $0 values
Index: k_cext.h =================================================================== RCS file: /cvsroot/pure-data/externals/k_cext/k_cext.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** k_cext.h 20 Jun 2004 14:39:51 -0000 1.2 --- k_cext.h 29 Jun 2004 20:49:31 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- #include <math.h> #include <stdbool.h> + #include <ctype.h> #ifdef _MSC_VER typedef int bool; *************** *** 108,114 ****
/* TB: values and bang outlets */ - #define VALUE(char) (*(value_get(gensym(char)))) - #define SETVALUE(char,float) value_setfloat(gensym(char),float) #define Ob(a) outlet_bang(x->outlets[a]);
--- 109,117 ----
/* TB: values and bang outlets */ #define Ob(a) outlet_bang(x->outlets[a]); + t_float k_cext_getvalue(char c[]); + int k_cext_setvalue(char c[],float f); + #define VALUE(char) k_cext_getvalue(char) + #define SETVALUE(char,float) k_cext_setvalue(char,float)
Index: k_cext.c =================================================================== RCS file: /cvsroot/pure-data/externals/k_cext/k_cext.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** k_cext.c 8 Jan 2004 14:55:24 -0000 1.1 --- k_cext.c 29 Jun 2004 20:49:31 -0000 1.2 *************** *** 33,37 **** static t_class *k_cfunc_class;
- int k_cext_intcompare(const void *p1, const void *p2) { --- 33,36 ---- *************** *** 334,335 **** --- 333,353 ---- k_cext_setup(); } + + /* TB: for accessing $0 values */ + t_float k_cext_getvalue(char c[]) + { + while ( isspace(c[0]) ) + { + c++; + } + return (*(value_get(gensym(c)))); + } + + int k_cext_setvalue(char c[],float f) + { + while ( isspace(c[0]) ) + { + c++; + } + return value_setfloat(gensym(c),f); + }