[PD-cvs] externals/hcs sql_query.c,1.2,1.3

Hans-Christoph Steiner eighthave at users.sourceforge.net
Sat Dec 22 21:25:48 CET 2007


Update of /cvsroot/pure-data/externals/hcs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22437

Modified Files:
	sql_query.c 
Log Message:
got the set_atom function working on the first inlet with symbols, now got to get the rest of the inlets working

Index: sql_query.c
===================================================================
RCS file: /cvsroot/pure-data/externals/hcs/sql_query.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sql_query.c	22 Dec 2007 07:24:36 -0000	1.2
--- sql_query.c	22 Dec 2007 20:25:46 -0000	1.3
***************
*** 58,69 ****
      t_object            x_obj;
  
!     t_binbuf*           x_query_binbuf;
      
!     unsigned int        placeholder_count;
!     struct _proxy_inlet*inlets;
!     t_atom**            atoms;
  
!     t_outlet*           x_data_outlet;
!     t_outlet*           x_status_outlet;
  } t_sql_query;
      
--- 58,69 ----
      t_object            x_obj;
  
!     t_binbuf*           x_query_binbuf;     // store query in a binbuf for reuse
      
!     struct _proxy_inlet*inlets;             // pointer to array of _proxy_inlets
!     t_atom*             atoms;              // pointer to array of atoms
!     unsigned int        placeholder_count;  // number of items in above arrays
  
!     t_outlet*           x_data_outlet;      // for list of data to plug into query
!     t_outlet*           x_query_outlet;     // for SQL query
  } t_sql_query;
      
***************
*** 86,89 ****
--- 86,92 ----
  }
  
+ 
+ 
+ 
  static void proxy_inlet_anything(t_proxy_inlet *p, t_symbol *s, int argc, t_atom *argv)
  {
***************
*** 109,126 ****
   */
  
! static void sql_query_set_atom(t_sql_query *x, int atom_num, t_symbol *s, t_atom *atom)
  {
!     char *buf;
!     int bufsize;
!     if( (&s == &s_symbol) || (&s == &s_list) )
      {
!         atom_string(atom, buf, bufsize);
      }
      else
      {
!         atom_string(atom, buf, bufsize);
      }
-     post("set atom %s", buf);
-     x->atoms[atom_num] = atom;
  }
  
--- 112,131 ----
   */
  
! static void sql_query_set_atom(t_sql_query *x, int atom_num, t_symbol *s, t_atom *a)
  {
!     DEBUG(post("sql_query_set_atom"););
!     if( (s == &s_symbol) || (s == &s_list) )
      {
!         char buf[MAXPDSTRING];
!         atom_string(a, &buf, MAXPDSTRING);
!         x->atoms[atom_num] = *a;
!         post("symbol/list set %s", buf);
      }
      else
      {
!         post("blah");
!         SETSYMBOL(&x->atoms[atom_num], s);
!         post("selector set %s", s->s_name);
      }
  }
  
***************
*** 132,136 ****
  static void sql_query_bang(t_sql_query *x)
  {
! 
  }
  
--- 137,148 ----
  static void sql_query_bang(t_sql_query *x)
  {
!     DEBUG(post("sql_query_bang"););
!     unsigned int i;
!     char buf[MAXPDSTRING];
!     for(i=0; i < x->placeholder_count; ++i)
!     {
!         atom_string(&x->atoms[i], &buf, MAXPDSTRING);
!         post("output atom %d: %s", i, buf);
!     }
  }
  
***************
*** 164,168 ****
      post("creating %d inlets", x->placeholder_count);
      x->inlets = getbytes(x->placeholder_count * sizeof(t_proxy_inlet));
-     x->atoms = getbytes(x->placeholder_count * sizeof(t_atom *));
      for(i=1; i< x->placeholder_count; ++i)
      {
--- 176,179 ----
***************
*** 171,176 ****
      }
  
  	x->x_data_outlet = outlet_new(&x->x_obj, 0);
! 	x->x_status_outlet = outlet_new(&x->x_obj, 0);
  
  	return (x);
--- 182,193 ----
      }
  
+     x->atoms = getbytes(x->placeholder_count * sizeof(t_atom));
+     for(i=0; i< x->placeholder_count; ++i)
+     {
+         SETSYMBOL(&x->atoms[i], &s_);
+     }
+ 
  	x->x_data_outlet = outlet_new(&x->x_obj, 0);
! 	x->x_query_outlet = outlet_new(&x->x_obj, 0);
  
  	return (x);





More information about the Pd-cvs mailing list