~ubuntu-branches/ubuntu/trusty/pd-zexy/trusty-proposed

« back to all changes in this revision

Viewing changes to src/length.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard, IOhannes m zmölnig, Jonas Smedegaard
  • Date: 2010-08-20 12:17:41 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100820121741-4kxozn8b9rhee9fr
Tags: 2.2.3-1
* New upstream version

[ IOhannes m zmölnig ]
* Adopt package, on behalf of Multimedia Team.
  Closes: #546964
* Simply debian/rules with CDBS, and don't unconditionally strip
  binaries.
  Closes: #437763
* Install into /usr/lib/pd/extra/zexy/. Document usage in REAME.Debian
  and warn about change in NEWS.
* git'ify package. Add Vcs-* stanzas to control file.
* Use dpkg source format 3.0 (quilt). Drop build-dependency on quilt.

[ Jonas Smedegaard ]
* Enable CDBS copyright-check routine.
* Add copyright and licensing header to debian/rules.
* Add myself as uploader.
* Rewrite debian/copyright using rev. 135 of draft DEP5 format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/******************************************************
 
2
 *
 
3
 * zexy - implementation file
 
4
 *
 
5
 * copyleft (c) IOhannes m zm�lnig
 
6
 *
 
7
 *   1999:forum::f�r::uml�ute:2004
 
8
 *
 
9
 *   institute of electronic music and acoustics (iem)
 
10
 *
 
11
 ******************************************************
 
12
 *
 
13
 * license: GNU General Public License v.2
 
14
 ******************************************************/
 
15
 
 
16
/* length :: get the length of a list */
 
17
 
 
18
 
 
19
#include "zexy.h"
 
20
 
 
21
static t_class *length_class;
 
22
typedef struct _length
 
23
{
 
24
  t_object x_obj;
 
25
} t_length;
 
26
 
 
27
static void length_list(t_length *x, t_symbol *s, int argc, t_atom *argv)
 
28
{
 
29
  ZEXY_USEVAR(s);
 
30
  ZEXY_USEVAR(argv);
 
31
  outlet_float(x->x_obj.ob_outlet, (t_float)argc);
 
32
}
 
33
static void length_any(t_length *x, t_symbol *s, int argc, t_atom *argv)
 
34
{
 
35
  ZEXY_USEVAR(s);
 
36
  ZEXY_USEVAR(argv);
 
37
  outlet_float(x->x_obj.ob_outlet, (t_float)argc+1);
 
38
}
 
39
 
 
40
static void *length_new(void)
 
41
{
 
42
  t_length *x = (t_length *)pd_new(length_class);
 
43
  outlet_new(&x->x_obj, &s_float);
 
44
  return (x);
 
45
}
 
46
 
 
47
void length_setup(void)
 
48
{
 
49
  length_class = class_new(gensym("length"), (t_newmethod)length_new, 0,
 
50
                         sizeof(t_length), 0, A_DEFFLOAT, 0);
 
51
 
 
52
  class_addlist(length_class, (t_method)length_list);
 
53
  class_addanything(length_class, (t_method)length_any);
 
54
 
 
55
  zexy_register("length");
 
56
}