Update of /cvsroot/pure-data/externals/k_cext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18459
Modified Files: k_cext.c k_cext.h Log Message: $0-aware send macros for float and symbol
Index: k_cext.h =================================================================== RCS file: /cvsroot/pure-data/externals/k_cext/k_cext.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** k_cext.h 9 Aug 2004 14:19:06 -0000 1.6 --- k_cext.h 18 Sep 2004 18:26:02 -0000 1.7 *************** *** 78,84 **** K_EXTERN void k_sys_init(void);
! /* TB value accessing functions*/ K_EXTERN t_float k_cext_getvalue(char c[]); K_EXTERN int k_cext_setvalue(char c[],float f);
--- 78,86 ---- K_EXTERN void k_sys_init(void);
! /* TB value accessing / send functions */ K_EXTERN t_float k_cext_getvalue(char c[]); K_EXTERN int k_cext_setvalue(char c[],float f); + K_EXTERN void k_cext_sendfloat (char c[],float f); + K_EXTERN void k_cext_sendsymbol (char c[],char s[]);
*************** *** 122,125 **** --- 124,133 ---- #define SETVALUE(char,float) k_cext_setvalue(char,float)
+ /* TB: send float and symbol functions */ + void k_cext_sendfloat (char c[],float f); + void k_cext_sendsymbol (char c[],char s[]); + #define SENDFLOAT(char,float) k_cext_sendfloat(char,float) + #define SENDSYMBOL(char1,char2) k_cext_sendsymbol(char1,char2) +
#define IF if(
Index: k_cext.c =================================================================== RCS file: /cvsroot/pure-data/externals/k_cext/k_cext.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** k_cext.c 9 Aug 2004 13:56:13 -0000 1.4 --- k_cext.c 18 Sep 2004 18:26:02 -0000 1.5 *************** *** 354,355 **** --- 354,380 ---- return value_setfloat(gensym(c),f); } + + void k_cext_sendfloat (char c[],float f) + { + static t_symbol *k_cext_internal_symbol=NULL; + while ( isspace(c[0]) ) + { + c++; + } + if(k_cext_internal_symbol==NULL) k_cext_internal_symbol=gensym(c); + if(k_cext_internal_symbol->s_thing) + pd_float(k_cext_internal_symbol->s_thing, f); + } + + void k_cext_sendsymbol (char c[],char s[]) + { + static t_symbol *k_cext_internal_symbol=NULL; + while ( isspace(c[0]) ) + { + c++; + } + if(k_cext_internal_symbol==NULL) + k_cext_internal_symbol=gensym(c); + if(k_cext_internal_symbol->s_thing) + pd_symbol(k_cext_internal_symbol->s_thing, gensym(s)); + }