From fc3d3c0a4f110a23335398c327ac0a4fc949d5cb Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Mon, 17 Jun 2002 10:13:57 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r12, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/ggee/; revision=13 --- control/prepend.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100755 control/prepend.c (limited to 'control/prepend.c') diff --git a/control/prepend.c b/control/prepend.c new file mode 100755 index 0000000..f2fc4af --- /dev/null +++ b/control/prepend.c @@ -0,0 +1,74 @@ +/* (C) Guenter Geiger */ + + +#include +#ifdef NT +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + +/* ------------------------ prepend ----------------------------- */ + +static t_class *prepend_class; + + +typedef struct _prepend +{ + t_object x_obj; + t_symbol* x_s; +} t_prepend; + + +void prepend_anything(t_prepend *x,t_symbol* s,t_int argc,t_atom* argv) +{ + int i = argc; + t_symbol* cur; + t_atom a_out[256]; + int c_out = 0; + t_atom* a = a_out; + +#if 1 + SETSYMBOL(a,s); + a++; + c_out++; +#endif + while (i--) { + switch( argv->a_type) { + case A_FLOAT: + post("%f",atom_getfloat(argv)); + break; + case A_SYMBOL: + post("%s",atom_getsymbol(argv)->s_name); + SETSYMBOL(a,atom_getsymbol(argv)); + a++; + c_out++; + break; + default: + post("unknown type"); + } + argv++; + } + + outlet_list(x->x_obj.ob_outlet,x->x_s,c_out,(t_atom*)&a_out); + post("done"); +} + +static void *prepend_new(t_symbol* s) +{ + t_prepend *x = (t_prepend *)pd_new(prepend_class); + outlet_new(&x->x_obj, &s_float); + if (s != &s_) + x->x_s = s; + else + x->x_s = gensym("prepend"); + return (x); +} + +void prepend_setup(void) +{ + prepend_class = class_new(gensym("prepend"), (t_newmethod)prepend_new, 0, + sizeof(t_prepend), 0,A_DEFSYM,NULL); + class_addanything(prepend_class,prepend_anything); +} + + -- cgit v1.2.1