Update of /cvsroot/pure-data/externals/zexy/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30030
Modified Files:
lifop.c fifop.c
Log Message:
added "dump" and "clear" messages
Index: fifop.c
===================================================================
RCS file: /cvsroot/pure-data/externals/zexy/src/fifop.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** fifop.c 19 May 2006 14:04:32 -0000 1.13
--- fifop.c 12 Dec 2006 11:15:28 -0000 1.14
***************
*** 206,216 ****
}
! static void fifop_help(t_fifop*x)
! {
! post("\n%c fifop\t\t:: a First-In-First-Out queue with priorities", HEARTSYMBOL);
! }
!
!
! static void fifop_free(t_fifop *x)
{
t_fifop_prioritylist *fifo_list=x->fifo_list;
--- 206,210 ----
}
! static void fifop_clear(t_fifop*x)
{
t_fifop_prioritylist *fifo_list=x->fifo_list;
***************
*** 238,241 ****
--- 232,271 ----
}
x->fifo_list=0;
+ x->counter=0;
+ }
+ /* this is NOT re-entrant! */
+ static void fifop_dump(t_fifop*x)
+ {
+ t_fifop_prioritylist*pfifo=getFifo(x->fifo_list);
+
+ if(!pfifo||!pfifo->fifo_start) {
+ outlet_bang(x->x_infout);
+ return;
+ }
+
+ while(pfifo) {
+ t_fifop_list*fifo=pfifo->fifo_start;
+ while(fifo) {
+ t_atom*argv=fifo->argv;
+ int argc=fifo->argc;
+
+ /* output the list */
+ outlet_list(x->x_out, &s_list, argc, argv);
+
+ fifo=fifo->next;
+ }
+ pfifo=pfifo->next;
+ }
+ }
+
+ static void fifop_help(t_fifop*x)
+ {
+ post("\n%c fifop\t\t:: a First-In-First-Out queue with priorities", HEARTSYMBOL);
+ }
+
+
+ static void fifop_free(t_fifop *x)
+ {
+ fifop_clear(x);
outlet_free(x->x_out);
***************
*** 264,267 ****
--- 294,301 ----
class_addbang (fifop_class, fifop_bang);
class_addlist (fifop_class, fifop_list);
+
+ class_addmethod (fifop_class, (t_method)fifop_clear, gensym("clear"), A_NULL);
+ class_addmethod (fifop_class, (t_method)fifop_dump, gensym("dump"), A_NULL);
+
class_addmethod (fifop_class, (t_method)fifop_query, gensym("info"), A_NULL);
class_addmethod (fifop_class, (t_method)fifop_help, gensym("help"), A_NULL);
Index: lifop.c
===================================================================
RCS file: /cvsroot/pure-data/externals/zexy/src/lifop.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** lifop.c 19 May 2006 14:04:32 -0000 1.11
--- lifop.c 12 Dec 2006 11:15:28 -0000 1.12
***************
*** 188,192 ****
outlet_float(x->x_infout, (t_float)x->counter);
}
! static void lifop_free(t_lifop *x)
{
t_lifop_prioritylist *lifo_list=x->lifo_list;
--- 188,192 ----
outlet_float(x->x_infout, (t_float)x->counter);
}
! static void lifop_clear(t_lifop *x)
{
t_lifop_prioritylist *lifo_list=x->lifo_list;
***************
*** 213,216 ****
--- 213,247 ----
}
x->lifo_list=0;
+ x->counter=0;
+ }
+
+ /* this is NOT re-entrant! */
+ static void lifop_dump(t_lifop*x)
+ {
+ t_lifop_prioritylist*plifo=getLifo(x->lifo_list);
+
+ if(!plifo||!plifo->lifo_start) {
+ outlet_bang(x->x_infout);
+ return;
+ }
+
+ while(plifo) {
+ t_lifop_list*lifo=plifo->lifo_start;
+ while(lifo) {
+ t_atom*argv=lifo->argv;
+ int argc=lifo->argc;
+
+ /* output the list */
+ outlet_list(x->x_out, &s_list, argc, argv);
+
+ lifo=lifo->next;
+ }
+ plifo=plifo->next;
+ }
+ }
+
+ static void lifop_free(t_lifop *x)
+ {
+ lifop_clear(x);
outlet_free(x->x_out);
***************
*** 243,246 ****
--- 274,281 ----
class_addbang (lifop_class, lifop_bang);
class_addlist (lifop_class, lifop_list);
+
+ class_addmethod (lifop_class, (t_method)lifop_clear, gensym("clear"), A_NULL);
+ class_addmethod (lifop_class, (t_method)lifop_dump, gensym("dump"), A_NULL);
+
class_addmethod (lifop_class, (t_method)lifop_query, gensym("info"), A_NULL);
class_addmethod (lifop_class, (t_method)lifop_help, gensym("help"), A_NULL);