[PD-cvs] pd/src desire.c, 1.1.2.217.2.93, 1.1.2.217.2.94 kernel.c, 1.1.2.8, 1.1.2.9 m_class.c, 1.3.4.7.2.22.2.16, 1.3.4.7.2.22.2.17 desire.h, 1.1.2.49.2.17, 1.1.2.49.2.18

Mathieu Bouchard matju at users.sourceforge.net
Thu Dec 28 00:30:36 CET 2006


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

Modified Files:
      Tag: desiredata
	desire.c kernel.c m_class.c desire.h 
Log Message:
removed rest of c_ prefixes


Index: m_class.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_class.c,v
retrieving revision 1.3.4.7.2.22.2.16
retrieving revision 1.3.4.7.2.22.2.17
diff -C2 -d -r1.3.4.7.2.22.2.16 -r1.3.4.7.2.22.2.17
*** m_class.c	27 Dec 2006 01:15:28 -0000	1.3.4.7.2.22.2.16
--- m_class.c	27 Dec 2006 23:30:34 -0000	1.3.4.7.2.22.2.17
***************
*** 36,42 ****
  static t_symbol *class_extern_dir = &s_;
  
! static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv)
! {
!     pd_error(x, "%s: no method for '%s'", (*x)->c_name->s_name, s->s_name);
  }
  
--- 36,41 ----
  static t_symbol *class_extern_dir = &s_;
  
! static void pd_defaultanything(t_pd *x, t_symbol *s, int argc, t_atom *argv) {
!     pd_error(x, "%s: no method for '%s'", (*x)->name->s_name, s->s_name);
  }
  
***************
*** 81,85 ****
         list into the inlets. otherwise gove up and complain. */
      if (c->anymethod != pd_defaultanything) c->anymethod(x,&s_list,argc,argv);
!     else if (c->c_patchable) obj_list((t_object *)x, s, argc, argv);
      else pd_defaultanything(x, &s_list, argc, argv);
  }
--- 80,84 ----
         list into the inlets. otherwise gove up and complain. */
      if (c->anymethod != pd_defaultanything) c->anymethod(x,&s_list,argc,argv);
!     else if (c->patchable) obj_list((t_object *)x, s, argc, argv);
      else pd_defaultanything(x, &s_list, argc, argv);
  }
***************
*** 150,157 ****
      }
      c = (t_class *)t_getbytes(sizeof(*c));
!     c->c_name = c->c_helpname = s;
!     c->c_size = size;
!     c->c_methods = (t_methodentry *)t_getbytes(0);
!     c->c_nmethod = 0;
      c->freemethod = (t_method)freemethod;
      c->bangmethod = pd_defaultbang;
--- 149,156 ----
      }
      c = (t_class *)t_getbytes(sizeof(*c));
!     c->name = c->helpname = s;
!     c->size = size;
!     c->methods = (t_methodentry *)t_getbytes(0);
!     c->nmethod = 0;
      c->freemethod = (t_method)freemethod;
      c->bangmethod = pd_defaultbang;
***************
*** 161,183 ****
      c->listmethod = pd_defaultlist;
      c->anymethod = pd_defaultanything;
!     c->c_firstin = ((flags & CLASS_NOINLET) == 0);
      c->firsttip = gensym("?");
      c->fields = (t_symbol **)malloc(sizeof(t_symbol *)*31);
      c->nfields = 0;
!     c->c_patchable = (typeflag == CLASS_PATCHABLE);
!     c->c_gobj = (typeflag >= CLASS_GOBJ);
!     c->c_drawcommand = 0;
!     c->c_floatsignalin = 0;
!     c->c_externdir = class_extern_dir;
!     c->c_savefn = (typeflag == CLASS_PATCHABLE ? text_save : class_nosavefn);
! 
  #ifdef QUALIFIED_NAME
!     c->c_helpname = S;
      // like a class_addcreator
