[PD-cvs] externals/sprinkler Changes,1.3,1.4 README.pod,1.3,1.4 configure.in,1.3,1.4 sprinkler.c,1.4,1.5

Bryan Jurish mukau at users.sourceforge.net
Tue Sep 14 19:34:44 CEST 2004


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

Modified Files:
	Changes README.pod configure.in sprinkler.c 
Log Message:
v0.06 Tue, 14 Sep 2004 18:50:03 +0200
  + added --enable-all-forwardmess configure option to use pd_forwardmess()
    for all messages (even those of length 1) : should fix 'bang' problem
  + fixed gcc-3.3 warning re: (++argv) in sprinkler_list() thanks to
    Erasmus Zipfel


Index: README.pod
===================================================================
RCS file: /cvsroot/pure-data/externals/sprinkler/README.pod,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** README.pod	23 Feb 2004 00:32:33 -0000	1.3
--- README.pod	14 Sep 2004 17:34:41 -0000	1.4
***************
*** 26,35 ****
  =over 4
  
! =item * --enable-debug , --disable-debug
  
  Whether to enable verbose debugging messages.
  Default=no.
  
! =item * --enable-forward , --disable-forward
  
  Whether to create [forward] objects as instances
--- 26,35 ----
  =over 4
  
! =item --enable-debug , --disable-debug
  
  Whether to enable verbose debugging messages.
  Default=no.
  
! =item --enable-forward , --disable-forward
  
  Whether to create [forward] objects as instances
***************
*** 37,40 ****
--- 37,52 ----
  Default=no.
  
+ =item --enable-all-forwardmess , --disable-all-forwardmess
+ 
+ Whether to use pd_forwardmess() for all messages.  If this
+ option is disabled (the default), messages of length 1 will
+ be handled specially; thus a symbol 'foo' will be passed as
+ 'symbol foo', rather than just 'foo'.
+ 
+ Default=no.
+ 
+ Future versions of 'sprinkler' may use pd_forwardmess() for
+ all messages by default -- go on, try it!
+ 
  =back
  
***************
*** 49,52 ****
--- 61,66 ----
  and to Miller Puckette for the name "sprinkler".
  
+ Thanks to Erasmus Zipfel for a bugreport and useful ideas.
+ 
  =head1 KNOWN BUGS
  
***************
*** 56,59 ****
--- 70,75 ----
  Backwards-compatible version is incompatible with MAX.
  
+ Semantic strangeness with singleton messages is somewhat cryptic.
+ 
  =head1 AUTHOR
  

Index: Changes
===================================================================
RCS file: /cvsroot/pure-data/externals/sprinkler/Changes,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Changes	23 Feb 2004 00:32:33 -0000	1.3
--- Changes	14 Sep 2004 17:34:41 -0000	1.4
***************
*** 1,4 ****
--- 1,10 ----
  Change log for PD external 'sprinkler' (formerly 'forward')
  
+ v0.06 Tue, 14 Sep 2004 18:50:03 +0200
+   + added --enable-all-forwardmess configure option to use pd_forwardmess()
+     for all messages (even those of length 1) : should fix 'bang' problem
+   + fixed gcc-3.3 warning re: (++argv) in sprinkler_list() thanks to
+     Erasmus Zipfel
+ 
  v0.05 Mon, 23 Feb 2004 01:14:08 +0100
    + added pass-through outlet for unbound destination symbols

Index: sprinkler.c
===================================================================
RCS file: /cvsroot/pure-data/externals/sprinkler/sprinkler.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sprinkler.c	13 Aug 2004 10:10:05 -0000	1.4
--- sprinkler.c	14 Sep 2004 17:34:41 -0000	1.5
***************
*** 1,13 ****
! /* -*- Mode: C -*- */
! /*=============================================================================*\
!  * File: sprinkler.c
   * Author: Bryan Jurish <moocow at ling.uni-potsdam.de>
!  * Description: message-forwarding : workaround for missing dynamic 'send'
   *
   *   + code adapted from 'send_class' in $PD_ROOT/src/x_connective.c
   *   + formerly 'forward.c'
- 
   *
!  * Copyright (c) 2002 Bryan Jurish.
   *
   * For information on usage and redistribution, and for a DISCLAIMER OF ALL
--- 1,16 ----
! /* File: sprinkler.c
   * Author: Bryan Jurish <moocow at ling.uni-potsdam.de>
!  * Contributors:
!  *    Krzysztof Czaja pointed out the MAX-incompatibility of the name 'forward'
!  *    Miller Puckette suggested the name 'sprinkler'
!  *    Erasmus Zipfel diagnosed a bug in sprinkler_list()
!  *
!  * Description: dynamic message-forwarding object
   *
   *   + code adapted from 'send_class' in $PD_ROOT/src/x_connective.c
   *   + formerly 'forward.c'
   *
!  *
!  * Copyright (c) 2002,2004 Bryan Jurish.
   *
   * For information on usage and redistribution, and for a DISCLAIMER OF ALL
***************
*** 32,36 ****
  
  #include <m_pd.h>
- //#include "sprinkler.h"
  
  /* black magic */
