aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Jurish <mukau@users.sourceforge.net>2009-01-17 22:22:38 +0000
committerBryan Jurish <mukau@users.sourceforge.net>2009-01-17 22:22:38 +0000
commit2787f508f244b5fcbca0b38c3ca755d555b723bf (patch)
tree312666db4b3d80bd347a66d30def23a90d956345
parent6757130ebc12fd86881d082925ffd321b1078ce7 (diff)
+ (re-)added sprinkler
svn path=/trunk/externals/moocow/; revision=10571
-rw-r--r--extended/Makefile10
-rw-r--r--sprinkler/Changes34
-rw-r--r--sprinkler/GnuGPL.txt290
-rw-r--r--sprinkler/Makefile.am172
-rw-r--r--sprinkler/README.cvs13
-rw-r--r--sprinkler/README.pod76
-rw-r--r--sprinkler/README.txt59
-rwxr-xr-xsprinkler/autogen.sh48
-rw-r--r--sprinkler/config/Makefile.am66
-rw-r--r--sprinkler/configure.in240
-rw-r--r--sprinkler/sprinkler-help.pd53
-rw-r--r--sprinkler/sprinkler-help.pd.in53
-rw-r--r--sprinkler/sprinkler.c204
13 files changed, 1314 insertions, 4 deletions
diff --git a/extended/Makefile b/extended/Makefile
index 84a6329..73a7e57 100644
--- a/extended/Makefile
+++ b/extended/Makefile
@@ -8,14 +8,16 @@
##======================================================================
## Variables
+SUBDIRS_TEST = sprinkler
SUBDIRS = \
flite \
gfsm \
deque \
readdir \
weightmap \
- pdstring \
- sprinkler
+ pdstring
+
+# sprinkler
##-- 'pdstring' and 'sprinkler' are already in 'flatspace' ... should they be moved here?
## -> 2008-08: removed any2string,string2any,pdstring from flatspace
@@ -223,9 +225,9 @@ readdir.cvsclean: readdir.extclean
##======================================================================
## Rules: subdirectory: sprinkler
-## + one directory higher in the tree than usual...
+## + (used to be one directory higher in the tree than usual...)
-SPRINKLER_DIR ?=../../sprinkler
+SPRINKLER_DIR ?=../sprinkler
SPRINKLER_CONFIGURE_ARGS ?=
sprinkler.autogen_stamp:
(cd $(SPRINKLER_DIR); sh ./autogen.sh) || true
diff --git a/sprinkler/Changes b/sprinkler/Changes
new file mode 100644
index 0000000..33e4187
--- /dev/null
+++ b/sprinkler/Changes
@@ -0,0 +1,34 @@
+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
+ + added hack to prevent 'bang's being sprinkled as 'normal' symbols
+
+v0.04 Thu, 29 Jan 2004 16:26:00 +0100
+ + added error() call for missing destinations
+ + todo: add pass-through outlet for missing destinations
+
+v0.03 Sun Sep 8 00:56:33 CEST 2002
+ + renamed to 'sprinkler'
+ + added 'configure' option --enable-forward to allow
+ backwards-compatibility
+ + added 'configure option --enable-debug
+ + added help-file tweaking to 'configure.in'
+
+v0.02 Sun Sep 1 00:47:40 CEST 2002
+ + added black magic in 'forward_anything()' to generate
+ real selectors for single-element arglists (especially symbols)
+ + gutted 'configure.in'
+ + added check for MacOSX in 'configure.in'
+ + added 'OFLAGS' autoconf->makefile variable for
+ optimization flags: contents from pd-0.35-test16
+ + added 'autogen.sh' and 'README.cvs'
+
+v0.01 Sun Apr 21 15:21:42 CEST 2002
+ + initial distributed version
diff --git a/sprinkler/GnuGPL.txt b/sprinkler/GnuGPL.txt
new file mode 100644
index 0000000..fa0bef4
--- /dev/null
+++ b/sprinkler/GnuGPL.txt
@@ -0,0 +1,290 @@
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom
+to share and change it. By contrast, the GNU General Public License is
+intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This General
+Public License applies to most of the Free Software Foundation's
+software and to any other program whose authors commit to using it.
+(Some other Free Software Foundation software is covered by the
+GNU Library General Public License instead.) You can apply it to your
+programs, too.
+
+When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone
+to deny you these rights or to ask you to surrender the rights. These
+restrictions translate to certain responsibilities for you if you distribute
+copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis
+or for a fee, you must give the recipients all the rights that you have. You
+must make sure that they, too, receive or can get the source code. And
+you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on,
+we want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.
+We wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program
+proprietary. To prevent this, we have made it clear that any patent must
+be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and
+modification follow.
+
+TERMS AND CONDITIONS FOR
+COPYING, DISTRIBUTION AND
+MODIFICATION
+
+0. This License applies to any program or other work which contains a
+notice placed by the copyright holder saying it may be distributed under
+the terms of this General Public License. The "Program", below, refers
+to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it, either
+verbatim or with modifications and/or translated into another language.
+(Hereinafter, translation is included without limitation in the term
+"modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of running
+the Program is not restricted, and the output from the Program is
+covered only if its contents constitute a work based on the Program
+(independent of having been made by running the Program). Whether
+that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the notices
+that refer to this License and to the absence of any warranty; and give
+any other recipients of the Program a copy of this License along with the
+Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide a
+ warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but does
+ not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program, and
+can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based on
+the Program, the distribution of the whole must be on the terms of this
+License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise the
+right to control the distribution of derivative or collective works based
+on the Program.
+
+In addition, mere aggregation of another work not based on the
+Program with the Program (or with a work based on the Program) on a
+volume of a storage or distribution medium does not bring the other
+work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding
+ machine-readable source code, which must be distributed under
+ the terms of Sections 1 and 2 above on a medium customarily
+ used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your cost
+ of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a
+ medium customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with
+ such an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to control
+compilation and installation of the executable. However, as a special
+exception, the source code distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies the
+executable.
+
+If distribution of executable or object code is made by offering access to
+copy from a designated place, then offering equivalent access to copy
+the source code from the same place counts as distribution of the source
+code, even though third parties are not compelled to copy the source
+along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt otherwise
+to copy, modify, sublicense or distribute the Program is void, and will
+automatically terminate your rights under this License. However, parties
+who have received copies, or rights, from you under this License will not
+have their licenses terminated so long as such parties remain in full
+compliance.
+
+5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and all
+its terms and conditions for copying, distributing or modifying the
+Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these terms
+and conditions. You may not impose any further restrictions on the
+recipients' exercise of the rights granted herein. You are not responsible
+for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot distribute
+so as to satisfy simultaneously your obligations under this License and
+any other pertinent obligations, then as a consequence you may not
+distribute the Program at all. For example, if a patent license would not
+permit royalty-free redistribution of the Program by all those who
+receive copies directly or indirectly through you, then the only way you
+could satisfy both it and this License would be to refrain entirely from
+distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents
+or other property right claims or to contest validity of any such claims;
+this section has the sole purpose of protecting the integrity of the free
+software distribution system, which is implemented by public license
+practices. Many people have made generous contributions to the wide
+range of software distributed through that system in reliance on
+consistent application of that system; it is up to the author/donor to
+decide if he or she is willing to distribute software through any other
+system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be
+a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Program under this License may add an
+explicit geographical distribution limitation excluding those countries, so
+that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new
+versions of the General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may differ in
+detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number
+of this License, you may choose any version ever published by the Free
+Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we
+sometimes make exceptions for this. Our decision will be guided by the
+two goals of preserving the free status of all derivatives of our free
+software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF
+CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM,
+TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
+WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE
+PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD
+THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
+COST OF ALL NECESSARY SERVICING, REPAIR OR
+CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW
+OR AGREED TO IN WRITING WILL ANY COPYRIGHT
+HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED
+ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
+ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
+LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
+WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
+OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
diff --git a/sprinkler/Makefile.am b/sprinkler/Makefile.am
new file mode 100644
index 0000000..af90188
--- /dev/null
+++ b/sprinkler/Makefile.am
@@ -0,0 +1,172 @@
+# File: ./Makefile.am
+# Package: sprinkler
+# Description:
+# + top-level automake file
+#
+# Process this file with Automake to create Makefile.in.
+#-----------------------------------------------------------------------
+
+#-----------------------------------------------------------------------
+# Options & Subdirectories
+#-----------------------------------------------------------------------
+
+## --- automake options
+#AUTOMAKE_OPTIONS = foreign dist-bzip2 dist-zip
+AUTOMAKE_OPTIONS = foreign
+
+## --- recursion subdirectories
+#SUBDIRS = config src
+
+## --- pseudo-deps for '.SUFFIXES'
+SUFFIXES = .pod .txt .@PDEXT@
+
+#-----------------------------------------------------------------------
+# Variables: cleanup
+#-----------------------------------------------------------------------
+## --- mostlyclean: built by 'make' & commonly rebuilt
+#MOSTLYCLEANFILES =
+
+## --- clean: built by 'make'
+#CLEANFILES =
+
+## --- distclean: built by 'configure'
+DISTCLEANFILES = \
+ config.log \
+ config.cache \
+ config.status
+
+## -- maintainerclean: built by maintainer / by hand
+MAINTAINERCLEANFILES = \
+ *.$(PDEXT) \
+ .*~ *~ \
+ Makefile Makefile.in \
+ aclocal.m4 \
+ configure \
+ install-sh \
+ stamp-h.in \
+ config.h.in \
+ compile \
+ config.guess \
+ config.sub \
+ depcomp \
+ install-sh \
+ ltmain.sh \
+ missing \
+ mkinstalldirs \
+ texinfo.tex \
+ ylwrap
+
+# $(PODS:.pod=.txt)
+
+maintainer-clean-local:
+ rm -rf autom4te.cache
+
+#CVSCLEAN_SUBDIRS = $(SUBDIRS)
+
+#CVSCLEANFILES = Makefile.in Makefile
+
+
+#-----------------------------------------------------------------------
+# Additional Variables & Rules: PODS
+#-----------------------------------------------------------------------
+PODS = README.pod
+
+.pod.txt:
+ pod2text $< $@
+
+all-local: $(PODS:.pod=.txt)
+
+#-----------------------------------------------------------------------
+# Variables: distribution
+#-----------------------------------------------------------------------
+
+## --- extra distribution files
+EXTRA_DIST = \
+ $(PODS:.pod=.txt) autogen.sh configure \
+ README.cvs GnuGPL.txt \
+ Makefile.in
+
+## --- recursion subdirectories for 'make dist'
+#DIST_SUBDIRS = $(SUBDIRS)
+
+## --- dist-hook: when another 'Makefile.am' is overkill
+#DISTHOOK_DIRS = foo
+#DISTHOOK_FILES = foo/bar.txt foo/baz.txt
+#dist-hook:
+# for d in $(DISTHOOK_DIRS); do\
+# mkdir -p $(distdir)/$$d ;\
+# done
+# for f in $(DISTHOOK_FILES); do\
+# cp -p $(srcdir)/$$f $(distdir)/$$f ;\
+# done
+
+#dist-bz2: dist-bzip2 ;
+
+
+#-----------------------------------------------------------------------
+# Rules: cleanup
+#-----------------------------------------------------------------------
+.PHONY: cvsclean cvsclean-hook
+
+cvsclean: maintainer-clean ;
+
+##======================================================================
+## sources etc
+##======================================================================
+
+#-----------------------------------------------------------------------
+# Flags and variables
+#-----------------------------------------------------------------------
+PDEXT = @PDEXT@
+EXEEXT = .@PDEXT@
+
+#-----------------------------------------------------------------------
+# pd externals (hacked _PROGRAMS target)
+#-----------------------------------------------------------------------
+
+## --- externals
+pdexterns_PROGRAMS = @PD_OBJECT_EXTERNALS@
+
+## --- possible externals
+EXTRA_PROGRAMS = \
+ sprinkler
+
+## --- patches
+pdexterns_DATA =
+
+## --- documentation
+pddoc_DATA = sprinkler-help.pd
+
+
+#-----------------------------------------------------------------------
+# sources
+#-----------------------------------------------------------------------
+
+sprinkler_SOURCES = \
+ sprinkler.c
+
+#-----------------------------------------------------------------------
+# external compilation : flags
+#-----------------------------------------------------------------------
+DEFS = @DEFS@
+AFLAGS = @AFLAGS@
+DFLAGS = @DFLAGS@
+IFLAGS = @IFLAGS@
+LFLAGS = @LFLAGS@
+OFLAGS = @OFLAGS@
+WFLAGS = -Wall -Winline
+
+AM_CPPFLAGS = $(IFLAGS) $(DFLAGS)
+AM_CFLAGS = $(OFLAGS) $(WFLAGS) $(AFLAGS)
+
+sprinkler_LDFLAGS = $(LFLAGS)
+#sprinkler_LDADD =
+
+#-----------------------------------------------------------------------
+# Variables: distribution
+#-----------------------------------------------------------------------
+
+## --- extra distribution files
+EXTRA_DIST += \
+ $(pddoc_DATA) \
+ $(pdexterns_DATA)
diff --git a/sprinkler/README.cvs b/sprinkler/README.cvs
new file mode 100644
index 0000000..2a0ee0c
--- /dev/null
+++ b/sprinkler/README.cvs
@@ -0,0 +1,13 @@
+To build from cvs, do the following:
+
+ ./autogen.sh
+ ./configure
+ make
+ make install
+
+NOTE: The README.txt file in the distribution
+is auto-generated from perl ".pod" format by
+the "pod2text" included in most perl distributions.
+
+marmosets,
+ Bryan
diff --git a/sprinkler/README.pod b/sprinkler/README.pod
new file mode 100644
index 0000000..301aa49
--- /dev/null
+++ b/sprinkler/README.pod
@@ -0,0 +1,76 @@
+=pod
+
+README for pd external 'sprinkler' (formerly 'forward')
+
+=head1 DESCRIPTION
+
+'sprinkler' objects do dynamic control-message dissemination.
+
+Given a list as input, a 'sprinkler' object interprets the initial
+list element as the name of a 'receive' object, and [send]s the
+rest of the list to that object.
+
+=head1 INSTALLATION
+
+Issue the following commands to the shell:
+
+ cd sprinkler-X.YY (or wherever you extracted the distribution)
+ ./configure
+ make
+ make install
+
+=head1 BUILD OPTIONS
+
+The 'configure' script supports the following options, among others:
+
+=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
+of the [sprinkler] class (MAX-incompatible).
+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
+
+=head1 ACKNOWLEDGEMENTS
+
+PD by Miller Puckette and others.
+
+Ideas, black magic, and other nuggets of information drawn
+from code by Guenter Geiger, Larry Troxler, and iohannes m zmoeling.
+
+Thanks to Krzysztof Czaja for pointing out to me the existence of MAX "forward",
+and to Miller Puckette for the name "sprinkler".
+
+Thanks to Erasmus Zipfel for a bugreport and useful ideas.
+
+=head1 KNOWN BUGS
+
+One of the acknowledgements used to be in this section.
+Sorry, folks.
+
+Backwards-compatible version is incompatible with MAX.
+
+Semantic strangeness with singleton messages is somewhat cryptic.
+
+=head1 AUTHOR
+
+Bryan Jurish E<lt>moocow@ling.uni-potsdam.deE<gt>
diff --git a/sprinkler/README.txt b/sprinkler/README.txt
new file mode 100644
index 0000000..900c332
--- /dev/null
+++ b/sprinkler/README.txt
@@ -0,0 +1,59 @@
+ README for pd external 'sprinkler' (formerly 'forward')
+
+DESCRIPTION
+ 'sprinkler' objects do dynamic control-message dissemination.
+
+ Given a list as input, a 'sprinkler' object interprets the initial list
+ element as the name of a 'receive' object, and [send]s the rest of the
+ list to that object.
+
+INSTALLATION
+ Issue the following commands to the shell:
+
+ cd sprinkler-X.YY (or wherever you extracted the distribution)
+ ./configure
+ make
+ make install
+
+BUILD OPTIONS
+ The 'configure' script supports the following options, among others:
+
+ --enable-debug , --disable-debug
+ Whether to enable verbose debugging messages. Default=no.
+
+ --enable-forward , --disable-forward
+ Whether to create [forward] objects as instances of the [sprinkler]
+ class (MAX-incompatible). Default=no.
+
+ --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!
+
+ACKNOWLEDGEMENTS
+ PD by Miller Puckette and others.
+
+ Ideas, black magic, and other nuggets of information drawn from code by
+ Guenter Geiger, Larry Troxler, and iohannes m zmoeling.
+
+ Thanks to Krzysztof Czaja for pointing out to me the existence of MAX
+ "forward", and to Miller Puckette for the name "sprinkler".
+
+ Thanks to Erasmus Zipfel for a bugreport and useful ideas.
+
+KNOWN BUGS
+ One of the acknowledgements used to be in this section. Sorry, folks.
+
+ Backwards-compatible version is incompatible with MAX.
+
+ Semantic strangeness with singleton messages is somewhat cryptic.
+
+AUTHOR
+ Bryan Jurish <moocow@ling.uni-potsdam.de>
+
diff --git a/sprinkler/autogen.sh b/sprinkler/autogen.sh
new file mode 100755
index 0000000..629feb1
--- /dev/null
+++ b/sprinkler/autogen.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+#-----------------------------------------------------------------------
+# File: autogen.sh
+# Description:
+# + wrapper for m4 black-magic
+#-----------------------------------------------------------------------
+
+MY_ALDIRS="."
+MY_AHDIRS=""
+MY_AMDIRS="."
+MY_ACDIRS="."
+
+test -z "$ACLOCAL" && ACLOCAL=aclocal
+test -z "$AUTOHEADER" && AUTOHEADER=autoheader
+test -z "$AUTOMAKE" && AUTOMAKE=automake
+test -z "$AUTOCONF" && AUTOCONF=autoconf
+
+if test -n "$MY_ALDIRS"; then
+ for d in $MY_ALDIRS ; do
+ echo "(cd $d ; $ACLOCAL)"
+ (cd $d ; $ACLOCAL)
+ done
+fi
+
+if test -n "$MY_AHDIRS"; then
+ for d in $MY_AHDIRS ; do
+ echo "(cd $d ; $AUTOHEADER)"
+ (cd $d ; $AUTOHEADER)
+ done
+fi
+
+if test -n "$MY_AMDIRS"; then
+ for d in $MY_AMDIRS ; do
+ echo "(cd $d ; $AUTOMAKE -a)"
+ (cd $d ; $AUTOMAKE -a)
+ done
+fi
+
+if test -n "$MY_ACDIRS"; then
+ for d in $MY_ACDIRS ; do
+ echo "(cd $d ; $AUTOCONF)"
+ (cd $d ; $AUTOCONF)
+ done
+fi
+
+#echo "(./configure)"
+#./configure $*
diff --git a/sprinkler/config/Makefile.am b/sprinkler/config/Makefile.am
new file mode 100644
index 0000000..16e2ab8
--- /dev/null
+++ b/sprinkler/config/Makefile.am
@@ -0,0 +1,66 @@
+## File: config/Makefile.am
+## Package: sprinkler
+## Description:
+## + automake file for 'config' package-subdir
+##
+## Process this file with Automake to create Makefile.in.
+##-----------------------------------------------------------------------
+
+##-----------------------------------------------------------------------
+## Variables: options
+##-----------------------------------------------------------------------
+
+##-----------------------------------------------------------------------
+## Variables: cleanup
+##-----------------------------------------------------------------------
+
+## --- mostlyclean: built by 'make' & commonly rebuilt
+#MOSTLYCLEANFILES =
+
+## --- clean: built by 'make'
+#CLEANFILES =
+
+## --- distclean: built by 'configure'
+#DISTCLEANFILES =
+
+## -- maintainerclean: built by maintainer / by hand
+MAINTAINERCLEANFILES = \
+ *~ .*~ \
+ compile Makefile Makefile.in \
+ config.guess \
+ config.sub \
+ depcomp \
+ install-sh \
+ ltmain.sh \
+ missing \
+ mkinstalldirs \
+ texinfo.tex \
+ ylwrap
+
+
+##-----------------------------------------------------------------------
+## Variables: distribution
+##-----------------------------------------------------------------------
+
+## --- extra distribution files
+EXTRA_DIST = \
+ Makefile.in \
+ depcomp \
+ install-sh \
+ mkinstalldirs \
+ missing
+
+# config.guess
+# config.sub
+# ltmain.sh
+# texinfo.tex
+
+## --- recursion subdirectories for 'make dist'
+#DIST_SUBDIRS = $(SUBDIRS)
+
+#-----------------------------------------------------------------------
+# Rules: cleanup
+#-----------------------------------------------------------------------
+.PHONY: cvsclean cvsclean-hook
+
+cvsclean: maintainer-clean ;
diff --git a/sprinkler/configure.in b/sprinkler/configure.in
new file mode 100644
index 0000000..d7b8564
--- /dev/null
+++ b/sprinkler/configure.in
@@ -0,0 +1,240 @@
+dnl Process this file with autoconf to produce a configure script.
+dnl -- adapted from 'configure.in' in ggee distribution by Guenter Geiger
+AC_PREREQ(2.5)
+
+dnl Some handy macros
+define([THE_PACKAGE_NAME], [sprinkler])
+define([THE_PACKAGE_VERSION], [0.06])
+define([THE_PACKAGE_AUTHOR], [moocow@ling.uni-potsdam.de])
+
+AC_INIT(THE_PACKAGE_NAME, THE_PACKAGE_VERSION, THE_PACKAGE_AUTHOR)
+
+dnl
+dnl source & aux
+dnl
+AC_CONFIG_AUX_DIR(config)
+
+
+dnl
+dnl save user's CFLAGS,CPPFLAGS
+dnl
+UCPPFLAGS="$CPPFLAGS"
+UCFLAGS="$CFLAGS"
+
+dnl
+dnl use automake
+dnl
+AM_INIT_AUTOMAKE(THE_PACKAGE_NAME, THE_PACKAGE_VERSION)
+
+dnl
+dnl use autoheader
+dnl
+dnl AM_CONFIG_HEADER(config.h)
+
+dnl
+dnl Programs, prefix
+dnl
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PREFIX_DEFAULT(/usr/local)
+
+dnl
+dnl Substitutions
+dnl
+AC_SUBST(AFLAGS)
+AC_SUBST(DFLAGS)
+AC_SUBST(IFLAGS)
+AC_SUBST(LFLAGS)
+AC_SUBST(OFLAGS)
+AC_SUBST(WFLAGS)
+AC_SUBST(LD)
+
+AC_SUBST(PDEXT)
+
+dnl version stuff (automatically exported?)
+AC_SUBST(PACKAGE_VERSION)
+AC_SUBST(PACKAGE_NAME)
+AC_SUBST(BUGREPORT)
+
+dnl other flags
+dnl AC_ISC_POSIX
+
+##--------------------------------------------------------------
+## Pd external objects
+AC_MSG_CHECKING([how to hack automake EXEEXT conventions])
+case "${am__api_version}" in
+ 1.[[0-4]]*)
+ AC_MSG_RESULT([automake v${am__api_version}: on install])
+ buildext=""
+ ;;
+ *)
+ AC_MSG_RESULT([automake v${am__api_version}: on build])
+ buildext="\$(EXEEXT)"
+ ;;
+esac
+PD_OBJECT_EXTERNALS="sprinkler${buildext}"
+AC_SUBST(PD_OBJECT_EXTERNALS)
+
+
+##--------------------------------------------------------------
+## Pd directories
+AC_ARG_WITH(pd-dir,
+ AC_HELP_STRING([--with-pd-dir=DIR], [PD base directory (default=PREFIX/pd)]),
+ [pddir="$withval"],
+ [pddir="\${prefix}/pd"])
+pddocdir="${pddir}/doc/5.reference"
+AC_SUBST(pddir)
+AC_SUBST(pddocdir)
+
+
+AC_ARG_WITH(pd-include,
+ AC_HELP_STRING([--with-pd-include=DIR], [PD include directory (default=NONE)]),
+ [pdincludedir="$withval"],
+ [pdincludedir=""])
+if test -n "$pdincludedir" ; then
+ IFLAGS="$IFLAGS -I$pdincludedir"
+fi
+AC_SUBST(pdincludedir)
+
+AC_ARG_WITH(pd-extdir,
+ AC_HELP_STRING([--with-pd-extdir=DIR], [Directory for PD externals (default=PDDIR/externs)]),
+ [pdexternsdir="$withval"],
+ [pdexternsdir="$pddir/externs"])
+AC_SUBST(pdexternsdir)
+
+dnl
+dnl Check for m_pd.h
+dnl
+CPPFLAGS="$CPPFLAGS $IFLAGS"
+AC_CHECK_HEADER(m_pd.h,[],
+ AC_MSG_WARN([-----------------------------------------------------------------])
+ AC_MSG_WARN([could not find PD header file 'm_pd.h' -- things might get ugly.])
+ AC_MSG_WARN([-----------------------------------------------------------------]),
+ [/* nonempty includes: compile only */])
+
+##--------------------------------------------------------------
+## local config
+
+dnl
+dnl build backwards-compatible non-max 'forward'?
+dnl
+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
+ AC_MSG_RESULT(yes)
+ NON_MAX_FORWARD="yes"
+ DFLAGS="$DFLAGS -DNON_MAX_FORWARD"
+ SPRINKLER_COMPAT_TEXT=["(with MAX-incompatible [forward] alias)"]
+ SPRINKLER_ALIAS_1="#X obj 102 407 forward;"
+ SPRINKLER_ALIAS_2="#X obj 102 432 fw;"
+else
+ AC_MSG_RESULT(no)
+ NON_MAX_FORWARD="no"
+ SPRINKLER_COMPAT_TEXT=["(formerly MAX-incompatible \[forward\])"]
+ SPRINKLER_ALIAS_1="#X text 102 407 none;"
+ SPRINKLER_ALIAS_2="#X text 102 432 (disabled);"
+fi
+AC_SUBST(NON_MAX_FORWARD)
+AC_SUBST(SPRINKLER_COMPAT_TEXT)
+AC_SUBST(SPRINKLER_ALIAS_1)
+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
+
+
+##--------------------------------------------------------------
+## debug?
+AC_MSG_CHECKING([whether we are building a debug version])
+AC_ARG_ENABLE([debug],
+ AC_HELP_STRING([--enable-debug],[build debug version (default=no)]))
+if test "$enable_debug" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ DEBUG="yes"
+ AC_DEFINE(SPRINKLER_DEBUG,1,
+ [Define this to include debugging code for the 'readdir' external.])
+else
+ AC_MSG_RESULT(no)
+ DEBUG="no"
+fi
+AC_SUBST(DEBUG)
+
+
+##--------------------------------------------------------------
+## machine-dependent variables
+##
+LD=ld
+if test `uname -s` = Linux;
+then
+ LFLAGS="-export_dynamic -shared"
+ if test "$DEBUG" = "no"; then
+ #OFLAGS="-O6 -funroll-loops -fomit-frame-pointer -finline-limit-10000000"
+ OFLAGS="-O3 -funroll-loops -fomit-frame-pointer -pipe"
+ else
+ OFLAGS="-g"
+ fi
+ PDEXT=pd_linux
+fi
+
+if test `uname -m` = alpha;
+then
+ AFLAGS="-mieee -mcpu=ev56";
+ OFLAGS="$CFLAGS"
+fi
+
+if test `uname -s` = IRIX64;
+then
+ LFLAGS="-n32 -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
+ -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
+ -shared -rdata_shared"
+ OFLAGS="$CFLAGS"
+ PDEXT=pd_irix6
+fi
+
+if test `uname -s` = IRIX32;
+then
+ LFLAGS="-o32 -DUNIX -DIRIX -O2 -shared -rdata_shared"
+ OFLAGS="$CFLAGS"
+ PDEXT=pd_irix5
+fi
+
+dnl
+dnl Flags for MacOSX, borrowed from pd-0.35-test16
+dnl
+if test `uname -s` = Darwin;
+then
+ LD=cc
+ LFLAGS="-bundle -undefined suppress -flat_namespace"
+ PDEXT=pd_darwin
+ DFLAGS="$DFLAGS -DMACOSX"
+
+ if test "$DEBUG" = "no"; then
+ OFLAGS="-O2"
+ else
+ OFLAGS="-g"
+ fi
+fi
+
+
+##-- restore user's CFLAGS
+CFLAGS="$UCFLAGS"
+CPPFLAGS="$UCPPFLAGS"
+
+AC_OUTPUT(config/Makefile sprinkler-help.pd Makefile)
diff --git a/sprinkler/sprinkler-help.pd b/sprinkler/sprinkler-help.pd
new file mode 100644
index 0000000..296ca25
--- /dev/null
+++ b/sprinkler/sprinkler-help.pd
@@ -0,0 +1,53 @@
+#N canvas 193 23 510 596 10;
+#X floatatom 26 36 5 0 0 0 - - -;
+#X symbolatom 36 100 10 0 0 0 - - -;
+#X text 25 389 ARGUMENTS: none;
+#X text 183 387 INLETS:;
+#X text 183 423 OUTLETS: none;
+#X text 217 161 forward lists;
+#X text 161 45 forward single floats;
+#X text 169 107 forward single symbols;
+#X text 41 469 NOTES:;
+#X text 185 401 1 - list or message of the form DST MSG;
+#X text 165 567 Bryan Jurish <moocow@ling.uni-potsdam.de>;
+#X floatatom 117 257 5 0 0 0 - - -;
+#X obj 53 257 pack s 0;
+#X text 178 224 dynamic destination;
+#X msg 45 153 420;
+#X obj 25 326 sprinkler;
+#X text 53 3 sprinkler : dynamic control-message dissemination;
+#X text 41 483 When a [sprinkler] object gets an input message of the
+form "DST MSG" at its inlet \, the message MSG is sent to the [receive]
+object(s) named by DST. 'sprinkler' is really only useful if you don't
+know (or don't want to know) the length and/or type(s) of your messages
+beforehand.;
+#X msg 25 59 sprinkler-help1 \$1;
+#X msg 35 121 sprinkler-help2 \$1;
+#X msg 45 177 sprinkler-help1 \$1 24 7;
+#X msg 54 212 sprinkler-help1;
+#X msg 60 234 sprinkler-help2;
+#X obj 340 42 r sprinkler-help1;
+#X obj 340 64 print sprinkler-help1;
+#X obj 340 110 r sprinkler-help2;
+#X obj 340 132 print sprinkler-help2;
+#X obj 25 350 print sprinkler-thru;
+#X text 257 298 this gets passed through;
+#X msg 53 297 illusory-receive-name uh oh;
+#X text 39 407 ALIASES:;
+#X text 102 407 none;
+#X text 102 432 (disabled);
+#X text 135 18 (formerly MAX-incompatible \[forward\]);
+#X connect 0 0 18 0;
+#X connect 1 0 19 0;
+#X connect 11 0 12 1;
+#X connect 12 0 15 0;
+#X connect 14 0 20 0;
+#X connect 15 0 27 0;
+#X connect 18 0 15 0;
+#X connect 19 0 15 0;
+#X connect 20 0 15 0;
+#X connect 21 0 12 0;
+#X connect 22 0 12 0;
+#X connect 23 0 24 0;
+#X connect 25 0 26 0;
+#X connect 29 0 15 0;
diff --git a/sprinkler/sprinkler-help.pd.in b/sprinkler/sprinkler-help.pd.in
new file mode 100644
index 0000000..73e93ac
--- /dev/null
+++ b/sprinkler/sprinkler-help.pd.in
@@ -0,0 +1,53 @@
+#N canvas 193 23 510 596 10;
+#X floatatom 26 36 5 0 0 0 - - -;
+#X symbolatom 36 100 10 0 0 0 - - -;
+#X text 25 389 ARGUMENTS: none;
+#X text 183 387 INLETS:;
+#X text 183 423 OUTLETS: none;
+#X text 217 161 forward lists;
+#X text 161 45 forward single floats;
+#X text 169 107 forward single symbols;
+#X text 41 469 NOTES:;
+#X text 185 401 1 - list or message of the form DST MSG;
+#X text 165 567 Bryan Jurish <moocow@ling.uni-potsdam.de>;
+#X floatatom 117 257 5 0 0 0 - - -;
+#X obj 53 257 pack s 0;
+#X text 178 224 dynamic destination;
+#X msg 45 153 420;
+#X obj 25 326 sprinkler;
+#X text 53 3 sprinkler : dynamic control-message dissemination;
+#X text 41 483 When a [sprinkler] object gets an input message of the
+form "DST MSG" at its inlet \, the message MSG is sent to the [receive]
+object(s) named by DST. 'sprinkler' is really only useful if you don't
+know (or don't want to know) the length and/or type(s) of your messages
+beforehand.;
+#X msg 25 59 sprinkler-help1 \$1;
+#X msg 35 121 sprinkler-help2 \$1;
+#X msg 45 177 sprinkler-help1 \$1 24 7;
+#X msg 54 212 sprinkler-help1;
+#X msg 60 234 sprinkler-help2;
+#X obj 340 42 r sprinkler-help1;
+#X obj 340 64 print sprinkler-help1;
+#X obj 340 110 r sprinkler-help2;
+#X obj 340 132 print sprinkler-help2;
+#X obj 25 350 print sprinkler-thru;
+#X text 257 298 this gets passed through;
+#X msg 53 297 illusory-receive-name uh oh;
+#X text 39 407 ALIASES:;
+@SPRINKLER_ALIAS_1@
+@SPRINKLER_ALIAS_2@
+#X text 135 18 @SPRINKLER_COMPAT_TEXT@;
+#X connect 0 0 18 0;
+#X connect 1 0 19 0;
+#X connect 11 0 12 1;
+#X connect 12 0 15 0;
+#X connect 14 0 20 0;
+#X connect 15 0 27 0;
+#X connect 18 0 15 0;
+#X connect 19 0 15 0;
+#X connect 20 0 15 0;
+#X connect 21 0 12 0;
+#X connect 22 0 12 0;
+#X connect 23 0 24 0;
+#X connect 25 0 26 0;
+#X connect 29 0 15 0;
diff --git a/sprinkler/sprinkler.c b/sprinkler/sprinkler.c
new file mode 100644
index 0000000..a6fd458
--- /dev/null
+++ b/sprinkler/sprinkler.c
@@ -0,0 +1,204 @@
+/* File: sprinkler.c
+ * Author: Bryan Jurish <moocow@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
+ * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * See file LICENSE for further informations on licensing terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *=============================================================================*/
+
+#include <m_pd.h>
+
+/* black magic */
+#ifdef NT
+#pragma warning( disable : 4244 )
+#pragma warning( disable : 4305 )
+#endif
+
+/*--------------------------------------------------------------------
+ * DEBUG
+ *--------------------------------------------------------------------*/
+//#define SPRINKLER_DEBUG 1
+
+
+/*=====================================================================
+ * Constants
+ *=====================================================================*/
+#ifdef SPRINKLER_DEBUG
+// error-message buffer
+#define EBUFSIZE 256
+static char sprinkler_errbuf[EBUFSIZE];
+#endif
+
+/*=====================================================================
+ * Structures and Types
+ *=====================================================================*/
+
+static char *sprinkler_banner =
+"\nsprinkler version %s by Bryan Jurish : dynamic message dissemination";
+
+static t_class *sprinkler_class;
+
+typedef struct _sprinkler
+{
+ t_object x_obj;
+ t_outlet *x_thru; //-- pass-through outlet
+} t_sprinkler;
+
+
+/*--------------------------------------------------------------------
+ * the guts:
+ * + 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)
+{
+
+#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) {
+ case A_FLOAT:
+ pd_typedmess(dst->s_thing,&s_float,argc,argv);
+ return;
+ case A_SYMBOL:
+ //-- special handling for 'bang'
+ if (argv->a_w.w_symbol == &s_bang) {
+ pd_typedmess(dst->s_thing,&s_bang,0,0);
+ } else {
+ pd_typedmess(dst->s_thing,&s_symbol,argc,argv);
+ }
+ return;
+ case A_POINTER:
+ pd_typedmess(dst->s_thing,&s_pointer,argc,argv);
+ return;
+
+ // everything else (stop 'gcc -Wall' from complaining)
+ case A_NULL:
+ case A_SEMI:
+ case A_COMMA:
+ case A_DEFFLOAT:
+ case A_DOLLAR:
+ case A_DOLLSYM:
+ case A_GIMME:
+ case A_CANT:
+ default:
+ break;
+ // just fall though
+ }
+ }
+
+#endif /* !defined(ALL_FORWARDMESS) */
+
+ // default -- sprinkler anything else with 'pd_forwardmess'
+ pd_forwardmess(dst->s_thing,argc,argv);
+ return;
+ }
+
+ //post("sprinkler: no destination for `%s'", dst ? dst->s_name : "(null)");
+ //-- pass through
+ outlet_anything(x->x_thru, dst, argc, argv);
+}
+
+static void sprinkler_list(t_sprinkler *x, t_symbol *s, int argc, t_atom *argv)
+{
+#ifdef SPRINKLER_DEBUG
+ post("sprinkler_debug : sprinkler_list : argc=%d", argc);
+#endif
+ sprinkler_anything(x,atom_getsymbol(argv), argc-1, argv+1);
+}
+
+
+/*--------------------------------------------------------------------
+ * newmethod, freemethod
+ */
+void *sprinkler_new(t_symbol *s)
+{
+ t_sprinkler *x = (t_sprinkler *)pd_new(sprinkler_class);
+ x->x_thru = outlet_new(&x->x_obj, &s_anything);
+ return (x);
+}
+
+void sprinkler_free(t_sprinkler *x) {
+ outlet_free(x->x_thru);
+}
+
+/*--------------------------------------------------------------------
+ * setup
+ *--------------------------------------------------------------------*/
+void sprinkler_setup(void)
+{
+ post(sprinkler_banner, PACKAGE_VERSION);
+ sprinkler_class = class_new(gensym("sprinkler"),
+ (t_newmethod)sprinkler_new,
+ (t_method)sprinkler_free,
+ sizeof(t_sprinkler),
+ 0, 0);
+
+#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);
+ class_addcreator((t_newmethod)sprinkler_new, gensym("fw"), A_DEFSYM, 0);
+#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);
+
+ // help symbol
+ class_sethelpsymbol(sprinkler_class, gensym("sprinkler-help.pd"));
+}