[PD-cvs] pd/src desire.c, 1.1.2.217.2.96, 1.1.2.217.2.97 kernel.c, 1.1.2.14, 1.1.2.15

Mathieu Bouchard matju at users.sourceforge.net
Sun Dec 31 08:27:24 CET 2006


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26872

Modified Files:
      Tag: desiredata
	desire.c kernel.c 
Log Message:
kernel.c goes C++


Index: kernel.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -C2 -d -r1.1.2.14 -r1.1.2.15
*** kernel.c	28 Dec 2006 20:39:01 -0000	1.1.2.14
--- kernel.c	31 Dec 2006 07:27:21 -0000	1.1.2.15
***************
*** 368,381 ****
      t_bindelem *e; bind_each(e,x) pd_typedmess(e->who, s, argc, argv);}
  
- void m_pd_setup(void) {
-     bindlist_class = class_new(gensym("bindlist"), 0, 0, sizeof(t_bindlist), CLASS_PD, 0);
-     class_addbang(bindlist_class, bindlist_bang);
-     class_addfloat(bindlist_class, (t_method)bindlist_float);
-     class_addsymbol(bindlist_class, bindlist_symbol);
-     class_addpointer(bindlist_class, bindlist_pointer);
-     class_addlist(bindlist_class, bindlist_list);
-     class_addanything(bindlist_class, bindlist_anything);
- }
- 
  static t_bindelem *bindelem_new(t_pd *who, t_bindelem *next) {
  	t_bindelem *self = (t_bindelem *)getbytes(sizeof(t_bindelem));
--- 368,371 ----
***************
*** 520,525 ****
  };
  
- int sys_tooltips = 1;
- 
  struct _inlet {
      t_pd i_pd;
--- 510,513 ----
***************
*** 556,564 ****
      x->i_next = 0;
      x->i_tip = gensym("?");
!     if (y = owner->ob_inlet) {
          while ((y2=y->i_next)) y = y2;
          y->i_next = x;
!     }
!     else owner->ob_inlet = x;
      return x;
  }
--- 544,552 ----
      x->i_next = 0;
      x->i_tip = gensym("?");
!     y = owner->ob_inlet;
!     if (y) {
          while ((y2=y->i_next)) y = y2;
          y->i_next = x;
!     } else owner->ob_inlet = x;
      return x;
  }
***************
*** 575,579 ****
  
  void inlet_settip(t_inlet* i,t_symbol* s) {i->i_tip = s;}
- void glob_tooltips(t_pd *dummy, t_float f) {sys_tooltips = f;}
  
  char* inlet_tip(t_inlet* i,int num) {
--- 563,566 ----
***************
*** 651,656 ****
      x->i_dest = 0; \
      x->i_next = 0; \
!     if (y = owner->ob_inlet) { \
!         while (y2 = y->i_next) y = y2; \
          y->i_next = x; \
      } else owner->ob_inlet = x; \
--- 638,644 ----
      x->i_dest = 0; \
      x->i_next = 0; \
!     y = owner->ob_inlet; \
!     if (y) { \
!         while ((y2 = y->i_next)) y = y2; \
          y->i_next = x; \
      } else owner->ob_inlet = x; \
***************
*** 750,765 ****
  }
  
- void m_obj_setup(void) {
-     wire_class = class_new(gensym("__wire"), (t_newmethod)wire_new,
- 	(t_method)wire_free, sizeof(t_wire), CLASS_GOBJ, A_GIMME, 0);
-     class_setsavefn(wire_class,(t_savefn)wire_save);
- }
- 
  t_outlet *outlet_new(t_object *owner, t_symbol *s) {
      t_outlet *x = (t_outlet *)getbytes(sizeof(*x)), *y, *y2;
      x->o_owner = owner;
      x->o_next = 0;
!     if (y = owner->ob_outlet) {
!         while (y2 = y->o_next) y = y2;
          y->o_next = x;
      } else owner->ob_outlet = x;
--- 738,748 ----
  }
  
  t_outlet *outlet_new(t_object *owner, t_symbol *s) {
      t_outlet *x = (t_outlet *)getbytes(sizeof(*x)), *y, *y2;
      x->o_owner = owner;
      x->o_next = 0;
!     y = owner->ob_outlet;
!     if (y) {
!         while ((y2 = y->o_next)) y = y2;
          y->o_next = x;
      } else owner->ob_outlet = x;
***************
*** 861,865 ****
          goto done;
      }
