From 31f625c4e5eaf443872eece61b9a7156121669d9 Mon Sep 17 00:00:00 2001 From: Thomas O Fredericks Date: Mon, 10 Sep 2007 22:25:41 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r8719, which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/tof/; revision=8720 --- destroysend/destroysend.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 destroysend/destroysend.c (limited to 'destroysend/destroysend.c') diff --git a/destroysend/destroysend.c b/destroysend/destroysend.c new file mode 100644 index 0000000..fbf3466 --- /dev/null +++ b/destroysend/destroysend.c @@ -0,0 +1,50 @@ +// Made by tof@danslchamp.prg + +#include "m_pd.h" +#include +#include + +static t_class *destroysend_class; + +typedef struct _destroysend { + t_object x_obj; + t_symbol *x_sym; //from pd_send +} t_destroysend; + +void destroysend_bang(t_destroysend *x) +{ + //post("Hello world !!"); +//From pd_send + if (x->x_sym->s_thing) pd_bang(x->x_sym->s_thing); +//END +} + + +void *destroysend_new(t_symbol *s) //Added args from pd send +{ + t_destroysend *x = (t_destroysend *)pd_new(destroysend_class); + +//From pd_send + + if (!*s->s_name) symbolinlet_new(&x->x_obj, &x->x_sym); + x->x_sym = s; + +//END + + return (void *)x; //return (x); +} + + +void *destroysend_free(t_destroysend *x) +{ + if (x->x_sym->s_thing) pd_bang(x->x_sym->s_thing); + //post("Killing !!"); + return 0; +} + +void destroysend_setup(void) { + + destroysend_class = class_new(gensym("destroysend"),(t_newmethod)destroysend_new,(t_method)destroysend_free, +sizeof(t_destroysend),0, A_DEFSYM, 0); + class_addbang(destroysend_class, destroysend_bang); +} -- cgit v1.2.1