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/sl.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100755 control/sl.c (limited to 'control/sl.c') diff --git a/control/sl.c b/control/sl.c new file mode 100755 index 0000000..2c94cb5 --- /dev/null +++ b/control/sl.c @@ -0,0 +1,73 @@ +/* (C) Guenter Geiger */ + + +#include +#include +#ifdef NT +#pragma warning( disable : 4244 ) +#pragma warning( disable : 4305 ) +#endif + + +/* -------------------- lsend ------------------------------ */ + +static t_class *lsend_class; + +typedef struct _lsend +{ + t_object x_obj; + t_symbol *x_sym; +} t_lsend; + +static void lsend_bang(t_lsend *x) +{ + if (x->x_sym->s_thing) pd_bang(x->x_sym->s_thing); +} + +static void lsend_float(t_lsend *x, t_float f) +{ + if (x->x_sym->s_thing) pd_float(x->x_sym->s_thing, f); +} + +static void lsend_symbol(t_lsend *x, t_symbol *s) +{ + if (x->x_sym->s_thing) pd_symbol(x->x_sym->s_thing, s); +} + +static void lsend_pointer(t_lsend *x, t_gpointer *gp) +{ + if (x->x_sym->s_thing) pd_pointer(x->x_sym->s_thing, gp); +} + +static void lsend_list(t_lsend *x, t_symbol *s, int argc, t_atom *argv) +{ + if (x->x_sym->s_thing) pd_list(x->x_sym->s_thing, s, argc, argv); +} + +static void lsend_anything(t_lsend *x, t_symbol *s, int argc, t_atom *argv) +{ + if (x->x_sym->s_thing) typedmess(x->x_sym->s_thing, s, argc, argv); +} + +static void *lsend_new(t_symbol *s) +{ + t_lsend *x = (t_lsend *)pd_new(lsend_class); + char mysym[MAXPDSTRING]; + + sprintf(mysym,"%s%p",s->s_name,canvas_getcurrent()); + x->x_sym = gensym(mysym); + return (x); +} + +void sl_setup(void) +{ + lsend_class = class_new(gensym("sendlocal"), (t_newmethod)lsend_new, 0, + sizeof(t_lsend), 0, A_DEFSYM, 0); + class_addcreator((t_newmethod)lsend_new, gensym("sl"), A_DEFSYM, 0); + class_addbang(lsend_class, lsend_bang); + class_addfloat(lsend_class, lsend_float); + class_addsymbol(lsend_class, lsend_symbol); + class_addpointer(lsend_class, lsend_pointer); + class_addlist(lsend_class, lsend_list); + class_addanything(lsend_class, lsend_anything); +} -- cgit v1.2.1