/* --------------------------- k_strcat ----------------------------------- */ /* */ /* */ /* This program is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU General Public License */ /* as published by the Free Software Foundation; either version 2 */ /* of the License, or (at your option) any later version. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* */ /* ---------------------------------------------------------------------------- */ #include "m_pd.h" #include #include #include static char *version = "k_strcat v0.1, written by Kjetil S. Matheussen, k.s.matheussen@notam02.no"; typedef struct k_strcat { t_object x_obj; t_inlet *inmin; /* inlet */ t_inlet *inmax; /* inlet */ t_outlet *x_outlet; /* result */ char string[500]; } t_k_strcat; static void k_strcat_bang(t_k_strcat *x) { post("bang"); } static void k_strcat_symbol(t_k_strcat *x, t_symbol *s) { char *first=s->s_name; char temp[500]; // t_symbol *send; sprintf(temp,"%s%s",first,x->string); // send=gensy outlet_symbol(x->x_obj.ob_outlet, gensym(temp)); } static t_class *k_strcat_class; static void *k_strcat_new(t_symbol *s, t_int argc, t_atom* argv) { int i; t_k_strcat *x = (t_k_strcat *)pd_new(k_strcat_class); x->x_outlet = outlet_new(&x->x_obj, gensym("symbol")); // x->in = symbolinlet_new(&x->x_obj, &x->minval); if(argc>0) sprintf(x->string,"%s",atom_getsymbolarg(0,argc,argv)->s_name); return (void *)x; } void k_strcat_setup(void) { k_strcat_class = class_new(gensym("k_strcat"), (t_newmethod)k_strcat_new, NULL, sizeof(t_k_strcat), 0, A_GIMME, 0); class_addbang(k_strcat_class, (t_method)k_strcat_bang); class_addsymbol(k_strcat_class, k_strcat_symbol); class_sethelpsymbol(k_strcat_class, gensym("help-k_strcat.pd")); post(version); }