!     if (pd_library_name&&newmethod) {
        class_addmethod(pd_objectmaker, (t_method)newmethod, S, vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]);
      }
  #endif
!     hash_set(class_table, c->c_name, c);
      return c;
  }
--- 160,181 ----
      c->listmethod = pd_defaultlist;
      c->anymethod = pd_defaultanything;
!     c->firstin = ((flags & CLASS_NOINLET) == 0);
      c->firsttip = gensym("?");
      c->fields = (t_symbol **)malloc(sizeof(t_symbol *)*31);
      c->nfields = 0;
!     c->patchable = (typeflag == CLASS_PATCHABLE);
!     c->gobj = (typeflag >= CLASS_GOBJ);
!     c->drawcommand = 0;
!     c->floatsignalin = 0;
!     c->externdir = class_extern_dir;
!     c->savefn = (typeflag == CLASS_PATCHABLE ? text_save : class_nosavefn);
  #ifdef QUALIFIED_NAME
!     c->helpname = S;
      // like a class_addcreator
!     if (pd_library_name && newmethod) {
        class_addmethod(pd_objectmaker, (t_method)newmethod, S, vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]);
      }
  #endif
!     hash_set(class_table, c->name, c);
      return c;
  }
***************
*** 224,229 ****
         is obsolete; you should now use the CLASS_MAINSIGNALIN macro. */
      if (sel == &s_signal) {
!         if (c->c_floatsignalin) post("warning: signal method overrides class_mainsignalin");
!         c->c_floatsignalin = -1;
      }
      /* check for special cases.  "Pointer" is missing here so that
--- 222,227 ----
         is obsolete; you should now use the CLASS_MAINSIGNALIN macro. */
      if (sel == &s_signal) {
!         if (c->floatsignalin) post("warning: signal method overrides class_mainsignalin");
!         c->floatsignalin = -1;
      }
      /* check for special cases.  "Pointer" is missing here so that
***************
*** 235,243 ****
      else if (sel == &s_anything) {if (argtype != A_GIMME) goto phooey; class_addanything(c, fn);}
      else {
!         c->c_methods = (t_methodentry *)t_resizebytes(c->c_methods,
!             c->c_nmethod * sizeof(*c->c_methods),
!             (c->c_nmethod + 1) * sizeof(*c->c_methods));
!         m = c->c_methods + c->c_nmethod;
!         c->c_nmethod++;
          m->me_name = sel;
          m->me_fun = (t_gotfn)fn;
--- 233,240 ----
      else if (sel == &s_anything) {if (argtype != A_GIMME) goto phooey; class_addanything(c, fn);}
      else {
!         c->methods = (t_methodentry *)t_resizebytes(c->methods,
!             c->nmethod * sizeof(*c->methods), (c->nmethod+1) * sizeof(*c->methods));
!         m = c->methods + c->nmethod;
!         c->nmethod++;
          m->me_name = sel;
          m->me_fun = (t_gotfn)fn;
***************
*** 263,274 ****
          }
          if (argtype != A_NULL)
!             error("%s_%s: only 5 arguments are typecheckable; use A_GIMME",
!                 c->c_name->s_name, sel->s_name);
          m->me_arg[nargs] = A_NULL;
      }
      return;
  phooey:
!     bug("class_addmethod: %s_%s: bad argument types\n",
!         c->c_name->s_name, sel->s_name);
  }
  
--- 260,269 ----
          }
          if (argtype != A_NULL)
!             error("%s_%s: only 5 arguments are typecheckable; use A_GIMME", c->name->s_name, sel->s_name);
          m->me_arg[nargs] = A_NULL;
      }
      return;
  phooey:
!     bug("class_addmethod: %s_%s: bad argument types\n", c->name->s_name, sel->s_name);
  }
  
***************
*** 299,315 ****
  void class_addanything(t_class *c, t_method fn) {    c->anymethod = (t_anymethod)fn;}
  
! char *class_getname(t_class *c)     {return c->c_name->s_name;}
! char *class_gethelpname(t_class *c) {return c->c_helpname->s_name;}
! void class_sethelpsymbol(t_class *c, t_symbol *s) {c->c_helpname = s;}
! void class_setdrawcommand(t_class *c) {c->c_drawcommand = 1;}
! int  class_isdrawcommand( t_class *c) {return c->c_drawcommand;}
  void class_setnotice(t_class *c, t_notice notice) {c->notice = notice;}
  
  static void pd_floatforsignal(t_pd *x, t_float f) {
!     int offset = (*x)->c_floatsignalin;
      if (offset > 0)
          *(t_sample *)(((char *)x) + offset) = f;
      else
!         pd_error(x, "%s: float unexpected for signal input", (*x)->c_name->s_name);
  }
  
--- 294,310 ----
  void class_addanything(t_class *c, t_method fn) {    c->anymethod = (t_anymethod)fn;}
  
! char *class_getname(t_class *c)     {return c->name->s_name;}
! char *class_gethelpname(t_class *c) {return c->helpname->s_name;}
! void class_sethelpsymbol(t_class *c, t_symbol *s) {c->helpname = s;}
! void class_setdrawcommand(t_class *c) {c->drawcommand = 1;}
! int  class_isdrawcommand( t_class *c) {return c->drawcommand;}
  void class_setnotice(t_class *c, t_notice notice) {c->notice = notice;}
  
  static void pd_floatforsignal(t_pd *x, t_float f) {
!     int offset = (*x)->floatsignalin;
      if (offset > 0)
          *(t_sample *)(((char *)x) + offset) = f;
      else
!         pd_error(x, "%s: float unexpected for signal input", (*x)->name->s_name);
  }
  
***************
*** 318,329 ****
      else {
          if (c->floatmethod != pd_defaultfloat)
!             post("warning: %s: float method overwritten", c->c_name->s_name);
          c->floatmethod = (t_floatmethod)pd_floatforsignal;
      }
!     c->c_floatsignalin = onset;
  }
  
  void class_set_extern_dir(t_symbol *s) {class_extern_dir = s;}
! char *class_gethelpdir(t_class *c) {return c->c_externdir->s_name;}
  
  static void class_nosavefn(t_gobj *z, t_binbuf *b) {
--- 313,324 ----
      else {
          if (c->floatmethod != pd_defaultfloat)
!             post("warning: %s: float method overwritten", c->name->s_name);
          c->floatmethod = (t_floatmethod)pd_floatforsignal;
      }
!     c->floatsignalin = onset;
  }
  
  void class_set_extern_dir(t_symbol *s) {class_extern_dir = s;}
! char *class_gethelpdir(t_class *c) {return c->externdir->s_name;}
  
  static void class_nosavefn(t_gobj *z, t_binbuf *b) {
***************
*** 331,336 ****
  }
  
! void class_setsavefn(t_class *c, t_savefn f) {c->c_savefn = f;}
! t_savefn class_getsavefn(t_class *c) {return  c->c_savefn;}
  
  /* ---------------- the symbol table ------------------------ */
