1
/******************************************************
3
* zexy - implementation file
5
* copyleft (c) IOhannes m zm�lnig
7
* 1999:forum::f�r::uml�ute:2004
9
* institute of electronic music and acoustics (iem)
11
******************************************************
13
* license: GNU General Public License v.2
14
******************************************************/
16
/* length :: get the length of a list */
21
static t_class *length_class;
22
typedef struct _length
27
static void length_list(t_length *x, t_symbol *s, int argc, t_atom *argv)
31
outlet_float(x->x_obj.ob_outlet, (t_float)argc);
33
static void length_any(t_length *x, t_symbol *s, int argc, t_atom *argv)
37
outlet_float(x->x_obj.ob_outlet, (t_float)argc+1);
40
static void *length_new(void)
42
t_length *x = (t_length *)pd_new(length_class);
43
outlet_new(&x->x_obj, &s_float);
47
void length_setup(void)
49
length_class = class_new(gensym("length"), (t_newmethod)length_new, 0,
50
sizeof(t_length), 0, A_DEFFLOAT, 0);
52
class_addlist(length_class, (t_method)length_list);
53
class_addanything(length_class, (t_method)length_any);
55
zexy_register("length");