--- 35,38 ----
***************
*** 59,63 ****
   *=====================================================================*/
  
! static char *sprinkler_banner = "\nsprinkler version %s by Bryan Jurish : dynamic message dissemination";
  
  static t_class *sprinkler_class;
--- 61,66 ----
   *=====================================================================*/
  
! static char *sprinkler_banner =
! "\nsprinkler version %s by Bryan Jurish : dynamic message dissemination";
  
  static t_class *sprinkler_class;
***************
*** 74,80 ****
   *  + send (the tail of) a list or message to the control-bus
   *    named by its initial element
!  *  + HACK for single-element arglists *ONLY*:
   *    - sprinkler float- and pointer-initial arglists with 'pd_sprinklermess',
!  *      everything else with 'pd_typedmess' as a *LIST*
   *--------------------------------------------------------------------*/
  static void sprinkler_anything(t_sprinkler *x, t_symbol *dst, int argc, t_atom *argv)
--- 77,83 ----
   *  + send (the tail of) a list or message to the control-bus
   *    named by its initial element
!  *  + [DEPRECATED] : HACK for single-element arglists *ONLY*
   *    - sprinkler float- and pointer-initial arglists with 'pd_sprinklermess',
!  *      everything else with 'pd_forwardmess'
   *--------------------------------------------------------------------*/
  static void sprinkler_anything(t_sprinkler *x, t_symbol *dst, int argc, t_atom *argv)
***************
*** 83,97 ****
  #ifdef SPRINKLER_DEBUG
    atom_string(argv, sprinkler_errbuf, EBUFSIZE);
!   post("sprinkler_debug : sprinkler_anything : dst=%s, argc=%d, arg1=%s", dst->s_name, argc, argc ? sprinkler_errbuf : "NULL");
  #endif
  
