aboutsummaryrefslogtreecommitdiff
path: root/bin/pddp/pddpboot.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/pddp/pddpboot.tcl')
-rwxr-xr-xbin/pddp/pddpboot.tcl32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/pddp/pddpboot.tcl b/bin/pddp/pddpboot.tcl
new file mode 100755
index 0000000..429ff8a
--- /dev/null
+++ b/bin/pddp/pddpboot.tcl
@@ -0,0 +1,32 @@
+#!/bin/sh
+# \
+exec tclsh "$0" -- "$@"
+
+# Synopsis
+# test run:
+# ./pddpboot.tcl [root [port [path]]]
+# from Pd:
+# source pddpboot.tcl
+# ::pddp::srvUse root (or ::pddp::srvStart root [port])
+# ::pddp::cliOpen path
+# ... (more "::pddp::cliOpen" calls) ...
+# ::pddp::srvStop
+
+if {[namespace exists ::pddp]} { ;# created by pddplink's setup
+ puts stderr "Booting pddp"
+ set ::pddp::testrun 0
+} else {
+ puts stderr "Booting pddp, test run..."
+ namespace eval ::pddp { variable testrun 1 }
+}
+
+if {[info exists ::pddp::theDir]} {
+ source [file join $::pddp::theDir pddpclient.tcl]
+ source [file join $::pddp::theDir pddpserver.tcl]
+ if {[info exists ::pddp::theVersion]} {
+ package provide pddp $::pddp::theVersion
+ }
+} else {
+ source pddpclient.tcl]
+ source pddpserver.tcl]
+}