--- 326,331 ----
  }
  
! void class_setsavefn(t_class *c, t_savefn f) {c->savefn = f;}
! t_savefn class_getsavefn(t_class *c) {return  c->savefn;}
  
  /* ---------------- the symbol table ------------------------ */
***************
*** 560,564 ****
          return;
      }
!     for (i = c->c_nmethod, m = c->c_methods; i--; m++) if (m->me_name == s) {
          wp = m->me_arg;
          if (*wp == A_GIMME) {
--- 555,559 ----
          return;
      }
!     for (i = c->nmethod, m = c->methods; i--; m++) if (m->me_name == s) {
          wp = m->me_arg;
          if (*wp == A_GIMME) {
***************
*** 632,636 ****
      return;
  badarg:
!     pd_error(x, "Bad arguments for message '%s' to object '%s'", s->s_name, c->c_name->s_name);
  }
  
--- 627,631 ----
      return;
  badarg:
!     pd_error(x, "Bad arguments for message '%s' to object '%s'", s->s_name, c->name->s_name);
  }
  
***************
*** 682,687 ****
      t_methodentry *m;
      int i;
!     for (i = c->c_nmethod, m = c->c_methods; i--; m++) if (m->me_name == s) return m->me_fun;
!     pd_error(x, "%s: no method for message '%s'", c->c_name->s_name, s->s_name);
      return((t_gotfn)nullfn);
  }
