From c8f3e3674f08bf56407e478c3160c4392196c118 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 30 Jul 2003 21:52:27 +0000 Subject: separated out all objects into individual files; created a few missing help files; moves all help files to new 0.37 help- standard; removed [reson~] and [abs~] since they are now maintained elsewhere; created Makefile for Linux and Darwin svn path=/trunk/externals/markex/; revision=806 --- strcat.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 strcat.c (limited to 'strcat.c') diff --git a/strcat.c b/strcat.c new file mode 100644 index 0000000..4c23144 --- /dev/null +++ b/strcat.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1997-1999 Mark Danks. + * For information on usage and redistribution, and for a DISCLAIMER OF ALL + * WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution. + */ + +#include "m_pd.h" +#include + +/* -------------------------- strcat ------------------------------ */ + +/* instance structure */ + +static t_class *strcat_class; + +typedef struct _strcat +{ + t_object x_obj; /* obligatory object header */ + t_symbol *a_text; /* the first part of the text */ + t_symbol *a_symbol; /* the last symbol sent out */ + t_outlet *t_out1; /* the outlet */ +} t_strcat; + +void strcat_sym(t_strcat *x, t_symbol *sym) +{ + char temp[64]; + sprintf(temp, "%s%s", x->a_text->s_name, sym->s_name); + x->a_symbol = gensym(temp); + outlet_symbol(x->t_out1, x->a_symbol); +} + +void strcat_float(t_strcat *x, t_floatarg n) +{ + char temp[64]; + sprintf(temp, "%s%f", x->a_text->s_name, n); + x->a_symbol = gensym(temp); + outlet_symbol(x->t_out1, x->a_symbol); +} + +void strcat_bang(t_strcat *x) +{ + outlet_symbol(x->t_out1, x->a_symbol); +} + +void *strcat_new(t_symbol *textname) /* init vals in struc */ +{ + t_strcat *x = (t_strcat *)pd_new(strcat_class); + x->t_out1 = outlet_new(&x->x_obj, 0); + x->a_text = textname; + x->a_symbol = textname; + return (x); +} + +void strcat_setup(void) +{ + strcat_class = class_new(gensym("strcat"), (t_newmethod)strcat_new, 0, + sizeof(t_strcat), 0, A_SYMBOL, 0); + class_addsymbol(strcat_class, (t_method)strcat_sym); + class_addfloat(strcat_class, (t_method)strcat_float); + class_addbang(strcat_class, (t_method)strcat_bang); + + class_sethelpsymbol(strcat_class, gensym("help-strcat")); +} + -- cgit v1.2.1