-   /*-----------------------------------------------------------------------
-    * HACK:
-    * + single-element arglists *ONLY*
-    * + sprinkler float- and pointer-initial arglists with 'pd_sprinklermess',
-    *   everything else with 'pd_typedmess' as a *LIST*
-    *------------------------------------------------------------------------
-    */
    if (dst->s_thing) {
      if (argc == 1) {
        switch (argv->a_type) {
--- 86,104 ----
  #ifdef SPRINKLER_DEBUG
    atom_string(argv, sprinkler_errbuf, EBUFSIZE);
!   post("sprinkler_debug : sprinkler_anything : dst=%s, argc=%d, arg1=%s",
!        dst->s_name, argc, argc ? sprinkler_errbuf : "NULL");
  #endif
  
    if (dst->s_thing) {
+ 
+ #if !defined(ALL_FORWARDMESS)
+ 
+     /*-----------------------------------------------------------------------
+      * HACK (obsolete):
+      * + single-element arglists *ONLY*
+      * + sprinkler float- and pointer-initial arglists with 'pd_sprinklermess',
+      *   everything else with 'pd_forwardmess'
+      *------------------------------------------------------------------------
+      */
      if (argc == 1) {
        switch (argv->a_type) {
***************
*** 125,128 ****
--- 132,138 ----
        }
      }
+ 
+ #endif /* !defined(ALL_FORWARDMESS) */
+ 
      // default -- sprinkler anything else with 'pd_forwardmess'
      pd_forwardmess(dst->s_thing,argc,argv);
***************
*** 140,144 ****
    post("sprinkler_debug : sprinkler_list : argc=%d", argc);
  #endif
!   sprinkler_anything(x,atom_getsymbol(argv),--argc,++argv);
  }
  
--- 150,154 ----
    post("sprinkler_debug : sprinkler_list : argc=%d", argc);
  #endif
!   sprinkler_anything(x,atom_getsymbol(argv), argc-1, argv+1);
  }
  
***************
*** 171,175 ****
  
  #ifdef NON_MAX_FORWARD
!   // add aliases [forward] and [fw]
    post("sprinkler : non-MAX [forward] alias enabled");
    class_addcreator((t_newmethod)sprinkler_new, gensym("forward"), A_DEFSYM, 0);
--- 181,185 ----
  
  #ifdef NON_MAX_FORWARD
!   //-- add aliases [forward] and [fw]
    post("sprinkler : non-MAX [forward] alias enabled");
    class_addcreator((t_newmethod)sprinkler_new, gensym("forward"), A_DEFSYM, 0);
***************
*** 177,185 ****
  #endif
  
  #ifdef SPRINKLER_DEBUG
    post("sprinkler : debugging enabled");
  #endif
    
!   // methods
    class_addlist(sprinkler_class, sprinkler_list);    
    class_addanything(sprinkler_class, sprinkler_anything);
--- 187,200 ----
  #endif
  
+ #ifdef ALL_FORWARDMESS
+   //-- report new semantics
+   post("sprinkler : will use pd_forwardmess() for all messages");
+ #endif
+ 
  #ifdef SPRINKLER_DEBUG
    post("sprinkler : debugging enabled");
  #endif
    
!   //-- methods
    class_addlist(sprinkler_class, sprinkler_list);    
    class_addanything(sprinkler_class, sprinkler_anything);

Index: configure.in
===================================================================
RCS file: /cvsroot/pure-data/externals/sprinkler/configure.in,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** configure.in	23 Feb 2004 00:32:33 -0000	1.3
--- configure.in	14 Sep 2004 17:34:41 -0000	1.4
***************
*** 2,6 ****
  dnl -- adapted from 'configure.in' in ggee distribution by Guenter Geiger
  AC_PREREQ(2.5)
! AC_INIT(sprinkler, [0.05], [moocow at ling.uni-potsdam.de])
  
  dnl
--- 2,6 ----
  dnl -- adapted from 'configure.in' in ggee distribution by Guenter Geiger
  AC_PREREQ(2.5)
! AC_INIT(sprinkler, [0.06], [moocow at ling.uni-potsdam.de])
  
  dnl
***************
*** 70,74 ****
    AC_MSG_RESULT(yes)
    DEBUG="yes"
!   DFLAGS="$DFLAGS -DSPRINKLER_DEBUG"
  else
    AC_MSG_RESULT(no)
--- 70,74 ----
    AC_MSG_RESULT(yes)
    DEBUG="yes"
!   AC_DEFINE(SPRINKLER_DEBUG, 1, [Define this to use pd_forwardmess() for all messages])
  else
    AC_MSG_RESULT(no)
***************
*** 83,87 ****
  AC_MSG_CHECKING([whether to allow non-MAX "forward" alias])
  AC_ARG_ENABLE([forward],
! 	AC_HELP_STRING([--enable-forward],[allow backwards-compatible non-MAX "forward" alias (default=no)]))
  
  if test "$enable_forward" == "yes" ; then
--- 83,89 ----
  AC_MSG_CHECKING([whether to allow non-MAX "forward" alias])
  AC_ARG_ENABLE([forward],
! 	AC_HELP_STRING(
! 	  [--enable-forward],
! 	  [allow backwards-compatible non-MAX "forward" alias (default=no)]))
  
  if test "$enable_forward" == "yes" ; then
***************
*** 104,108 ****
--- 106,124 ----
  AC_SUBST(SPRINKLER_ALIAS_2)
  
+ dnl
+ dnl use pd_forwardmess() for everything?
+ dnl
+ AC_MSG_CHECKING([whether to use pd_forwardmess() for all messages])
+ AC_ARG_ENABLE([all-forwardmess],
+ 	AC_HELP_STRING(
+ 	  [--enable-all-forwardmess],
+ 	  [use pd_forwardmess() for all messages (default=no)]))
  
+ if test "$enable_all_forwardmess" = "yes" ; then
+   AC_MSG_RESULT(yes)
+   AC_DEFINE(ALL_FORWARDMESS, 1, [Define this to use pd_forwardmess() for all messages])
+ else
+   AC_MSG_RESULT(no)
+ fi
  
  dnl





More information about the Pd-cvs mailing list