--- 677,682 ----
      t_methodentry *m;
      int i;
!     for (i = c->nmethod, m = c->methods; i--; m++) if (m->me_name == s) return m->me_fun;
!     pd_error(x, "%s: no method for message '%s'", c->name->s_name, s->s_name);
      return((t_gotfn)nullfn);
  }
***************
*** 691,695 ****
      t_methodentry *m;
      int i;
!     for (i = c->c_nmethod, m = c->c_methods; i--; m++) if (m->me_name == s) return m->me_fun;
      return 0;
  }
--- 686,690 ----
      t_methodentry *m;
      int i;
!     for (i = c->nmethod, m = c->methods; i--; m++) if (m->me_name == s) return m->me_fun;
      return 0;
  }
***************
*** 738,743 ****
  */
      "gobj \"%d\" patchable \"%d\" firstin \"%d\" "
!     "firsttip \"%s\" methods {",s->s_name,c->c_helpname->s_name,c->c_externdir->s_name,
! c->c_size,c->c_gobj,c->c_patchable,c->c_firstin,c->firsttip->s_name);
      if (c->   bangmethod != pd_defaultbang)     sys_vgui("<bang> ");
      if (c->pointermethod != pd_defaultpointer)  sys_vgui("<pointer> ");
--- 733,738 ----
  */
      "gobj \"%d\" patchable \"%d\" firstin \"%d\" "
!     "firsttip \"%s\" methods {",s->s_name,c->helpname->s_name,c->externdir->s_name,
! 	c->size,c->gobj,c->patchable,c->firstin,c->firsttip->s_name);
      if (c->   bangmethod != pd_defaultbang)     sys_vgui("<bang> ");
      if (c->pointermethod != pd_defaultpointer)  sys_vgui("<pointer> ");
***************
*** 746,750 ****
      if (c->   listmethod != pd_defaultlist)     sys_vgui("<list> ");
      if (c->    anymethod != pd_defaultanything) sys_vgui("<any> ");
!     {int i; for (i=0; i<c->c_nmethod; i++) sys_vgui("%s ",c->c_methods[i].me_name->s_name);}
      sys_vgui("}]; %s %s %s\n",cb_recv->s_name, cb_sel->s_name, s->s_name);
  }
--- 741,745 ----
      if (c->   listmethod != pd_defaultlist)     sys_vgui("<list> ");
      if (c->    anymethod != pd_defaultanything) sys_vgui("<any> ");
!     {int i; for (i=0; i<c->nmethod; i++) sys_vgui("%s ",c->methods[i].me_name->s_name);}
      sys_vgui("}]; %s %s %s\n",cb_recv->s_name, cb_sel->s_name, s->s_name);
  }

Index: kernel.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -d -r1.1.2.8 -r1.1.2.9
*** kernel.c	27 Dec 2006 01:15:28 -0000	1.1.2.8
--- kernel.c	27 Dec 2006 23:30:34 -0000	1.1.2.9
***************
*** 288,300 ****
  t_hash *object_table;
  
