Update of /cvsroot/pure-data/externals/hcs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1002
Modified Files: sql_query.c sql_query-help.pd Log Message: got data and sql query output working; added float handling to sql_query_set_atom()
Index: sql_query-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/hcs/sql_query-help.pd,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sql_query-help.pd 22 Dec 2007 07:24:36 -0000 1.2 --- sql_query-help.pd 22 Dec 2007 23:39:13 -0000 1.3 *************** *** 26,29 **** --- 26,30 ---- #X obj 118 105 sql_query this is a test? more ? ? ? ?; #X msg 39 235 bang; + #X msg 177 268 234; #X connect 0 0 11 1; #X connect 1 0 11 1; *************** *** 37,38 **** --- 38,40 ---- #X connect 11 1 3 1; #X connect 13 0 11 0; + #X connect 14 0 11 0;
Index: sql_query.c =================================================================== RCS file: /cvsroot/pure-data/externals/hcs/sql_query.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sql_query.c 22 Dec 2007 20:28:07 -0000 1.4 --- sql_query.c 22 Dec 2007 23:39:13 -0000 1.5 *************** *** 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;
--- 58,69 ---- t_object x_obj;
! t_binbuf* x_query_binbuf; // binbuf for converting args to string
! 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;
*************** *** 134,147 **** }
! 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); ! } }
--- 134,144 ---- }
! static void sql_query_output(t_sql_query *x) { ! DEBUG(post("sql_query_output");); ! int natom = binbuf_getnatom(x->x_query_binbuf); ! t_atom *vec = binbuf_getvec(x->x_query_binbuf); ! outlet_anything(x->x_query_outlet, vec[0].a_w.w_symbol, natom - 1, vec + 1); ! outlet_list(x->x_data_outlet, &s_list, x->placeholder_count, x->atoms); }
*************** *** 205,209 ****
/* add inlet datatype methods */ ! class_addbang(sql_query_class, (t_method) sql_query_bang); class_addanything(sql_query_class, (t_method) sql_query_anything); } --- 202,206 ----
/* add inlet datatype methods */ ! class_addbang(sql_query_class, (t_method) sql_query_output); class_addanything(sql_query_class, (t_method) sql_query_anything); }