!     while (oc2 = oc->next) {
          if (oc2->oc_to == i) {
              oc->next = oc2->next;
--- 844,848 ----
          goto done;
      }
!     while ((oc2 = oc->next)) {
          if (oc2->oc_to == i) {
              oc->next = oc2->next;
***************
*** 1097,1105 ****
      how this is handled.  */
  
- extern void text_save(t_gobj *z, t_binbuf *b);
- 
  t_class *class_new(t_symbol *s, t_newmethod newmethod, t_method freemethod,
!     size_t size, int flags, t_atomtype type1, ...)
! {
      va_list ap;
      t_atomtype vec[MAXPDARG+1], *vp = vec;
--- 1080,1085 ----
      how this is handled.  */
  
  t_class *class_new(t_symbol *s, t_newmethod newmethod, t_method freemethod,
! size_t size, int flags, t_atomtypearg type1, ...) {
      va_list ap;
      t_atomtype vec[MAXPDARG+1], *vp = vec;
***************
*** 1111,1115 ****
      int typeflag = flags & CLASS_TYPEMASK;
      if (!typeflag) typeflag = CLASS_PATCHABLE;
!     *vp = type1;
  
      va_start(ap, type1);
--- 1091,1095 ----
      int typeflag = flags & CLASS_TYPEMASK;
      if (!typeflag) typeflag = CLASS_PATCHABLE;
!     *vp = (t_atomtype)type1;
  
      va_start(ap, type1);
***************
*** 1121,1125 ****
          vp++;
          count++;
!         *vp = va_arg(ap, t_atomtype);
      }
      va_end(ap);
--- 1101,1105 ----
          vp++;
          count++;
!         *vp = (t_atomtype)va_arg(ap,int);
      }
      va_end(ap);
***************
*** 1183,1191 ****
     can belong to, but this won't be used until the newmethod is actually
     called back (and the new method explicitly takes care of this.) */
! void class_addcreator(t_newmethod newmethod, t_symbol *s, t_atomtype type1, ...) {
      va_list ap;
      t_atomtype vec[MAXPDARG+1], *vp = vec;
      int count = 0;
!     *vp = type1;
      va_start(ap, type1);
      while (*vp) {
--- 1163,1171 ----
     can belong to, but this won't be used until the newmethod is actually
     called back (and the new method explicitly takes care of this.) */
! void class_addcreator(t_newmethod newmethod, t_symbol *s, t_atomtypearg type1, ...) {
      va_list ap;
      t_atomtype vec[MAXPDARG+1], *vp = vec;
      int count = 0;
!     *vp = (t_atomtype)type1;
      va_start(ap, type1);
      while (*vp) {
***************
*** 1196,1200 ****
          vp++;
          count++;
!         *vp = va_arg(ap, t_atomtype);
      }
      va_end(ap);
--- 1176,1180 ----
          vp++;
          count++;
!         *vp = (t_atomtype)va_arg(ap,int);
      }
      va_end(ap);
***************
*** 1266,1271 ****
  }
  
! void class_addmethod(t_class *c, t_method fn, t_symbol *sel, t_atomtype arg1, ...) 
! {
      char fmt[42],*f=fmt;
      int t;
--- 1246,1250 ----
  }
  
! void class_addmethod(t_class *c, t_method fn, t_symbol *sel, t_atomtypearg arg1, ...) {
      char fmt[42],*f=fmt;
      int t;
***************
*** 1277,1281 ****
  	if (t>A_CANT) {error("class_addmethod: ARRGH! t=%d",t); return;}
  	*f++ = " fsp;,FS$@*!"[t];
! 	t=va_arg(ap, t_atomtype);
      }
      *f = 0;
--- 1256,1260 ----
  	if (t>A_CANT) {error("class_addmethod: ARRGH! t=%d",t); return;}
  	*f++ = " fsp;,FS$@*!"[t];
! 	t=(t_atomtype)va_arg(ap,int);
      }
      *f = 0;
***************
*** 1378,1382 ****
  	sym1 = symhash + (hash2 & (HASHSIZE-1));
  #endif
!     while (sym2 = *sym1) {
          if (!strcmp(sym2->s_name, s)) return sym2;
          sym1 = &sym2->s_next;
--- 1357,1361 ----
  	sym1 = symhash + (hash2 & (HASHSIZE-1));
  #endif
!     while ((sym2 = *sym1)) {
          if (!strcmp(sym2->s_name, s)) return sym2;
          sym1 = &sym2->s_next;
***************
*** 1418,1422 ****
  static int tryingalready;
  
! void canvas_popabstraction(t_canvas *x);
  extern t_pd *newest;
  
--- 1397,1401 ----
  static int tryingalready;
  
! extern "C" void canvas_popabstraction(t_canvas *x);
  extern t_pd *newest;
  
***************
*** 1501,1516 ****
      &s_list, &s_anything, &s_signal, &s__N, &s__X, &s_x, &s_y, &s_};
  
- void mess_init(void) {
-     t_symbol **sp;
-     int i;
-     if (pd_objectmaker) return;
-     for (i = sizeof(symlist)/sizeof(*symlist), sp = symlist; i--; sp++)
-         (void) dogensym((*sp)->s_name, strlen((*sp)->s_name), *sp);
-     pd_objectmaker = class_new(gensym("objectmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);
-     pd_canvasmaker = class_new(gensym("canvasmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);
-     pd_bind(&pd_canvasmaker, &s__N);
-     class_addanything(pd_objectmaker, (t_method)new_anything);
- }
- 
  t_pd *newest;
  
--- 1480,1483 ----
***************
*** 1567,1571 ****
          if (argc > MAXPDARG) argc = MAXPDARG;
          if (x != &pd_objectmaker) *(ap++) = (t_int)x, narg++;
!         while (wanttype = *wp++) {
              switch (wanttype) {
              case A_POINTER:
--- 1534,1538 ----
          if (argc > MAXPDARG) argc = MAXPDARG;
          if (x != &pd_objectmaker) *(ap++) = (t_int)x, narg++;
!         while ((wanttype = *wp++)) {
              switch (wanttype) {
              case A_POINTER:
***************
*** 1611,1614 ****
--- 1578,1582 ----
                  narg++;
                  ap++;
+             default: {}
              }
          }
***************
*** 1719,1723 ****
  /* only looks for already loaded classes though. */
  
! t_class *class_find (t_symbol *s) {return hash_get(class_table,s);}
  
  void glob_update_class_info (t_pd *bogus, t_symbol *s, t_symbol *cb_recv, t_symbol *cb_sel) {
--- 1687,1691 ----
  /* only looks for already loaded classes though. */
  
! t_class *class_find (t_symbol *s) {return (t_class *)hash_get(class_table,s);}
  
  void glob_update_class_info (t_pd *bogus, t_symbol *s, t_symbol *cb_recv, t_symbol *cb_sel) {
***************
*** 1916,1920 ****
      }
      if (length && buf[length-1] == ' ') {
!         if (newbuf = (char *)t_resizebytes(buf, length, length-1)) {
              buf = newbuf;
              length--;
--- 1884,1889 ----
      }
      if (length && buf[length-1] == ' ') {
!         newbuf = (char *)t_resizebytes(buf, length, length-1);
!         if (newbuf) {
              buf = newbuf;
              length--;
***************
*** 2005,2014 ****
      int newsize = x->n + argc, i;
      t_atom *ap;
!     if (ap = (t_atom *)t_resizebytes(x->vec, x->n * sizeof(*x->vec), newsize * sizeof(*x->vec))) {
!             x->vec = ap;
!     } else {
          error("binbuf_addmessage: out of space");
          return;
      }
      for (ap = x->vec + x->n, i = argc; i--; ap++) {
          if (argv->a_type == A_SYMBOL) {
--- 1974,1983 ----
      int newsize = x->n + argc, i;
      t_atom *ap;
!     ap = (t_atom *)t_resizebytes(x->vec, x->n * sizeof(*x->vec), newsize * sizeof(*x->vec));
!     if (!ap) {
          error("binbuf_addmessage: out of space");
          return;
      }
+     x->vec = ap;
      for (ap = x->vec + x->n, i = argc; i--; ap++) {
          if (argv->a_type == A_SYMBOL) {
***************
*** 2016,2023 ****
              if (!strcmp(str, ";")) SETSEMI(ap);
              else if (!strcmp(str, ",")) SETCOMMA(ap);
!             else if ((str2 = strchr(str, '$')) && str2[1] >= '0' && str2[1] <= '9') {
                  int dollsym = 0;
                  if (*str != '$') dollsym = 1;
!                 else for (str2 = str + 1; *str2; str2++) if (*str2 < '0' || *str2 > '9') {
                      dollsym = 1;
                      break;
--- 1985,1992 ----
              if (!strcmp(str, ";")) SETSEMI(ap);
              else if (!strcmp(str, ",")) SETCOMMA(ap);
!             else if ((str2 = strchr(str, '$')) && isdigit(str2[1])) {
                  int dollsym = 0;
                  if (*str != '$') dollsym = 1;
!                 else for (str2 = str + 1; *str2; str2++) if (!isdigit(*str2)) {
                      dollsym = 1;
                      break;
***************
*** 2080,2084 ****
    char c=*cs;
    *buf=0;
!   while(c&&(c>='0')&&(c<='9')) {
      c=*cs++;
      arglen++;
--- 2049,2053 ----
    char c=*cs;
    *buf=0;
!   while (c && isdigit(c)) {
      c=*cs++;
      arglen++;
***************
*** 2255,2258 ****
--- 2224,2228 ----
                  else pd_list(target, 0, nargs, stackwas);
                  break;
+             default: {}
              }
          }
***************
*** 2290,2296 ****
      char *buf;
      char namebuf[MAXPDSTRING];
!     namebuf[0] = 0;
!     if (*dirname) strcat(namebuf, dirname), strcat(namebuf, "/");
!     strcat(namebuf, filename);
      if ((fd = binbuf_doopen(namebuf, 0)) < 0) {
          error("open: %s: %s",namebuf,strerror(errno));
--- 2260,2265 ----
      char *buf;
      char namebuf[MAXPDSTRING];
!     if (*dirname) sprintf(namebuf,"%s/%s",dirname,filename);
!     else          sprintf(namebuf,   "%s",        filename);
      if ((fd = binbuf_doopen(namebuf, 0)) < 0) {
          error("open: %s: %s",namebuf,strerror(errno));
***************
*** 2740,2750 ****
  }
  
! void mess_init(void);
! void conf_init(void);
! void glob_init(void);
! void garray_init(void);
! void pd_init(void) {
      object_table = hash_new(127);
!     mess_init();
      obj_init();
      conf_init();
--- 2709,2737 ----
  }
  
! extern "C" {
! void conf_init();
! void glob_init();
! void garray_init();
! void pd_init() {
      object_table = hash_new(127);
!     bindlist_class = class_new(gensym("bindlist"), 0, 0, sizeof(t_bindlist), CLASS_PD, 0);
!     class_addbang(bindlist_class, (t_method)bindlist_bang);
!     class_addfloat(bindlist_class, (t_method)bindlist_float);
!     class_addsymbol(bindlist_class, (t_method)bindlist_symbol);
!     class_addpointer(bindlist_class, (t_method)bindlist_pointer);
!     class_addlist(bindlist_class, (t_method)bindlist_list);
!     class_addanything(bindlist_class, (t_method)bindlist_anything);
!     wire_class = class_new(gensym("__wire"), (t_newmethod)wire_new,
! 	(t_method)wire_free, sizeof(t_wire), CLASS_GOBJ, A_GIMME, 0);
!     class_setsavefn(wire_class,(t_savefn)wire_save);
!     t_symbol **sp;
!     int i;
!     if (pd_objectmaker) bug("ARGH");
!     for (i = sizeof(symlist)/sizeof(*symlist), sp = symlist; i--; sp++)
!         (void) dogensym((*sp)->s_name, strlen((*sp)->s_name), *sp);
!     pd_objectmaker = class_new(gensym("objectmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);
!     pd_canvasmaker = class_new(gensym("canvasmaker"), 0, 0, sizeof(t_pd), CLASS_DEFAULT, A_NULL);
!     pd_bind(&pd_canvasmaker, &s__N);
!     class_addanything(pd_objectmaker, (t_method)new_anything);
      obj_init();
      conf_init();
***************
*** 2752,2754 ****
      garray_init();
  }
! 
--- 2739,2741 ----
      garray_init();
  }
! };

Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.96
retrieving revision 1.1.2.217.2.97
diff -C2 -d -r1.1.2.217.2.96 -r1.1.2.217.2.97
*** desire.c	28 Dec 2006 05:24:05 -0000	1.1.2.217.2.96
--- desire.c	31 Dec 2006 07:27:18 -0000	1.1.2.217.2.97
***************
*** 1208,1212 ****
  static int canvas_find_index1, canvas_find_index2;
  static t_binbuf *canvas_findbuf;
! extern "C" int binbuf_match(t_binbuf *inbuf, t_binbuf *searchbuf);
  
  /* find an atom or string of atoms */
--- 1208,1212 ----
  static int canvas_find_index1, canvas_find_index2;
  static t_binbuf *canvas_findbuf;
! int binbuf_match(t_binbuf *inbuf, t_binbuf *searchbuf);
  
  /* find an atom or string of atoms */
***************
*** 2355,2360 ****
  extern "C" t_inlet  *vinlet_getit(t_pd *x);
  extern "C" t_outlet *voutlet_getit(t_pd *x);
- extern "C" void obj_moveinletfirst( t_object *x, t_inlet *i);
- extern "C" void obj_moveoutletfirst(t_object *x, t_outlet *i);
  
  static void canvas_resortinlets(t_canvas *x) {
--- 2355,2358 ----
***************
*** 6198,6202 ****
  }
  
- extern "C" char *class_gethelpdir(t_class *c);
  extern "C" void open_via_helppath(const char *name, const char *dir);
  static void canvas_object_help(t_canvas *x, t_symbol *name) {
--- 6196,6199 ----
***************
*** 6205,6209 ****
          t_class *c = o->_class;
          strcpy(namebuf, class_gethelpname(c));
!         dir = class_gethelpdir(c);
          if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
          open_via_helppath(namebuf, dir);
--- 6202,6206 ----
          t_class *c = o->_class;
          strcpy(namebuf, class_gethelpname(c));
!         dir = c->externdir->s_name;
          if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
          open_via_helppath(namebuf, dir);
***************
*** 7514,7518 ****
  }
  
- extern "C" void glob_update_class_info (t_pd *bogus, t_symbol *s, t_symbol *cb_recv, t_symbol *cb_sel);
  extern "C" void glob_update_path (void);
  
--- 7511,7514 ----
***************
*** 7531,7535 ****
  	}
          strcpy(namebuf, class_gethelpname(c));
!         dir = class_gethelpdir(c);
          if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
          open_via_helppath(namebuf, dir);
--- 7527,7531 ----
  	}
          strcpy(namebuf, class_gethelpname(c));
!         dir = c->externdir->s_name;
          if (strcmp(namebuf + strlen(namebuf) - 3, ".pd")) strcat(namebuf, ".pd");
          open_via_helppath(namebuf, dir);
***************
*** 7537,7541 ****
  
  EXTERN t_hash *class_table;
! void glob_update_class_list (t_pd *self, t_symbol *cb_recv, t_symbol *cb_sel) {
      hashkey k; hashvalue v;
      sys_gui("global class_list; set class_list {");
--- 7533,7537 ----
  
  EXTERN t_hash *class_table;
! extern "C" void glob_update_class_list (t_pd *self, t_symbol *cb_recv, t_symbol *cb_sel) {
      hashkey k; hashvalue v;
      sys_gui("global class_list; set class_list {");
***************
*** 7812,7816 ****
  void glob_startup_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv);
  void glob_ping(t_pd *dummy);
- void glob_tooltips(t_pd *dummy, t_float f);
  /* tb: message-based audio configuration { */
  void glob_audio_testaudiosetting(t_pd * dummy, t_symbol *s, int ac, t_atom *av);
--- 7808,7811 ----
***************
*** 7870,7874 ****
      class_addmethod3(c,glob_midi_dialog,      "midi-dialog", "*");
      class_addmethod3(c,glob_ping, "ping","");
-     class_addmethod3(c,glob_tooltips,         "tooltips", "F");
      /* tb: message-based audio configuration { */
  //    class_addmethod3(c,glob_audio_samplerate, "audio-samplerate", "F");
--- 7865,7868 ----
***************
*** 8057,8061 ****
  extern "C" {
  void conf_init(void) {
!     S(hash) S(m_obj) S(m_pd) S(x_acoustics) S(x_connective)
      S(x_time) S(x_arithmetic) S(x_midi) S(x_misc) S(x_net) S(x_qlist)
      S(x_gui) S(x_list) S(d_arithmetic) S(d_array) S(d_ctl) S(d_dac)
--- 8051,8055 ----
  extern "C" {
  void conf_init(void) {
!     S(x_acoustics) S(x_connective)
      S(x_time) S(x_arithmetic) S(x_midi) S(x_misc) S(x_net) S(x_qlist)
      S(x_gui) S(x_list) S(d_arithmetic) S(d_array) S(d_ctl) S(d_dac)





More information about the Pd-cvs mailing list