! t_pd *pd_new(t_class *c)
! {
      t_pd *x;
      if (!c) bug("pd_new: apparently called before setup routine");
!     x = (t_pd *)t_getbytes(c->c_size);
      *x = c;
      hash_set(object_table,x,(void*)0);
!     if (c->c_gobj) ((t_gobj *)x)->g_adix = appendix_new((t_gobj *)x);
!     if (c->c_patchable) {
          ((t_object *)x)->ob_inlet = 0;
          ((t_object *)x)->ob_outlet = 0;
--- 288,299 ----
  t_hash *object_table;
  
! t_pd *pd_new(t_class *c) {
      t_pd *x;
      if (!c) bug("pd_new: apparently called before setup routine");
!     x = (t_pd *)t_getbytes(c->size);
      *x = c;
      hash_set(object_table,x,(void*)0);
!     if (c->gobj) ((t_gobj *)x)->g_adix = appendix_new((t_gobj *)x);
!     if (c->patchable) {
          ((t_object *)x)->ob_inlet = 0;
          ((t_object *)x)->ob_outlet = 0;
***************
*** 303,313 ****
  }
  
! void pd_free(t_pd *x)
! {
      t_class *c = *x;
      if (c->freemethod) ((t_gotfn)(c->freemethod))(x);
!     if (c->c_gobj) appendix_free((t_gobj *)x);
      hash_delete(object_table,x);
!     if (c->c_patchable) {
  	t_object *y = (t_object *)x;
  	while (y->ob_outlet) outlet_free(y->ob_outlet);
--- 302,311 ----
  }
  
! void pd_free(t_pd *x) {
      t_class *c = *x;
      if (c->freemethod) ((t_gotfn)(c->freemethod))(x);
!     if (c->gobj) appendix_free((t_gobj *)x);
      hash_delete(object_table,x);
!     if (c->patchable) {
  	t_object *y = (t_object *)x;
  	while (y->ob_outlet) outlet_free(y->ob_outlet);
***************
*** 315,324 ****
  	if (y->ob_binbuf)    binbuf_free(y->ob_binbuf);
      }
!     if (c->c_size) t_freebytes(x, c->c_size);
  }
  
  void gobj_save(t_gobj *x, t_binbuf *b) {
      t_class *c = x->g_pd;
!     if (c->c_savefn) c->c_savefn(x, b);
  }
  
--- 313,322 ----
  	if (y->ob_binbuf)    binbuf_free(y->ob_binbuf);
      }
!     if (c->size) t_freebytes(x, c->size);
  }
  
  void gobj_save(t_gobj *x, t_binbuf *b) {
      t_class *c = x->g_pd;
!     if (c->savefn) c->savefn(x, b);
  }
  
***************
*** 786,791 ****
  t_symbol *outlet_getsymbol(t_outlet *x) {return x->o_sym;}
  
! void outlet_free(t_outlet *x)
! {
      t_object *y = x->o_owner;
      t_outlet *x2;
--- 784,788 ----
  t_symbol *outlet_getsymbol(t_outlet *x) {return x->o_sym;}
  
! void outlet_free(t_outlet *x) {
      t_object *y = x->o_owner;
      t_outlet *x2;
***************
*** 802,806 ****
  static t_pd *find_inlet(t_object *to, int inlet) {
      t_inlet *i;
!     if (to->ob_pd->c_firstin) {
  	if (inlet==0) return (t_pd *)to;
  	inlet--;
--- 799,803 ----
  static t_pd *find_inlet(t_object *to, int inlet) {
      t_inlet *i;
!     if (to->ob_pd->firstin) {
  	if (inlet==0) return (t_pd *)to;
  	inlet--;
***************
*** 868,872 ****
  
  int obj_ninlets(t_object *x) {
!     int n=!!x->ob_pd->c_firstin; t_inlet *i;
      for (i = x->ob_inlet; i; i = i->i_next) n++;
      return n;
--- 865,869 ----
  
  int obj_ninlets(t_object *x) {
!     int n=!!x->ob_pd->firstin; t_inlet *i;
      for (i = x->ob_inlet; i; i = i->i_next) n++;
      return n;
***************
*** 887,891 ****
          t_inlet *i = (t_inlet *)y, *i2;
          t_object *dest = i->i_owner;
!         for (n = dest->ob_pd->c_firstin, i2 = dest->ob_inlet;
              i2 && i2 != i; i2 = i2->i_next) n++;
          *whichp = n;
--- 884,888 ----
          t_inlet *i = (t_inlet *)y, *i2;
          t_object *dest = i->i_owner;
!         for (n = dest->ob_pd->firstin, i2 = dest->ob_inlet;
              i2 && i2 != i; i2 = i2->i_next) n++;
          *whichp = n;
***************
*** 903,907 ****
      it, correctly typed, or zero if the check failed. */
  t_object *pd_checkobject(t_pd *x) {
!     return (*x)->c_patchable ? (t_object *)x : 0;
  }
  
--- 900,904 ----
      it, correctly typed, or zero if the check failed. */
  t_object *pd_checkobject(t_pd *x) {
!     return (*x)->patchable ? (t_object *)x : 0;
  }
  
***************
*** 935,939 ****
      int n; t_inlet *i;
      for (i = x->ob_inlet, n = 0; i; i = i->i_next) if (i->i_symfrom == &s_signal) n++;
!     if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) n++;
      return n;
  }
--- 932,936 ----
      int n; t_inlet *i;
      for (i = x->ob_inlet, n = 0; i; i = i->i_next) if (i->i_symfrom == &s_signal) n++;
!     if (x->ob_pd->firstin && x->ob_pd->floatsignalin) n++;
      return n;
  }
***************
*** 947,951 ****
  int obj_siginletindex(t_object *x, int m) {
      int n=0; t_inlet *i;
!     if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) {
          if (!m--) return 0; else n++;
      }
--- 944,948 ----
  int obj_siginletindex(t_object *x, int m) {
      int n=0; t_inlet *i;
!     if (x->ob_pd->firstin && x->ob_pd->floatsignalin) {
          if (!m--) return 0; else n++;
      }
***************
*** 965,970 ****
  int obj_issignalinlet(t_object *x, int m) {
      t_inlet *i;
!     if (x->ob_pd->c_firstin) {
!         if (!m)  return x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin;
          else m--;
      }
--- 962,967 ----
  int obj_issignalinlet(t_object *x, int m) {
      t_inlet *i;
!     if (x->ob_pd->firstin) {
!         if (!m) return x->ob_pd->firstin && x->ob_pd->floatsignalin;
          else m--;
      }
***************
*** 978,988 ****
  }
  
! t_sample *obj_findsignalscalar(t_object *x, int m)
! {
      int n = 0;
      t_inlet *i;
!     if (x->ob_pd->c_firstin && x->ob_pd->c_floatsignalin) {
!         if (!m--)
!             return x->ob_pd->c_floatsignalin > 0 ? (t_sample *)(((char *)x) + x->ob_pd->c_floatsignalin) : 0;
          n++;
      }
--- 975,983 ----
  }
  
! t_sample *obj_findsignalscalar(t_object *x, int m) {
      int n = 0;
      t_inlet *i;
!     if (x->ob_pd->firstin && x->ob_pd->floatsignalin) {
!         if (!m--) return x->ob_pd->floatsignalin > 0 ? (t_sample *)(((char *)x) + x->ob_pd->floatsignalin) : 0;
          n++;
      }

Index: desire.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.h,v
retrieving revision 1.1.2.49.2.17
retrieving revision 1.1.2.49.2.18
diff -C2 -d -r1.1.2.49.2.17 -r1.1.2.49.2.18
*** desire.h	27 Dec 2006 01:15:27 -0000	1.1.2.49.2.17
--- desire.h	27 Dec 2006 23:30:34 -0000	1.1.2.49.2.18
***************
*** 71,80 ****
  
  struct _class {
!     t_symbol *c_name;                   /* name (mostly for error reporting) */
!     t_symbol *c_helpname;               /* name of help file */
!     t_symbol *c_externdir;              /* directory extern was loaded from */
!     size_t c_size;                      /* size of an instance */
!     t_methodentry *c_methods;           /* methods other than bang, etc below */
!     int c_nmethod;                      /* number of methods */
      t_method        freemethod;       /* function to call before freeing */
      t_bangmethod    bangmethod;       /* common methods */
--- 71,80 ----
  
  struct _class {
!     t_symbol *name;                   /* name (mostly for error reporting) */
!     t_symbol *helpname;               /* name of help file */
!     t_symbol *externdir;              /* directory extern was loaded from */
!     size_t size;                      /* size of an instance */
!     t_methodentry *methods;           /* methods other than bang, etc below */
!     int nmethod;                      /* number of methods */
      t_method        freemethod;       /* function to call before freeing */
      t_bangmethod    bangmethod;       /* common methods */
***************
*** 84,93 ****
      t_listmethod    listmethod;
      t_anymethod     anymethod;
!     t_savefn c_savefn;           /* function to call when saving */
!     int c_floatsignalin;         /* onset to float for signal input */
!     unsigned c_gobj:1;           /* true if is a gobj */
!     unsigned c_patchable:1;      /* true if we have a t_object header */
!     unsigned c_firstin:1;        /* if patchable, true if draw first inlet */
!     unsigned c_drawcommand:1;    /* a drawing command for a template */
      unsigned newatoms:1;         /* can handle refcounting of atoms (future use) */
      unsigned use_stringmethod:1; /* the symbolmethod slot holds a stringmethod instead */
--- 84,93 ----
      t_listmethod    listmethod;
      t_anymethod     anymethod;
!     t_savefn savefn;           /* function to call when saving */
!     int floatsignalin;         /* onset to float for signal input */
!     unsigned gobj:1;           /* true if is a gobj */
!     unsigned patchable:1;      /* true if we have a t_object header */
!     unsigned firstin:1;        /* if patchable, true if draw first inlet */
!     unsigned drawcommand:1;    /* a drawing command for a template */
      unsigned newatoms:1;         /* can handle refcounting of atoms (future use) */
      unsigned use_stringmethod:1; /* the symbolmethod slot holds a stringmethod instead */
***************
*** 98,101 ****
--- 98,107 ----
  };
  
+ //#define c_methods methods /* for Cyclone */
+ //#define c_nmethod nmethod /* for Cyclone */
+ //#define c_externdir externdir /* for PDDP */
+ //#define c_name name /* for Cyclone,Creb,Pidip */
+ //#define c_size size /* for Cyclone,Flext */
+ 
  /* m_obj.c */
  EXTERN int obj_noutlets(t_object *x);

Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.93
retrieving revision 1.1.2.217.2.94
diff -C2 -d -r1.1.2.217.2.93 -r1.1.2.217.2.94
*** desire.c	27 Dec 2006 00:26:26 -0000	1.1.2.217.2.93
--- desire.c	27 Dec 2006 23:30:31 -0000	1.1.2.217.2.94
***************
*** 192,196 ****
  		t_notice ice = obs->_class->notice;
  		if (ice) ice(obs,origin,argc,argv);
! 		else post("null func ptr for class %s",self->_class->c_name->s_name);
  	}
  }
--- 192,196 ----
  		t_notice ice = obs->_class->notice;
  		if (ice) ice(obs,origin,argc,argv);
! 		else post("null func ptr for class %s",self->_class->name->s_name);
  	}
  }
***************
*** 214,219 ****
  //#define DEBUG_QUEUE
  
! void pd_print (t_pd *self, char *header) {
! 	if (self->_class->c_patchable) {
  		t_binbuf *b = ((t_text *)self)->binbuf;
  		if (b) {
--- 214,219 ----
  //#define DEBUG_QUEUE
  
! static void pd_print (t_pd *self, char *header) {
! 	if (self->_class->patchable) {
  		t_binbuf *b = ((t_text *)self)->binbuf;
  		if (b) {
***************
*** 224,228 ****
  		}
  	}
! 	printf("%s (%s)\n",header,self->_class->c_name->s_name);
  }
  
--- 224,228 ----
  		}
  	}
! 	printf("%s (%s)\n",header,self->_class->name->s_name);
  }
  
***************
*** 2206,2211 ****
  
  void canvas_add_debug(t_canvas *x, t_gobj *y) {
!     if (!y->_class->c_patchable) {
! 	printf("canvas_add %p %p class=%s (non-t_text)\n",x,y,y->_class->c_name->s_name);
      } else {
          char *buf; int bufn;
--- 2206,2211 ----
  
  void canvas_add_debug(t_canvas *x, t_gobj *y) {
!     if (!y->_class->patchable) {
! 	printf("canvas_add %p %p class=%s (non-t_text)\n",x,y,y->_class->name->s_name);
      } else {
          char *buf; int bufn;
***************
*** 2216,2220 ****
  	    free(buf);
  	} else {
! 	    printf("canvas_add %p %p class=%s (binbuf without b_vec !)\n",x,y,y->_class->c_name->s_name);
  	}
      }
--- 2216,2220 ----
  	    free(buf);
  	} else {
! 	    printf("canvas_add %p %p class=%s (binbuf without b_vec !)\n",x,y,y->_class->name->s_name);
  	}
      }
***************
*** 6168,6172 ****
  		return 0;
  	}
! 	if (!o->_class->c_patchable) {error("%s target not a patchable object"); return 0;}
  	return o;
  }
--- 6168,6172 ----
  		return 0;
  	}
! 	if (!o->_class->patchable) {error("%s target not a patchable object"); return 0;}
  	return o;
  }
***************
*** 6196,6203 ****
  	t_text *o = symbol2opointer(name); if (!o) return;
  	char foo[666];
! 	if (o->ob_pd->c_firstin) strcpy(foo,o->ob_pd->firsttip->s_name); else strcpy(foo,"");
  	int n = obj_ninlets(x);
  	char *foop = foo;
! 	for (int i=!!o->ob_pd->c_firstin; i<n; i++) {
  		strcat(foo," ");
  		strcat(foo,inlet_tip(o->inlet,i));
--- 6196,6203 ----
  	t_text *o = symbol2opointer(name); if (!o) return;
  	char foo[666];
! 	if (o->_class->firstin) strcpy(foo,o->_class->firsttip->s_name); else strcpy(foo,"");
  	int n = obj_ninlets(x);
  	char *foop = foo;
! 	for (int i=!!o->_class->firstin; i<n; i++) {
  		strcat(foo," ");
  		strcat(foo,inlet_tip(o->inlet,i));
***************
*** 6500,6504 ****
  	binbuf_gettext(b,&s,&n);
  	if (s[n-1]=='\n') n--;
! 	if (c->c_patchable) {
  		sys_vgui("change x%lx x%lx {%.*s} %d %d\n",(long)self,(long)self->dix->canvas,n,s,
  			obj_ninlets((t_text *)self), obj_noutlets((t_text *)self));
--- 6500,6504 ----
  	binbuf_gettext(b,&s,&n);
  	if (s[n-1]=='\n') n--;
! 	if (c->patchable) {
  		sys_vgui("change x%lx x%lx {%.*s} %d %d\n",(long)self,(long)self->dix->canvas,n,s,
  			obj_ninlets((t_text *)self), obj_noutlets((t_text *)self));
***************
*** 7849,7853 ****
  	post("object_table = {");
  	hash_foreach(k,v,object_table) {
! 		post("  %p %ld %s",k,(long)v,((t_pd *)k)->_class->c_name->s_name);
  	}
  	post("} (%d objects)",hash_size(object_table));
--- 7849,7853 ----
  	post("object_table = {");
  	hash_foreach(k,v,object_table) {
! 		post("  %p %ld %s",k,(long)v,((t_pd *)k)->_class->name->s_name);
  	}
  	post("} (%d objects)",hash_size(object_table));





More information about the Pd-cvs mailing list