From 2c23a63729d6323de172f7e1e8c16ff7ce8bedc6 Mon Sep 17 00:00:00 2001 From: Bryan Jurish Date: Sun, 8 Sep 2002 00:15:23 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r116, which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=117 --- externals/sprinkler/Changes | 20 +++ externals/sprinkler/GnuGPL.txt | 290 +++++++++++++++++++++++++++++++ externals/sprinkler/README.cvs | 13 ++ externals/sprinkler/README.pod | 60 +++++++ externals/sprinkler/VERSION | 1 + externals/sprinkler/autogen.sh | 4 + externals/sprinkler/configure.in | 162 +++++++++++++++++ externals/sprinkler/install-sh | 251 ++++++++++++++++++++++++++ externals/sprinkler/makefile.in | 86 +++++++++ externals/sprinkler/sprinkler-help.pd.in | 48 +++++ externals/sprinkler/sprinkler.c | 164 +++++++++++++++++ 11 files changed, 1099 insertions(+) create mode 100644 externals/sprinkler/Changes create mode 100644 externals/sprinkler/GnuGPL.txt create mode 100644 externals/sprinkler/README.cvs create mode 100644 externals/sprinkler/README.pod create mode 100644 externals/sprinkler/VERSION create mode 100755 externals/sprinkler/autogen.sh create mode 100644 externals/sprinkler/configure.in create mode 100755 externals/sprinkler/install-sh create mode 100644 externals/sprinkler/makefile.in create mode 100644 externals/sprinkler/sprinkler-help.pd.in create mode 100644 externals/sprinkler/sprinkler.c diff --git a/externals/sprinkler/Changes b/externals/sprinkler/Changes new file mode 100644 index 00000000..a99e13ce --- /dev/null +++ b/externals/sprinkler/Changes @@ -0,0 +1,20 @@ +Change log for PD external 'sprinkler' (formerly 'forward') + +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/externals/sprinkler/GnuGPL.txt b/externals/sprinkler/GnuGPL.txt new file mode 100644 index 00000000..fa0bef49 --- /dev/null +++ b/externals/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/externals/sprinkler/README.cvs b/externals/sprinkler/README.cvs new file mode 100644 index 00000000..2a0ee0c8 --- /dev/null +++ b/externals/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/externals/sprinkler/README.pod b/externals/sprinkler/README.pod new file mode 100644 index 00000000..172458e9 --- /dev/null +++ b/externals/sprinkler/README.pod @@ -0,0 +1,60 @@ +=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. + +=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". + +=head1 KNOWN BUGS + +One of the acknowledgements used to be in this section. +Sorry, folks. + +Backwards-compatible version is incompatible with MAX. + +=head1 AUTHOR + +Bryan Jurish Emoocow@ling.uni-potsdam.deE diff --git a/externals/sprinkler/VERSION b/externals/sprinkler/VERSION new file mode 100644 index 00000000..7dec35f7 --- /dev/null +++ b/externals/sprinkler/VERSION @@ -0,0 +1 @@ +0.02 diff --git a/externals/sprinkler/autogen.sh b/externals/sprinkler/autogen.sh new file mode 100755 index 00000000..b7793874 --- /dev/null +++ b/externals/sprinkler/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +autoconf +pod2text README.pod README.txt diff --git a/externals/sprinkler/configure.in b/externals/sprinkler/configure.in new file mode 100644 index 00000000..7c914d60 --- /dev/null +++ b/externals/sprinkler/configure.in @@ -0,0 +1,162 @@ +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) +AC_INIT(sprinkler, [0.03], [moocow@ling.uni-potsdam.de]) + +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(LD) + +AC_SUBST(EXT) + +AC_SUBST(MYSOURCES) +AC_SUBST(MYPODS) +AC_SUBST(MYPDDOC) +AC_SUBST(MYDISTNAME) + + +dnl version stuff (automatically exported?) +AC_SUBST(PACKAGE_VERSION) +AC_SUBST(PACKAGE_NAME) +AC_SUBST(BUGREPORT) + + +dnl +dnl pd-directory/ies +dnl +AC_ARG_WITH(pd-dir, + AC_HELP_STRING([--with-pd-dir=DIR], [PD base directory (default=/usr/local/pd)]), + [PD_DIR="$withval"], + [PD_DIR="/usr/local/pd"]) +AC_SUBST(PD_DIR) + +AC_ARG_WITH(pd-include, + AC_HELP_STRING([--with-pd-include=DIR], [PD include directory (default=${PD_DIR}/src)]), + [PD_INC="$withval"], + [PD_INC="${PD_DIR}/src"]) +AC_SUBST(PD_INC) + + +dnl +dnl configuration stuff here +dnl +MYDISTNAME="sprinkler" +MYSOURCES="sprinkler.c" +MYPODS="`echo *.pod`" +MYPDDOC="sprinkler-help.pd" +IFLAGS="-I./include -I${PD_INC}" + +dnl +dnl debug version? +dnl +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" + DFLAGS="$DFLAGS -DSPRINKLER_DEBUG" +else + AC_MSG_RESULT(no) + DEBUG="no" +fi +AC_SUBST(DEBUG) + + +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 327 forward;" + SPRINKLER_ALIAS_2="#X obj 102 352 fw;" +else + AC_MSG_RESULT(no) + NON_MAX_FORWARD="no" + SPRINKLER_COMPAT_TEXT=["(formerly MAX-incompatible \[forward\])"] + SPRINKLER_ALIAS_1="#X text 102 327 none;" + SPRINKLER_ALIAS_2="#X text 102 352 (disabled);" +fi +AC_SUBST(NON_MAX_FORWARD) +AC_SUBST(SPRINKLER_COMPAT_TEXT) +AC_SUBST(SPRINKLER_ALIAS_1) +AC_SUBST(SPRINKLER_ALIAS_2) + + + +dnl +dnl machine-dependent variables +dnl +LD=ld +if test `uname -s` = Linux; +then + LFLAGS="-export_dynamic -shared" + if test "$DEBUG" == "no"; then + OFLAGS="-O6 -funroll-loops -fomit-frame-pointer" + else + OFLAGS="-g" + fi + EXT=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" +EXT=pd_irix6 +fi + +if test `uname -s` = IRIX32; +then + LFLAGS="-o32 -DUNIX -DIRIX -O2 -shared -rdata_shared" + OFLAGS="$CFLAGS" + EXT=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" + EXT=pd_darwin + DFLAGS="$DFLAGS -DMACOSX" + + if test "$DEBUG" == "no"; then + OFLAGS="-O2" + else + OFLAGS="-g" + fi +fi + +AC_OUTPUT(makefile sprinkler-help.pd) diff --git a/externals/sprinkler/install-sh b/externals/sprinkler/install-sh new file mode 100755 index 00000000..7dc2f289 --- /dev/null +++ b/externals/sprinkler/install-sh @@ -0,0 +1,251 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/externals/sprinkler/makefile.in b/externals/sprinkler/makefile.in new file mode 100644 index 00000000..3c040072 --- /dev/null +++ b/externals/sprinkler/makefile.in @@ -0,0 +1,86 @@ +PD_DIR = @PD_DIR@ +PD_INC = @PD_INC@ + +EXT = @EXT@ +DEFS = @DEFS@ +CC = @CC@ +LD = @LD@ +AFLAGS = @AFLAGS@ +DFLAGS = @DFLAGS@ +LFLAGS = @LFLAGS@ +WFLAGS = -Wall +OFLAGS = @OFLAGS@ +############## +# DEBUG +# OFLAGS = -g +############## +IFLAGS = -I$(PD_INC) @IFLAGS@ +INSTALL_PREFIX=@prefix@ + +VERSION = "@PACKAGE_VERSION@" +DISTVERSION = @PACKAGE_VERSION@ + + +.SUFFIXES: .$(EXT) .pod .txt + + +PDCFLAGS = $(OFLAGS) $(DEFS) $(IFLAGS) $(WFLAGS) $(LFLAGS) $(AFLAGS) $(DFLAGS) -DVERSION=$(VERSION) +CFLAGS = $(OFLAGS) $(DEFS) $(IFLAGS) $(WFLAGS) $(DFLAGS) -DVERSION=$(VERSION) + + +LIBS = @LIBS@ +SOURCES = @MYSOURCES@ +PODS = @MYPODS@ +PDDOC = @MYPDDOC@ +DISTNAME = @MYDISTNAME@ +DISTOTHER = GnuGPL.txt Changes makefile.in configure.in sprinkler-help.pd.in configure install-sh +TARGETS = $(SOURCES:.c=.$(EXT)) $(PODS:.pod=.txt) + +DISTTARGETS = $(SOURCES) $(PODS:.pod=.txt) $(PDDOC) $(DISTOTHER) + +all: $(TARGETS) + +clean:: + rm -f *.$(EXT) so_locations ; rm -f *~ *.o + +distclean: clean + rm -f config.cache config.log config.status makefile + +maintainerclean: distclean + rm -f configure $(PODS:.pod=.txt) sprinkler-help.pd + +cvsclean: maintainerclean + +distcleancvs: + rm -f CVS reference/CVS + + +.pod.txt: + pod2text $< $@ + +.c.o: + $(CC) -DPD $(CFLAGS) -o $@ -c $*.c + +# cp $@ $*_stat.o + +.o.$(EXT): + $(CC) -DPD $(PDCFLAGS) -o $@ $*.o + + +install:: + install -d $(INSTALL_PREFIX)/lib/pd/externs + install -m 644 *.pd_linux $(INSTALL_PREFIX)/lib/pd/externs + for f in $(PDDOC) ; do \ + install -m 644 $$f $(INSTALL_PREFIX)/lib/pd/doc/5.reference ;\ + done + +.PHONY: dist + +dist: + ( cd ..;\ + rm -f $(DISTNAME)-$(DISTVERSION);\ + ln -s $(DISTNAME) $(DISTNAME)-$(DISTVERSION);\ + tar czvf $(DISTNAME)-$(DISTVERSION).tgz $(patsubst %,$(DISTNAME)-$(DISTVERSION)/%,$(DISTTARGETS));\ + mv $(DISTNAME)-$(DISTVERSION).tgz $(DISTNAME);\ + rm -f $(DISTNAME)-$(DISTVERSION);\ + ) diff --git a/externals/sprinkler/sprinkler-help.pd.in b/externals/sprinkler/sprinkler-help.pd.in new file mode 100644 index 00000000..6f5b3c44 --- /dev/null +++ b/externals/sprinkler/sprinkler-help.pd.in @@ -0,0 +1,48 @@ +#N canvas 186 52 500 508 10; +#X floatatom 26 36 5 0 0; +#X symbolatom 36 100 10 0 0; +#X text 25 309 ARGUMENTS: none; +#X text 183 307 INLETS:; +#X text 183 343 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 379 NOTES:; +#X text 185 321 1 - list or message of the form DST MSG; +#X text 165 477 Bryan Jurish ; +#X floatatom 118 254 5 0 0; +#X obj 54 254 pack s 0; +#X text 175 219 dynamic destination; +#X msg 45 153 420; +#X obj 26 284 sprinkler; +#X text 53 3 sprinkler : dynamic control-message dissemination; +#X text 41 393 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 55 209 sprinkler-help1; +#X msg 61 231 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 text 39 327 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 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; diff --git a/externals/sprinkler/sprinkler.c b/externals/sprinkler/sprinkler.c new file mode 100644 index 00000000..123b1ed2 --- /dev/null +++ b/externals/sprinkler/sprinkler.c @@ -0,0 +1,164 @@ +/* -*- Mode: C -*- */ +/*=============================================================================*\ + * File: sprinkler.c + * Author: Bryan Jurish + * 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 + * 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 +//#include "sprinkler.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_version = "\nsprinkler version 0.03 by Bryan Jurish : dynamic message dissemination"; + +static t_class *sprinkler_class; + +typedef struct _sprinkler +{ + t_object x_obj; +} t_sprinkler; + + +/*-------------------------------------------------------------------- + * the guts: + * + 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) +{ + +#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) { + case A_FLOAT: + pd_typedmess(dst->s_thing,&s_float,argc,argv); + return; + case A_SYMBOL: + 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: + // just fall though + } + } + // default -- sprinkler anything else with 'pd_forwardmess' + pd_forwardmess(dst->s_thing,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,++argv); +} + +void *sprinkler_new(t_symbol *s) +{ + t_sprinkler *x = (t_sprinkler *)pd_new(sprinkler_class); + return (x); +} + +/*-------------------------------------------------------------------- + * setup + *--------------------------------------------------------------------*/ +void sprinkler_setup(void) +{ + post(sprinkler_version); + sprinkler_class = class_new(gensym("sprinkler"), (t_newmethod)sprinkler_new, 0, 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 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")); +} -- cgit v1.2.1