aboutsummaryrefslogtreecommitdiff
path: root/pd
diff options
context:
space:
mode:
authorMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-11 20:09:07 +0000
committerMiller Puckette <millerpuckette@users.sourceforge.net>2006-08-11 20:09:07 +0000
commit173b4e7033e4fc902d20a3cc19e9198a61924f37 (patch)
tree7c0f909a98dab4bcda225d7fa478a8c721cbe00c /pd
parent9cba3b8fccf2f9d680d5ef7847689fe9cda2e294 (diff)
Fixed to compile correctly on macosx 10.3, 10.4 and Windows.
svn path=/trunk/; revision=5566
Diffstat (limited to 'pd')
-rw-r--r--pd/doc/5.reference/adc~_dac~-help.pd9
-rw-r--r--pd/extra/bonk~/makefile96
-rw-r--r--pd/extra/choice/makefile96
-rw-r--r--pd/extra/expr~/makefile89
-rw-r--r--pd/extra/fiddle~/makefile96
-rw-r--r--pd/extra/loop~/makefile97
-rw-r--r--pd/extra/lrshift~/makefile97
-rw-r--r--pd/extra/pique/makefile96
-rw-r--r--pd/portaudio/pa_unix_oss/pa_unix_oss.c15
-rw-r--r--pd/portaudio/pa_win_wdmks/pa_win_wdmks.c2
-rw-r--r--pd/portaudio/pablio/ringbuffer.c2
-rw-r--r--pd/portaudio/pablio/ringbuffer.h2
-rw-r--r--pd/portmidi/pm_mac/pmmacosxcm.c2
-rw-r--r--pd/src/CHANGELOG.txt8
-rw-r--r--pd/src/configure.in41
-rw-r--r--pd/src/g_all_guis.c36
-rw-r--r--pd/src/g_canvas.c41
-rw-r--r--pd/src/g_editor.c27
-rw-r--r--pd/src/g_readwrite.c92
-rw-r--r--pd/src/g_rtext.c6
-rw-r--r--pd/src/g_template.c4
-rw-r--r--pd/src/g_text.c18
-rw-r--r--pd/src/m_atom.c2
-rw-r--r--pd/src/m_binbuf.c99
-rw-r--r--pd/src/m_class.c41
-rw-r--r--pd/src/makefile.in10
-rw-r--r--pd/src/makefile.nt2
-rw-r--r--pd/src/notes.txt8
-rw-r--r--pd/src/s_audio_pablio.h2
-rw-r--r--pd/src/s_audio_paring.c2
-rw-r--r--pd/src/s_audio_paring.h2
-rw-r--r--pd/src/s_loader.c196
-rw-r--r--pd/src/s_main.c2
-rw-r--r--pd/src/s_path.c3
-rw-r--r--pd/src/s_stuff.h2
-rw-r--r--pd/src/u_main.tk18
-rw-r--r--pd/src/x_interface.c2
37 files changed, 407 insertions, 956 deletions
diff --git a/pd/doc/5.reference/adc~_dac~-help.pd b/pd/doc/5.reference/adc~_dac~-help.pd
index e97429b6..7538d8ff 100644
--- a/pd/doc/5.reference/adc~_dac~-help.pd
+++ b/pd/doc/5.reference/adc~_dac~-help.pd
@@ -5,7 +5,12 @@
#X text 143 121 (input from channel 5 only);
#X obj 61 145 dac~ 1 2 5 23;
#X text 184 145 (output to channels 1 \, 2 \, 5 \, and 23);
-#X text 16 173 The actual number of channels Pd inputs and outputs are set on Pd's command line. You can open patches that want to use more channels \, and channel numbers out of rance will be dropped (dac~) or appear as zero (adc~).;
+#X text 16 173 The actual number of channels Pd inputs and outputs
+are set on Pd's command line. You can open patches that want to use
+more channels \, and channel numbers out of rance will be dropped (dac~)
+or appear as zero (adc~).;
#X text 308 254 updated for Pd version 0.33;
#X text 122 9 - audio I/O;
-#X text 8 46 Adc~ and dac~ rovide real-time audio input and output for Pd \, respectively \, whether analog or digital. By default they are stereo but you can specify channel numbers as in:;
+#X text 8 46 Adc~ and dac~ provide real-time audio input and output
+for Pd \, respectively \, whether analog or digital. By default they
+are stereo but you can specify channel numbers as in:;
diff --git a/pd/extra/bonk~/makefile b/pd/extra/bonk~/makefile
index 5c805bcd..af6399cc 100644
--- a/pd/extra/bonk~/makefile
+++ b/pd/extra/bonk~/makefile
@@ -1,98 +1,4 @@
NAME=bonk~
CSYM=bonk_tilde
-current: pd_linux
-
-# ----------------------- NT -----------------------
-
-pd_nt: $(NAME).dll
-
-.SUFFIXES: .dll
-
-PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
-VC="C:\Program Files\Microsoft Visual Studio\Vc98"
-
-PDNTINCLUDE = /I. /I..\..\src /I$(VC)\include
-
-PDNTLDIR = $(VC)\lib
-PDNTLIB = $(PDNTLDIR)\libc.lib \
- $(PDNTLDIR)\oldnames.lib \
- $(PDNTLDIR)\kernel32.lib \
- ..\..\bin\pd.lib
-
-.c.dll:
- cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
- link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
-
-# ----------------------- IRIX 5.x -----------------------
-
-pd_irix5: $(NAME).pd_irix5
-
-.SUFFIXES: .pd_irix5
-
-SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
-
-SGIINCLUDE = -I../../src
-
-.c.pd_irix5:
- $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
- rm $*.o
-
-# ----------------------- IRIX 6.x -----------------------
-
-pd_irix6: $(NAME).pd_irix6
-
-.SUFFIXES: .pd_irix6
-
-SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
- -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
- -Ofast=ip32
-
-.c.pd_irix6:
- $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
- rm $*.o
-
-# ----------------------- LINUX i386 -----------------------
-
-pd_linux: $(NAME).pd_linux
-
-.SUFFIXES: .pd_linux
-
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
- -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
-
-LINUXINCLUDE = -I../../src
-
-.c.pd_linux:
- $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
- strip --strip-unneeded $*.pd_linux
- rm -f $*.o
-
-# ----------------------- Mac OSX -----------------------
-
-pd_darwin: $(NAME).pd_darwin
-pd_imac: $(NAME).pd_imac
-
-.SUFFIXES: .pd_darwin .pd_imac
-
-DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
-
-.c.pd_darwin:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
- rm -f $*.o
-
-.c.pd_imac:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_imac $*.o
- rm -f $*.o
-
-# ----------------------------------------------------------
-
-clean:
- rm -f *.o *.pd_* so_locations
+include ../makefile
diff --git a/pd/extra/choice/makefile b/pd/extra/choice/makefile
index 8ecb0dd4..7fc71159 100644
--- a/pd/extra/choice/makefile
+++ b/pd/extra/choice/makefile
@@ -1,98 +1,4 @@
NAME=choice
CSYM=choice
-current: pd_linux
-
-# ----------------------- NT -----------------------
-
-pd_nt: $(NAME).dll
-
-.SUFFIXES: .dll
-
-PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
-VC="C:\Program Files\Microsoft Visual Studio\Vc98"
-
-PDNTINCLUDE = /I. /I..\..\src /I$(VC)\include
-
-PDNTLDIR = $(VC)\lib
-PDNTLIB = $(PDNTLDIR)\libc.lib \
- $(PDNTLDIR)\oldnames.lib \
- $(PDNTLDIR)\kernel32.lib \
- ..\..\bin\pd.lib
-
-.c.dll:
- cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
- link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
-
-# ----------------------- IRIX 5.x -----------------------
-
-pd_irix5: $(NAME).pd_irix5
-
-.SUFFIXES: .pd_irix5
-
-SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
-
-SGIINCLUDE = -I../../src
-
-.c.pd_irix5:
- $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
- rm $*.o
-
-# ----------------------- IRIX 6.x -----------------------
-
-pd_irix6: $(NAME).pd_irix6
-
-.SUFFIXES: .pd_irix6
-
-SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
- -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
- -Ofast=ip32
-
-.c.pd_irix6:
- $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
- rm $*.o
-
-# ----------------------- LINUX i386 -----------------------
-
-pd_linux: $(NAME).pd_linux
-
-.SUFFIXES: .pd_linux
-
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
- -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
-
-LINUXINCLUDE = -I../../src
-
-.c.pd_linux:
- $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
- strip --strip-unneeded $*.pd_linux
- rm -f $*.o
-
-# ----------------------- Mac OSX -----------------------
-
-pd_darwin: $(NAME).pd_darwin
-pd_imac: $(NAME).pd_imac
-
-.SUFFIXES: .pd_darwin .pd_imac
-
-DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
-
-.c.pd_darwin:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
- rm -f $*.o
-
-.c.pd_imac:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_imac $*.o
- rm -f $*.o
-
-# ----------------------------------------------------------
-
-clean:
- rm -f *.o *.pd_* so_locations
+include ../makefile
diff --git a/pd/extra/expr~/makefile b/pd/extra/expr~/makefile
index e62ff9f3..88c1e839 100644
--- a/pd/extra/expr~/makefile
+++ b/pd/extra/expr~/makefile
@@ -124,65 +124,66 @@ linux_clobber: clean
# ----------------------- MAC OSX -----------------------
-MACOSXOBJ = vexp.pd_darwin_o vexp_fun.pd_darwin_o vexp_if.pd_darwin_o
-.SUFFIXES: .pd_darwin_o
+MACOSXOBJ = vexp.d_ppc_o vexp_fun.d_ppc_o vexp_if.d_ppc_o
+.SUFFIXES: .d_ppc_o
MACOSXCFLAGS = -DMACOSX -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
+ -Wno-unused -Wno-parentheses -Wno-switch
MACOSXINCLUDE = -I../../src
-pd_darwin: expr.pd_darwin expr~.pd_darwin fexpr~.pd_darwin
-.c.pd_darwin_o:
- $(CC) -g $(MACOSXCFLAGS) $(MACOSXINCLUDE) -o $*.pd_darwin_o -c $*.c
+d_ppc: expr.d_ppc expr~.d_ppc fexpr~.d_ppc
+.c.d_ppc_o:
+ $(CC) -g $(MACOSXCFLAGS) $(MACOSXINCLUDE) -o $*.d_ppc_o -c $*.c
-expr.pd_darwin: $(MACOSXOBJ)
+expr.d_ppc: $(MACOSXOBJ)
$(CC) -bundle -undefined suppress -flat_namespace \
- -o expr.pd_darwin $(MACOSXOBJ) -lm
- rm -f ../expr.pd_darwin
- -ln -s expr~/expr.pd_darwin ..
-
-expr~.pd_darwin: expr.pd_darwin
- -ln -s expr.pd_darwin expr~.pd_darwin
- rm -f ../expr~.pd_darwin
- -ln -s expr~/expr~.pd_darwin ..
-
-fexpr~.pd_darwin: expr.pd_darwin
- -ln -s expr.pd_darwin fexpr~.pd_darwin
- rm -f ../fexpr~.pd_darwin
- -ln -s expr~/fexpr~.pd_darwin ..
-
-pd_imac: expr.pd_imac expr~.pd_imac fexpr~.pd_imac
-.c.pd_imac_o:
- $(CC) -g $(MACOSXCFLAGS) $(MACOSXINCLUDE) -o $*.pd_imac_o -c $*.c
-
-expr.pd_imac: $(MACOSXOBJ)
+ -o expr.d_ppc $(MACOSXOBJ) -lm
+ rm -f ../expr.d_ppc
+ -ln -s expr~/expr.d_ppc ..
+
+expr~.d_ppc: expr.d_ppc
+ -ln -s expr.d_ppc expr~.d_ppc
+ rm -f ../expr~.d_ppc
+ -ln -s expr~/expr~.d_ppc ..
+
+fexpr~.d_ppc: expr.d_ppc
+ -ln -s expr.d_ppc fexpr~.d_ppc
+ rm -f ../fexpr~.d_ppc
+ -ln -s expr~/fexpr~.d_ppc ..
+
+d_fat: expr.d_fat expr~.d_fat fexpr~.d_fat
+.c.d_fat_o:
+ $(CC) -g $(MACOSXCFLAGS) $(MACOSXINCLUDE) -arch i386 -arch ppc \
+ -o $*.d_ppc_o -c $*.c
+
+expr.d_fat: $(MACOSXOBJ)
$(CC) -bundle -undefined suppress -flat_namespace \
- -o expr.pd_imac $(MACOSXOBJ) -lm
- rm -f ../expr.pd_imac
- -ln -s expr~/expr.pd_imac ..
+ -o expr.d_fat $(MACOSXOBJ) -lm
+ rm -f ../expr.d_fat
+ -ln -s expr~/expr.d_fat ..
-expr~.pd_imac: expr.pd_imac
- -ln -s expr.pd_imac expr~.pd_imac
- rm -f ../expr~.pd_imac
- -ln -s expr~/expr~.pd_imac ..
+expr~.d_fat: expr.d_fat
+ -ln -s expr.d_fat expr~.d_fat
+ rm -f ../expr~.d_fat
+ -ln -s expr~/expr~.d_fat ..
-fexpr~.pd_imac: expr.pd_imac
- -ln -s expr.pd_imac fexpr~.pd_imac
- rm -f ../fexpr~.pd_imac
- -ln -s expr~/fexpr~.pd_imac ..
+fexpr~.d_fat: expr.d_fat
+ -ln -s expr.d_fat fexpr~.d_fat
+ rm -f ../fexpr~.d_fat
+ -ln -s expr~/fexpr~.d_fat ..
install_darwin:
- install expr.pd_darwin $(PDEXTERN)
- rm -f $(PDEXTERN)/expr~.pd_darwin
- rm -f $(PDEXTERN)/fexpr~.pd_darwin
+ install expr.d_ppc $(PDEXTERN)
+ rm -f $(PDEXTERN)/expr~.d_ppc
+ rm -f $(PDEXTERN)/fexpr~.d_ppc
cd $(PDEXTERN); \
- -ln -s expr.pd_darwin expr~.pd_darwin; \
- -ln -s expr.pd_darwin fexpr~.pd_darwin
+ -ln -s expr.d_ppc expr~.d_ppc; \
+ -ln -s expr.d_ppc fexpr~.d_ppc
darwin_clean:
- rm -f *.pd_darwin_o *.o
+ rm -f *.d_ppc_o *.o
darwin_clobber: clean
- rm -f expr.pd_darwin
+ rm -f expr.d_ppc
diff --git a/pd/extra/fiddle~/makefile b/pd/extra/fiddle~/makefile
index dc99764b..247c905e 100644
--- a/pd/extra/fiddle~/makefile
+++ b/pd/extra/fiddle~/makefile
@@ -1,98 +1,4 @@
NAME=fiddle~
CSYM=fiddle_tilde
-current: pd_linux
-
-# ----------------------- NT -----------------------
-
-pd_nt: $(NAME).dll
-
-.SUFFIXES: .dll
-
-PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
-VC="C:\Program Files\Microsoft Visual Studio\Vc98"
-
-PDNTINCLUDE = /I. /I..\..\src /I$(VC)\include
-
-PDNTLDIR = $(VC)\lib
-PDNTLIB = $(PDNTLDIR)\libc.lib \
- $(PDNTLDIR)\oldnames.lib \
- $(PDNTLDIR)\kernel32.lib \
- ..\..\bin\pd.lib
-
-.c.dll:
- cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
- link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
-
-# ----------------------- IRIX 5.x -----------------------
-
-pd_irix5: $(NAME).pd_irix5
-
-.SUFFIXES: .pd_irix5
-
-SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
-
-SGIINCLUDE = -I../../src
-
-.c.pd_irix5:
- $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
- rm $*.o
-
-# ----------------------- IRIX 6.x -----------------------
-
-pd_irix6: $(NAME).pd_irix6
-
-.SUFFIXES: .pd_irix6
-
-SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
- -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
- -Ofast=ip32
-
-.c.pd_irix6:
- $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
- rm $*.o
-
-# ----------------------- LINUX i386 -----------------------
-
-pd_linux: $(NAME).pd_linux
-
-.SUFFIXES: .pd_linux
-
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
- -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
-
-LINUXINCLUDE = -I../../src
-
-.c.pd_linux:
- $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
- strip --strip-unneeded $*.pd_linux
- rm -f $*.o
-
-# ----------------------- Mac OSX -----------------------
-
-pd_darwin: $(NAME).pd_darwin
-pd_imac: $(NAME).pd_imac
-
-.SUFFIXES: .pd_darwin .pd_imac
-
-DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
-
-.c.pd_darwin:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
- rm -f $*.o
-
-.c.pd_imac:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_imac $*.o
- rm -f $*.o
-
-# ----------------------------------------------------------
-
-clean:
- rm -f *.o *.pd_* so_locations
+include ../makefile
diff --git a/pd/extra/loop~/makefile b/pd/extra/loop~/makefile
index b1eada70..fd21f2b4 100644
--- a/pd/extra/loop~/makefile
+++ b/pd/extra/loop~/makefile
@@ -1,99 +1,4 @@
NAME=loop~
CSYM=loop_tilde
-
-current: pd_linux
-
-# ----------------------- NT -----------------------
-
-pd_nt: $(NAME).dll
-
-.SUFFIXES: .dll
-
-PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
-VC="C:\Program Files\Microsoft Visual Studio\Vc98"
-
-PDNTINCLUDE = /I. /I..\..\src /I$(VC)\include
-
-PDNTLDIR = $(VC)\lib
-PDNTLIB = $(PDNTLDIR)\libc.lib \
- $(PDNTLDIR)\oldnames.lib \
- $(PDNTLDIR)\kernel32.lib \
- ..\..\bin\pd.lib
-
-.c.dll:
- cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
- link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
-
-# ----------------------- IRIX 5.x -----------------------
-
-pd_irix5: $(NAME).pd_irix5
-
-.SUFFIXES: .pd_irix5
-
-SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
-
-SGIINCLUDE = -I../../src
-
-.c.pd_irix5:
- $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
- rm $*.o
-
-# ----------------------- IRIX 6.x -----------------------
-
-pd_irix6: $(NAME).pd_irix6
-
-.SUFFIXES: .pd_irix6
-
-SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
- -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
- -Ofast=ip32
-
-.c.pd_irix6:
- $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
- rm $*.o
-
-# ----------------------- LINUX i386 -----------------------
-
-pd_linux: $(NAME).pd_linux
-
-.SUFFIXES: .pd_linux
-
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
- -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
-
-LINUXINCLUDE = -I../../src
-
-.c.pd_linux:
- $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
- strip --strip-unneeded $*.pd_linux
- rm -f $*.o
-
-# ----------------------- Mac OSX -----------------------
-
-pd_darwin: $(NAME).pd_darwin
-pd_imac: $(NAME).pd_imac
-
-.SUFFIXES: .pd_darwin .pd_imac
-
-DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
-
-.c.pd_darwin:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
- rm -f $*.o
-
-.c.pd_imac:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_imac $*.o
- rm -f $*.o
-
-# ----------------------------------------------------------
-
-clean:
- rm -f *.o *.pd_* so_locations
+include ../makefile
diff --git a/pd/extra/lrshift~/makefile b/pd/extra/lrshift~/makefile
index 2f9ccfa5..d6a24cfe 100644
--- a/pd/extra/lrshift~/makefile
+++ b/pd/extra/lrshift~/makefile
@@ -1,99 +1,4 @@
NAME=lrshift~
CSYM=lrshift_tilde
-
-current: pd_linux
-
-# ----------------------- NT -----------------------
-
-pd_nt: $(NAME).dll
-
-.SUFFIXES: .dll
-
-PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
-VC="C:\Program Files\Microsoft Visual Studio\Vc98"
-
-PDNTINCLUDE = /I. /I..\..\src /I$(VC)\include
-
-PDNTLDIR = $(VC)\lib
-PDNTLIB = $(PDNTLDIR)\libc.lib \
- $(PDNTLDIR)\oldnames.lib \
- $(PDNTLDIR)\kernel32.lib \
- ..\..\bin\pd.lib
-
-.c.dll:
- cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
- link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
-
-# ----------------------- IRIX 5.x -----------------------
-
-pd_irix5: $(NAME).pd_irix5
-
-.SUFFIXES: .pd_irix5
-
-SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
-
-SGIINCLUDE = -I../../src
-
-.c.pd_irix5:
- $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
- rm $*.o
-
-# ----------------------- IRIX 6.x -----------------------
-
-pd_irix6: $(NAME).pd_irix6
-
-.SUFFIXES: .pd_irix6
-
-SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
- -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
- -Ofast=ip32
-
-.c.pd_irix6:
- $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
- rm $*.o
-
-# ----------------------- LINUX i386 -----------------------
-
-pd_linux: $(NAME).pd_linux
-
-.SUFFIXES: .pd_linux
-
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
- -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
-
-LINUXINCLUDE = -I../../src
-
-.c.pd_linux:
- $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
- strip --strip-unneeded $*.pd_linux
- rm -f $*.o
-
-# ----------------------- Mac OSX -----------------------
-
-pd_darwin: $(NAME).pd_darwin
-pd_imac: $(NAME).pd_imac
-
-.SUFFIXES: .pd_darwin .pd_imac
-
-DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
-
-.c.pd_darwin:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
- rm -f $*.o
-
-.c.pd_imac:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_imac $*.o
- rm -f $*.o
-
-# ----------------------------------------------------------
-
-clean:
- rm -f *.o *.pd_* so_locations
+include ../makefile
diff --git a/pd/extra/pique/makefile b/pd/extra/pique/makefile
index 41e830b2..562ce23b 100644
--- a/pd/extra/pique/makefile
+++ b/pd/extra/pique/makefile
@@ -1,98 +1,4 @@
NAME=pique
CSYM=pique
-current: pd_linux
-
-# ----------------------- NT -----------------------
-
-pd_nt: $(NAME).dll
-
-.SUFFIXES: .dll
-
-PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo
-VC="C:\Program Files\Microsoft Visual Studio\Vc98"
-
-PDNTINCLUDE = /I. /I..\..\src /I$(VC)\include
-
-PDNTLDIR = $(VC)\lib
-PDNTLIB = $(PDNTLDIR)\libc.lib \
- $(PDNTLDIR)\oldnames.lib \
- $(PDNTLDIR)\kernel32.lib \
- ..\..\bin\pd.lib
-
-.c.dll:
- cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c
- link /dll /export:$(CSYM)_setup $*.obj $(PDNTLIB)
-
-# ----------------------- IRIX 5.x -----------------------
-
-pd_irix5: $(NAME).pd_irix5
-
-.SUFFIXES: .pd_irix5
-
-SGICFLAGS5 = -o32 -DPD -DUNIX -DIRIX -O2
-
-SGIINCLUDE = -I../../src
-
-.c.pd_irix5:
- $(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -elf -shared -rdata_shared -o $*.pd_irix5 $*.o
- rm $*.o
-
-# ----------------------- IRIX 6.x -----------------------
-
-pd_irix6: $(NAME).pd_irix6
-
-.SUFFIXES: .pd_irix6
-
-SGICFLAGS6 = -n32 -DPD -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
- -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
- -Ofast=ip32
-
-.c.pd_irix6:
- $(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c
- ld -n32 -IPA -shared -rdata_shared -o $*.pd_irix6 $*.o
- rm $*.o
-
-# ----------------------- LINUX i386 -----------------------
-
-pd_linux: $(NAME).pd_linux
-
-.SUFFIXES: .pd_linux
-
-LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \
- -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch $(CFLAGS)
-
-LINUXINCLUDE = -I../../src
-
-.c.pd_linux:
- $(CC) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- ld -export_dynamic -shared -o $*.pd_linux $*.o -lc -lm
- strip --strip-unneeded $*.pd_linux
- rm -f $*.o
-
-# ----------------------- Mac OSX -----------------------
-
-pd_darwin: $(NAME).pd_darwin
-pd_imac: $(NAME).pd_imac
-
-.SUFFIXES: .pd_darwin .pd_imac
-
-DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \
- -Wno-unused -Wno-parentheses -Wno-switch
-
-.c.pd_darwin:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_darwin $*.o
- rm -f $*.o
-
-.c.pd_imac:
- $(CC) $(DARWINCFLAGS) $(LINUXINCLUDE) -o $*.o -c $*.c
- $(CC) -bundle -undefined suppress -flat_namespace -o $*.pd_imac $*.o
- rm -f $*.o
-
-# ----------------------------------------------------------
-
-clean:
- rm -f *.o *.pd_* so_locations
+include ../makefile
diff --git a/pd/portaudio/pa_unix_oss/pa_unix_oss.c b/pd/portaudio/pa_unix_oss/pa_unix_oss.c
index 221235d8..125fb8ce 100644
--- a/pd/portaudio/pa_unix_oss/pa_unix_oss.c
+++ b/pd/portaudio/pa_unix_oss/pa_unix_oss.c
@@ -1,5 +1,5 @@
/*
- * $Id: pa_unix_oss.c,v 1.6.2.27 2006/02/21 19:13:56 bjornroche Exp $
+ * $Id: pa_unix_oss.c,v 1.6.2.28 2006/03/20 18:22:06 aknudsen Exp $
* PortAudio Portable Real-Time Audio Library
* Latest Version at: http://www.portaudio.com
* OSS implementation by:
@@ -530,12 +530,15 @@ static PaError BuildDeviceList( PaOSSHostApiRepresentation *ossApi )
PA_UNLESS( deviceInfos = (PaDeviceInfo **) realloc( deviceInfos, maxDeviceInfos * sizeof (PaDeviceInfo *) ),
paInsufficientMemory );
}
- deviceInfos[numDevices - 1] = deviceInfo;
+ {
+ int devIdx = numDevices - 1;
+ deviceInfos[devIdx] = deviceInfo;
- if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 )
- commonApi->info.defaultInputDevice = i;
- if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 )
- commonApi->info.defaultOutputDevice = i;
+ if( commonApi->info.defaultInputDevice == paNoDevice && deviceInfo->maxInputChannels > 0 )
+ commonApi->info.defaultInputDevice = devIdx;
+ if( commonApi->info.defaultOutputDevice == paNoDevice && deviceInfo->maxOutputChannels > 0 )
+ commonApi->info.defaultOutputDevice = devIdx;
+ }
}
/* Make an array of PaDeviceInfo pointers out of the linked list */
diff --git a/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c b/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c
index ff05e384..45c40d0d 100644
--- a/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c
+++ b/pd/portaudio/pa_win_wdmks/pa_win_wdmks.c
@@ -1,5 +1,5 @@
/*
- * $Id: pa_win_wdmks.c,v 1.4 2006-06-03 19:13:07 millerpuckette Exp $
+ * $Id: pa_win_wdmks.c,v 1.5 2006-08-11 20:09:07 millerpuckette Exp $
* PortAudio Windows WDM-KS interface
*
* Author: Andrew Baldwin
diff --git a/pd/portaudio/pablio/ringbuffer.c b/pd/portaudio/pablio/ringbuffer.c
index f1fc819e..35b2e631 100644
--- a/pd/portaudio/pablio/ringbuffer.c
+++ b/pd/portaudio/pablio/ringbuffer.c
@@ -1,5 +1,5 @@
/*
- * $Id: ringbuffer.c,v 1.3 2006-08-07 23:08:10 millerpuckette Exp $
+ * $Id: ringbuffer.c,v 1.4 2006-08-11 20:09:07 millerpuckette Exp $
* ringbuffer.c
* Ring Buffer utility..
*
diff --git a/pd/portaudio/pablio/ringbuffer.h b/pd/portaudio/pablio/ringbuffer.h
index 8e16f2c7..7a06c6be 100644
--- a/pd/portaudio/pablio/ringbuffer.h
+++ b/pd/portaudio/pablio/ringbuffer.h
@@ -6,7 +6,7 @@ extern "C"
#endif /* __cplusplus */
/*
- * $Id: ringbuffer.h,v 1.4 2006-06-03 19:13:07 millerpuckette Exp $
+ * $Id: ringbuffer.h,v 1.5 2006-08-11 20:09:07 millerpuckette Exp $
* ringbuffer.h
* Ring Buffer utility..
*
diff --git a/pd/portmidi/pm_mac/pmmacosxcm.c b/pd/portmidi/pm_mac/pmmacosxcm.c
index 0847596e..9f64a45b 100644
--- a/pd/portmidi/pm_mac/pmmacosxcm.c
+++ b/pd/portmidi/pm_mac/pmmacosxcm.c
@@ -5,7 +5,7 @@
* and subsequent work by Andrew Zeldis and Zico Kolter
* and Roger B. Dannenberg
*
- * $Id: pmmacosxcm.c,v 1.4 2006-06-03 19:13:07 millerpuckette Exp $
+ * $Id: pmmacosxcm.c,v 1.5 2006-08-11 20:09:07 millerpuckette Exp $
*/
/* Notes:
diff --git a/pd/src/CHANGELOG.txt b/pd/src/CHANGELOG.txt
index 39eefbef..321b0bc8 100644
--- a/pd/src/CHANGELOG.txt
+++ b/pd/src/CHANGELOG.txt
@@ -1,6 +1,14 @@
This file describes implementation and API changes; stuff more visible to the
user appears in the "release notes" instead.
+0.40.0
+
+0.39.0
+
+canvas_dspstate and signalinlet_new() exported to m_pd.h
+
+new function verbose() added to m_pd.h
+
0.38.0
finally figured out how to do "-enable-", etc., flags in the configure
diff --git a/pd/src/configure.in b/pd/src/configure.in
index 6656f493..5dfdc557 100644
--- a/pd/src/configure.in
+++ b/pd/src/configure.in
@@ -8,9 +8,9 @@ AC_SUBST(portmidi, no)
AC_SUBST(binarymode, -m755)
AC_SUBST(fftw, no)
AC_SUBST(PDLIB)
+AC_SUBST(CPPFLAGS)
AC_SUBST(MORECFLAGS)
AC_SUBST(EXT)
-AC_SUBST(OPT_CFLAGS)
AC_SUBST(USE_DEBUG_CFLAGS, no)
AC_SUBST(SYSSRC)
AC_SUBST(TCLTK_FRAMEWORKS_PATH)
@@ -171,8 +171,8 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
LDFLAGS="$LDFLAGS -static"
fi
EXT=pd_linux
- MORECFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX -DUNISTD\
- -DUSEAPI_OSS \
+ CPPFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX -DUNISTD\
+ -DUSEAPI_OSS \
-I../portaudio/pa_common -I../portaudio/pablio \
-I../portmidi/pm_common \
-I../portmidi/pm_linux \
@@ -181,7 +181,7 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
if test x$alsa == "xyes";
then
SYSSRC=$SYSSRC" s_audio_alsa.c s_audio_alsamm.c s_midi_alsa.c"
- MORECFLAGS=$MORECFLAGS" -DPA_USE_ALSA -DUSEAPI_ALSA"
+ CPPFLAGS=$CPPFLAGS" -DPA_USE_ALSA -DUSEAPI_ALSA"
LDFLAGS=$LDFLAGS" -lasound"
fi
@@ -190,7 +190,7 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
then
- MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 "$MORECFLAGS
+ CPPFLAGS=$CPPFLAGS" -DUSEAPI_PORTAUDIO -DPA19"
SYSSRC="s_audio_pa.c \
s_audio_pablio.c \
s_audio_paring.c \
@@ -209,7 +209,7 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
if test x$alsa == "xyes";
then
SYSSRC=$SYSSRC" ../portaudio/pa_linux_alsa/pa_linux_alsa.c"
- MORECFLAGS=$MORECFLAGS" -Wno-error"
+ CPPFLAGS=$CPPFLAGS" -Wno-error"
fi
fi
if test x$setuid == "xyes";
@@ -220,9 +220,9 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
GUINAME="pd-gui"
if test x$USE_DEBUG_CFLAGS == "xyes";
then
- OPT_CFLAGS="-g"
+ MORECFLAGS=$MORECFLAGS" -g"
else
- OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer"
+ MORECFLAGS=$MORECFLAGS" -O6 -funroll-loops -fomit-frame-pointer"
fi
if test x$jack == "xyes";
then
@@ -233,7 +233,7 @@ dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
LDFLAGS=$LDFLAGS" -lrt -ljack"
fi
- echo OPT_CFLAGS --------------- $OPT_CFLAGS
+ echo MORECFLAGS --------------- $MORECFLAGS
OSNUMBER=0
fi
@@ -244,12 +244,19 @@ then
-framework AudioUnit -framework AudioToolbox \
-framework Carbon -framework CoreMIDI"
EXT=pd_darwin
- MORECFLAGS="-DDL_OPEN -DMACOSX -DUNISTD -I/usr/X11R6/include \
- -I../portaudio/pa_common -I../portaudio/pablio \
+ CPPFLAGS="-DDL_OPEN -DMACOSX -DUNISTD -I/usr/X11R6/include \
+ -I../portaudio/pa_common -I../portaudio/pablio \
-I../portmidi/pm_common -I../portmidi/pm_mac \
-I../portmidi/porttime \
- -Wno-error \
-DUSEAPI_PORTAUDIO -DPA19 -DPA_USE_COREAUDIO"
+ if test `uname -r` = 7.9.0;
+ then
+ MORECFLAGS="-Wno-error"
+ EXTERNTARGET=d_ppc
+ else
+ MORECFLAGS="-arch i386 -arch ppc -Wno-error"
+ EXTERNTARGET=d_fat
+ fi
SYSSRC="s_midi_pm.c s_audio_pa.c \
s_audio_pablio.c \
s_audio_paring.c \
@@ -292,17 +299,11 @@ then
-I$TCLTK_FRAMEWORKS_PATH/Tcl.framework/Versions/8.4/PrivateHeaders"
if test x$USE_DEBUG_CFLAGS == "xyes";
then
- OPT_CFLAGS="-g"
+ MORECFLAGS=$MORECFLAGS" -g"
else
- OPT_CFLAGS="-O2"
+ MORECFLAGS=$MORECFLAGS" -O2"
fi
OSNUMBER=2
- if test `uname -m` = i386;
- then
- EXTERNTARGET=pd_imac
- else
- EXTERNTARGET=pd_darwin
- fi
if test x$jack == "xyes";
then
LDFLAGS=$LDFLAGS" -weak_framework Jack"
diff --git a/pd/src/g_all_guis.c b/pd/src/g_all_guis.c
index 4f82bec0..2d18f480 100644
--- a/pd/src/g_all_guis.c
+++ b/pd/src/g_all_guis.c
@@ -147,30 +147,34 @@ int iemgui_modulo_color(int col)
return(col);
}
-t_symbol *iemgui_raute2dollar(t_symbol *s)
+t_symbol *iemgui_dollar2raute(t_symbol *s)
{
- if (s->s_name[0] == '#')
+ char buf[MAXPDSTRING+1], *s1, *s2;
+ if (strlen(s->s_name) >= MAXPDSTRING)
+ return (s);
+ for (s1 = s->s_name, s2 = buf; ; s1++, s2++)
{
- char buf[MAXPDSTRING];
- strncpy(buf, s->s_name, MAXPDSTRING);
- buf[MAXPDSTRING-1] = 0;
- buf[0] = '$';
- return (gensym(buf));
+ if (*s1 == '$')
+ *s2 = '#';
+ else if (!(*s2 = *s1))
+ break;
}
- else return (s);
+ return(gensym(buf));
}
-t_symbol *iemgui_dollar2raute(t_symbol *s)
+t_symbol *iemgui_raute2dollar(t_symbol *s)
{
- if (s->s_name[0] == '$')
+ char buf[MAXPDSTRING+1], *s1, *s2;
+ if (strlen(s->s_name) >= MAXPDSTRING)
+ return (s);
+ for (s1 = s->s_name, s2 = buf; ; s1++, s2++)
{
- char buf[MAXPDSTRING];
- strncpy(buf, s->s_name, MAXPDSTRING);
- buf[MAXPDSTRING-1] = 0;
- buf[0] = '#';
- return (gensym(buf));
+ if (*s1 == '#')
+ *s2 = '$';
+ else if (!(*s2 = *s1))
+ break;
}
- else return (s);
+ return(gensym(buf));
}
void iemgui_verify_snd_ne_rcv(t_iemgui *iemgui)
diff --git a/pd/src/g_canvas.c b/pd/src/g_canvas.c
index edc387a4..9a5aaeef 100644
--- a/pd/src/g_canvas.c
+++ b/pd/src/g_canvas.c
@@ -17,10 +17,11 @@ to be different but are now unified except for some fossilized names.) */
/* LATER consider adding font size to this struct (see glist_getfont()) */
struct _canvasenvironment
{
- t_symbol *ce_dir; /* directory patch lives in */
- int ce_argc; /* number of "$" arguments */
- t_atom *ce_argv; /* array of "$" arguments */
- int ce_dollarzero; /* value of "$0" */
+ t_symbol *ce_dir; /* directory patch lives in */
+ int ce_argc; /* number of "$" arguments */
+ t_atom *ce_argv; /* array of "$" arguments */
+ int ce_dollarzero; /* value of "$0" */
+ t_namelist *ce_path; /* search path */
};
#define GLIST_DEFCANVASWIDTH 450
@@ -181,12 +182,11 @@ t_symbol *canvas_realizedollar(t_canvas *x, t_symbol *s)
{
t_symbol *ret;
char *name = s->s_name;
- if (*name == '$' && name[1] >= '0' && name[1] <= '9')
+ if (strchr(name, '$'))
{
t_canvasenvironment *env = canvas_getenv(x);
canvas_setcurrent(x);
- ret = binbuf_realizedollsym(gensym(name+1),
- env->ce_argc, env->ce_argv, 1);
+ ret = binbuf_realizedollsym(s, env->ce_argc, env->ce_argv, 1);
canvas_unsetcurrent(x);
}
else ret = s;
@@ -337,8 +337,8 @@ void glist_init(t_glist *x)
}
/* make a new glist. It will either be a "root" canvas or else
- its parent will be a "text" object in another window... we don't
- know which yet. */
+ it appears as a "text" object in another window (canvas_getcurrnet()
+ tells us which.) */
t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv)
{
t_canvas *x = (t_canvas *)pd_new(canvas_class);
@@ -981,35 +981,15 @@ void canvas_objfor(t_glist *gl, t_text *x, int argc, t_atom *argv);
void canvas_restore(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
{
t_pd *z;
- /* this should be unnecessary, but sometimes the canvas's name gets
- out of sync with the owning box's argument; this fixes that */
if (argc > 3)
{
t_atom *ap=argv+3;
if (ap->a_type == A_SYMBOL)
{
- char *buf=ap->a_w.w_symbol->s_name, *bufp;
- if (*buf == '$' && buf[1] >= '0' && buf[1] <= '9')
- {
- for (bufp = buf+2; *bufp; bufp++)
- if (*bufp < '0' || *bufp > '9')
- {
- SETDOLLSYM(ap, gensym(buf+1));
- goto didit;
- }
- SETDOLLAR(ap, atoi(buf+1));
- didit: ;
- }
- }
-
- if (ap->a_type == A_DOLLSYM)
- {
t_canvasenvironment *e = canvas_getenv(canvas_getcurrent());
canvas_rename(x, binbuf_realizedollsym(ap->a_w.w_symbol,
- e->ce_argc, e->ce_argv, 1), 0);
+ e->ce_argc, e->ce_argv, 1), 0);
}
- else if (ap->a_type == A_SYMBOL)
- canvas_rename(x, argv[3].a_w.w_symbol, 0);
}
canvas_pop(x, x->gl_willvis);
@@ -1433,6 +1413,7 @@ void canvas_redrawallfortemplatecanvas(t_canvas *x, int action)
canvas_redrawallfortemplate(0, action);
}
+
/* ------------------------------- setup routine ------------------------ */
/* why are some of these "glist" and others "canvas"? */
diff --git a/pd/src/g_editor.c b/pd/src/g_editor.c
index 77eaf156..13346779 100644
--- a/pd/src/g_editor.c
+++ b/pd/src/g_editor.c
@@ -1960,8 +1960,12 @@ static void canvas_copy(t_canvas *x)
int bufsize;
rtext_getseltext(x->gl_editor->e_textedfor, &buf, &bufsize);
-#ifdef UNIX
- /* in X windows (i.e., UNIX) the selection already went to the
+#if defined(MSW) || defined(MACOSX)
+ /* for Mac or Windows, copy the text to the clipboard here */
+ sys_vgui("clipboard clear\n", bufsize, buf);
+ sys_vgui("clipboard append {%.*s}\n", bufsize, buf);
+#else
+ /* in X windows the selection already went to the
clipboard when it was made; here we "copy" it to our own buffer
as well, because, annoyingly, the clipboard will usually be
destroyed by the time the user asks to "paste". */
@@ -1970,11 +1974,7 @@ static void canvas_copy(t_canvas *x)
canvas_textcopybuf = (char *)getbytes(bufsize);
memcpy(canvas_textcopybuf, buf, bufsize);
canvas_textcopybufsize = bufsize;
-#else /* UNIX */
- /* otherwise just copy the text to the clipboard here */
- sys_vgui("clipboard clear\n", bufsize, buf);
- sys_vgui("clipboard append {%.*s}\n", bufsize, buf);
-#endif /* UNIX */
+#endif
}
}
@@ -2124,19 +2124,18 @@ static void canvas_paste(t_canvas *x)
if (x->gl_editor->e_textedfor)
{
/* simulate keystrokes as if the copy buffer were typed in. */
-#ifdef UNIX
- /* in UNIX we kept the text in our own copy buffer */
+#if defined(MSW) || defined(MACOSX)
+ /* for Mac or Windows, ask the GUI to send the clipboard down */
+ sys_gui("pdtk_pastetext\n");
+#else
+ /* in X windows we kept the text in our own copy buffer */
int i;
for (i = 0; i < canvas_textcopybufsize; i++)
{
pd_vmess(&x->gl_gobj.g_pd, gensym("key"), "iii",
1, canvas_textcopybuf[i]&0xff, 0);
}
-#else /* UNIX */
- /* otherwise appeal to the GUI to send the clipboard down */
- sys_gui("pdtk_pastetext\n");
-#endif /* UNIX */
-
+#endif
}
else
{
diff --git a/pd/src/g_readwrite.c b/pd/src/g_readwrite.c
index d8090b48..ae51baa9 100644
--- a/pd/src/g_readwrite.c
+++ b/pd/src/g_readwrite.c
@@ -2,10 +2,13 @@
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
-/* this file reads and writes the "data" portions of a canvas to a file.
-See also canvas_saveto(), etc., in g_editor.c. The data portion is a
-collection of "scalar" objects. Routines here can save collections of
-scalars into a file and reload them; also, support is included here for
+/*
+Routines to read and write canvases to files:
+canvas_savetofile() writes a root canvas to a "pd" file. (Reading "pd" files
+is done simply by passing the contents to the pd message interpreter.)
+Alternatively, the glist_read() and glist_write() routines read and write
+"data" from and to files (reading reads into an existing canvas), using a
+file format as in the dialog window for data.
*/
#include <stdlib.h>
@@ -14,6 +17,9 @@ scalars into a file and reload them; also, support is included here for
#include "g_canvas.h"
#include <string.h>
+static t_class *declare_class;
+static void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b);
+
/* the following routines read "scalars" from a file into a canvas. */
static int canvas_scanbinbuf(int natoms, t_atom *vec, int *p_indexout,
@@ -566,22 +572,31 @@ static void canvas_saveto(t_canvas *x, t_binbuf *b)
/* subpatch */
if (x->gl_owner && !x->gl_env)
{
+ /* have to go to original binbuf to find out how we were named. */
+ t_binbuf *bz = binbuf_new();
+ t_symbol *patchsym;
+ binbuf_addbinbuf(bz, x->gl_obj.ob_binbuf);
+ patchsym = atom_getsymbolarg(1, binbuf_getnatom(bz), binbuf_getvec(bz));
+ binbuf_free(bz);
binbuf_addv(b, "ssiiiisi;", gensym("#N"), gensym("canvas"),
(int)(x->gl_screenx1),
(int)(x->gl_screeny1),
(int)(x->gl_screenx2 - x->gl_screenx1),
(int)(x->gl_screeny2 - x->gl_screeny1),
- (*x->gl_name->s_name ? x->gl_name: gensym("(subpatch)")),
+ (patchsym != &s_ ? patchsym: gensym("(subpatch)")),
x->gl_mapped);
}
/* root or abstraction */
- else binbuf_addv(b, "ssiiiii;", gensym("#N"), gensym("canvas"),
+ else
+ {
+ binbuf_addv(b, "ssiiiii;", gensym("#N"), gensym("canvas"),
(int)(x->gl_screenx1),
(int)(x->gl_screeny1),
(int)(x->gl_screenx2 - x->gl_screenx1),
(int)(x->gl_screeny2 - x->gl_screeny1),
(int)x->gl_font);
-
+ canvas_savedeclarationsto(x, b);
+ }
for (y = x->gl_list; y; y = y->g_next)
gobj_save(y, b);
@@ -714,6 +729,63 @@ static void canvas_menusave(t_canvas *x)
else canvas_menusaveas(x2);
}
+/* ------------------------------- declare ------------------------ */
+
+/* put "declare" objects in a patch to tell it about the environment in
+which objects should be created in this canvas. This includes directories to
+search ("-path", "-stdpath") and object libraries to load
+("-lib" and "-stdlib"). These must be set before the patch containing
+the "declare" object is filled in with its contents; so when the patch is
+saved, we throw early messages to the canvas to set the environment
+before any objects are created in it. */
+
+
+typedef struct _declare
+{
+ t_object x_obj;
+ t_canvas *x_canvas;
+ int x_useme;
+} t_declare;
+
+static void *declare_new(t_symbol *s, int argc, t_atom *argv)
+{
+ t_declare *x = (t_declare *)pd_new(declare_class);
+ x->x_useme = 1;
+ x->x_canvas = canvas_getcurrent();
+ /* LATER update environment and/or load libraries */
+ return (x);
+}
+
+static void declare_free(t_declare *x)
+{
+ x->x_useme = 0;
+ /* LATER update environment */
+}
+
+static void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b)
+{
+ t_gobj *y;
+
+ for (y = x->gl_list; y; y = y->g_next)
+ {
+ if (pd_class(&y->g_pd) == declare_class)
+ {
+ binbuf_addv(b, "s", gensym("#X"));
+ binbuf_addbinbuf(b, ((t_declare *)y)->x_obj.te_binbuf);
+ binbuf_addv(b, ";");
+ }
+ else if (pd_class(&y->g_pd) == canvas_class)
+ canvas_savedeclarationsto((t_canvas *)y, b);
+ }
+}
+
+static void canvas_declare(t_canvas *x, t_symbol *s, int argc, t_atom *argv)
+{
+ startpost("declare:: %s", s->s_name);
+ postatom(argc, argv);
+ endpost();
+}
+
void g_readwrite_setup(void)
{
@@ -727,9 +799,15 @@ void g_readwrite_setup(void)
gensym("savetofile"), A_SYMBOL, A_SYMBOL, 0);
class_addmethod(canvas_class, (t_method)canvas_saveto,
gensym("saveto"), A_CANT, 0);
+ class_addmethod(canvas_class, (t_method)canvas_declare,
+ gensym("declare"), A_GIMME, 0);
/* ------------------ from the menu ------------------------- */
class_addmethod(canvas_class, (t_method)canvas_menusave,
gensym("menusave"), 0);
class_addmethod(canvas_class, (t_method)canvas_menusaveas,
gensym("menusaveas"), 0);
+/*---------------------------- declare ------------------- */
+ declare_class = class_new(gensym("declare"), (t_newmethod)declare_new,
+ (t_method)declare_free, sizeof(t_declare), CLASS_NOINLET, A_GIMME, 0);
+
}
diff --git a/pd/src/g_rtext.c b/pd/src/g_rtext.c
index a07e20a9..d65038c1 100644
--- a/pd/src/g_rtext.c
+++ b/pd/src/g_rtext.c
@@ -312,19 +312,19 @@ void rtext_retext(t_rtext *x)
for (s1 = nextchar - wantreduce, s2 = s1 + wantreduce;
s2 < ebuf; s1++, s2++)
*s1 = *s2;
- t_resizebytes(x->x_buf, bufsize, text->te_width);
+ x->x_buf = t_resizebytes(x->x_buf, bufsize, text->te_width);
bufsize = text->te_width;
goto done;
giveup:
/* give up and bash it to "+" or "-" */
x->x_buf[0] = (atomp->a_w.w_float < 0 ? '-' : '+');
- t_resizebytes(x->x_buf, bufsize, 1);
+ x->x_buf = t_resizebytes(x->x_buf, bufsize, 1);
bufsize = 1;
}
else if (bufsize > text->te_width)
{
x->x_buf[text->te_width - 1] = '>';
- t_resizebytes(x->x_buf, bufsize, text->te_width);
+ x->x_buf = t_resizebytes(x->x_buf, bufsize, text->te_width);
bufsize = text->te_width;
}
done:
diff --git a/pd/src/g_template.c b/pd/src/g_template.c
index b2b359d3..a1e8882f 100644
--- a/pd/src/g_template.c
+++ b/pd/src/g_template.c
@@ -1634,8 +1634,8 @@ static void plot_vis(t_gobj *z, t_glist *glist,
if (plot_readownertemplate(x, data, template,
&elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
&vis, &scalarvis, &xfielddesc, &yfielddesc, &wfielddesc) ||
- (vis == 0) ||
- array_getfields(elemtemplatesym, &elemtemplatecanvas,
+ ((vis == 0) && tovis) /* FIXME - why is 'tovis' flag necessary? */
+ || array_getfields(elemtemplatesym, &elemtemplatecanvas,
&elemtemplate, &elemsize, xfielddesc, yfielddesc, wfielddesc,
&xonset, &yonset, &wonset))
return;
diff --git a/pd/src/g_text.c b/pd/src/g_text.c
index 5b3172b1..3cca6b3a 100644
--- a/pd/src/g_text.c
+++ b/pd/src/g_text.c
@@ -30,8 +30,8 @@ t_widgetbehavior text_widgetbehavior;
/* ----------------- the "text" object. ------------------ */
- /* add a "text" object (comment) to a glist. While this one goes for any glist,
- the other 3 below are for canvases only. (why?) This is called
+ /* add a "text" object (comment) to a glist. While this one goes for any
+ glist, the other 3 below are for canvases only. (why?) This is called
without args if invoked from the GUI; otherwise at least x and y
are provided. */
@@ -566,6 +566,19 @@ static void gatom_symbol(t_gatom *x, t_symbol *s)
gatom_bang(x);
}
+ /* We need a list method because, since there's both an "inlet" and a
+ "nofirstin" flag, the standard list behavior gets confused. */
+static void gatom_list(t_gatom *x, t_symbol *s, int argc, t_atom *argv)
+{
+ if (!argc)
+ gatom_bang(x);
+ else if (argv->a_type == A_FLOAT)
+ gatom_float(x, argv->a_w.w_float);
+ else if (argv->a_type == A_SYMBOL)
+ gatom_symbol(x, argv->a_w.w_symbol);
+ else pd_error(x, "gatom_list: need float or symbol");
+}
+
static void gatom_motion(void *z, t_floatarg dx, t_floatarg dy)
{
t_gatom *x = (t_gatom *)z;
@@ -1349,6 +1362,7 @@ void g_text_setup(void)
class_addbang(gatom_class, gatom_bang);
class_addfloat(gatom_class, gatom_float);
class_addsymbol(gatom_class, gatom_symbol);
+ class_addlist(gatom_class, gatom_list);
class_addmethod(gatom_class, (t_method)gatom_set, gensym("set"),
A_GIMME, 0);
class_addmethod(gatom_class, (t_method)gatom_click, gensym("click"),
diff --git a/pd/src/m_atom.c b/pd/src/m_atom.c
index 95e2216c..f8859c6f 100644
--- a/pd/src/m_atom.c
+++ b/pd/src/m_atom.c
@@ -120,7 +120,7 @@ void atom_string(t_atom *a, char *buf, unsigned int bufsize)
sprintf(buf, "$%d", a->a_w.w_index);
break;
case A_DOLLSYM:
- snprintf(buf, bufsize-1, "%s", a->a_w.w_symbol->s_name);
+ strncpy(buf, a->a_w.w_symbol->s_name, bufsize);
buf[bufsize-1] = 0;
break;
default:
diff --git a/pd/src/m_binbuf.c b/pd/src/m_binbuf.c
index 6afbb931..9e96d68b 100644
--- a/pd/src/m_binbuf.c
+++ b/pd/src/m_binbuf.c
@@ -76,8 +76,7 @@ void binbuf_text(t_binbuf *x, char *text, size_t size)
{
/* it's an atom other than a comma or semi */
char c;
- int floatstate = 0, slash = 0, lastslash = 0,
- firstslash = (*textp == '\\');
+ int floatstate = 0, slash = 0, lastslash = 0, dollar = 0;
bufp = buf;
do
{
@@ -142,6 +141,9 @@ void binbuf_text(t_binbuf *x, char *text, size_t size)
if (!digit) floatstate = -1;
}
}
+ if (!lastslash && c == '$' && (textp != etext &&
+ textp[0] >= '0' && textp[0] <= '9'))
+ dollar = 1;
if (!slash) bufp++;
}
while (textp != etext && bufp != ebuf &&
@@ -151,24 +153,25 @@ void binbuf_text(t_binbuf *x, char *text, size_t size)
#if 0
post("binbuf_text: buf %s", buf);
#endif
- if (*buf == '$' && buf[1] >= '0' && buf[1] <= '9' && !firstslash)
+ if (floatstate == 2 || floatstate == 4 || floatstate == 5 ||
+ floatstate == 8)
+ SETFLOAT(ap, atof(buf));
+ /* LATER try to figure out how to mix "$" and "\$" correctly;
+ here, the backslashes were already stripped so we assume all
+ "$" chars are real dollars. In fact, we only know at least one
+ was. */
+ else if (dollar)
{
- for (bufp = buf+2; *bufp; bufp++)
+ if (buf[0] != '$')
+ dollar = 0;
+ for (bufp = buf+1; *bufp; bufp++)
if (*bufp < '0' || *bufp > '9')
- {
- SETDOLLSYM(ap, gensym(buf));
- goto didit;
- }
- SETDOLLAR(ap, atoi(buf+1));
- didit: ;
- }
- else
- {
- if (floatstate == 2 || floatstate == 4 || floatstate == 5 ||
- floatstate == 8)
- SETFLOAT(ap, atof(buf));
- else SETSYMBOL(ap, gensym(buf));
+ dollar = 0;
+ if (dollar)
+ SETDOLLAR(ap, atoi(buf+1));
+ else post("dollsym %s", buf), SETDOLLSYM(ap, gensym(buf));
}
+ else SETSYMBOL(ap, gensym(buf));
}
ap++;
natom++;
@@ -352,16 +355,21 @@ void binbuf_restore(t_binbuf *x, int argc, t_atom *argv)
{
if (argv->a_type == A_SYMBOL)
{
- char *str = argv->a_w.w_symbol->s_name;
+ char *str = argv->a_w.w_symbol->s_name, *str2;
if (!strcmp(str, ";")) SETSEMI(ap);
else if (!strcmp(str, ",")) SETCOMMA(ap);
- else if (str[0] == '$' && str[1] >= '0' && str[1] <= '9')
+ else if ((str2 = strchr(str, '$')) && str2[1] >= '0'
+ & str2[1] <= '9')
{
int dollsym = 0;
- char *str2;
- for (str2 = str + 2; *str2; str2++)
+ if (*str != '$')
+ dollsym = 1;
+ else for (str2 = str + 1; *str2; str2++)
if (*str2 < '0' || *str2 > '9')
- dollsym = 1;
+ {
+ dollsym = 1;
+ break;
+ }
if (dollsym)
SETDOLLSYM(ap, gensym(str));
else
@@ -482,36 +490,43 @@ t_symbol *binbuf_realizedollsym(t_symbol *s, int ac, t_atom *av, int tonew)
* whenever this happened, enable this code
*/
substr=strchr(str, '$');
- if(substr){
- strncat(buf2, str, (substr-str));
- str=substr+1;
+ if(substr)
+ {
+ strncat(buf2, str, (substr-str));
+ str=substr+1;
}
#endif
while((next=binbuf_expanddollsym(str, buf, dollarnull, ac, av, tonew))>=0)
- {
- /*
- * JMZ: i am not sure what this means, so i might have broken it
- * it seems like that if "tonew" is set and the $arg cannot be expanded (or the dollarsym is in reality a A_DOLLAR)
- * 0 is returned from binbuf_realizedollsym
- * this happens, when expanding in a message-box, but does not happen when the A_DOLLSYM is the name of a subpatch
- */
- if(!tonew&&(0==next)&&(0==*buf)){
- return 0; /* JMZ: this should mimick the original behaviour */
+ {
+ /*
+ * JMZ: i am not sure what this means, so i might have broken it
+ * it seems like that if "tonew" is set and the $arg cannot be expanded
+ * (or the dollarsym is in reality a A_DOLLAR)
+ * 0 is returned from binbuf_realizedollsym
+ * this happens, when expanding in a message-box, but does not happen
+ * when the A_DOLLSYM is the name of a subpatch
+ */
+ if(!tonew&&(0==next)&&(0==*buf))
+ {
+ return 0; /* JMZ: this should mimick the original behaviour */
}
strncat(buf2, buf, MAXPDSTRING/2-1);
str+=next;
substr=strchr(str, '$');
- if(substr){
- strncat(buf2, str, (substr-str));
- str=substr+1;
- } else {
- strcat(buf2, str);
-
- return gensym(buf2);
+ if(substr)
+ {
+ strncat(buf2, str, (substr-str));
+ str=substr+1;
+ }
+ else
+ {
+ strcat(buf2, str);
+ goto done;
}
- }
+ }
+done:
return (gensym(buf2));
}
diff --git a/pd/src/m_class.c b/pd/src/m_class.c
index 30aeb310..1ec13146 100644
--- a/pd/src/m_class.c
+++ b/pd/src/m_class.c
@@ -514,42 +514,6 @@ extern t_pd *newest;
t_symbol* pathsearch(t_symbol *s,char* ext);
int pd_setloadingabstraction(t_symbol *sym);
-
-/* replace everything but [a-zA-Z0-9_] by "0x%x" */
-static char*alternative_classname(char*classname)
-{
- char *altname=(char*)getbytes(sizeof(char)*MAXPDSTRING);
- int count=0;
- int i=0;
- for(i=0; i<MAXPDSTRING; i++)
- altname[i]=0;
- i=0;
- while(*classname)
- {
- char c=*classname;
- if((c>=48 && c<=57)|| /* [0-9] */
- (c>=65 && c<=90)|| /* [A-Z] */
- (c>=97 && c<=122)||/* [a-z] */
- (c==95)) /* [_] */
- {
- altname[i]=c;
- i++;
- }
- else /* a "bad" character */
- {
- sprintf(altname+i, "0x%02x", c);
- i+=4;
- count++;
- }
- classname++;
- }
- if(count>0)return altname;
- /* seems like the given classname is fine as can be */
- freebytes(altname, sizeof(char)*MAXPDSTRING);
- return 0;
-}
-
-
/* this routine is called when a new "object" is requested whose class Pd
doesn't know. Pd tries to load it as an extern, then as an abstraction. */
void new_anything(void *dummy, t_symbol *s, int argc, t_atom *argv)
@@ -558,11 +522,10 @@ void new_anything(void *dummy, t_symbol *s, int argc, t_atom *argv)
t_symbol *dir = canvas_getcurrentdir();
int fd;
char dirbuf[MAXPDSTRING], *nameptr;
- char *altname=alternative_classname(s->s_name);
if (tryingalready) return;
newest = 0;
class_loadsym = s;
- if (sys_load_lib(dir->s_name, s->s_name, altname))
+ if (sys_load_lib(dir->s_name, s->s_name))
{
tryingalready = 1;
typedmess(dummy, s, argc, argv);
@@ -573,8 +536,6 @@ void new_anything(void *dummy, t_symbol *s, int argc, t_atom *argv)
current = s__X.s_thing;
if ((fd = open_via_path(dir->s_name, s->s_name, ".pd",
dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 ||
- (altname && (fd = open_via_path(dir->s_name, altname, ".pd",
- dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) ||
(fd = open_via_path(dir->s_name, s->s_name, ".pat",
dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0)
{
diff --git a/pd/src/makefile.in b/pd/src/makefile.in
index 6f644237..ba09f7a4 100644
--- a/pd/src/makefile.in
+++ b/pd/src/makefile.in
@@ -20,21 +20,19 @@ libpddir = $(libdir)/pd
pddocdir = $(libpddir)/doc
libpdbindir = $(libpddir)/bin
+CPPFLAGS = @CPPFLAGS@
MORECFLAGS = @MORECFLAGS@
-
-INCLUDE = -I.
-GINCLUDE = $(INCLUDE) @GUIFLAGS@
+GINCLUDE = $(CPPFLAGS) @GUIFLAGS@
GLIB = @LIBS@
LDFLAGS = @LDFLAGS@
LIB = @PDLIB@
-OPT_CFLAGS = @OPT_CFLAGS@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
-Wno-unused -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD
-CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(MORECFLAGS)
+CFLAGS = @CFLAGS@ $(ARCH_CFLAGS) $(WARN_CFLAGS) $(CPPFLAGS) $(MORECFLAGS)
# the sources
@@ -188,7 +186,7 @@ tags: $(SRC) $(GSRC); ctags *.[ch]
depend: makefile.dependencies
makefile.dependencies: makefile
- $(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies
+ $(CC) $(CPPFLAGS) -M $(SRC) > makefile.dependencies
uninstall:
rm -f -r $(libpddir)
diff --git a/pd/src/makefile.nt b/pd/src/makefile.nt
index 56b94a0a..fcc70aaa 100644
--- a/pd/src/makefile.nt
+++ b/pd/src/makefile.nt
@@ -31,7 +31,7 @@ SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
s_main.c s_inter.c s_file.c s_print.c \
s_loader.c s_path.c s_entry.c s_audio.c s_midi.c \
d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc.c \
- d_math.c d_fft.c d_mayer_fft.c d_fftroutine.c d_array.c d_global.c \
+ d_math.c d_fft.c d_fft_mayer.c d_fftroutine.c d_array.c d_global.c \
d_delay.c d_resample.c \
x_arithmetic.c x_connective.c x_interface.c x_midi.c x_misc.c \
x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c x_list.c d_soundfile.c \
diff --git a/pd/src/notes.txt b/pd/src/notes.txt
index 4c3b1997..f9c6126c 100644
--- a/pd/src/notes.txt
+++ b/pd/src/notes.txt
@@ -1,11 +1,19 @@
---------------- dolist --------------------
+fix:
+look again at array vis/invis conundrum, g_template.c
+subpatches appear at top left of screen regardless
+$1-args not evaluated (z.pd)
+
test:
compile on various versions of linux
windows:
modal dialogs confuse watchdog
check the right-click-on-empty-canvas
MIDI I/O (inc. sysex)
+mac:
+ text paste broken
+ clicking on windows seems sometimes not to open them
what does OSX do when jack is compiled into Pd but not installed??
turn on paMacCore_ChangeDeviceParameters for mac (pa_mac_core.h)
diff --git a/pd/src/s_audio_pablio.h b/pd/src/s_audio_pablio.h
index 43e9a4b9..f98509ab 100644
--- a/pd/src/s_audio_pablio.h
+++ b/pd/src/s_audio_pablio.h
@@ -7,7 +7,7 @@ extern "C"
#endif /* __cplusplus */
/*
- * $Id: s_audio_pablio.h,v 1.2 2006-06-03 19:13:07 millerpuckette Exp $
+ * $Id: s_audio_pablio.h,v 1.3 2006-08-11 20:09:07 millerpuckette Exp $
* PABLIO.h
* Portable Audio Blocking read/write utility.
*
diff --git a/pd/src/s_audio_paring.c b/pd/src/s_audio_paring.c
index ca1a60a5..7bfc1170 100644
--- a/pd/src/s_audio_paring.c
+++ b/pd/src/s_audio_paring.c
@@ -1,5 +1,5 @@
/*
- * $Id: s_audio_paring.c,v 1.2 2006-06-03 19:13:07 millerpuckette Exp $
+ * $Id: s_audio_paring.c,v 1.3 2006-08-11 20:09:07 millerpuckette Exp $
* ringbuffer.c
* Ring Buffer utility..
*
diff --git a/pd/src/s_audio_paring.h b/pd/src/s_audio_paring.h
index 27edb01f..535dae76 100644
--- a/pd/src/s_audio_paring.h
+++ b/pd/src/s_audio_paring.h
@@ -6,7 +6,7 @@ extern "C"
#endif /* __cplusplus */
/*
- * $Id: s_audio_paring.h,v 1.2 2006-06-03 19:13:07 millerpuckette Exp $
+ * $Id: s_audio_paring.h,v 1.3 2006-08-11 20:09:07 millerpuckette Exp $
* ringbuffer.h
* Ring Buffer utility..
*
diff --git a/pd/src/s_loader.c b/pd/src/s_loader.c
index d985af05..a5cf38e4 100644
--- a/pd/src/s_loader.c
+++ b/pd/src/s_loader.c
@@ -23,122 +23,114 @@
typedef void (*t_xxx)(void);
-static char sys_dllextent[] =
+/* naming convention for externs. The names are kept distinct for those
+who wich to make "fat" externs compiled for many platforms. Less specific
+fallbacks are provided, primarily for back-compatibility; these suffice if
+you are building a package which will run with a single set of compiled
+objects. The specific name is the letter b, l, d, or m for BSD, linux,
+darwin, or microsoft, followed by a more specific string, either "fat" for
+a fat binary or an indication of the instruction set. */
+
#ifdef __FreeBSD__
- ".pd_freebsd";
+static char sys_dllextent[] = ".b_i386", sys_dllextent2[] = ".pd_freebsd";
#endif
-#ifdef IRIX
-#ifdef N32
- ".pd_irix6";
+#ifdef __linux__
+#ifdef __ia64__
+static char sys_dllextent[] = ".l_ia64", sys_dllextent2[] = ".pd_linux";
#else
- ".pd_irix5";
+static char sys_dllextent[] = ".l_i386", sys_dllextent2[] = ".pd_linux";
#endif
#endif
-#ifdef __linux__
- ".pd_linux";
-#endif
#ifdef MACOSX
-#ifdef __i386
- ".pd_imac";
+#ifdef __i386__
+static char sys_dllextent[] = ".d_fat", sys_dllextent2[] = ".pd_darwin";
#else
- ".pd_darwin";
+static char sys_dllextent[] = ".d_ppc", sys_dllextent2[] = ".pd_darwin";
#endif
#endif
#ifdef MSW
- ".dll";
+static char sys_dllextent[] = ".m_i386", sys_dllextent2[] = ".dll";
#endif
void class_set_extern_dir(t_symbol *s);
-static int sys_load_lib_alt(char *dirname, char *classname, char *altname)
+static int sys_do_load_lib(char *dirname, char *classname)
{
char symname[MAXPDSTRING], filename[MAXPDSTRING], dirbuf[MAXPDSTRING],
- classname2[MAXPDSTRING], *nameptr, *lastdot,
- altsymname[MAXPDSTRING];
+ *nameptr, altsymname[MAXPDSTRING];
void *dlobj;
t_xxx makeout = NULL;
- int fd;
+ int i, hexmunge = 0, fd;
#ifdef MSW
HINSTANCE ntdll;
#endif
+ for (i = 0, nameptr = classname; i < MAXPDSTRING-7 && *nameptr; nameptr++)
+ {
+ char c = *nameptr;
+ if ((c>='0' && c<='9') || (c>='A' && c<='Z')||
+ (c>='a' && c<='z' )|| c == '_')
+ {
+ symname[i] = c;
+ i++;
+ }
+ /* trailing tilde becomes "_tilde" */
+ else if (c == '~' && nameptr[1] == 0)
+ {
+ strcpy(symname+i, "_tilde");
+ i += strlen(symname+i);
+ }
+ else /* anything you can't put in a C symbol is sprintf'ed in hex */
+ {
+ sprintf(symname+i, "0x%02x", c);
+ i += strlen(symname+i);
+ hexmunge = 1;
+ }
+ }
+ symname[i] = 0;
+ if (hexmunge)
+ {
+ memmove(symname+6, symname, strlen(symname+1));
+ strncpy(symname, "setup_", 6);
+ }
+ else strcat(symname, "_setup");
+
#if 0
fprintf(stderr, "lib %s %s\n", dirname, classname);
#endif
/* try looking in the path for (classname).(sys_dllextent) ... */
if ((fd = open_via_path(dirname, classname, sys_dllextent,
- dirbuf, &nameptr, MAXPDSTRING, 1)) < 0)
- {
- /* next try (classname)/(classname).(sys_dllextent) ... */
- strncpy(classname2, classname, MAXPDSTRING);
- filename[MAXPDSTRING-2] = 0;
- strcat(classname2, "/");
- strncat(classname2, classname, MAXPDSTRING-strlen(classname2));
- filename[MAXPDSTRING-1] = 0;
- if ((fd = open_via_path(dirname, classname2, sys_dllextent,
- dirbuf, &nameptr, MAXPDSTRING, 1)) < 0)
- {
- /* next try (alternative_classname).(sys_dllextent) */
- if (altname)
- {
- if ((fd = open_via_path(dirname, altname, sys_dllextent,
- dirbuf, &nameptr, MAXPDSTRING, 1)) < 0)
- {
- /* next try
- (alt_classname)/(alt_classname).(sys_dllextent) */
- strncpy(classname2, altname, MAXPDSTRING);
- filename[MAXPDSTRING-2] = 0;
- strcat(classname2, "/");
- strncat(classname2, altname,
- MAXPDSTRING-strlen(classname2));
- filename[MAXPDSTRING-1] = 0;
- if ((fd = open_via_path(dirname, classname2,
- sys_dllextent, dirbuf, &nameptr, MAXPDSTRING, 1)) < 0)
- {
- return 0;
- }
- }
- }
- else return (0);
- }
- }
+ dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0)
+ goto gotone;
+ /* same, with the more generic sys_dllextent2 */
+ if ((fd = open_via_path(dirname, classname, sys_dllextent2,
+ dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0)
+ goto gotone;
+ /* next try (classname)/(classname).(sys_dllextent) ... */
+ strncpy(filename, classname, MAXPDSTRING);
+ filename[MAXPDSTRING-2] = 0;
+ strcat(filename, "/");
+ strncat(filename, classname, MAXPDSTRING-strlen(filename));
+ filename[MAXPDSTRING-1] = 0;
+ if ((fd = open_via_path(dirname, filename, sys_dllextent,
+ dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0)
+ goto gotone;
+ if ((fd = open_via_path(dirname, filename, sys_dllextent2,
+ dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0)
+ goto gotone;
+ return (0);
+gotone:
close(fd);
class_set_extern_dir(gensym(dirbuf));
- /* refabricate the pathname */
+ /* rebuild the absolute pathname */
strncpy(filename, dirbuf, MAXPDSTRING);
filename[MAXPDSTRING-2] = 0;
strcat(filename, "/");
strncat(filename, nameptr, MAXPDSTRING-strlen(filename));
filename[MAXPDSTRING-1] = 0;
- /* extract the setup function name */
- if (lastdot = strrchr(nameptr, '.'))
- *lastdot = 0;
-
-#ifdef DIDFORMACOSX /* no longer correct on macosx??? */
- strcpy(symname, "_");
- strcat(symname, nameptr);
- if(altname)
- {
- strcpy(altsymname, "_setup_");
- strcat(symname, altname);
- }
-#else
- strcpy(symname, nameptr);
- if(altname)
- {
- strcpy(altsymname, "setup_");
- strcat(altsymname, altname);
- }
-#endif
- /* if the last character is a tilde, replace with "_tilde" */
- if (symname[strlen(symname) - 1] == '~')
- strcpy(symname + (strlen(symname) - 1), "_tilde");
- /* and append _setup to form the C setup function name */
- strcat(symname, "_setup");
#ifdef DL_OPEN
dlobj = dlopen(filename, RTLD_NOW | RTLD_GLOBAL);
- post("opened %x", dlobj);
if (!dlobj)
{
post("%s: %s", filename, dlerror());
@@ -146,7 +138,6 @@ static int sys_load_lib_alt(char *dirname, char *classname, char *altname)
return (0);
}
makeout = (t_xxx)dlsym(dlobj, symname);
- if(!makeout)makeout = (t_xxx)dlsym(dlobj, altsymname);
#endif
#ifdef MSW
sys_bashfilename(filename, filename);
@@ -158,46 +149,11 @@ static int sys_load_lib_alt(char *dirname, char *classname, char *altname)
return (0);
}
makeout = (t_xxx)GetProcAddress(ntdll, symname);
- if(!makeout)makeout = (t_xxx)GetProcAddress(ntdll, altsymname);
-#endif
-#if defined(MACOSX) && !defined(DL_OPEN)
- {
- NSObjectFileImage image;
- void *ret;
- NSSymbol s;
- if ( NSCreateObjectFileImageFromFile( filename, &image) != NSObjectFileImageSuccess )
- {
- post("%s: couldn't load", filename);
- class_set_extern_dir(&s_);
- return 0;
- }
- ret = NSLinkModule( image, filename,
- NSLINKMODULE_OPTION_BINDNOW |
- NSLINKMODULE_OPTION_RETURN_ON_ERROR);
-
- if (ret == NULL) {
- int err;
- const char *fname, *errt;
- NSLinkEditErrors c;
- NSLinkEditError(&c, &err, &fname, &errt);
- post("link error %d %s %s", err, fname, errt);
- return 0;
- }
- s = NSLookupSymbolInModule(ret, symname);
-
- if(!s)s=NSLookupSymbolInModule(ret, altsymname);
-
- if (s)
- makeout = (t_xxx)NSAddressOfSymbol( s);
- else makeout = 0;
- }
#endif
if (!makeout)
{
post("load_object: Symbol \"%s\" not found", symname);
- if(altname)
- post("load_object: Symbol \"%s\" not found", altsymname);
class_set_extern_dir(&s_);
return 0;
}
@@ -207,7 +163,7 @@ static int sys_load_lib_alt(char *dirname, char *classname, char *altname)
}
/* callback type definition */
-typedef int (*loader_t)(char *dirname, char *classname, char *altname);
+typedef int (*loader_t)(char *dirname, char *classname);
/* linked list of loaders */
typedef struct loader_queue {
@@ -215,7 +171,7 @@ typedef struct loader_queue {
struct loader_queue *next;
} loader_queue_t;
-static loader_queue_t loaders = {sys_load_lib_alt, NULL};
+static loader_queue_t loaders = {sys_do_load_lib, NULL};
/* register class loader function */
void sys_register_loader(loader_t loader)
@@ -235,16 +191,14 @@ void sys_register_loader(loader_t loader)
}
}
-int sys_load_lib(char *dirname, char *classname, char *altname)
+int sys_load_lib(char *dirname, char *classname)
{
int dspstate = canvas_suspend_dsp();
int ok = 0;
loader_queue_t *q;
for(q = &loaders; q; q = q->next)
- if(ok = q->loader(dirname, classname, altname)) break;
+ if(ok = q->loader(dirname, classname)) break;
canvas_resume_dsp(dspstate);
return ok;
}
-
-
diff --git a/pd/src/s_main.c b/pd/src/s_main.c
index a8baa8c4..9f842fd5 100644
--- a/pd/src/s_main.c
+++ b/pd/src/s_main.c
@@ -221,7 +221,7 @@ void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv)
#endif
/* load dynamic libraries specified with "-lib" args */
for (nl = sys_externlist; nl; nl = nl->nl_next)
- if (!sys_load_lib(cwd, nl->nl_string, 0))
+ if (!sys_load_lib(cwd, nl->nl_string))
post("%s: can't load library", nl->nl_string);
/* open patches specifies with "-open" args */
for (nl = sys_openlist; nl; nl = nl->nl_next)
diff --git a/pd/src/s_path.c b/pd/src/s_path.c
index c8fb4da3..9d7e0798 100644
--- a/pd/src/s_path.c
+++ b/pd/src/s_path.c
@@ -12,7 +12,6 @@
/* #define DEBUG(x) x */
#define DEBUG(x)
-void readsf_banana( void); /* debugging */
#include <stdlib.h>
#ifdef UNISTD
@@ -84,7 +83,7 @@ static const char* strtokcpy(char *to, const char *from, int delim)
/* add a single item to a namelist. If "allowdup" is true, duplicates
may be added; othewise they're dropped. */
-
+
t_namelist *namelist_append(t_namelist *listwas, const char *s, int allowdup)
{
t_namelist *nl, *nl2;
diff --git a/pd/src/s_stuff.h b/pd/src/s_stuff.h
index 7cbe84f9..09e2cb55 100644
--- a/pd/src/s_stuff.h
+++ b/pd/src/s_stuff.h
@@ -46,7 +46,7 @@ extern int sys_defaultfont;
extern t_symbol *sys_libdir; /* library directory for auxilliary files */
/* s_loader.c */
-int sys_load_lib(char *dirname, char *filename, char *altname);
+int sys_load_lib(char *dirname, char *filename);
/* s_audio.c */
diff --git a/pd/src/u_main.tk b/pd/src/u_main.tk
index 62ddf836..177e1171 100644
--- a/pd/src/u_main.tk
+++ b/pd/src/u_main.tk
@@ -1783,13 +1783,8 @@ proc gatom_escape {sym} {
set ret [string replace $sym 0 0 "--"]
# puts stderr [concat escape $sym $ret]
} else {
- if {[string equal -length 1 $sym "$"]} {
- set ret [string replace $sym 0 0 "#"]
-# puts stderr [concat unescape $sym $ret]
- } else {
- set ret $sym
-# puts stderr [concat escape $sym "no change"]
- }
+ set ret [string map {"$" "#"} $sym]
+# puts stderr [concat unescape $sym $ret]
}
}
pdtk_unspace $ret
@@ -1800,13 +1795,8 @@ proc gatom_unescape {sym} {
set ret [string replace $sym 0 0 ""]
# puts stderr [concat unescape $sym $ret]
} else {
- if {[string equal -length 1 $sym "#"]} {
- set ret [string replace $sym 0 0 "$"]
-# puts stderr [concat unescape $sym $ret]
- } else {
- set ret $sym
-# puts stderr [concat unescape $sym "no change"]
- }
+ set ret [string map {"#" "$"} $sym]
+# puts stderr [concat unescape $sym $ret]
}
concat $ret
}
diff --git a/pd/src/x_interface.c b/pd/src/x_interface.c
index 19c44962..4effa0d9 100644
--- a/pd/src/x_interface.c
+++ b/pd/src/x_interface.c
@@ -41,7 +41,6 @@ static void print_float(t_print *x, t_float f)
static void print_list(t_print *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
- char buf[80];
if (argc && argv->a_type != A_SYMBOL) startpost("%s:", x->x_sym->s_name);
else startpost("%s: %s", x->x_sym->s_name,
(argc > 1 ? s_list.s_name : (argc == 1 ? s_symbol.s_name :
@@ -53,7 +52,6 @@ static void print_list(t_print *x, t_symbol *s, int argc, t_atom *argv)
static void print_anything(t_print *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
- char buf[80];
startpost("%s: %s", x->x_sym->s_name, s->s_name);
postatom(argc, argv);
endpost();